Monday, June 28, 2010

I got pulled into yet another demo, involving building yet another prototype. I managed to get something functional in under a week, in about 2000 lines of Java. The next two weeks involved rewriting lots of the code either due to my misunderstanding of what it was supposed to do, or changes in what it should do after having something available to play with. Since I was the only one working on the code, I felt free to rewrite big chunks of it. The demo ended up being about 3000 lines of Java and seems to have gone successfully.

Two things, which I've said before, apply to this experience.

  • Being able to throw away the first few iterations is valuable. The design of later iterations can incorporate issues that weren't forseen in the earlier iterations.

  • Static typing makes replacing large chunks of code manageable. The compiler caught numerous little oversights, whereas using a dynamically typed language would have been much more painful.


So, for prototyping and rapid iteration, I strongly prefer using statically typed languages.

For an established code base that has many people working on it, rewriting large chunks of code is less of an option.

  • It's harder to understand all of the issues in a large codebase.

  • Management conservatism discourages potentially disruptive changes.

No comments:

Post a Comment