New answers tagged

-3 votes

How to tell someone their style changes are

There are multiple perspectives to consider. From a green-field perspective, one would never use the designer. It's slow, it's buggy, and it's badly architected. The whole idea of designers is ...
DeadMG's user avatar
  • 36.9k
0 votes

How to tell someone their style changes are

I'm trying to help him increase his own code quality as well as our groups code. I don't see that there's a quality issue at stake here. It's a relatively minor issue, and either option is "of ...
Steve's user avatar
  • 8,474
4 votes

How to "Tell, don't ask" when both the condition and action involves 2 objects?

As others have pointed out, "tell, don't ask" is a principle not a rule. It leads your code in a direction which has some good properties, but has other quirks that sometimes you wish to ...
Cort Ammon's user avatar
  • 10.9k
-1 votes

How to "Tell, don't ask" when both the condition and action involves 2 objects?

When you do decide it is worth the hassle, there is a refactoring for this that follows tell don't ask. Yes, even with two classes. Yes, without encapsulation destroying accessors. No getters required....
candied_orange's user avatar
13 votes

How to "Tell, don't ask" when both the condition and action involves 2 objects?

Tell don't ask is a principle aiming at guidance for effectively encapsulating internal details of objects. It therewith: encourages better abstraction, by placing inside the object the logic that ...
Christophe's user avatar
  • 76.8k
26 votes

How to "Tell, don't ask" when both the condition and action involves 2 objects?

You wrote I know the following is bad and already here is a misconception: thinking religiously in terms of good and bad about this. My interpretation of Tell-Don't-Ask is: when you see a code ...
Doc Brown's user avatar
  • 206k
1 vote

How to "Tell, don't ask" when both the condition and action involves 2 objects?

if(a.isX){ a.doY(); } This is not a violation of "Tell, don't ask". Directly accessing the data-member isX is not nice, but that can be easily remedied with a accessor: public class A{ ...
Bart van Ingen Schenau's user avatar
0 votes

How to follow the 80 character limit best practice while writing source code?

For .NET you can use an analyzer (NuGet package LeetKean.Analyzers.LineLength) that will add a warning (code LK0080) into your warnings list for every line longer than 80 chars.
Dima's user avatar
  • 165

Top 50 recent answers are included