Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: This looks like someone sneezed and hit the keyboard

by flyingmoose (Priest)
on Feb 03, 2004 at 14:09 UTC ( [id://326196]=note: print w/replies, xml ) Need Help??


in reply to Re: This looks like someone sneezed and hit the keyboard
in thread This looks like someone sneezed and hit the keyboard

In one of my first projects using Perl (I had an internship at the time), someone wanted me to parse the output of top and another Unix tool. Both used ANSI codes, so I backed away. It looks like this guy didn't back away, so I'll give him a gold star for bravery. However, he looses his gold star for not commenting his code and using an ugly regex without the /x modifier.

It's really amazing how many people (and in good open-source programs, too) forget to add line comments here at there when they could greatly help. I am not asking for flower-box style comments, just an occasional "now we parse the ANSI terminal prompt" kind of comment here and there.

Long story short, people who never comment their code and modules implementations need to be shot :)

  • Comment on Re: Re: This looks like someone sneezed and hit the keyboard

Replies are listed 'Best First'.
Re: Re: Re: This looks like someone sneezed and hit the keyboard
by ysth (Canon) on Feb 03, 2004 at 17:05 UTC
    I have real trouble with remembering to use whitespace, comments, and /x in my regexs. I just don't have the habit (yet!) while writing code. Almost all the /x's that end up in my code are added after-the-fact. I'm almost ready to decide just to put an /x on all regexes (to help develop the habit), but I know that will get me strange looks.
      My regexes tend to be very basic, so, like you I don't use /x much. It would look crazy if used everywhere. However, this example is pretty ugly and needs it just for maintaince purposes. We are lucky some folks remember what ANSI escape sequences look like, as someone who didn't use ANSI codes wouldn't have a clue.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-06-25 09:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.