Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I think you're wasting way too many brain cycles trying to save CPU cycles. I was heavy into assembly programming for a while and used to be the same way; however at some point your realize that 10,000 clock cycles just aren't worth the 3 hours extra work. If you're really so bent on speed as to mind every last CPU cycle, how did you end up with Perl?

> #while(1) psuedo-loop
> {

Isn't this kind of the worst of both worlds? You have to type out the while anyway, in addition to the redo, and get the horrible maintainability of the naked block you're using. And you also have to maintain all your pseudocode comments to match the actual code. I can't think of any way to make things more awkward.

To your subrant: smack them over the head if they don't use indentation. I don't care about exact formatting habits like where people put their curlies and whether their else's are cuddled, but indentation is an iron rule.

while(1) is misleading only to a person who has never seen this idiom before, while it is the most efficient way to signal "infinite loop" to someone who's spent any amount of time writing Perl. Personally, the moment I see that idiom, I know what's going on without even thinking. Learning these idioms is what makes you good at a language.

Questioning accepted good practice is a good way of thinking; throwing accepted good practice out of the window just for the sake of doing things differently, in your own style, is not. I used to question everything and often went about things my own way. In the end I discovered that I only repeated mistakes others had made before and which had led them to establish those accepted good practices I dismissed. Tradition becomes tradition, because it actually works well, not because everyone just does it that way. Sometimes, straying from it is good; but someone who is too quick to dismiss it will not stay true to his new, "better" rules for long either.


In reply to Re^4: do/redo or for(;;): what's Kosher? by Aristotle
in thread do/redo or for(;;): what's Kosher? by rje

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 making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-24 05:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found