Skip to main content

New answers tagged

0 votes

Is it still "feature envy" if the state to make decision or the action to take after asking the state involves other classes to participate?

The answer by @Doc Brown gives really highlights the fact that you need to be thinking and planning your code well. I just wanted to add a concrete example of what I would do with your code. In this ...
Luke Nelson's user avatar
6 votes

Is it still "feature envy" if the state to make decision or the action to take after asking the state involves other classes to participate?

if a class asks another class for the state, and then call methods of that class, it should move the code into the object as an instance method No, that is not what the cited answer says. It says As ...
Doc Brown's user avatar
  • 210k
5 votes

Is the inability to find code by searching for a class name a reason to avoid using auto in c++ variable declarations?

It is true that code is being read and maintained more often than it is written. But that's one more reason to use auto ! auto to accelerate change propagation For the maintenance of code, auto has ...
Christophe's user avatar
  • 78.7k
4 votes

Is the inability to find code by searching for a class name a reason to avoid using auto in c++ variable declarations?

It depends on how clever your development software is. Searching for all uses of MyClass as text is easy. But some IDEs have the ability to search for MyClass as a symbol as well. That could be by ...
gnasher729's user avatar
6 votes

Is the inability to find code by searching for a class name a reason to avoid using auto in c++ variable declarations?

No, I don't think this is a valid reason to avoid all usage of auto in general. It may be a valid reason for certain cases (though both of your examples look somewhat debatable to me). Let me first ...
Doc Brown's user avatar
  • 210k
7 votes

Is the inability to find code by searching for a class name a reason to avoid using auto in c++ variable declarations?

It's certainly a valid reason. Whether that's enough of a reason to avoid auto in your situation - that depends on whether there are superior reasons for using it. Presumably you can find such ...
Kilian Foth's user avatar

Top 50 recent answers are included