DISQUS

DISQUS Hello! Elliott Back's Blog is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Jump to original thread »
Author

Perl Style: The If / Else Statement — Elliott C. Back

Started by elliottback · 8 months ago

No excerpt available. Jump to website »

6 comments

  • I have to agree with the book's author. In my opinion, "cuddling" an else hurts readability, although I'll admit I'm rather anal when it comes to coding style. I find it far easier to be able to look straight down the column and find my if, elseif, else statements all lined up. Sure, it takes up a little extra space, but the difference is negligible.

    A person's coding style should cater toward ease of readability for other people, not the compiler. The compiler doesn't care if your else's are cuddled or not; in fact in many lanuages you could write your entire script on a single line and the compiler won't mind one bit. But I can guarantee that the programmer who comes in behind you and has to maintain your code will have a thing or two to say about it.
  • I cuddle as well, but it really does look more readable without cuddling.
  • fasdffsd
  • I think there are more important things to worry about, you anal twats.
  • I think there are more important things to worry about, you anal twats.
  • Un-cuddled is easier to spot when quick-scanning unfamiliar code, for instance to distinguish from an elsif. And it's the same amount of text space - a bit more screen space, but sometimes that's a good thing.

Add New Comment

Returning? Login