3 ms·
How to convince your fellow developer to write short methods?
- silentbicycle 17y ago> But, do not reply to that question that way. Instead say, "Over the weekend I got into my car, started it, drove 5 miles West, took a right turn, then a left turn, then drove another 10 miles, ..." Go at it for several minutes until your colleague gets frustrated and interrupts you with "What's wrong with you." Now simply reply, "oh, I though I'll tell you how my weekend way like you write your methods." Wow. I'm pretty sure being passive-aggressive is not the solution. If there's a really concrete case where a method doing too much is making code hard to correct (because you cannot change just one part of it in isolation), show it to the developer, and don't be a dick about it. While they may just be writing sloppy code, there's a good chance it was a smaller method that grew so gradually that it never set off their mental alarms.