There's more than one way to do things | |
PerlMonks |
Re: block-based programming...by dragonchild (Archbishop) |
on Apr 22, 2004 at 11:48 UTC ( [id://347309]=note: print w/replies, xml ) | Need Help?? |
I'm of two (or more) minds about this. Firstly, this is not some radical new style. This is a form of imperative programming without subroutines, similar to some older languages (like Apple Basic and the like). You are, essentially, programming with goto.
Now, you did say that this is a small program. In a way, so long as your stuff is well-named and well laid out, it almost doesn't matter what way you program this. Heck, your program seems to be simple enough that, if the hooks were there, you could program this in Parrot! (I don't reccomend it, but it could be interesting ...) Now, you talk about a state machine. If you think about this being a state machine and you don't use CPAN code, you're (probably) reinventing the wheel. The standard distribution for handling state machines in Perl is POE*. It's a bit of a learning curve, but I would definitely suggest looking there if you consider this a state machine. As for my feelings on block-driven programming in general ... I guess I would say that it's a neat idea, so long as your codebase remains very very small. This doesn't scale in any meaningful way. *shrugs* *CGI::Application can be considered as another state machine distribution, but it is both domain-specific to web applications and doesn't really have built-in support. ------
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
In Section
Meditations
|
|