Skip to main content

Questions tagged [anti-patterns]

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

Filter by
Sorted by
Tagged with
-3 votes
1 answer
182 views

Is there a name for this anti-pattern? A reference to a class member is being passed to another class method, rather than having the class method set the class member directly. public class ...
Jeff Roe's user avatar
5 votes
1 answer
336 views

I see this pattern a lot, especially with countries, or more generally regions. An enum is defined with additional fields and with methods that translate to and from these values. Example: import ...
user2740's user avatar
  • 159
2 votes
2 answers
351 views

Introduction Hi everyone, in my company we are using microservice approach and of course are trying to do it as correct as possible. There is a new requirement coming up where I have laid out a ...
Musterknabe's user avatar
0 votes
1 answer
195 views

In C programming, I have a set of information, and I have to ways of providing it to user: construct a data structure and provide it as an object. write a function to read them out and return them. ...
DannyNiu's user avatar
  • 374
0 votes
0 answers
127 views

I need to perform the following task: for a user [email protected], store a blob of data into their dedicated data store. DataStoreService is what actually stores the blob of data in the user's store, ...
async's user avatar
  • 854
-1 votes
3 answers
540 views

NOTE: Please don't respond by telling me that I probably don't understand what I am looking at. You can't possibly know that and it's wrong. Just don't answer if that's all you have to say. I'm ...
JimmyJames's user avatar
  • 31.1k
11 votes
5 answers
4k views

There is a coding anti-pattern I've noticed (while using .Net). You declare a data class, which is supposed to have a dictionary field (or get/set Property), and lets call it 'Properties', for the ...
Tim Lovell-Smith's user avatar
3 votes
2 answers
587 views

Assume that an external library or framework not under our control exposes a Controller API: abstract class Controller { abstract fun call(): Result } Assume that we want to handle exceptions ...
Matthew Layton's user avatar
0 votes
3 answers
245 views

Ok I have a bunch of components that all have the same logic but have different css classes. So I wanted to create a sort of factory function that takes the names of the classes as its argument and ...
kaan_atakan's user avatar
0 votes
1 answer
275 views

Module A contains a gap buffer for manipulating text and some associated methods. Relevant to this question is the dependency on a Module B, used for syntax highlighting of text. Module A also ...
user avatar
1 vote
2 answers
164 views

I am reading a lot about patterns and code structure and something that bothers me is BeanValidation's way to handle errors. I like Java and think that BeanValidation is easy to use, but it seems to ...
Apollo's user avatar
  • 139
1 vote
2 answers
707 views

Consider you have the following code: class UserContainer { List<User> user; //some methods to get specific users, for example users, which are higher than 1,70meters } The User have a ...
Robin Kreuzer's user avatar
106 votes
11 answers
27k views

Is it an anti-pattern or code smell to put "general use" functions (examples below) into a catch-all file named "helpers" or "utils"? It's a pattern I've seen quite a lot ...
old greg's user avatar
  • 959
6 votes
2 answers
164 views

Let's say I have a REST api endpoint that is getting a resource called a "purchasable" (an item that a user can purchase). Here is an example of what this might look like. Endpoint: GET /...
katmfoo's user avatar
  • 71
3 votes
3 answers
2k views

We have an input flag in our API which indicates whether we should keep the mid level resources involved in fulfilling current request or not. I've decided to use some context managers at interface ...
Mehraban's user avatar
  • 269
4 votes
5 answers
1k views

I have the following situation: class User { public Thing curThing; } //each thing can only belong to one user at a time //And vice versa class Thing { ...
Arturo's user avatar
  • 149
0 votes
1 answer
423 views

I have seen around the Internet several rest web services with the following behaviour. In case there are any errors, they return a Error object, otherwise they return, say, MyClass. See the ...
joninx's user avatar
  • 211
-2 votes
1 answer
752 views

I want to use Dependecy injection in my new .net core project, but my manager thinks it is an anti-pattern usage. I already know benefits of dependency injection. But my manager cares architecture ...
cansu's user avatar
  • 169
116 votes
17 answers
24k views

I am confused because in quite a few places I've already read that the so-called 'boneheaded' exceptions (ones that result from bugs in code) are not supposed to be caught. Instead, they must be ...
gaazkam's user avatar
  • 4,529
1 vote
1 answer
279 views

In my current project, I am trying to implement an environment to perform simulations of different workflows in a range of programs, websites, and mobile applications. These simulation subjects can ...
chb's user avatar
  • 119
0 votes
2 answers
276 views

I'm working through a book on writing Single Page Applications in Vanilla Javascript. (I'm working on a project where I'm not allowed to use React or any other frameworks, so I'm trying to get better ...
samfrances's user avatar
  • 1,095
29 votes
7 answers
10k views

I recently came across an MSDN article about branching and merging and SCM: Branching and Merging Primer - Chris Birmele. In the article they say 'big bang merge' is a merging antipattern: Big Bang ...
user6567423's user avatar
0 votes
1 answer
723 views

I'm busy playing around with some training material to help teach some of the juniors the factory pattern. Whilst writing the example, I can't help but think this might be an anti-pattern. Lets say ...
Darkestlyrics's user avatar
2 votes
3 answers
499 views

I come from OOP pradigm and I also know a bit about functional programming and its advantages. Over time I came to like the separation of data and transformations that are applied to it using pure ...
konrad's user avatar
  • 551
2 votes
2 answers
431 views

I'll describe the anti-pattern I see occasionally as this. Rather than using encapsulation or inheritance, a utility library grows with feature specializations directly added to it. Subsequent usage ...
selbie's user avatar
  • 633

1
2 3 4 5