Member-only story
Good Code vs Bad Code
Why writing good code matters, and how to do it
When writing code in any language, there are good coding practices — and there are really bad ones.
Both may be correct as far as compiling and when they are run. But bad code can present some problems in development, debugging, and modifying. In the workplace, no matter how well your program runs, someone will have to read or alter your code at some point.
They may have to add new features, correct a rare bug, or they might just want to read it to understand how it works. Similarly, you will have to read someone else’s code to do the same thing. Everyone will get along a whole lot better if the code is readable and understandable.
To know the importance of good quality code, let’s try to understand what a bad quality of code can lead to. Badly written code could lead to financial losses or waste of time needed for further maintenance, enhancements, or adjustments to software.
You write your code once, but then follow it numerous times after. Hence, documenting your code becomes really important, and naming conventions become really important.
Many times, I come across my colleagues joking about how they do not remember which code or logic they wrote a few days ago. Now, couple it with writing bad code style, and you will take more time to understand what you did.
Things start to go haywire when an artist fails to understand their own piece of…