Questions tagged [code-smell]

Determining what is and is not a "code smell" is subjective, and varies by language, developer and development methodology.

Before you ask if some technique is a "code smell," ask yourself what the consequences to your specific project would be, if you used the technique. Simply asking whether something is a "code smell" or not is too subjective.

Determining what is and is not a code smell is subjective, and varies by language, developer and development methodology.

Before you ask if some technique is a "code smell," ask yourself what the consequences to your specific project would be, if you used the technique. Then, ask about those specifics. Simply asking whether something is a "code smell" or not is subjective, and increases the likelihood that your question will be closed.

171 questions
10
votes
2 answers

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 current component upwards to find a specific class (in…
Bascy
  • 203
8
votes
5 answers

What to do when your work colleague doesn't understand the design trying to be maintained

A software project that I am working on involves me and another programmer. The project involved an engine backend with an MVC front end. Initially I did alot of the work on the project and so setup some simple design methodologies mainly…
dreza
  • 3,476
5
votes
1 answer

Is this a feature envy smell?

In my Application, I wanted to seperate GUI and business logic with some kind of ModelViewPresenter-Design. Therefore I made some Presenter classes, which have not much more code than the properties my forms are databound to. To provide persistance…
MW1971
  • 155
3
votes
4 answers

Escape a GameLogic god class.

When programming a simple game as an example. I always tend to get left with a large GameLogic class somewhere which is reponsible for gluing together all of the other portions of the software. A Common example of the GameLogic class I talk about…
2
votes
2 answers

Does using primitive types instead of user-defined types reduce dependencies?

Suppose I have a member function void A::foo(B const &b) where a class B instance is just a bunch of data. Would it not be better to remove the dependency between class A and class B by rewriting the member function like void A::foo(int var1, double…
1
vote
1 answer

Clear examples for code smells

does anybody know how the code smells "rigidity", "fragility", "immobility" and "viscosity" can be explained in short code examples? I've found a lot of text but never a source code example. Thanks for your hints. Are there at least very pratical…
Freude
  • 139
1
vote
0 answers

Is this an example of Data Envy? How do I solve it?

I have a scenario where I'm using an external service which requires a big hash of parameters like so: def external_service_params(user, invoice) { name: user.name, email: user.email, phone: user.phone, invoice_id: invoice.id, …
-3
votes
3 answers

Is there a name for the code smell where we add different types of objects to a list or array instead of defining a new data structure?

I came across a question earlier where someone asked how to create an array list with multiple object types (Create an ArrayList with multiple object types?). The easiest solution is to create a list of objects, but many people mentioned in the…
Chrisuu
  • 123