Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

its simpler

by MichaelORourke (Initiate)
on Nov 17, 2007 at 05:50 UTC ( [id://651381]=perlmeditation: print w/replies, xml ) Need Help??

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: its simpler
by chromatic (Archbishop) on Nov 17, 2007 at 19:54 UTC
    Why do you need more than the base implementations for clever, nicely built systems?

    How many millions of bugs are in thousands of programs written in C because C has null-terminated strings? By storing the length of the string with the string itself, Perl renders an entire category of bugs and security problems and O(n) (or worse) algorithms irrelevant.

Re: its simpler
by dragonchild (Archbishop) on Nov 18, 2007 at 05:02 UTC
    To expand on chromatic's comment, you can actually have strings with embedded \0's and it all "Just Works". Without me having to worry about anything.

    This goes back to one of my primary rules for software development - have as few moving parts as possible that you have to maintain. This is why I use modules as much as possible, even for the simplest of things. The closer my code is to my problemspace and the fewer moving parts I have to maintain, the better off I am. So, whenever I have to worry about the flag that says "My string ends here", that's an extra moving part. Whenever I have to worry "Did I free everything correctly?", that's an extra moving part. And, so on.

    So, no, I don't believe that Perl-written-as-C is more powerful. In fact, Perl-written-as-Perl is much more powerful than C can ever be, from a developer perspective. Of course, hand-tuned C is going to be faster, smaller, and all that jazz. But, frankly, it's cheaper, from the business's perspective, to buy another machine than pay me for a week of my time. So, that's a non-starter.


    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
Re: its simpler
by erroneousBollock (Curate) on Nov 18, 2007 at 04:25 UTC
    Believe me friends, if you know C and write your Perl as the same, you'll find the real power therein.
    (Almost) every time I see some Perl code written in the style of C, that code
    • uses non-idiomatic looping structures, and
    • copies too much data around, and
    • doesn't take advantage of language features (like regexps) which are written in C.

    On the other hand, having some knowledge of the way perl's internals are written in C can give you some insights into optimisation and behaviour.

    Simply asserting that one will "find the real power therein" when they "know C and write your Perl as the same" is retarded thinking.

    P.S. -- is Java clumbsy? Rhetorically.
    P.S. Were you drunk when you posted this drivel ?

    -David

Re: its simpler
by ysth (Canon) on Nov 18, 2007 at 05:29 UTC
    So is your argument addressed to the language or its programmers? That is, are you saying Perl the language allows to much complexity, or that programmers are best off only using the most basic features of the language?
Re: its simpler
by sundialsvc4 (Abbot) on Nov 20, 2007 at 23:44 UTC

    When you want to get to the corner store, how long does it take you to slay the dinosaur? For then you must bury it, wait for it to turn into oil, pump the oil out of the ground and start-up the refinery while you build a fire to start smelting that chunk of rusty rock you just dug up...

    No, that's not what you do. You plop your buns into that nice pre-built car, drive down to the store to go to the freezer-section to grab that nice pre-built pizza in a box, muttering “well, it will just have to do” as you wander over towards the beer.

    So, build computer-programs that way, using the highest-level tools you can find. Because what you want to do is to “cease feeling hungry and cease feeling sober.” Or to have a working program that solves whatever your client next needs to do, so that you can enjoy your box-pizza and beer without having to push-through three hours of coding work with either a faint buzz or a big hangover. Does a high-level programming tool that does most of the work for you, or better-yet a CPAN module that does all of the work for you, sound appealing? Sure.

    Laziness. Hubris. Warm pizza. Cold beer. Life is good.™

A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://651381]
Approved by ysth
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-18 22:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found