Code Smells – Issue Number 2

Code Smells Welcome to the second edition of Code Smells! Periodically I'll be posting about how to detect code smells and what they mean in terms of the big picture of your code. The previous installment can be found right here. What's a code smell? Wikipedia says it perfectly: In computer programming, code smell is any symptom in the source code of a program that possibly indicates a deeper problem. Code smells are usually not bugs—they are not technically incorrect and don't currently prevent the program from functioning. Instead, they indicate weaknesses in design that may be slowing down development or increasing the risk of bugs or failures in the future. Onto the code smells! The Stink List Code Smell #4: (Thanks to reddit user fkaginstrom) You have an large number of parameters being passed in to your function call. Functions that take in a ton of parameters stink for…

0 Comments

Code Smells – Issue Number 1

Background I thought this might be kind of fun (fun can also be read as "upsetting"), so I'm giving it a shot. It's pretty frequent as programmers we go back and revisit some code and find ourselves shaking our heads at what we see. These code smells often don't show their faces when they're being created, so don't beat yourself (or anyone else) up just yet. Common signs you've stumbled upon a code smell are when you find yourself saying: How could that co-op have possibly coded this?! Blast those interns! Or What the heck was John thinking when he put this together?! Does he not have a brain?! Or No wonder we find so many bugs in this part of code! Look what Jane did! But it never truly hits home until you get one of these: What is…

4 Comments

End of content

No more pages to load