Earlier today a friend and I were sharing some of our best practices for coding and overall work ethics. During that conversation, he asked what is my secret for writing massive amounts of code in a short amount of time. For those of you that know me, you already know that I do in fact churn out a lot of code in a very short amount of time. The answer to that question is simple, “planning”. Yep, before I write a single line of code, I will walk thru the entire application in my head and make as many notes as I can on paper. For larger projects, I will even draw out the overall architecture of the project before jumping into the code. Even though the architecture can and most likely will change throughout the project lifecycle, having an idea ahead of time of all that will be involved makes the development a lot easier and faster.
After I have written out (or at least planned in my head) everything that will be required, I begin what I call a “power hour”. Since I already have a good idea of everything I need to do, I will spend the next solid hour doing nothing but writing code. I make sure to remove any and all distractions so that I can get at least one full hour of coding complete. Since I’m a fairly fast typist, I can usually complete smaller projects within this one hour. When working on projects that cannot be completed within a single hour, I still make sure to stop when the hour is up even if it’s only to revisit my architecture drawings and notes or to grab a sandwich or stretch my legs. Otherwise I will begin to get fatigued and can quickly lose interest in the project. I know that I code for exactly one hour because I will set a timer on my cellphone before the power hour begins.
I also like to do my actual coding late at night after everyone else has gone to bed. During the day, I get phone calls and emails continuously which interrupt my power hour of coding. Even the slightest sounds of things like cars passing by, dogs barking, or planes flying over head can break my concentration. So, by waiting until at least 11:00pm or even midnight (and sometimes even later), I always get in at least one full hour of coding done. If my power hour is up and I have to take a break but there is still more work to be done, I will typically wait until the next wall-clock-hour (or half hour) and restart my timer for another power hour and will repeat the process until the project is finished.
For planning my projects, I have a notebook on my desk that I will use to make any necessary notes which provides me with something to revisit if I get stuck. By spelling it out on paper, I found that I can usually think thru things a lot better than just planning it out in my head. Depending on how many projects I have going on at a time, I will have several notebooks, one for each project, on my desk. Separate notebooks are great to have for larger projects and for when you are working on multiple projects at a time. However, I would always recommend working on one project at a time if possible. Since I have several responsibilities at my day job and have several personal projects going on, it’s difficult for me to stay focused on one single project at any given time. Instead, I find it’s better for me to juggle multiple projects at the same time which helps me from getting burned out on any one project. I also have a whiteboard on my office wall that I will use for any architectures or mind maps that need to be drawn out for planning. Having visuals like this within eyesight really helps keep the creative juices flowing and thought process engaged, especially after taking a break from a project and revisiting it later.
So, as you can see, just like with anything else you do in life, you can always do it faster and better if you just take a little time up front to do some planning. Once you know what it is you have to do, getting it done is the easy part.
PayPal will open in a new tab.