Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: poll ideas quest 2013

by B-Man (Acolyte)
on Mar 22, 2013 at 13:32 UTC ( #1024928=note: print w/ replies, xml ) Need Help??


in reply to poll ideas quest 2013

You're free to ignore the spoiler. It's the previous way this question was set up.

How do you write your curly brackets?

sub foo { if (bar) { #Blah! } }

or...

sub foo { if (bar) { #Blah! } }

How do you write your curly brackets?

  • K&R style
  • Variant: 1TBS
  • Allman style
  • BSD KNF style
  • Whitesmiths style
  • GNU style
  • Horstmann style
  • Pico style
  • Banner style
  • Lisp style
  • Ratliff style
  • Compact control readability style
  • Other, they all suck
  • Style? I dunno, that's done in the automated integration process
  • With special thanks to Tux for giving me a refined, "poll-ready" list. If you need help with the style names, please visit the Wikipedia page on the matter.


    Comment on Re: poll ideas quest 2013
    Select or Download Code
    Re^2: poll ideas quest 2013
    by Voronich (Hermit) on Mar 22, 2013 at 14:21 UTC
      I actually use the second method, much to the persistent annoyance of just about everybody I've ever worked with. It lets me see the structure of the code on a teeny font and pressures me to keep my routines small, so they fit on the screen.

        I honestly am not sure why the former method is so popular. I think it's a pain to read, and quite annoying to fix when you have an unmached bracket. Those are easy to get when you're doing any sort of sigificant code building or modification.

          I don't see the disadvantage in either of those two for editing. I do agree with editing being made more difficult with cuddled else as in } else {. Now that sucks.


          Enjoy, Have FUN! H.Merijn
          pmsig
    Re^2: poll ideas quest 2013
    by Tux (Monsignor) on Mar 22, 2013 at 15:21 UTC

      Are those the only two options? See wikipedia for a longer list of styles. I use banner style, and I also have my reasons to use it: I thought about it. I'm afraid a lot of fresh coders just follow what they were fed at school or what their editor-of-choice gives as prefered style.

      sub foo { if (bar) { # Blah! } } # foo

      WAY more important than what style is used, is that the style is used consistently and by all members in the team.

      FWIW I do not think this would be a good poll. It would lead to flame wars.


      Enjoy, Have FUN! H.Merijn

        I agree that consistency in a team is important. I think that programmer should learn how to flexibly write their code to conform to a current project's standards. However, this question isn't asking for the "best" method or even the one you should use in practice on any given project. It's just asking for your preferred method that you would use if you were coding something all by yourself for whatever reason. What method would you use if you were working on a simple project at home or whatever?

        If this causes flame wars, than it speaks of the stubborness of Perl programmers in a very negative way. I hope you guys aren't really that stubborn. Geez. I'm not asking for a "correct" answer.

        P.S.: Do you have any idea how condescending it is to say that you use your style because you "thought about it," while others who aren't "veterans" like yourself "just follow what they were fed at school or what their editor-of-choice gives as prefered style." Of course us "newbies" can't actually have real justifications for why we use a style! We're just stupid like that, aren't we?

        P.P.S.: Okay, so there are more than just two styles. After all, whitespace is fairly "free form" and has no real affect on your code other than readability. If you want to take it that far, I could make some big huge list of styles and have them all be options, or "reference the names" and link to each type for people to actually look up. For most of us, that requires a lot of extra reading to use styles that we probably didn't even think of as having names. Seriously, I think it says a lot about you that you're linking to named styles. They're important, but most of us don't care what the styles are called! You really don't have to know that you're using "Lisp Style" to use it. e_e The only real purpose it "serves" as is a way to quickly referene what you mean without fullly describing it.

    Re^2: poll ideas quest 2013
    by ambrus (Abbot) on Mar 25, 2013 at 21:11 UTC

      Please try to rephrase this poll idea in a way that you think could appear verbatim in a poll. The pollsters won't make a poll with nine-line code snippets embedded in a poll answer. Quoting How do I create a Poll?, “Draft the complete wording of your poll. No one will do it for you.”

        Bleh. I'm sure I ruffled a few feathers with my rather terse attitude earlier in this post. I'm in the middle of building a spider for my company's intranet. When I have a bit of time I'll fix my poll by using style name references. Please be patient. :)

          The wikipedia list comes in very handy for the names:

          • K&R style
          • Variant: 1TBS
          • Allman style
          • BSD KNF style
          • Whitesmiths style
          • GNU style
          • Horstmann style
          • Pico style
          • Banner style
          • Lisp style
          • Ratliff style
          • Compact control readability style
          • Other, they all suck
          • Style? I dunno, that's done in the automated integration process

          Enjoy, Have FUN! H.Merijn

    Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (10)
    As of 2014-12-28 03:06 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (178 votes), past polls