DEV Community

Chakrit Wichian for PRODIGY9

Posted on • Updated on

[WIP] Write Better Code

This series is meant to be a collection of tips, tricks and techniques for writing a more readable and maintainable code. The content will focus exclusively on the style and other subjective elements of code writing. There are already many other content on the web that talk about the semantics and how a piece of code or an algorithm "works". We focus, here, instead on how the code "reads".

That being said, this does not mean we will forego the concern of making sure the code work entirely. We believe, rather, that correctly working code are a result of not only it having correct semantics, but also because the programmer writing/maintaining it can reason about it easily because the code was written with such high readability standards.

In other words, we believe making the code more readable makes it more correct as well.

The content are purely derived from my own personal experience writing, reading and debugging unbelievable number of lines of code over 20+ years. Contributions are, of course, welcome and if this proves to be useful to many people, I'd be happy to open source and license it.

Some of the content found here may feels familiar to readers of coding style books, but, again, I'd like to emphasize that this is distilled from my personal experience only and not summarized from any book. It also have no set plans or publishing schedule, I'll add to it as I have time and feel like I have something useful to contribute. Other times, it may stay static for months or years.

I do believe, however, that there is an ultimate answer to all code styling issues. I believe that after a certain point in the career of programming and software development, most of us eventually come to the same or similar realization/conclusion. So it should be of no coincidence that some concepts found here may have already been explained in some book or some blog post somewhere on the interwebs. In which case , I'll add links and references to the relevant pages.

Top comments (0)