Tuesday, 24 July 2007

The Joy of Copy Paste

When considering what I think the next big thing in software will be I was using the idea that a lot of software evoloution is about avoiding Copy Pasting...

The single responsibility Principle is all about creating software with nicely seperated out behaviours that you can resuse easily

We often end up with a bunch of very similar looking "for" loops in staticly typed languages that dynamic types languages avoid.

TDD / Refactoring is all about removing duplication

However there is still a ton of similar looking software whether it be the way you deal with exceptions, threading, iteration, etc etc. Copy Paste is still a useful function to replicate some of this structure!

Some of what I like about Resharper is that it has "mini" factories which help avoid Copy Pasting things like method names.

In Ruby on Rails there are Generators that basically copy paste the right things into the right places for you.

I make macros and templates and generators that automate the common stuff I do.

So what we need to do is try and put this concept on Steroids. Powerful software/coding factories. One problem with these things at the moment is that once something is generated we lose track of it and have little ability to regenerate things. So we endup with the pitfalls of Copy Pasting. Still, its hugely more productive to have these kinds of generators.

No comments: