cognitive-load icon indicating copy to clipboard operation
cognitive-load copied to clipboard

[Comments] OMG YES

Open JohnnyWalkerDigital opened this issue 1 year ago • 14 comments

This isn't an "issue" but I just wanted to write a note of support 🎉

A lot of the useful tips and tools mentioned in this document are worth learning and using. OOP, Design Patterns, DDD, small method lengths (side note: never heard anyone say "small classes" -- that one makes no sense to me) are all extremely helpful in the pursuit of easily maintainable/extendable/scalable code... IF they're applied correctly.

I guess the issue is that you might need to apply them incorrectly a few times to learn their benefits.

But as I see it, a general rule of thumb is: Is the thing I'm trying to apply to my code making my FUTURE life harder or easier? When I return to this codebase in six months and have completely forgotten why I made the decisions I did, is the thing I'm trying to apply now actually going to make it easier for me to get back into it?

Or: Is it OK to leave this method long, breaking that recommendation, as long as the method is well-structured, has clearly understandable variables and logic, and has comments to explain what's going on?

You just want to make your future life as easy as possible for yourself (which also makes it easier for your follow team mates).

Rather than trying to be clever, using obscure functions and trying to reduce the number of lines of code, we should be focussing on reducing the number of lines you need to scroll up in order to understand what's going on. That's a much better goal than playing code golf with yourself/your team.

Impress me with how BASIC you've made everything (and, when applied correctly, the recommendations mentioned in this article with HELP with that).

JohnnyWalkerDigital avatar May 25 '23 11:05 JohnnyWalkerDigital