An anti-pattern is a behavior or practice that is common despite being ineffective or counterproductive.

learn more… | top users | synonyms

10
votes
3answers
1k 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: ...
251
votes
13answers
69k views

So Singletons are bad, then what?

There has been a lot of discussion lately about the problems with using (and overusing) Singletons. I've been one of those people earlier in my career too. I can see what the problem is now, and yet, ...
31
votes
7answers
1k views

Code maintenance: keeping a bad pattern when extending new code for being consistent, or not?

I have to extend an existing module of a project. I don't like the way it has been done (lots of anti-pattern involved, like copy/pasted code). I don't want to perform a complete refactor for many ...
17
votes
7answers
5k views

Are exceptions as control flow considered a serious antipattern? If so, Why?

Back in the late 90's I worked quite a bit with a code base that used exceptions as flow control. It implemented a finite state machine to drive telephony applications. Lately I am reminded of those ...
98
votes
60answers
9k views

Which things instantly ring alarm bells when looking at code? [closed]

I attended a software craftsmanship event a couple of weeks ago and one of the comments made was "I'm sure we all recognize bad code when we see it" and everyone nodded sagely without further ...
31
votes
8answers
11k views

Is ORM an Anti-Pattern? [closed]

I had a very stimulating and interessting discussion with a colleague about ORM and its pros and cons. In my opinion, an ORM is useful only in the rarest cases. At least in my experience. But I don't ...
3
votes
2answers
1k views

Alternative to “inheritance versus composition?” [duplicate]

Possible Duplicate: Where does this concept of “favor composition over inheritance” come from? I have colleagues at work who claim that "Inheritance is an anti-pattern" and want to use ...
36
votes
11answers
5k views

Are error variables an anti-pattern or good design?

In order to handle several possible errors that shouldn't halt execution, I have an error variable that clients can check and use to throw exceptions. Is this an Anti-Pattern? Is there a better way to ...
11
votes
4answers
5k views

EAV - is it really bad in all scenarios?

I'm thinking to use EAV for some of the stuff in one of the projects, but all questions about it in stackoverflow end up to answers calling EAV an anti pattern. But I'm wondering, if is it that wrong ...
8
votes
5answers
453 views

Reengineering the project from scratch [duplicate]

Possible Duplicate: When do you rebuild an application or keep on fixing the existing one I am currently working on a project that has been in development for the last few years used ...
23
votes
2answers
1k views

Is there an anti pattern for historically grown software? [closed]

Is there an anti pattern that describes a historically grown software system where multiple developers just added new features to the system but no one really kept an eye on the overall architecture ...
26
votes
8answers
1k views

What to do about “Failure Driven Development”?

At our shop, we strive to be agile. And I'd say we are making great strides. That said, a few of us have spotted a pattern we have started calling "Failure Driven Development". Failure Driven ...
22
votes
10answers
3k views

How many are too many interfaces on a class?

I would probably consider it a code smell or even an anti-pattern to have a class that implements 23 interfaces. If it is indeed an anti-pattern, what would you call it? Or is it simply just not ...
9
votes
1answer
496 views

When is a glue or management class doing too much?

I'm prone to building centralized classes that manage the other classes in my designs. It doesn't store everything itself, but most data requests would go to the "manager" first. While looking at an ...
26
votes
11answers
12k views

Is using nested try-catch blocks an anti-pattern?

Is this an antipattern? It is an acceptable practice? try { //do something } catch (Exception e) { try { //do something in the same line, but being less ambitious ...
25
votes
10answers
4k views

What naming anti-patterns exist? [closed]

There are some names, where if you find yourself reaching for those names, you know you've already messed something up. For example: XxxManager This is bad because a class should describe what the ...
34
votes
6answers
2k views

Good or bad practice to mask Java collections with meaningful class names?

Lately I've been in the habit of "masking" Java collections with human-friendly class names. Some simple examples: // Facade class that makes code more readable and understandable. public class ...
25
votes
7answers
5k views

Are utility classes with nothing but static members an anti-pattern in C++?

The question Where should I put functions that are not related to a class has sparked some debate over whether it makes sense in C++ to combine utility functions in a class or just have them exist as ...
5
votes
4answers
318 views

Direct database manipulation an anti-pattern?

Recently I learned that some teams have moved all their database manipulation to the actual database through the use of stored procedures. I thought that was pretty clever, since the database becomes ...
2
votes
0answers
263 views

Is this any form of service pattern, some other pattern, SOA or just an anti-pattern?

I'm going to set out a scenario/pattern I've encountered and then I have a few questions pertaining to it. During an MVC request in a web framework (PHP, Laravel in my case), if I have an abstract ...