Upper Lamarck (Feb 03 2009)

Message boards : Technical News : Upper Lamarck (Feb 03 2009)
Message board moderation

To post messages, you must log in.

AuthorMessage
Profile Matt Lebofsky
Volunteer moderator
Project administrator
Project developer
Project scientist
Avatar

Send message
Joined: 1 Mar 99
Posts: 1444
Credit: 957,058
RAC: 0
United States
Message 861709 - Posted: 4 Feb 2009, 0:35:10 UTC
Last modified: 4 Feb 2009, 0:39:27 UTC

So then. We had our weekly outage today. We knew it would be a long one - the result table is bloated for various reasons so it took forever to compress. This may help get past this period of "indigestion" I mentioned in the previous thread, but there's no sign of it getting much better any time soon. Expect continuing network pain. Plus Bob is resync'ing the mysql replica, so that'll be behind a bit in the near term.

Quite often we recompile all the back-end servers with code thoroughly tested in beta and switch in these new versions in the public project during the outage. We did so today, and the splitters and assimilators all freaked out upon starting up this afternoon with library linking errors. What a hassle. It seems like our servers are slowly getting more and more out of sync, given some are 32-bit, some are 64-bit, some are running this rev of the OS, some are running that rev, some have this package installed, some don't, etc. and this is apparently becoming a problem. Like we have time to clean this all up.


I was having an offline discussion with a friend who insists that C++ is a vast improvement on C, and that C programmers who complain about C++'s major failings are living in the past or "just don't understand." I wouldn't mind the debate except C++ afficianados usually adopt a smug, condescending tone regarding C programmers that reminds me of republicans describing democrats. In any case there was a programming mystery today that ate up a man-hour of my and Jeff's time. If the object in question was just a struct it would have been painfully obvious. Instead the problem was obscured in vague assignment operator behavior. Does anybody have an actual, simple example of C++ code that is (a) easier to debug than analogous C code, (b) required less manpower to generate, and (c) will be forever useful and understood? I'm willing to be convinced, but it hasn't happened yet. Maybe it's just a different (and not necessarily better) kind of brain that loves C++, but I tend to think it stemmed from the evil part of our monkey mind that turns a blind eye toward unnecessary complication for everybody in the hope that things may be easier for ourself later on. Or the other evil part of our monkey mind that foists contorted methodology on others as some sort of sick competition (which may be fun but is hardly productive). K&R = 200 pages. Stroustrup = 1000 pages. Is C++ really 500% better that it requires 500% the pages to describe? Nope. Case closed.


- Matt
-- BOINC/SETI@home network/web/science/development person
-- "Any idiot can have a good idea. What is hard is to do it." - Jeanne-Claude
ID: 861709 · Report as offensive
PhonAcq

Send message
Joined: 14 Apr 01
Posts: 1656
Credit: 30,658,217
RAC: 1
United States
Message 861714 - Posted: 4 Feb 2009, 0:49:36 UTC - in response to Message 861709.  

Ah, you mean democrats describing republicans, don't you?

I agree with you that C++ hardly seems worth the effort over C, but I know C and C++ is like an unfriendly in-law. Yet, C# is worth a look if you like programming. It seems so much cleaner than C++ and more conceptual than C, as long as you don't try to program C using C#.

Hope these two comments don't tear down this thread. Sorry, but couldn't help. My father would have said, if he were of this century, that the three things you don't discuss in polite settings are religion, politics, and programming languages.
ID: 861714 · Report as offensive
Profile Euan Holton
Avatar

Send message
Joined: 4 Sep 99
Posts: 65
Credit: 17,441,343
RAC: 0
United Kingdom
Message 861760 - Posted: 4 Feb 2009, 4:23:47 UTC - in response to Message 861714.  

Ah, you mean democrats describing republicans, don't you?

I think it's just best to abstract it to politicians describing rival politicians...

ID: 861760 · Report as offensive
John McLeod VII
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 15 Jul 99
Posts: 24806
Credit: 790,712
RAC: 0
United States
Message 861766 - Posted: 4 Feb 2009, 4:55:39 UTC - in response to Message 861709.  

I have written a lot of C and even more C++. The point of C++ is that operations should be embedded in the class. This makes one place to fix rather than several.

Yes, there is C++ code that is permanently useful. However, the most useful permanent C++ isn't that simple to code, but it is simple to use - the std template library.

I have written a large amount of C++ that took less time than the equivalent C code would have.

As for C#, it is a royal pain to write a large program in C# - I have written a fair amount in C# as well. It is also nearly impossible, if not completely impossible, to do some things that are trivial in either C or C++ (just try to write your own container, or do hardware access, or binary file read/write).


BOINC WIKI
ID: 861766 · Report as offensive
Profile ML1
Volunteer moderator
Volunteer tester

Send message
Joined: 25 Nov 01
Posts: 20084
Credit: 7,508,002
RAC: 20
United Kingdom
Message 861854 - Posted: 4 Feb 2009, 11:50:34 UTC - in response to Message 861709.  

... servers are slowly getting more and more out of sync, given some are 32-bit, some are 64-bit, some are running this rev of the OS, some are running that rev, some have this package installed, some don't, etc. and this is apparently becoming a problem. Like we have time to clean this all up.

Give Boinc a real test and schedule a full shutdown Tues onwards until everything is synchronised up to the same versions. That may well fix a lot of the NFS mounts problems... And release a whole load of admin time in that there should be less head scratching over the differences quirks... Possible?

... a friend who insists that C++ is a vast improvement on C... a programming mystery... the problem was obscured in vague assignment operator behavior... foists contorted methodology...

Any programmer can program in dangerously obscure ways in any language!

As with all the various programming languages, each has its place. You can be just as dangerously vague in C with sloppy machine dependant casts or obfuscated code as you can be with the confused or unexpected use of operator overloading in C++. Usually, it's all just a case of making a clear and understandable design.

Unfortunately, human time constraints usually mean that quick dirty hacks get added to bodge-fix special cases until it all becomes an unmaintainable mess. Can any project manager be convinced with allocating enough time for code review and then to actually tidy up the first coding attempts for easy maintainability? (Usually no because that will be a problem for another project manager 'sometime'...)


So... How many programmers use 'defensive' programming for example?

eg:

#include <stdio.h>

int main()
{
        int a=3;
        const int b=4;

        if ( b == a )
                printf ("\n'a' and 'b' are equal\n\n");
        else
                printf ("\n'a' and 'b' are not equal\n\n");

        return (0);
}

Who takes the thought to write the "( b == a )" to guard against a typo where "( a == b )" could be mistyped "(a = b )" and be still syntactically correct and may even survive trivial testing to then only later fail with the more thorough 'real-world' testing?

In any case, who has the time for testing?!...

Regards,
Martin
See new freedom: Mageia Linux
Take a look for yourself: Linux Format
The Future is what We all make IT (GPLv3)
ID: 861854 · Report as offensive
John McLeod VII
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 15 Jul 99
Posts: 24806
Credit: 790,712
RAC: 0
United States
Message 861860 - Posted: 4 Feb 2009, 12:07:57 UTC - in response to Message 861854.  

I have seen both atrociously written C and atrociously written C++. One example in C was a case where two values (X and Y) were passed down a call stack as arguments the 5th call in the stack they were passed in the order Y and X. In the tenth level they stopped being passed without being used. In the 20th call in the stack, X and Y were magically used out of a pair of globals -- that were set in the function where they were called in the order Y and X. Because of entanglement with other places, this took about a week to fix.

One example of atrocious C++ was a case where X++ and ++X incremented different variables. The quthor of that code used so many obscure tricks that we decided it would be easier to start over.

On the + side of C++, se had a case where an entire corner of the program had to be redesigned, but replacing the code for that corner was just replacing one class herarchy, and did not take very long considering how much was redesigned.

Encapsulation really does pay if you do it right.


BOINC WIKI
ID: 861860 · Report as offensive
Richard Haselgrove Project Donor
Volunteer tester

Send message
Joined: 4 Jul 99
Posts: 14645
Credit: 200,643,578
RAC: 874
United Kingdom
Message 861893 - Posted: 4 Feb 2009, 13:44:34 UTC

Good to see data from the new 05Jan09 recordings filtering through from the splitters.

Even better, A2010 seems to have replaced A2130 in the observing schedules thru March 12. That should suit everyone - there won't be the massive overload of VHAR 'shorties' for the servers to cope with, and there won't be a massive overload of VLAR to clog up the CUDA clients.
ID: 861893 · Report as offensive
Notimeoff
Avatar

Send message
Joined: 15 Sep 05
Posts: 12
Credit: 43,235
RAC: 0
United States
Message 861894 - Posted: 4 Feb 2009, 13:51:57 UTC
Last modified: 4 Feb 2009, 13:52:57 UTC

Just a thought.
I rarely post. I felt this necessary. You/we have a great project, it grows daily. Details can kill. It’s out of sync. We Crunchers can tell from the inconsistencies. In my opinion (for what that may be worth) now is not the time, to second guess your decisions on the code. It is all relative. Changing code today will not find the sync errors. Frustrating as it may be … I find errors are harder to find, when I over detail them or look to hard…. Talk about code change… they all have their quirks. Try, cleaning up what is existing. Then you will have time to review your options. Try a triple Grande Latte; it’s easier on the stomach. Keep up the great R&D.
</obnoxious rant as well>
ID: 861894 · Report as offensive
Profile Matt Lebofsky
Volunteer moderator
Project administrator
Project developer
Project scientist
Avatar

Send message
Joined: 1 Mar 99
Posts: 1444
Credit: 957,058
RAC: 0
United States
Message 861912 - Posted: 4 Feb 2009, 15:43:58 UTC - in response to Message 861860.  

Encapsulation really does pay if you do it right.


I totally agree - I do admit C++ has its pros in theory *and* practice (I use the STL of course). The key is "if you do it right" - which happens as often as it does in any language, i.e. almost never, and debugging C++ is far more painful than C. I'm talking *real* debugging - nitty gritty stuff - we've encountered bugs in other people's tried-and-true C++ code. Totally painful to hunt down and figure out given the obscurity and malleability of the code.

I see C as a simple highway, with cars, and the basic rules of the road. C++ is cell phones, GPS, satellite radio, etc. that make highway travel seem more efficient, but ultimately these distractions are at best just distractions and quite possibly the cause of fatal accidents.

I also see C as "wanna build a house? here's some tools and supplies" and C++ as "wanna build a house? here's some tools and supplies and a set of random carpenters." You may get the house done faster with the carpenters, but it won't be to your personal spec without much planning and oversight, and then you'll have quite probably have to remodel it later. Plus I'd rather hang out with the guy who builds his own house himself.

As for the republicans describing democrats metaphor, I think this is quite apt. I'm firmly aware democrats have a different but equally annoying tone when describing republicans, and might use that metaphor from time to time. Of course, I'm thinking of the caricature depictions of these parties, which is basically all they are these days, aggravated by this constant us vs. them dialog in the media yet these two parties are functionally equivalent in many ways. I personally feel both parties are dead and useless and should disband and reform as several others, FWIW.

- Matt
-- BOINC/SETI@home network/web/science/development person
-- "Any idiot can have a good idea. What is hard is to do it." - Jeanne-Claude
ID: 861912 · Report as offensive
OzzFan Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 9 Apr 02
Posts: 15691
Credit: 84,761,841
RAC: 28
United States
Message 862186 - Posted: 5 Feb 2009, 4:23:58 UTC - in response to Message 861912.  

I personally feel both parties are dead and useless and should disband and reform as several others, FWIW.


I completely agree!
ID: 862186 · Report as offensive

Message boards : Technical News : Upper Lamarck (Feb 03 2009)


 
©2024 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.