Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Code for readablity or fewer lines?

by unixwzrd (Beadle)
on Feb 27, 2001 at 22:09 UTC ( [id://61117]=note: print w/replies, xml ) Need Help??


in reply to Re: Code for readablity or fewer lines?
in thread Code for readablity or fewer lines?

I'll second that footpad, coding for clarity is best. People time is more expensive than machine time, and the divergence between the two gets wider every day.

Optimization is good to the point where code starts to lose clarity. Unless the application has to be really optimized. It optimization is the case, then add copius comments so when you or someone else comes back a year later to enhance or fix it - again people time.

I also agree, that I like to over-comment. A year from now I want to know what I was thinking when I go back and look at my code. Besides, comments don't add anything to the actual executable, they are discarded at compile time.

Mike - mps@discomsys.com

"The two most common elements in the universe are hydrogen... and stupidity."
Harlan Ellison

  • Comment on Re: Re: Code for readablity or fewer lines?

Replies are listed 'Best First'.
Re: Re: Re: Code for readablity or fewer lines?
by howard40 (Beadle) on Feb 28, 2001 at 02:54 UTC
    People time is more valuble than machine time.
    hehe ... that seems to be the driving motto of perl... :)

    if we were all hell-bent on maximum performance, most of us wouldnt be using perl at all but rather assembly or some language of that sort.

    i agree with you, readability almost always wins out over line count in my programs, however, dont mistake line count for efficiency line count doesnt always indicate a slower/worse script... sometimes adding a few lines into a script can substantially speed it up.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-25 23:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found