modal verb (3rd sing. should)

  1. Used to indicate obligation, duty, or correctness, typically when criticizing someone’s actions

Should is a dangerous word. You should break up large functions. You should separate concerns. You should remove repetition. You should encapsulate your data. Should replaces the weighing of tradeoffs with a moral imperative. It insists on always doing the ‘right thing’, as if every question had a simple answer if you would only listen.

Should is especially dangerous for beginners, who hear it from their elders with all the weight of a religious commandment, and pass it down the same way. This is how ideas mutate from rule of thumb to guideline to inviolable law to invisible custom, until even questioning them is a trigger for derision.

Taboo the word. Keeping asking why and don’t stop until you get to something you actually care about. Don’t confuse the means with the ends. You write code to solve a problem, to learn something new or to express yourself. Indirection, modularity, abstraction and tests are merely tools whose sole virtue is in whether they help you reach your goal.

Some long functions are easier to read when left alone. Some concerns cannot be cleanly separated. Repetition is sometimes the lesser evil and encapsulation isn’t free.

Don’t blindly apply tools without stopping to question whether they fit the task at hand. And certainly don’t let the shame of ‘bad code’ prevent you from using your own best judgement about the problems you face.