Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I think the answer to your question is dependent on context: Correctness usually is ...

If your writing a program that is likely to run for hours on an expensive resource, then perhaps the interesting bench-marking discussed by other posters probably counts for something. After all: if it is costing lots of $$/minute to run the program, it might be worth it to spend the $$ up front and have really efficient code from a hardware performance and resource point of view.(But if that were the case, would you be programming in Perl?)

If your writing code under the vast majority of circumstances, then the 'team' aspect is probably more important, as wading through code written for brevity, as compared to having been written for readability/maintainabilty, can be costly. Personally, I prefer code which, when read by someone other than the author, does not assume that the reader knows much about the implicit characteristics of how the code compiles or runs. It boils down to a potential trade-off between some extra hardware resources applied occasionally as compared to wetware resources applied fairly regularly. On the other hand, that does not mean that every line needs a comment either as some level of skill should be assumed to be had by the code reader/modifier. Obviously a balancing act...

In my experience, correctness is the in realm of those that think the world should reflect the way they like things to be, as compared to for example, the way I like things to be. :-) Am I correct or are they? I am of course!

The point is that if you take a look around at code written by others who appear to be better than you are and find someone whose code you like, emulate that until you have a valid reason not to. If your goal is to be correct, you are going to spend an awful lot of time defending your version of correct. Do what works for you and does not get in the way of others and you will be about as correct as your likely to ever be...

Incidentally, I like the 'my %hash = ();' just because it is so explicit. Am I correct? I doubt it...but it works for me and most others really don't give a damn that I spent and extra 5 keystrokes.... :-)


...the majority is always wrong, and always the last to know about it...
Insanity: Doing the same thing over and over again and expecting different results...

In reply to Re: Is there a difference in this declaration? by wjw
in thread Is there a difference in this declaration? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-20 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found