Somewhat of a jem...
-
just look at this beauty:
m_fooDictionary[m_fooList[p_fooIndex].BarTypeEnum][oldState]--;
the interesting thing is that this line is repeated numerous times across a 1500+ lines class, sometimes with "++" or "--" at the end.. truly a great way to start off your day
-
just look at this beauty:
m_fooDictionary[m_fooList[p_fooIndex].BarTypeEnum][oldState]--;
the interesting thing is that this line is repeated numerous times across a 1500+ lines class, sometimes with "++" or "--" at the end.. truly a great way to start off your day
Looks OK, just add some horizontal space.
-
Looks OK, just add some horizontal space.
No error checking for array bounds.
«_Superman_»
-
No error checking for array bounds.
«_Superman_»
There might be, just not in that snippet, or maybe that's was a design decision, I can't tell from just that one statement.
-
Looks OK, just add some horizontal space.
PIEBALDconsult wrote:
Looks OK
Yes, if you mean OK as in syntactically correct. But it's not very readable, this statement seems to say: I don't care too much about my team mates and/or maintainability. And if that is repeated many times throughout the class, sometimes with one
-
, sometimes with two, then it is only a question of time until a problem related to these statements will occur.www.thomas-weller.de Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Programmer - an organism that turns coffee into software. -
PIEBALDconsult wrote:
Looks OK
Yes, if you mean OK as in syntactically correct. But it's not very readable, this statement seems to say: I don't care too much about my team mates and/or maintainability. And if that is repeated many times throughout the class, sometimes with one
-
, sometimes with two, then it is only a question of time until a problem related to these statements will occur.www.thomas-weller.de Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Programmer - an organism that turns coffee into software.Thomas Weller wrote:
And if that is repeated many times throughout the class, sometimes with one -, sometimes with two, then it is only a question of time until a problem related to these statements will occur.
How could there be one '-'? Would that even parse? (BTW, the inability to parse a single trailing plus minus would seem a reason to favor i++ over ++i when the two operations would otherwise be interchangeable). If there were only one or two such statements in the code, I would probably be inclined to create temporary variables to hold the outputs of the various subexpressions. If the exact bit of code is repeated extremely often, I might be inclined to define a separate method for it. Otherwise I would expect someone parsing the code to example that classes referenced therein and determine what the different methods or properties mean. The expression seems pretty straightforward; if it only appeared once, expanding it to use temporary variables would make it easier to read, but if it appears many times, expanding it in such fashion would make one instance (the first one examined) easier to read and the rest bloated and annoying.
-
just look at this beauty:
m_fooDictionary[m_fooList[p_fooIndex].BarTypeEnum][oldState]--;
the interesting thing is that this line is repeated numerous times across a 1500+ lines class, sometimes with "++" or "--" at the end.. truly a great way to start off your day