Friday, December 12, 2008

When did they kick in ?

So there I am working away tonight, trying to install the latest build on some server, from home, with a dodgy net connection. ysh is still raising NotImplementedErrors so I'm taking the full log by copy-and-paste-and-run-and-copy-and-paste.

Yes, I've heard of screen and the like, but I prefer going back-to-basics when considering a new feature, as it allows much more flexibility in discarding use cases. Comes from doing so much building, installing and testing I guess. When your edit-compile-run cycle is measured in days, not minutes, it makes you fussier about wasted effort. And putting effort into doing it the right way for some app, when we might not end up using that app, is wasted effort. So a new feature always brings me back to the bash command line
  1. type in command to terminal
  2. run command
  3. copy everything from terminal, paste to log
And next time I open that log and
  1. copy command from old log to terminal
  2. run command
  3. copy everything from terminal paste to new log
Add in vim for commenting and hiding, and that's as far as automation goes; until I'm happy that I have gathered the requirements of the new feature, and designed enough of it to start coding.

So I'm still there, pasting to the log command by command, when the connection goes, losing the log completely. So I set it all up again, and I'm there again pasting to the log command again by command again, when (you guessed it) the connection goes again. As does the log, again.

Such a dumb error even my current wife can tell me how to fix it. Unfortunately it's not the log that I'm really losing - it's the logging in, find right tarball, edit the config file, ... and all the commands that are required to set up the test I'm trying to verify. And the new feature I haven't written yet is supposed to save that.

That's when the blogs kicked in.

The Internet has added layers to my programming. Google it did a few years ago, after which I threw away manuals. Copy the error message from command line to browser, and (usually) find the answer. Now programming blogs are adding more layers.
So there I (still) am with the lost logs when it hits me: next one will be the third. But it's an expensive loss if it happens again, so maybe I should write a program now, or perhaps step back to consider the whole process? And instead of just repeating the same old error prone solution I spend a while blogging about it, finding more interesting links, listing quotes, re-combining other posts, ... until eventually Zebedee arrives.

Tomorrow I'll get up, go to office, and the problem will be solved, with no need for any code at all, at all.

What I learned from reading programming blogs that made me a better programmer:

Don't write so much

Labels: , , , , , , , , ,


Blogger JSN said...

> command > ./log 2>&1

Or, perhaps better,
DATE=`date +%Y%m%d%H%M`
really \
long \
command \
> ./log.$DATE 2>&1

10:46 p.m.  

Post a Comment

Links to this post:

Create a Link

<< Home