Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

RE: COBOL vs. Perl

by davorg (Chancellor)
on Jun 14, 2000 at 12:26 UTC ( #18056=note: print w/replies, xml ) Need Help??

in reply to COBOL vs. Perl

10 lines of code to do that in Perl sounds a bit excessive!

Obviously I'm not entirely sure exactly what you were doing, but it seems to me that with split and pack you could probably do it in about two lines.


Replies are listed 'Best First'.
RE: RE: COBOL vs. Perl
by Ovid (Cardinal) on Jun 14, 2000 at 21:34 UTC
    Ordinarily, yes. Unfortunately, the format of the input file depended heavily on the computer-illeterate users, so I had to do validation on the input and spit out error messages as appropriate.

    The Moral of This Little Tale: Trust your users, not their input!

    Update: I was going to correct my little spelling error, but I realized others might appreciate the irony of my mispelling "illiterate."

      Absolutely right!

      Something that I think gets lost in this mad rush to find the smallest most obscure code to solve a problem is that often you're sacrificing error-checking along the way. In the real world, I place much more emphasis on Doing the Right Thing than in brevity.

      I applaud you for this. I wish more people followed your lead.

      (Yes, I am a boring old fart :-)

        I must admit that there has been many a time that I've come up with some beautiful piece of code that does exactly what I want it to do in one line or two, and then I have to pollute it and expand it with all of the error checking conditions. Most annoying, but necessary. The approach that I take to my code is "Make things as simple as possible, but no simpler". In other words, brevity is good and worthwhile and whatnot, but as soon as you start sacrificing necessary functionality or readability, you're trying to make it too short and you need to slow down a little. Most of my code tends to be fairly readable as a result. :)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://18056]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2022-05-16 09:53 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (62 votes). Check out past polls.