Hi Mimi,


Mimi Cafe wrote:
I think this will work, but is it elegant.?

If (condition){

   if (nexted_condition){


As others have noted, it will work. But as for elegance, this is a very subjective opinion and contrary to what recent comments have said, my take on it is that it depends on who intends to look at this code and what their background is. Is it just you? Or publicly available open source for potentially everyone? Or just the members of your software engineering team? Are they people with good Perl backgrounds or are their backgrounds varied and maybe might prefer if...else and switch, constructs that are available in other languages.

I personally prefer switch and if..else (in that order) since they are based on keywords which my syntax highlighter picks up easily and are even shown when I print the code out. Also, I can grep for, if I need to.

Regardless of what you choose, you should also use comments before the block of code to explain what it is you're doing...

Ray


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to