Code Smells – Issue Number 3

Code Smells Welcome to the third 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. These code smells are often based on my own opinion and experience with programming. If you disagree with what I'm saying in my post, please don't hesitate to post a comment.…


Lambdas: An Example in Refactoring Code

Background: Lambdas and Why This Example is Important Based on your experience in C# or other programming languages, you may or may not be familiar with what a lambda is. If the word "Lambda" is new and scary to you, don't worry. Hopefully after reading this you'll have a better idea of how you can use them. My definition of a lambda expression is a function that you can define in local scope to pass as an argument provided it meets the delegate signature. It's probably pretty obvious to you that you can pass in object references and value types into all kinds of functions... But what about passing in a whole function as an argument? And what if you just want to declare a simple anonymous method right when you want to provide it to a function? Lambdas. So…

1 Comment

End of content

No more pages to load