Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,147,817 members, 7,798,752 topics. Date: Tuesday, 16 April 2024 at 09:50 AM

O-O Design Code Smells - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / O-O Design Code Smells (1121 Views)

(2) (3) (4)

(1) (Reply)

O-O Design Code Smells by harryobas: 4:06pm On Jul 03, 2012
Hello fellow nairalanders just want to share a few O-O design “Code Smells“(code that can make software design harder to change) with you all. These are just a few of the common smells i have come across from my experience of performing O-O design and code refactoring so please feel free to add to the list below if u think i have omitted any. The list is as follows:

Duplicate code
Long methods
Big classes
Big switch statements
Long navigations (eg, a.b().c().d())
Too much checking for null objects
Data clumps (eg, a Contact class that has fields for address, phone, email etc) – similar to non-normalized tables in relational database design
Data classes (classes that have mainly fields/properties and little or no methods)
Un-encapsulated fields (public member variables)

Note that the above code smells have been listed from the c# programming language standpoint but i believe they are equally applicable to any O-O compliant language(java ,c++ etc).
Re: O-O Design Code Smells by ektbear: 7:56am On Jul 19, 2012
"Eww, what is that smell. Your code stank!"

(1) (Reply)

Building For Android And Blackberry In C# / A First Time Programmer Needs Help In Python / Asynchronous ES6 With Generators – Tutsplus

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 5
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.