Academia

Started by
35 comments, last by slicer4ever 10 years, 5 months ago

Even "p" as the position of a particle is ambiguous - it could easily be momentum (which is denoted as "p"). I've always despised single-letter variables (Volume? Velocity? Voltage? Acceleration? Amperes? Area?) even when dealing with mathematics. Walking into programming where it's expected that variable names be descriptive with such behavior is, in my opinion, inexcusable. I mean, "vel" is already a massive improvement over "v" (likewise with "pos" and such) -_-

Advertisement

Yes, I hate trying to read code where they use short hand variable names.

The human brain is wired to instantly recognize words it knows. You read number all over the place. When you see number even if it is not in the correct order, you will be able to recognize it as such.

Writing out words instead of short handing them makes the code SOOO much easier to read.

"Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoatnt tihng is taht the frist and lsat ltteers be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe."

That right there should be evidence enough for people to use FULL AND MEANING FULL words for their code. Is it really that much more effort to type a few extra letters.

That right there should be evidence enough for people to use FULL AND MEANING FULL words for their code. Is it really that much more effort to type a few extra letters.

Better yet - now we can randomize variable names without impeding code readability, as lnog as the frsit and lsat cahracetrs are in the rghit palce wink.png

That said there is an anti-argument to this - ridiculously long variable and function names lead to extremely long code lines (think business java code with getCustomerFormAndIDFileSecureTransactionDBConcurrent() methods) which are difficult to read, not to mention print. So a balance needs to be achieved somehow.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

That right there should be evidence enough for people to use FULL AND MEANING FULL words for their code. Is it really that much more effort to type a few extra letters.

Better yet - now we can randomize variable names without impeding code readability, as lnog as the frsit and lsat cahracetrs are in the rghit palce wink.png

That said there is an anti-argument to this - ridiculously long variable and function names lead to extremely long code lines (think business java code with getCustomerFormAndIDFileSecureTransactionDBConcurrent() methods) which are difficult to read, not to mention print. So a balance needs to be achieved somehow.


Heh. They COULD be random, if you're happy with your code not compiling happy.png

And yeah, obviously if its TOO long then you've got a problem too.

The right balance depends on the scope of the variable. If you've got a 3-line loop body, with Vec3 p = blah.position; as the first line, then there's no problem, as further explanation about what 'p' means appears in the same context.
If someone has a member variable named 'p', then the class better be pretty damn simple/small/self-explanatory.
If someone has a global variable named 'p', they can GTFO ;-)

The larger the scope, the longer the appropriate name length.

The right balance depends on the scope of the variable. If you've got a 3-line loop body, with Vec3 p = blah.position; as the first line, then there's no problem, as further explanation about what 'p' means appears in the same context.
If someone has a member variable named 'p', then the class better be pretty damn simple/small/self-explanatory.
If someone has a global variable named 'p', they can GTFO ;-)

The larger the scope, the longer the appropriate name length.

Yeah, that sounds like a reasonable line of reasoning.

The right balance depends on the scope of the variable. If you've got a 3-line loop body, with Vec3 p = blah.position; as the first line, then there's no problem, as further explanation about what 'p' means appears in the same context.
If someone has a member variable named 'p', then the class better be pretty damn simple/small/self-explanatory.
If someone has a global variable named 'p', they can GTFO ;-)

The larger the scope, the longer the appropriate name length.

Yeah, that sounds like a reasonable line of reasoning.

I think it's reasonably reasonable for you to say that his reasoning is reasonable.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

The right balance depends on the scope of the variable. If you've got a 3-line loop body, with Vec3 p = blah.position; as the first line, then there's no problem, as further explanation about what 'p' means appears in the same context.
If someone has a member variable named 'p', then the class better be pretty damn simple/small/self-explanatory.
If someone has a global variable named 'p', they can GTFO ;-)

The larger the scope, the longer the appropriate name length.

Yeah, that sounds like a reasonable line of reasoning.

I think it's reasonably reasonable for you to say that his reasoning is reasonable.

How reasonable of you!

The reasonable amount of reasonably reasonable posts in this reasonable thread is reasonably reasonable.

...I dare you to read that sped up =P

Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

I think that everyone is being too reasona...oh what the crap, it isn't worth it. I'm screwing it up. This being reasonable stuff is becoming unreasonable!

This topic is closed to new replies.

Advertisement