The curley bracket!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #46
    Originally posted by AricC
    With the speeds of PC processing these days I wouldn't think this is a big factor. Do you any have proof?
    I suspect that it isn't faster at all once the optimiser has got it's hands on it.

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #47
      Originally posted by AricC
      With the speeds of PC processing these days I wouldn't think this is a big factor.
      Argh! Evil !!

      This sort of "who cares, PCs are fast these day" reasoning is responsible for a lot of stupid coding and user frustration.

      You don't happen to work for MS, by any chance?

      Comment

      • Ganon11
        Recognized Expert Specialist
        • Oct 2006
        • 3651

        #48
        Originally posted by AnthonyScaife
        I prefer:

        Code:
        if (databaseGotUpdated)
        {   updateCount++;
            clearDisplay();
            renderNewTable();
        }
        I like:
        - The style of indentation
        - camelHumpStyle names rather than with_under_scor es
        - ++
        - Functions in the style verbAdjectiveNo un() in plain English

        What does everyone else think ? ( "what a pedant !" ? )
        Not sure I like including code on the same line as the opening bracket, but otherwise we agree.

        Comment

        • AricC
          Recognized Expert Top Contributor
          • Oct 2006
          • 1885

          #49
          Originally posted by Killer42
          Argh! Evil !!

          This sort of "who cares, PCs are fast these day" reasoning is responsible for a lot of stupid coding and user frustration.

          You don't happen to work for MS, by any chance?
          No I don't work for MS but tell me how ++ is that much faster than +=?

          Comment

          • Banfa
            Recognized Expert Expert
            • Feb 2006
            • 9067

            #50
            Originally posted by Killer42
            This sort of "who cares, PCs are fast these day" reasoning is responsible for a lot of stupid coding and user frustration.
            Actually this is a very good point, I once had to spend 2 weeks going through the code of an embedded project with 16Mbyte RAM searching for ways to save memory because people with this sloppy style had used it all up and the project need space for development.

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #51
              Originally posted by Banfa
              Actually this is a very good point, I once had to spend 2 weeks going through the code of an embedded project with 16Mbyte RAM searching for ways to save memory because people with this sloppy style had used it all up and the project need space for development.
              Ah, code bloat - ya gotta love it!

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #52
                Originally posted by Killer42
                Argh! Evil !!

                This sort of "who cares, PCs are fast these day" reasoning is responsible for a lot of stupid coding and user frustration.

                You don't happen to work for MS, by any chance?
                I agree, M$ == Code Bloat. Takes up lots of space and requires lots of RAM.

                Comment

                • Banfa
                  Recognized Expert Expert
                  • Feb 2006
                  • 9067

                  #53
                  Originally posted by acoder
                  I agree, M$ == Code Bloat. Takes up lots of space and requires lots of RAM.
                  It isn't just MS, programming on todays PC's can get anyone into sloppy habits if they are not paying attention to what they are doing.

                  Comment

                  • Ganon11
                    Recognized Expert Specialist
                    • Oct 2006
                    • 3651

                    #54
                    Like Me. O.o

                    Using simple programs to learn hasn't exactly pounded home efficiency.

                    Comment

                    • AricC
                      Recognized Expert Top Contributor
                      • Oct 2006
                      • 1885

                      #55
                      Originally posted by Banfa
                      Actually this is a very good point, I once had to spend 2 weeks going through the code of an embedded project with 16Mbyte RAM searching for ways to save memory because people with this sloppy style had used it all up and the project need space for development.
                      I wouldn't call using += 1 over ++ sloppy at all and I still haven't seen any proff ++ is that much better.

                      Comment

                      • Banfa
                        Recognized Expert Expert
                        • Feb 2006
                        • 9067

                        #56
                        Originally posted by AricC
                        I wouldn't call using += 1 over ++ sloppy at all and I still haven't seen any proff ++ is that much better.
                        I never said it was you are reading my comments out of context to the reply they where made to and the original comparison was between ++i and i++ not i++ and i += 1;

                        Personally I still maintain that once the optomiser has put its oar in they should all be more or less the same.
                        Last edited by Banfa; Mar 8 '07, 03:46 PM. Reason: Removing naughty '

                        Comment

                        • Killer42
                          Recognized Expert Expert
                          • Oct 2006
                          • 8429

                          #57
                          Originally posted by Banfa
                          It isn't just MS, programming on todays PC's can get anyone into sloppy habits if they are not paying attention to what they are doing.
                          That's true. M$ is just the poster-child.

                          Comment

                          • Killer42
                            Recognized Expert Expert
                            • Oct 2006
                            • 8429

                            #58
                            Originally posted by Banfa
                            Last edited by Banfa : Today at 02:46 AM. Reason: Removing naughty '
                            I hope it was removed humanely and sent to a good home. Otherwise the Apostrophe Preservation Society will be after you.

                            Comment

                            • AricC
                              Recognized Expert Top Contributor
                              • Oct 2006
                              • 1885

                              #59
                              Originally posted by Banfa
                              I never said it was you are reading my comments out of context to the reply they where made to and the original comparison was between ++i and i++ not i++ and i += 1;

                              Personally I still maintain that once the optomiser has put its oar in they should all be more or less the same.
                              Perhaps I was, but that is what I've gathered from reading previous posts is that there is some sort of big difference between the two.

                              Comment

                              • Banfa
                                Recognized Expert Expert
                                • Feb 2006
                                • 9067

                                #60
                                Originally posted by AricC
                                Perhaps I was, but that is what I've gathered from reading previous posts is that there is some sort of big difference between the two.
                                Hmm only if you believe the poster of the original comment that ++i is more efficient than i++ because of a copy but there are many cases where there would be no need of a copy and many more where optimiser would come along and optimise away the inefficiency.

                                I do not think the argument for ++i over i++ holds water.

                                Comment

                                Working...