DEV Community

Discussion on: Every programmer should know these conventions and practices

 
chasm profile image
Charles F. Munat

Exactly. The point of all programming is to take complex problems and break them down into progressively simpler chunks until they are understandable and easily solved. Then those bits are recombined to solve the larger problem.

Approaches that make the code more complex and difficult to understand are the precise antithesis of what programming should be. A variation on Occam's Razor is apropos: as simple as it can be and no simpler.

The majority of modern coding practices (IMO) start off with the right idea: making things simpler. But then they go off track trying to please everyone and soon they have become the problem rather than the cure.

Never write a line of code until you have to.
Never add a dependency except as a last resort.
Never abstract your code any more than absolutely necessary.

Not only will this keep your code simpler and more understandable, but it will save quite a bit of time once you learn the habit (until you learn it, plan on lots of refactoring as you realize you ain't gonna need it).