Why do we say that "baby Perl" is OK but then we flame people for writing it?
Personally, I don't mind baby Perl so much; what I mind is two things:
I see lots of both and they frustrate the heck out of me. I guess I'm less tolerant than I used to be.
Re:Could you define it?
Ovid on 2007-10-02T12:11:21
Oy. Given that I often ask for definitions, I guess I deserved that question
:) "Baby perl" generally seems to refer to using a small subset of the language to get things done even though the full expressiveness of the language would allow a task to get done cleaner and simpler. Unfortunately, that "subset" might not include things like "strict", "sub" and other commonly used bits of the language. And what's the cutoff for "small"? Larry has said more than once that there's nothing wrong with using Baby Perl, though others seem to disagree.
I guess that without a clear definition, it's not an easy to question to ask or answer.
Re:Could you define it?
btilly on 2007-10-02T12:35:45
I think that Larry's comment about baby Perl is kind of like saying that there's nothing wrong with babies.
Babies are wonderful. Babies have their place. But you don't want them driving heavy machinery. (Though letting them think they are driving heavy machinery can be a lot of fun.)
Similarly it is good that people can learn some baby Perl and make their lives easier. I think that's wonderful and nobody should object. The problem comes when the baby graduates to programming toddlerdom and tries to insist on doing things that require skills they lack. (Ever heard a toddler insist, "Me do it!"?)Re:Could you define it?
ziggy on 2007-10-02T13:37:01
Larry has said more than once that there's nothing wrong with using Baby Perl, though others seem to disagree.
I guess that without a clear definition, it's not an easy to question to ask or answer.
To me, Baby Perl always feels like it's written by someone who learned BASIC in the 1970s from a bad book or a class with low expectations. Maybe some subs, but generally large ones. Lots of if/elsif/elsif cascades (with nested ifs). No references, objects or regexes. Cut and paste design. Use and abuse of flag variables. Many non-local references (either globals or lexicals defined way above the fold). Lots of code...
btilly got it right: you want babies, but you don't want babies driving heavy machinery. Perl fits in that sweet spot where you can build large systems, but also make little pieces of duct tape. Cultures like those around C, C++ and Java tend to discount little pieces of duct tape (whoever writes them), and attempt to aggregate lots of little needs into one big over-engineered system (that's invariably bloated, late and over budget). In that context, encouraging Baby Perl isn't about letting the infants into the glass house and letting them play with the power tools, as much as it is about acknowledging that you don't always need to use the power tools.
If you interpret the blessing on Baby Perl literally instead of as intended, you misinterpret it as allowing babies playing with power tools. That was certainly not what Larry was saying.