|
den2k88 wrote: since I have to be productive with a 2 weeks training over a medium sized project with no documentation nor coding standard
Ouch! I feel your pain!
Latest Article - A Concise Overview of Threads
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
|
Oh my. This is what happens when people can get titles like "senior" based on time and not on skill. I need a drink after reading that
|
|
|
|
|
Mind you the corollary to that is when people have very similar long variable names CompanyIsAgent, CompanyHasAgent, CompanyAgent, IsCompanyAgent, IsAgentCompany etc etc in that they are all nice long descriptive names, but you cannot begin to comprehend the usage or meaning of any of them without studying the program context, and it's easy to use the wrong one and for the code to still run! (this is a real world example!). Using variable names like a, aa, aaa, aaaa and x, xx, xxx, xxxx etc (also a real world example) is hardly any worse.
Naming things well is hard, so I would go for brevity where possible and using objects containing properties if at all practical simply so the context can be easily acquired when reading the code
|
|
|
|
|
Did the guy knew about IDEs with auto-complete?
I understand the point that even if it takes a fraction of a second longer to type a variable name, it will save you several minutes/hours in the future when you or someone else has to maintain that code. But even that fraction of a second disappears with auto-complete.
|
|
|
|
|
Most of these people think that "vim is better" than a proper IDE.
GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
|
Quote: Did the guy knew about IDEs with auto-complete?
He didn't like auto-complete telling him what to type.
Quote: it will save you several minutes/hours in the future
He believed that some ephemeral future savings did not outweigh a concrete savings right now!
And besides, "a real programmer can figure out the code". Extra time to figure things was not important, but the fraction of a second typing time mattered. I believe the saying "Penny wise and Pound foolish" applies.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
I used to work with a guy who typed (mostly) with one finger - if he needed a capital letter he hit caps lock then the letter then caps lock ...
This was pre-IDE with completion days. His variable and function names were really terse. When we noticed his coding style, the functions we implemented in our libraries started to "change" so cpos(...) became setVirtualCursorPosition(...) and fg(...) became setForegroundTextColour(...) and so on
|
|
|
|
|
Not disagreeing with the idea that a symbol's name should tell you a bit about it (if possible), but I have worked with someone who who's symbol and function names were pretty near essays.
It takes a bit of common sense - and making distinguishing them a non-painful eye exercise. Why not loop with i, j, etc., as counters? Why not use IPAddr instead of ipa (slurp!)?
Always just common sense to make readable and to avoid mistakes. It shouldn't be hard.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
There were people here who would call that variable ip. It drove me crazy until I eradicated all traces of that nonsense.
|
|
|
|
|
|
BillW33 wrote: You will save a lot of time only typing 2 or 3 letter variable names instead of those long names.
And here I thought if you use shorter variable names, the program runs faster!
Latest Article - A Concise Overview of Threads
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Thanks. I'm now having flashbacks to GW-BASIC.
If you think 'goto' is evil, try writing an Assembly program without JMP.
|
|
|
|
|
You tell me... this code sucks so much I wrote several VB6 lines inside C++, not kidding!
GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Reminds me of my first foray into Fortran IV. Then, we used computer cards. We were only allowed six characters for variable names. Then, it was all in CAPS.
|
|
|
|
|
Sounds like a bunch of college students to me. They need refinement. But, you get what you pay for.
|
|
|
|
|
Do you get paid by the line of code?
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Sadly not. I would have made a million in the first two weeks and then resigned if that was the case.
GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Well, seeing that you do not like switch statements to begin with, they have already failed, throwing the 4 and 5 in is just overkill.
BTW, I love how they are checking str if it is not 5 in a case statement where str = 4 . Of course it is not 5.
Edit: I just realized your title is saying what I just said. I really need to take a nap.
|
|
|
|
|
Slacker007 wrote: hey are checking str if it is not 5 in a case statement where str = 4 . Of course it is not 5.
But it might be next week!
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Was it originally a set of nested if and they just missed that one?
|
|
|
|
|
MarkTJohnson wrote: Was it originally a set of nested if and they just missed that one?
I have no idea, and I didn't want to look through the TFS change history to find out.
Latest Article - A Concise Overview of Threads
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
If that is Java...then also you can't compare strings that way! fundamental knowledge.
|
|
|
|
|
I think that
if (itIsRainin == true)
is just as bad.
|
|
|
|