Programmers are notoriously nit-picky. We have opinions, stances, and preferences on just about everything and tend to get into frivolous (and often heated) arguments and discussions about our nit-picks. Compiled language vs. interpreted language? Nit-pick! Tabs vs. spaces? Nit-pick! Braces on same line or new line? Nit-pick!!!
In fact, programmers are so passionately nit-picky we invented a process to force our nit-pickyness onto others when they contribute code to our open source projects: code reviews! We even prefix some of our comments with “Nit:” for emphasis! (Do understand I am using hyperbole here. Code reviews are a good thing and I am grateful for them.)
Lately I have been reading the book RailsSpace (1st edition website) to expose myself to the Ruby programming language, Ruby on Rails, and MVC. I am not actually running any of the code, simply reading the book, code and all. It has been rather interesting and I may have to write a post on the experience when I finish it.
As I read through the book, I came across a code snippet containing something I (and many other programmers) are nit-picky about. Allow me to post the relevant lines:
if (redirect_url = session[:protected_page]) session[:protected_page = nil redirect_to redirect_url
Do you see the nit-picky statement? It is the
What about this paragraph from a little earlier in the book?
Parentheses are optional on Ruby methods, including those that take no arguments. If you want to, you can certainly use parentheses… This might make you Java/Python/PHP programmers out there happier, since user.save might look a little too close to a class attribute… On the other hard, leaving off the parentheses in this context is very Rubyish…
I talk about my personal nit-pickiness because, from my limited observations and experiences, I have found it is a programmer’s nit-picks that greatly define their coding style. The majority of programmers are passionate about their work, style, and beliefs, hence the aforementioned heated arguments. Programmers also have their own preferences. Two people can learn how to program from a single instructor, or one person can work closely with another on a project and learn from the more experienced. For a while, each student will follow the same style and have the same preferences as their instructor, but given enough time and code, they will begin to develop their own style and preferences. In the same manner, inherited nit-picks will change, be removed, or added to.
Just as our clothing style defines how we dress and our environment affects our frame of view, so preferences and nit-picks define our programming. I like casual, relaxed clothing, so I prefer wearing a nice polo shirt, dark blue jeans, and low top Converse shoes. Someone who lives in a large city may believe working from home is an important factor in a job opening more than someone who lives in a small place. In the same token, because I began programming in Python, Where Whitespace Will Work Well™, I like my white space to be clean. I run linters and set my IDEs to display white space so I can ensure everything is consistent and satisfies my nik-picks.
One thing we do need to be aware of is the personal nature of nit-picks. Something I nit-pick about may hold no bearing on you. As we all have opinions, so we have nik-picks. Just because someone does not share the same nik-pick as you (and some person that must be to not agree with you on these trivial matters!) does not give permission to bombard them with broadcasts about your perspective and how they are wrong. In the end the only person that cares about the nik-picks is yourself. Thus we should be respectful of each other and their different perspective on the matter (although yours is obviously the best).
We hear all the time we ought not to nik-pick, as it can be rude, impolite, and inconsiderate. While I agree with this life rule of thumb, maybe we need to nit-pick a tiny little bit. Maybe we need to have passionate debates with random people on the Web over insignificant matters. If we do this a little bit while respecting others perspectives and opinions, we can build a solid foundation in knowing what you know in important life areas (what cut of socks you prefer not being one of them).