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

learn more… | top users | synonyms

9
votes
3answers
429 views

Is there a formal anti-pattern to describe the scenerio?

Some code is written to generate Excel Spreadsheets (Office Interop). The code performs very poorly. A subsystem is designed to generate the files at night. Performance isn't a concern at night. ...
2
votes
2answers
465 views

Best practice for processing a list of items

I have a list of objects that need to be processed in some way. That way may not be correct for an item and thus raise an exception. In pseudo-code, it would look like: proccessItems (list) error = ...
31
votes
8answers
10k 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 ...
7
votes
4answers
381 views

Is there a name for “More events than expected” bug?

Is there a name for a family of bugs, that are caused by assumption, that user would generate only 1 event during the execution of the handler ? Simplest example is: animation triggered by click, ...
24
votes
11answers
9k 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 ...
22
votes
10answers
2k 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 ...
0
votes
1answer
298 views

Finding a definition for this anti-pattern

Working on a large and multi-tiered software project, I just found a recurring anti-pattern to be occurring in the code. I coulnd't find its definition in Wikipedia or other sources after a quick ...
10
votes
9answers
1k views

Is this an anti-pattern?

I've seen this a lot in our legacy system at work - functions that go something like this: bool todo = false; if(cond1) { ... // lots of code here if(cond2) todo = true; ... // some other ...
8
votes
3answers
556 views

Reinventing the wheel because it doesn't exist

One of the languages I have to use at work is a very small, niche language called psl. One of the largest complaints I have about it as a language is that the libraries are very limited. While that's ...
10
votes
5answers
654 views

Violation of the DRY Principle

I am sure there's a name for this anti-pattern somewhere; however I am not familiar enough with the anti-pattern literature to know it. Consider the following scenario: or0 is a member function in a ...
4
votes
2answers
523 views

Is there a term for the error-handling anti-pattern of discarding all available info and just returning failure?

From time to time (unfortunately way too often) I have to fix code such as this: // C++ code bool anyOldFunction(Param p) { try { ... if(some_condition_here) { handleErrorX(); return ...
9
votes
4answers
416 views

Is there a name for the not given/null/empty-problem?

I work with code, where data is stored/exchanged in Hashtable/Dictionary/Associative-Array-like structures, like this { 'alpha': None, 'bravo': '', # 'charlie' is not given } there is not ...
3
votes
1answer
1k views

Is functional decomposition really an antipattern?

While I was reading The worst anti-patterns you have came across, I clicked on the link in this post to land on the web site about anti-patterns. And the ...
12
votes
12answers
1k views

The difference between best practices and common sense?

There is a lot of conversation regarding best practices1 in software development. I've seen at least three major points get a lot of discussion both on SE and elsewhere: What qualifies as a best ...
10
votes
4answers
4k 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 ...
5
votes
3answers
1k views

Design Anti-Patterns - C# - Do you call this a God object?

I am writing Portfolio module for my web site and it has 3 components. Gallery Category, Gallery, & Gallery Images. I am doing all the request handling, (creating, reading, updating, other), for ...
15
votes
5answers
836 views

How are mock objects commonly misused?

I read an article recently which said that mock objects are often misunderstood and misused. Are there any clear mocking anti-patterns which I can look out for?
24
votes
10answers
3k 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 ...
2
votes
5answers
446 views

Anti patterns - Worth spending time or not

I have read this question and after a very long time it's clear I still don't understand anti-patterns. perhaps, it raised a new level of curosity to know why should I read Anti design pattern if they ...
12
votes
4answers
2k views

What is pattern based programming?

Can somebody explain the obsession with patterns and anti-patterns in programming? I ask because I have absolutely no idea what any of the patterns mean. When faced with a programming task I think ...
8
votes
1answer
432 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 ...
4
votes
3answers
1k views

Constant Interface antipattern - PHP

I came across this Wikiepedia article which says that using interfaces for defining constants is not a good thing. Solution suggested there is to define constants in a final class and use static ...
19
votes
12answers
3k views

What design patterns are the worst or most narrowly defined? [closed]

For every programming project, Managers with past programming experience try to shine when they recommend some design patterns for your project. I like design patterns when they make sense or if you ...
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 ...
1
vote
5answers
279 views

Does this have a name? DRY overloading?

public int foo(int x) { int defaultValue = 0; return foo(x, defaultValue); } public int foo(int x, int y) { return x + y; }
224
votes
13answers
55k 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, ...
2
votes
6answers
853 views

Is “call and return” a pattern or an antipattern?

Imagine to have this code: class Foo: def __init__(self, active): self.active = active def doAction(self): if not self.active: return # do something f=Foo(false) f.doAction() ...
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 ...
41
votes
41answers
3k views

Which comments instantly ring alarm bells when a programmer says them? [closed]

Similar to my question about easily spotted warning signs in code I think sometimes comments programmers make can tell you quite a lot (of not good things) about them in a short period of time. The ...
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 ...