Software development store. If everyone acted like coders | by Bennett Garner | Developer Goal | Jul 2022


If everyone acted like coders

Imagine you are shopping at Software Co.

You want to buy a dozen eggs, but the EggChooserService is too complicated. The only function you can use returns duck eggs in batches of 5.

You would like to buy some milk, but there are no papers. It takes you hours of searching the store (ahem, source code) before you find the PregnantCowPasteurizedDairyService.

Buying bread is even worse. Since bread is so fundamental to the grocery app, a “smart” engineer tried to optimize things by removing the lint. You don’t buy bread, you buy b. Unlike the rest of the store, prices are not shown in decimals. They are multiplied by 100 to avoid floating point calculations. Calling him choose_loaf function has all sorts of side effects.

Vegetables are a total crap shoot. Each vegetable works differently when they really should all share the same interface. There are no tests for the different interfaces, so sometimes you get the wrong zucchini, a truncated carrot, or the wrong amount of tomatoes.

Neither will your users or fellow engineers.

The software must be consistent, predictable, tested and documented.

When engineers stray from these boundaries (as they too often do), things get nasty.

Do everyone a favor – think about groceries when you write code.

What your messy code is costing you – It’s natural for code to get messy, but cleaning it up is everyone’s responsibility

Refactoring: 5 Steps to Improve Existing Code: A Checklist for Improving Existing Code

Your misnamed variables are hurting your team – Naming is one of the hardest things in coding and the most important thing to get right


Comments are closed.