One of myths about coders/coding I feel has been poorly perpetuated by movies like The Social Network where we simply write code all day and night, non-stop. Perhaps, there are a few people who might enact this but I feel that the average coder does not perform in this manner.
One of the more profound videos I’ve seen was a hack-a-thon demonstrated by Dropbox. They followed two programmers trying to build a wireless detection type of project. During the interview, one of the programmers mentioned that typically he would go through these burst cycles of programming where he would stop, try to figure out a certain problem, write a few lines of code, then stop and figure out the next problem. I believe that the problem solving aspect took far longer than the coding aspect and this is what I believe the reality of most coders’ behavior is.
The thing is that you can’t code all day and night without knowing exactly the problem you’re trying to solve. If the problem has a repeatable solution and you’re just copy/pasting your code over and over, you’re handling the problem in the wrong way (more than likely you need to automate dealing with the boilerplate code or the problem has been defined incorrectly). Either that or you’re architecting the solution in the wrong way and should look at the bigger picture in coming up with a more economic means for how the code is being handled (maybe using more OOP with inheritance for instance).
I find myself often times spending the most time researching solutions for a particular problem. Sure, there are times when the code itself becomes easily solvable because you’ve seen the problem before. But quite often I find myself struggling the most when I encounter a situation where I really want a solid solution. Here’s an example. I’m currently developing a backend that I intend to hook into my Android application that I’m building. Part of it involves a registration process. Pretty standard, right?
As a web programmer, registration sequences are fairly easy. And even dealing with mobile isn’t too bad because part of what I’m going to do will be setting up RESTful services. Now, the difficulty for me lies in choosing a platform that I’m not familiar in (Python/Flask) as well as dealing with authentication/security/authorization issues. So the struggle is doing the research to figure out whether or not I should be using an existing extension, choosing the right level of security and reading up on how to implement it within an environment that I’m not familiar with. Once this part is setup, building the actual RESTful interfaces ought to be quite easy, especially since the extension I ended up using (Eve) handles everything quite elegantly.
Now, for a non-programmer this might not sound like a daunting task. Why not just pick something and go for it? Well, the short answer is that if I were to choose the easiest path, I could end up with a Sony-like situation (shots fired!) In the case of security, I could do something really naive in picking a Basic Authentication scheme, thereby sending usernames/passwords between each request to my RESTful services. Without an SSL certificate on my backend, this path surely is a horrible idea. So rather than choosing an easy path, it would be to my benefit to choose a slightly more difficult path. But in going down that path, I need to do more research and reading and more tinkering.
Along the way, one thing I found myself doing is mentally getting into analysis paralysis and becoming too frustrated with myself for not being able to resolve the issue. It’s not really a trivial matter either as you want to establish good habits early on. But by involving myself too deeply into this problem, I found myself less productive and stressing myself out unnecessarily. Instead, my solution to this was to take a few days break as a refresher. That way when I go back to the problem, everything will seem fresh and I can look at the issue with a clear head.
So what’s the point of all of this? I don’t think I’m alone when it comes to these types of programming habits. I think those that don’t do this are probably in need of a bath/shower badly or have nothing else going on in their lives. In short, coding non-stop is not healthy and people who do not code should realize what the average coder has to go through in order to do their work properly. Creating a stressful, deadline based environment has lead to things like Sony’s recent hacking incident where the more idealized structure can never be realized. Certainly, every company has some form of reality to be met, but they can’t be unrealistic with the way they handle their developers without better comprehension of what they psychologically must go through.