Four stages of obsessing about your code
I’ve been a developer for a very long time. After all those years in development, one probably will come to a similar conclusion as I did – when in comes to how you approach writing code (not the code quality), you’ll eventually make a full 360, and you’ll be at the starting point.
Let me break this into four stages:
- The working code. So this is when you’re starting your adventure. I can’t remember a person who actually cared how the code looks or sometimes works, as long as it makes the job done.
- The pretty code. By now you think you know your code, you’ve grasped the basic concept of modularization, classes, you kind of know what prototype is, and how reuse certain parts of your class. Taking all of this into account, it’s time to make in look pretty.
- The optimized code. Here you’re starting to think beyond your jQuery, and all those pre-packaged toolkits. You’re probably digging more into optimized code, solving solutions with custom code that suits a very specific case. You’re writing clean, modular, optimized code. You’re obsessed about every unnecessary
varand get annoyed when someone doesn’t use
- The working code… again. And this is the stage where you probably come to a conclusion that it’s time to stop obsessing. I don’t mean that you just forget what was learned, not at all, but having gone through all stages, you’re professional enough not to focus on absolute perfection, use what’s already available, have trust in work done by other people.
In my case, CoffeeScript was quite the eye opener. Time to stop thinking about what the compiler generates, I have some trust that those guys know what they’re doing. I don’t care how classes are being build, if it’s all wrapped in a closure or otherwise.
You’ve gained the experience, some things come natural, other things are completely unimportant so stop obsessing.
May 20, 2013 − Take discussion to Branch