An indicator within a codebase that possibly indicates a deeper problem.

learn more… | top users | synonyms

10
votes
3answers
623 views

How to tackle a 'branched' arrow head anti-pattern? [duplicate]

I recently read this question that features, the arrow anti-pattern. I have something similar in code I'm trying to refactor except that it branches. It looks a little something like this: ...
51
votes
16answers
6k views

Are #regions an antipattern or code smell?

In C# code it allows the #region/#endregion keywords to made areas of code collapsible in the editor. Whenever I am doing this though I find it is to hide large chunks of code that could probably be ...
53
votes
17answers
4k views

How to train yourself to avoid writing “clever” code?

Do you know that feeling when you just need to show off that new trick with Expressions or generalize three different procedures? This does not have to be on Architecture Astronaut scale and in fact ...
21
votes
5answers
1k views

Is code ownership a code smell?

This is something I've been thinking about ever since I read this answer in the controversial programming opinions thread: Your job is to put yourself out of work. When you're writing ...
46
votes
12answers
2k views

If your unit test code “smells” does it really matter?

Usually I just throw my unit tests together using copy and paste and all kind of other bad practices. The unit tests usually end up looking quite ugly, they're full of "code smell," but does this ...
6
votes
3answers
510 views

Why it is not recommended to have set-only property?

Today at work one of my colleague reviewed my code, and suggested me to remove set-only property and use method insted. As we both were busy with other stuffs, he told me to look at Property Design ...
16
votes
11answers
1k views

Why are we supposed to use short functions to sectionalize our code? [duplicate]

I've seen an increasing trend in the programming world saying that it is good practice to separate code blocks into their own functions. Obviously, if that code block is reusable, you should do that. ...
12
votes
8answers
1k views

What was the worst piece of code you fixed that you are proud of? [closed]

I have had a few that I am proud of and some of them were written by myself few years ago. It doesn't have to be necessarily buggy, just bad code.
8
votes
2answers
530 views

Is it a code smell if an object knows a lot of its owner?

In our Delphi 2007 application we are using a lot of the following constructs FdmBasic:=TdmBasicData(FindOwnerClass(AOwner,TdmBasicData)); The FindOwnerClass travels the Owner hierarchy of the ...
8
votes
5answers
540 views

How much redundancy/robustness should complex software implement?

The focus of this question: Some software performs "extra work" in order to increase the chance of a "eventually successful/satisfactory" outcome, despite one or more internal errors in the software, ...
7
votes
4answers
677 views

Is “Code Smell” still a useful metaphor, or has misuse of the term subverted its meaning? [closed]

I've come across some comments and answers on Programmers.SE that decry the use of the phrase "Code Smell" and I've been wondering what the reasoning is for those who dislike it. I first encountered ...
3
votes
9answers
359 views

What tools do you use to let you know that methods in your codebase are getting too long? [closed]

Most people seem to agree that long methods are a code smell - a sign something may not be quite right with the code contained in them. Which tools do you use to detect this smell? clarified title ...
3
votes
3answers
599 views

Refactoring code smells in ASP.NET Web Forms Code Behind Files: Is it risky? Is it wise? Is it a waste of time?

Given a long method with Pac-Man ifs, would it be wise to: Break down code blocks into regions. Then refactor code blocks into methods. Or would it be best to leave it alone? Would it be risky? ...