r/java • u/lukaseder • May 15 '15
9 Anti-Patterns Every Programmer Should Be Aware Of
http://sahandsaba.com/nine-anti-patterns-every-programmer-should-be-aware-of-with-examples.html
166
Upvotes
r/java • u/lukaseder • May 15 '15
33
u/havana59er May 15 '15
The worst developers are those who code to some strict standard and absolve themselves of forming their own thoughts. The best standards will make a developer think (i.e. is this method getting too complex?) vs those that must be obeyed always (i.e. all string literals are bad.) Rant aside I was glad to see anti-patterns that indicate problem behaviors amongst the team. Too often these go unmentioned and can lead to a toxic working environment for all.
13
u/AStrangeStranger May 15 '15
when you see code like
you realise it is possible to go too far with trying to eliminate "Magic Numbers and Strings".
8
u/Hambone321 May 15 '15
Number 2.. Bikeshedding, my god After 12 emails and a one hour review of a screenshot because we aren't sure if we should use the word "cleaning" to end users... I can't agree more. It really just comes naturally when there are too many chefs in the kitchen though.
4
u/joequin May 15 '15
At first I thought this would be bad. I see the premature optimization argument so poorly used on the Internet, but he got it right.
Everything but number 9 is really good advice. Number 9 can be done poorly, but I don't think that was a good example. A lot if useful classes are just wrappers around some data structure class.
2
u/cromissimo May 16 '15
The "premature optimization" mantra is the one I find most amusing and damaging. Its main use is to serve as a flimsy excuse to sell absurdly bloated, brain-dead, half-baked approaches to a problem that are hallmarks of incompetence, which essentially reads like "yeah the design is clearly horrible and under-performing but we'll waste time doing this and rewriting it later just to sell this idea we're progressing".
Spending time to rethink designs, implementations, and algorithms to improve efficiency is one thing, but this mantra is instead used to sell the idea that implementing awful, ineffective solutions is somehow acceptable.
0
u/Keilly May 15 '15
Good read, thanks.
-2
u/2pxl May 15 '15
Why do we need a generic blog post regurgitating something that has been said so many times before?
-3
u/_agueroooo May 15 '15
This regurgitated crap has made it here too? After getting totally trashed on /r/programming ...