Episode 19 mistakes

183 views
Skip to first unread message

OM

unread,
Jun 13, 2013, 10:26:05 PM6/13/13
to clean-code...@googlegroups.com
Some mistakes that I didn't see mentioned yet

- Did not remove magic numbers eg if (size > 2) etc

- Using a fixed list of honorifics when you can't know all possible honorifics that could be used in a name (eg what if the person is from another country, do you really want to hard code the list of honorifics for all countries.  You will miss some if you do it this way.

- Unnecessary else statements  eg
if (a) return x
else return y

instead of just

if (a) return x
return y

Uncle Bob

unread,
Jun 14, 2013, 5:29:11 AM6/14/13
to clean-code...@googlegroups.com
Winner #20.  

Thank you OM, and thank you all.  A lovely discussion.
Reply all
Reply to author
Forward
0 new messages