Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Re: Re: Re: do/redo or for(;;): what's Kosher?

by Lord Wrath (Friar)
on Jan 04, 2002 at 22:24 UTC ( #136333=note: print w/ replies, xml ) Need Help??


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

First of all, I ended up in PERL because I took a job that deals with PERL, and in the current market slump, any job that pays is better than no job at all. I have grown to enjoy PERL, but it is not, and I don't expect it to ever be, my favorite language {ducks the hurled mugs}.

Second, I don't see how maintaining a naked block is any more difficult than a labeled block. This might be due to my relatively short 8 years as a programmer, but it seems to me the psuedocode comments should pretty well fall into place when writing the loop. In a multi-leveled if structure I am in the habit of labeling most of my close brackets so those who are using editors that do not support matching bracket searches have less trouble debugging. So adding a beginning comment in place of a loop condition and then a comment at the end does not seem like a massive undertaking in my eyes. To some it may, and I guess this entire thread should not interest you and you can continue with your day.

Third, you said you know what's going on without even thinking. I believe this is the problem with the whole sub-thread we are looking at here. This is no longer about PERL and it's not really even about programming at the root level. Many people will tell you the best way to improve is to make your own mistakes, and that forces you to have a fundamental understanding of the error. When I was in pre-veterinarian classes, my first chemistry class and my first biology class had us doing the most basic experiments possible. This was to help us to learn why the priciples existed, so we did not blindly memorize the work of others and have no real knowledge to make improvements of our own. Now I have been working with DBI for a while now, and many of the old scripts I come accross use ORAPERL. I change them to use the new way. I do not leave them because it used to be the vastly accepted way of doing it. If people did not question the ways things were done, there would be no USA, and I would probably be sitting in one of the English provinces banging away in COBOL and FORTRAN. I approve of all those who question the "accepted" ways, because this shows a person who has not rolled over and died. I refuse to crush the budding creativityof a programmer becuase I might not like the fact he used needless keystrokes to comment a naked block that seemed like a good way to go. I won't even argue that it is the best thing to do, but I will {obviously} defend their right to find out why it is or is not. Besides, your shop standards may be wildly different than mine, so that's why I suggested the monk who asked this question take it to their manager and group who will be maintaining this code. If they see it as good and not confusing then who are we to tell them different.

Now, not to be stupid or to point out the obvious, but considering the author of this debated loop, and his long list of credentials, and his deep understanding of and link to the language itself, I cannot for the life of me figure out why this is even a matter of dispute.

Lord Wrath


Comment on Re: Re: Re: Re: Re: do/redo or for(;;): what's Kosher?
Download Code
Some Ways Are Suboptimal: An Illustration
by chromatic (Archbishop) on Jan 05, 2002 at 04:11 UTC
    yrav yam ,ylsuoivbo ,egaelim ruoY

    .etib tsrif eht ni teg nac I fi ees ot retaw eht ni daeh ym kcits ot denilcni ton m'I ,"luferac eb ,ereht srotagilla era ereht ,yeH" ,syas dna nisab revir nozamA eht ni sregnif ym gnilgnad em sehctac enoemos fi tub ,uoy tuoba wonk t'nod I

    .daeha og ,sllimdniw rewot yrovi deviecrep ta tlit dna mgidarap tnanimod eht trevbus ot deen evitaerc a evah uoy fI .lauqe detaerc era syaw lla ton taht tuo tniop ot ytirohtua eht dna ecneirepxe eht evah su fo wef a etiuq tub ,tI oD oT yaW enO nahT eroM s'erehT

      Secret Decoder Ring....
      % GET http://perlmonks.org/?node=136424 | perl -lne 'print scalar reve +rse if /yra?v/../oD/'
      -Blake

      yletanutrofun rehtar,

      .hsilgne ekil yltcaxe sesrap taht em To .cixelsid ma i that si meblorp ym fo traP .ereh srorre lacihpargopyt yna usecxe esaelp melborp eht fo trap sA

      .ewisrehto ro, syawedis, sdrawkcab, sdrawrof, edoc, htam, hsinaps, hsilgne eb ti rethew ;ykcliuq yllauqe (wonk i) seguagnal daer nac i nosaer emos roF

      .nwo reith hcae oT ,nuf evah
      xnyj

      (on a serious eton, while i can parse bare blocks mentally as quickly as a while(1) loop with little to on problems, that doesn't maen i think oneevery can. In edoc taht is for procudtion use, the code should eb as easy to daer as possible for eht average user, and that usullay means gniwollof idioms; tsuj like i t'nod normally tsop sdrawkcab text despite eht fact that i nac type ti as easily sa fordraw txet in tsom cases :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (12)
As of 2014-11-26 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (165 votes), past polls