What do you think is the biggest/most common mistake software developers make?
— Eric Elliott (@_ericelliott) November 2, 2015
He received from good responses, though this was the one he agreed with the most:
@_ericelliott not being pragmatic, over complicating things
— Osmel Mora (@osmel_mora) November 2, 2015
Elliott then goes on to look deeper at the concept of “simple code”, which isn’t as straightforward as it appears. Anyone can write a single-purpose function or separate concerns between classes, but as your project increases in size and scale, it can be tempting to take shortcuts or bend a few rules that keep complexity in check:
What is Simple Code?
Simple, from the latin simplus, originally referred to a medicine made from one constituent, especially from one plant. The meaning I refer to here is “not complex or compound; single.” Simple vs complex can be summed up concisely: one thing vs many things.
The author then goes through functions, classes and other programming concepts and provides point-form rules to apply to their implementation. For example, when it comes to functions:
Functions which have no side-effects and exhibit referential transparency are called pure functions. A pure function:
- Given the same input, will always return the same output.
- Produces no side effects.
- Relies on no external state.