Member-only story
Simple Ways to Reduce the Total Number of Lines of Code
Small things that tend to add up.
If one were asked to describe what makes a Programmer “good”, they might come up with a plethora of answers including:
- The ability to write code that is Self Documenting (I.E. Another programmer doesn’t have to look at the Documentation).
- The ability to write algorithmically efficient code (I.E. They can keep Big O efficiency to a minimum).
- The ability to keep used memory to a minimum (E.G. To not put too much memory on the Stack Frame).
- And at least a few other skills.
I would say that one skill nice to have is being able to write functions (or even classes) that are short and concise. There are at least a few ways that one could do this, and this story will attempt to explore them.
Opening (and possibly closing) Brackets on the Same Line
If a programmer were to consider all the things that they do (from a syntactical perspective) while programming a class or file, they could probably come up with a lengthy list…