Monday, March 21, 2011

Classic coding error

  Reading through some code someone else wrote in order to extend it for a new feature I'm designing and implementing and I came across this.

enum SESSION_TYPE_T
  {
    SESSION_TYPE_DS,
    SESSION_TYPE_IS,
    SESSION_TYPE_SS,
    SESSION_TYPE_CS,
    SESSION_TYPE_TS,
    SESSION_TYPE_NS
  };

  All I can say is wow. Really, how much is just wrong with this from the pointless repeat of the enumeration to the utter lack of any useful description of the difference between the values. Single character differentiators between values are pretty much meaningless. This is also in code that has pretty much zero comments explaining stuff. I know who wrote this, they are no longer here, it shows just how junior and inexperienced they are despite their title containing senior.

No comments:

Post a Comment