What Makes Good Code?
As I continue to pour through WordPress themes in developing my own, I find it interesting to see how people tackle challenges. Even though we are all using the same languages to develop the themes, there are a million different ways that people come to the same answer.
This then brings up coding practices, and how one method of coding is better than another.
Most people seem to have developed almost a fingerprint in the way that they code, and even if it isn’t the best for optimization and the lightest on the server, they’ll still stand by their code because their method allows them to produce massive amounts of usable code that might take a perfectionist in optimization upwards of ten times longer.
Of course there are various standards, speed tests, and other information out there on writing the perfect code, but is it better to focus on producing shippable code fast rather than perfect code slow?
Even without taking personal coding speeds into consideration, coders seem split on how to do simple things in WordPress themes, like are you the type that echo’s out HTML or do you exit PHP before doing HTML? .
For as long as there have been coding languages, there have been various practices. In my experiences with Code Igniter, I found it hard to break from the way I coded things before and work within the constraints of the model, view, controller way of developing applications.
It seems like once you’ve learned how to code, changing can be as difficult as breaking deep set habits.
But coders have to remember that things change, new ways of doing things are found, and as developers we have to evolve, change, and adapt to the language we program in, making sure to create the best code we can for ourselves, our clients, and our companies.
So my original question still exists. What makes good code? Is it keeping up with the standards of the language? Is it fulfilling the needs of the client? Or is it something else?
How do you make sure that you write good code? Do applications keep you in check, other coders, or are you always reading the latest web development books and websites? Let me know in the comments below.