What Are Two Years of Study Worth?

chromatic on 2003-06-01T06:01:27

It's been almost two years since I last did any work on Jellybean (link fixed the next morning). It's not that it wasn't a good idea. It's not that it got too difficult. It's not that I couldn't have made time.

Part of it is that I'm easily distracted. I also didn't really know what to do with it. My theory is, at some point, writing frameworks becomes deathly boring to a good programmer. You need to stay grounded in the practical. (That may just be the way I learn, though; Perl 6 grammar stays in my head only with extreme effort. If I can't play with it, it doesn't stick.)

The house was empty except for me and the cat today and I have a very clever plan for my next talk that requires a tiny, controllable web server, so I hopped back in the candy factory and banged out some newer code. (If you're really curious, download it from the site above. It only serves files — a bit naively — but all of the pieces fit together.)

I've discovered two big mistakes. First, though I had a test suite, it wasn't very maintainable. If you're not using Test::Harness to its full advantage, you're really missing out. (It's okay to use Test and not Test::More and friends, as long as you use a good harness.)

Second, I was trying to make my code too flexible. Since I didn't really have a single grand purpose in mind, I was trying to code all things for all people. That's a good way to tie yourself in knots. That's partly why it took so long to get back to it.

I'm a big believer in releasing working code, but I'm starting to believe very much in releasing simple code without apology. I know there are flaws. I know there are limitations. I'd love to be deluged with patches to smooth down all the rough spots and to sand all of the sharp corners. That probably won't happen, so I'll get to them eventually.

I do hope my code is useful to other people, but I'm not going to lose sleep trying to make that happens. If it needs a little attention to work for you and you want my help with that, that's great. I'm happy to do it. If you don't need me, it'd be nice to hear that too. If it doesn't meet your needs, I hope you find something that does, even if you have to write it yourself. I hope you're inspired by my ideas or my code, though.

It takes a lot of work to write good software, but it's a lot easier when you stop trying to meet an impossible goal or two and accept that you can do good things in smaller steps.


404

spur on 2003-06-01T06:56:01

The link returns an (rather cool) error page.

Re:404

koschei on 2003-06-01T09:23:29

Try this instead.

Debugging?

jflowers on 2003-06-01T13:39:39

So I have some of the same issues myself with too many things to distract me. I was working on Net::WWWServer for a while with the specific purpose of enhancing CGI debugging. I used dead project "The Perl Web Server" from Source Forge. There is much about it that I would have written differently, but for my purpose it did not need to be changed. I want to release it back to the Perl community but I feel wrong in doing so with something that I fell is written poorly. I wonder if your jellybean might easily be modified to run CGI in the same process so that CGI could be debugged in the web server while interacting with it through a browser. I would much rather work on a team, I seem to be having a similar problem to you having been trying to write for all possible uses, I have not been comfortable guessing others needs and trying to write to them.

Re:Debugging?

chromatic on 2003-06-01T16:29:59

It's easy to run in-process CGI (well, last time I faked it with pipes, but it works). The previous version did it pretty well. I just have to forward port it.

frameworks and over-abstracting

merlyn on 2003-06-01T18:11:24

So far, the only significant trick I've discovered (by having made the mistake of not doing it {grin}) is to be flexible without a sense of the endpoints of the dimensions along which I'm being flexible.

In other words, I need to work from concrete variations (solutions to specific distinct problems) and then work back from there to get the abstractions. If I try to work forward and simply put in hooks and variables for everything, I end up with Config-hell.

For example, I think [http://www.tt2.org|Template Toolkit] is a good example of a framework that seems to have just the right number of hooks and callbacks and subclassable overrides. But I bet Andy didn't get it right the first time... in fact, some of those hooks were added later because real-life problems demanded access here and there. Also, unless you work through the little-end tutorials, you don't know how many of the config things you really need to specify the first time out (nearly none!).

Re:frameworks and over-abstracting

VSarkiss on 2003-06-02T16:46:53

[http://www.tt2.org|Template Toolkit] ...
Too much time spent on Perl Monks, methinks. ;-)

I can't tell you the number of times I've written something like [merlyn] or [chromatic] here, only to go "Whoops" later.