7
fermar7
7y

So in our last retros some of my colleagues suggested to (forced) limit the number of lines per method in order to "maximize our code quality".

In the one hand I can see the benefits of this, such as easier testability when having more sperate testable blocks of logic.

But on the other side their code contains lots of such one or two lines private methods which get most of the cases not more than one time called. (And which I then can't even test separately)

I don't understand how this should help...
Is this really a thing? Am I just not "clean" enough?
(it's c# btw)

Comments
  • 0
    ur colleague is an idiot
    Code quality have nothing to do with amount of lines
    it is all about how lazy you are
  • 1
    For me this is a great rule. We have a maximum 10 lines per method rule and I think in 95% of the time this leads to better code
  • 0
    @host127001 Yes, I think, if this method is used properly (working with abstractions, make things really reusable), it can really give a good result. But not with that way, we are “trying“ to use it.
Add Comment