Hacker News new | ask | show | jobs
by vendiddy 1196 days ago
Never trust an abstract principle by itself. Come up with your own concrete examples.

Tinker with these examples to improve your understanding of underlying factors of the principle.

Look for examples that might contradict the principle and understand why.

Let us take DRY for example:

If I make a change in one place, and I have to know about 4 other far away places to make the same change, will that cause problems?

What if there two duplicate lines of code in the same file, right below each other?

What if it's a 3000 line file that's duplicated? How about a 4 line function?

What if changing it in one place doesn't mean you have to change the other place?

1 comments

This is something I wish was more widely discussed. Abstract principles are only templates for how to act, not prescriptive rules on what to do.

Much like a craftsman uses various stencils and measures to guide their craft, it's not simply using the stencil that is necessary but applying that stencil with skill and judgment, and when working with others, sharing those stencils kindly.