|
K&R C was developed in the days when the Teletype ASR 33 was the standard keyboard/printer/paper tape reader/punch. The ASR 33 read and printed AT 10 CHARACTERS PER SECOND. Since it could take hours to compile and print a program listing, brevity was paramount. Spaces were important since each space took a 1/10 of a second to process; tabs were not usually used because tab settings were not consistent; and the program author was the maintainer, so understanding and style consistency were already learned.
IMHO, C, C++, Java, JavaScript, and all their derivative languages are innately prone to error.
I have spent countless unnecessary hours chasing non-obvious programming errors. In one case, I spent over 6 months chasing an "=" vs "==" in an if statement in a C program that was buried in an error recovery routine.
Programs should be written, first for communications to yourself; second, to other programmers; and finally to the equipment. And part of communications is consistency in style.
At last count, I have written programs and systems in over 40 languages, some of which where proprietary to equipment or application. They all have room for improvement!
Just my thoughts
|
|
|
|
|
I normally put the opening brace on the introductory statement line, but there are a number of functions I've written that do not follow this rule: those auto-generated by tools, and those that have too many arguments to put on one line. In the latter case, the main problem is that auto-formatting would not indent follow-up code correctly if I placed the opening brace on the last line of the argument list. But formatting works fine if I put it on a separate line.
Life is compromise
(yes, it's totally possible there are formatting tools better than the built-in VS editor, but I'm not going to clutter my toolbox just for this!)
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
Get resharper on that code right away!!
|
|
|
|
|
I was outside doing some work when I noticed that the tulips and daffodils are coming up. What a great winter we are having
Within you lies the power for good - Use it!
|
|
|
|
|
Damn, it's hell on wheels here in hamster land. -20 to -30C seems to be the norm.
/ravi
|
|
|
|
|
Ravi Bhavnani wrote: in hamster land.
Strange - don't you normally get Tulips from hamster land?
MVVM # - I did it My Way
___________________________________________
Man, you're a god. - walterhevedeich 26/05/2011
.\\axxx
(That's an 'M')
|
|
|
|
|
Good catch! Clearly I have food on the brain.
/ravi
|
|
|
|
|
Wow, that's awesome. Well played sir.
|
|
|
|
|
Yes - we have flowers blooming as well. "Crocuses" apparently - I only recognize two forms of plant: "Grass" and "Tree". Everything else is a complication I leave to Herself.
I will (under duress) mow the grass, but I draw the line at anything else.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
OriginalGriff wrote: I will (under duress) mow the grass, but I draw the line at anything else. I draw the line at sand.
/ravi
|
|
|
|
|
Here in SC and in FL as well snow is on the way Weds. and wind chills in the low teens, last time this happened was in 89!
|
|
|
|
|
Back in 2004, the Upstate region of South Carolina (Rock Hill specifically) got a snow storm in February - 18 inches in one day. What would have been a 45 minute commute home took 3 hours.
And, no, it doesn't happen very often, but when it does... well, just stay off the roads. Even if YOU know how to drive in it, MOST of them don't.
Tim
|
|
|
|
|
Stay off the roads because all the non-driving idiots are out in force, they can't even drive the roads when it rains so when it snows well...
|
|
|
|
|
Mike Hankey wrote: Ravi we don't want your weather Nor do I!
/ravi
|
|
|
|
|
I can imagine y'all have been slammed.
Hopefully it will be an early spring for y'all?
|
|
|
|
|
PJ Arends wrote: What a great winter we are having
I'm happy to send you some nice white fertilizer.
Marc
|
|
|
|
|
Thanks, but no thanks.
Within you lies the power for good - Use it!
|
|
|
|
|
It's been pretty rough here, as well, PJ. In the mid to high-70s, sunny. Ugghh!
I planted a nectarine tree last weekend, and it's already sprouting new growth!
Will Rogers never met me.
|
|
|
|
|
Poor, poor Roger.
Software Zen: delete this;
|
|
|
|
|
-2°F (-19°C) in northern Illinois - heading to -14°F tonight with 20-30 mph winds just to spice things up.
I LOVE ILLINOIS! I Love Illinois! I love Illinois! i love illinois...
Government is not reason; it is not eloquent; it is force. Like fire, it is a dangerous servant and a fearful master. ~ George Washington
|
|
|
|
|
51 today in Nome Alaska.
i believe they broke a record.
|
|
|
|
|
I heard they had to postpone a few stages of the Iditarod due to warm temperatures and a lack of snow.
Government is not reason; it is not eloquent; it is force. Like fire, it is a dangerous servant and a fearful master. ~ George Washington
|
|
|
|
|
-8 right now, was -20 this morning with -49 windchill, schools closed 3 times in the last week.
Polar Vortex[^] they're calling it, I call it %#@*&!, Ravi's description is far too nice a way to describe it.
Then the crazy canucks blow up a pipe line [^] (By accident, of course) and the utility companies are telling us to turn the heat down to 60F (16C) so we doin't run out of gas.
F-f-f-f-f-f-f -freeze off!
It was broke, so I fixed it.
|
|
|
|
|
The only two-lips in this area are blue,
|
|
|
|
|
-2°C here this morning. Tomorrow there is "some" snow expected. Brrr..
The signature is in building process.. Please wait...
|
|
|
|