Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coding Efficiency
#31
Clarity is KING.  Proper named variables are also a huge help as well as organized variable naming conventions.  For example, if my variable is a local only variable, it will begin with lowercase 't' (meaning temp) - this way I know at a glance that it is local only.
Reply
#32
I agree with dano on clarity, some people are very clever but only they can understand their code
Reply
#33
Using sensible variable names is "ancient", but it was often overlooked. You could read about it already in every good programming book over 30 years ago, especially in the standard programming work: Code Complete from 1993.

And there is something else that you can find/found not only there, the use of brackets in C, Java & Co. 
[Image: banghead-2.gif]

Code: (Select All)

int main(void) {

float betrag = 10000.0, zinssatz = 0.0;

if (betrag > 50000) {
  zinssatz = 3.0;
} else if (betrag > 10000) {
  zinssatz = 2.0;
} else if (betrag > 0) {
  zinssatz = 1.0;
} else {
  zinssatz = -0.2;
}
printf("Fertig!\n");

return(0);
}

Even back then, in 1993(!), it was pointed out that this type of bracketing have costed hundreds of thousands of man-hours in troubleshooting. But it is ineradicable! People still use brackets like this. --> Now about . . . 100 million man-hours? Or could it be a bit more?  Rolleyes
Reply
#34
Not to mention tax brackets. Although the difference here is the higher you go, the more time money you lose.

Pete Big Grin

- I coded with bell-bottoms in the 1970's.
Fake News + Phony Politicians = Real Problems

Reply




Users browsing this thread: 2 Guest(s)