karldmoore development

A development oriented blog, containing anything I've been working on, reading or thinking about.

I’m Sick of Restarting My Server!

Posted by karldmoore on August 3, 2009

Anyone that has been following @karldmoore on Twitter will have seen a recent tweet in which I stated that “I’m Sick of Restarting My Server!”. This was borne out of extreme frustration on a particularly bad day after several hours unproductive development AND multiple server restarts. From that moment on I’ve continued to realise just how sick I’ve become of restarting my server.

I’ve been developing using Java for around ten years now and during that time it’s been a pretty happy relationship. I’ve got used to the fact that some changes I make require a server restart whilst others can be seamlessly hot-swapped leaving me free to carry on with my work. I’ve accepted this for a long time, but for some reason I’ve really started to get sick of restarting my server. As discussed previously:

The longer a build-deploy cycle takes, the more compelling testing becomes. On many occasions I’ve seen people finally give in and start to write unit tests not when shouted at and told to by the lead developer, but instead, when they are sick of waiting for their application to load for the 100th time and just want to get their work finished.

These frustrating server restarts have led many people, to rely on testing much more than ever before and to shift the focus away from debugging and logging. By moving the focus away from compile-build-deploy-test and forcing testing earlier into development, productivity can be greatly improved helping the developer to say in the zone. Although testing helps, it’s still not enough and sometimes it feels like there needs to be more support.

After searching for more I stumbled across JavaRebel which boasted some very impressive features in comparison to the standard hot swap technology. After using their ROI calculator it claims the cost of JavaRebel could be repaid within six days which would seems like a pretty convincing argument to even the most frugal of managers. This all sounds great and confirms exactly how I’ve been feeling lately. There has to be a better way to do things, it has to be easier and simpler to be more productive. Maybe JavaRebel is the answer, but after recently spending some time using Grails, I wonder if I’ve found another potential solution to my problem.

In one evening of coding with Grails, I recently managed to clock up several hours without a single server restart (this was only cut short by the need to sleep). This is made possible by a feature within Grails known as auto reloading. As the documentation states this isn’t without it’s quirks, but when using this with Grails I really do feel productive. By removing the necessity to restart my server when I make changes, I’ve removed that frustrating minute between stopping and starting which not only seem to take an age but also distract you from your train of thought and send you over to have a quick browse on DZone. Grails has so far provided a really impressive and effortless development experience and most of all it’s confirmed something to me, “I’m Sick of Restarting My Server!”.

Advertisements

4 Responses to “I’m Sick of Restarting My Server!”

  1. williamlouth said

    I use the restart time as “think time” which unfortunately goes against the grain. In addition the overhead (delay) of restart forces me to focus on getting my design & code right the first time (at least that is the goal) and to batch the change into meaningful work items instead of changing a line of code then looking at what has happened which seems even more wasteful and lazy because the brain seems to be disconnected from the art of the development and instead it is also about immediate feedback just like some drug.

    Also I like to isolate my work especially when performing diagnostics which cannot be truly done with constant hot deploys which do not happen in production.

    William

  2. karldmoore said

    @William you make some really good points. I’m not suggesting that the server restarts are an excuse to just start hacking but more that there is some development work that beomes very tedious when you have to keep restarting. Last week I was fixing up some Struts mapping issues which led to several server restarts and much frustration. Likewise I often spot little snips of code which might benefit from refactoring e.g. extract method. Do this and Eclipse is going to start complaining and so am I when my server takes over a minute to restart.

  3. scot said

    if you wrote unit tests for your code the first place, and especially if you used test driven design, you wouldn’t be relying on it running in the server so much in the first place. also, you’d find your code was better designed.

  4. karldmoore said

    @Scot – As discussed “These frustrating server restarts have led many people, to rely on testing much more than ever before and to shift the focus away from debugging and logging”. I do heavily rely on testing but as I said that isn’t always enough. Depending on the project in question even with testing server restarts can be quite frequent. One example, a former work mate was working on doing some i18n work last week and because of the setup once he’d finished some translations he had to restart the server to see the results. I was using StrutsTestCase last week to test some of the new code I’d written but not everything could be verified before you press the big GO button.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: