Anti Patterns

In additions to common, well covered, Anti Patterns as described in Wiki (http://en.wikipedia.org/wiki/Anti-pattern), from Spaghetti code, Lasagna code, hard code, Lava Code, Stale Code, magic number/string, cut&paste …etc
There’s a list of things dev lead should specifically watch for.

Critical – Things for which you’d have a hard time fixing, debugging.
a. Open Thread – Not using ThreadPool? Slow build up of thread count?
b. Dispose – when not implemented (or incorrectly/accidentally/unintentionally removed). Result? Slow dealth by memory leak, and subsequent paging.
(Thread.Abort?)
c. Open lock – fine grain vs coarse grain locking? Is lock necessary?
d. Open Transaction – is it needed?
e. Open Connection to a resource (Database, File…etc) and not releasing it?
(Thread.Abort?)
Architectural/Maintenance – Things that you won’t need to fix right away, but will degrade your code quality over time, to a state you’ll just need rewrite from scratch
a. Duplicate code, cut & paste, code reusea. Duplicate code, cut & paste, code reuse
b. Duplicate class’es? Entity vs VM?
c. Two utilility libraries (FTP for example) serving same purpose in different parts of the application
d. Global variables: Excessive use of Context or static variables (aka Spaghetti code)
e. Over/under engineering
Too much Business Logic in UI/presentation tier, God Object (aka Spaghetti code)
Over layering (aka Lasagna code)
f. No/insufficient input validation
(security concerns, as well as introduction downstream problem)
h. Un-necessary tie down functionality to specific technologies: For example, validation regular expressions/logic should not be tied to, for example, ASP.NET validation control. It should be generic static method in plain C# dll.
i. Critical execution paths
– unnecessary additions
– row by row handling vs BCP
j. Hard coded magic constants
k. switch statements not covering all possible cases
l. Incoherency/incongruency: For example validation expression/rule between client side validation and server side differs
m. Error hiding
n. Stale code (aka “Lava Code”)
i. Syntax
Camel vs Pascal casing
Pascal case: GreenButtonType.
Camel case: myInt
Indent Convention

http://sourcemaking.com/antipatterns/software-development-antipatterns
http://cplus.about.com/od/learnc/ss/csharpclasses_5.htm

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s