Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. YouPreferSomethingLikeThis or you-prefer-something-like-this?

YouPreferSomethingLikeThis or you-prefer-something-like-this?

Scheduled Pinned Locked Moved The Lounge
linuxquestion
36 Posts 20 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Chris C B

    So there! :)

    G Offline
    G Offline
    Gary R Wheeler
    wrote on last edited by
    #13

    Pascal case is okay, and underscores are groovy. Camel case, on the other hand, is an abomination before God. (so says the olde git)

    Software Zen: delete this;

    C 1 Reply Last reply
    0
    • J jpg 0

      Before I step into the world of linux, I always use camel case, but in the linux world, almost everything are separated by a dash Now I have to manage a cross platform project and is thinking about which naming convention to adopt

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #14

      If this is you own product, use the same coding convention that you are used to. If you are working on an existing Open Source software, use the coding conventions already in place for that project.

      Watched code never compiles.

      1 Reply Last reply
      0
      • J jpg 0

        Before I step into the world of linux, I always use camel case, but in the linux world, almost everything are separated by a dash Now I have to manage a cross platform project and is thinking about which naming convention to adopt

        J Offline
        J Offline
        Joan M
        wrote on last edited by
        #15

        Depending the language you are using - can give you problems in variable names. Therefore I would go with an uppercase letter in each word start.

        [www.tamautomation.com] Robots, CNC and PLC machines for grinding and polishing.

        1 Reply Last reply
        0
        • G Gary R Wheeler

          Pascal case is okay, and underscores are groovy. Camel case, on the other hand, is an abomination before God. (so says the olde git)

          Software Zen: delete this;

          C Offline
          C Offline
          Chris C B
          wrote on last edited by
          #16

          Gary R. Wheeler wrote:

          underscores are groovy

          _I_hate_underscores_-_all_those_extra_key_strokes_._:mad:_

          Gary R. Wheeler wrote:

          Camel case, on the other hand, is an abomination before God.

          I'm a devil worshipper, so that's alright then. ;) Anyway, after 20 years in the Middle East, camel case just comes naturally. :laugh:

          G 1 Reply Last reply
          0
          • C Chris C B

            So there! :)

            E Offline
            E Offline
            Espen Harlinn
            wrote on last edited by
            #17

            iPreferSomethingLikeThis

            Is that the Apple style? ;)

            Espen Harlinn Principal Architect, Software - Goodtech Projects & Services AS My LinkedIn Profile

            1 Reply Last reply
            0
            • C Chris C B

              Gary R. Wheeler wrote:

              underscores are groovy

              _I_hate_underscores_-_all_those_extra_key_strokes_._:mad:_

              Gary R. Wheeler wrote:

              Camel case, on the other hand, is an abomination before God.

              I'm a devil worshipper, so that's alright then. ;) Anyway, after 20 years in the Middle East, camel case just comes naturally. :laugh:

              G Offline
              G Offline
              Gary R Wheeler
              wrote on last edited by
              #18

              Chris C-B wrote:

              after 20 years in the Middle East, camel case just comes naturally

              At my company, that statement would be an "EOE violation". EOE == the corporate policy that ensures that all employees are interchangable, gender and ethnic-neutral drones.

              Software Zen: delete this;

              1 Reply Last reply
              0
              • OriginalGriffO OriginalGriff

                Vivic wrote:

                COBOL is better.

                That is the first time I have ever seen those three words together, in that order, without them having the suffix "than being nailed to a wall by your eyes and having your genitals stapled together." And hopefully the last! :laugh:

                Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                V Offline
                V Offline
                Vivi Chellappa
                wrote on last edited by
                #19

                Come on. Do you have anything like the "Alter" statement which will change the address (statement label) you jump to while executing a program? Makes for a hairy debugging experience! :laugh:

                OriginalGriffO 1 Reply Last reply
                0
                • V Vivi Chellappa

                  Come on. Do you have anything like the "Alter" statement which will change the address (statement label) you jump to while executing a program? Makes for a hairy debugging experience! :laugh:

                  OriginalGriffO Offline
                  OriginalGriffO Offline
                  OriginalGriff
                  wrote on last edited by
                  #20

                  FORTRAN: Not only can you declare a single integer and use it as a four dimensional array of reals, but you can change the value of physical constants! You haven't met hairy debugging until a loop that is fixed to do 3 iterations is doing 14 because the constant 3 has been changed. Or working out why your circles aren't because someone accidentally changed 3.1415927 to 8.6 Or assembler. Self modifying code! Fun, fun fun, 'til someone loses an eye... :laugh:

                  Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                  "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                  "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                  1 Reply Last reply
                  0
                  • OriginalGriffO OriginalGriff

                    Nah - compilers are used to developers screaming at them. Abuse normally.

                    Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                    B Offline
                    B Offline
                    BillWoodruff
                    wrote on last edited by
                    #21

                    Hiren spake thus: "Compiler will complain to code on shouting." Whence OriginalGriff spake thus: "Nah - compilers are used to developers screaming at them. Abuse normally." But, OG, how do you think the code feels having to bear the constant burden of being the one and only entity to which the compiler can ventilate their continual frustrations with the mis-use developers are subjecting them to ? I think a viable product would be a device that attaches to the side of the computer with an electro-mechnical arm, with a padded fist attached to it, that can be adjusted to slap the programmer up the side of the head based on commands sent to it by its integration into Visual Studio, possibly an add-on for ReSharper, or JustCode, etc. Too many static variables scattered across classes, and used willy-nilly: bitch-slap. Anonymous functions within recursive anonymous functions: TKO. Writing an extension that extends 'Object:' permanent coma. best, Bill

                    "The greatest mystery is not that we have been flung at random between the profusion of matter and of the stars, but that within this prison we can draw from ourselves images powerful enough to deny our nothingness." Andre Malraux

                    OriginalGriffO 1 Reply Last reply
                    0
                    • OriginalGriffO OriginalGriff

                      For best results, I would recommend a Fortran naming convention: 6 characters only, starts with a letter. No lower case. :-D

                      Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                      M Offline
                      M Offline
                      Mycroft Holmes
                      wrote on last edited by
                      #22

                      OriginalGriff wrote:

                      I would recommend a Fortran naming convention

                      So that is where that convention came from (never having been inflicted with any of the seed languages), I ran across it in the late 80s and wanted to know who in their right mind would inflict such a horrible format on someone. The other one was the datamap, PRGX12 = Customer link file to phone numbers!

                      Never underestimate the power of human stupidity RAH

                      OriginalGriffO 1 Reply Last reply
                      0
                      • B BillWoodruff

                        Hiren spake thus: "Compiler will complain to code on shouting." Whence OriginalGriff spake thus: "Nah - compilers are used to developers screaming at them. Abuse normally." But, OG, how do you think the code feels having to bear the constant burden of being the one and only entity to which the compiler can ventilate their continual frustrations with the mis-use developers are subjecting them to ? I think a viable product would be a device that attaches to the side of the computer with an electro-mechnical arm, with a padded fist attached to it, that can be adjusted to slap the programmer up the side of the head based on commands sent to it by its integration into Visual Studio, possibly an add-on for ReSharper, or JustCode, etc. Too many static variables scattered across classes, and used willy-nilly: bitch-slap. Anonymous functions within recursive anonymous functions: TKO. Writing an extension that extends 'Object:' permanent coma. best, Bill

                        "The greatest mystery is not that we have been flung at random between the profusion of matter and of the stars, but that within this prison we can draw from ourselves images powerful enough to deny our nothingness." Andre Malraux

                        OriginalGriffO Offline
                        OriginalGriffO Offline
                        OriginalGriff
                        wrote on last edited by
                        #23

                        Can we add a pistol-whipping for unnecessary use of GOTO?

                        Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                        N 1 Reply Last reply
                        0
                        • M Mycroft Holmes

                          OriginalGriff wrote:

                          I would recommend a Fortran naming convention

                          So that is where that convention came from (never having been inflicted with any of the seed languages), I ran across it in the late 80s and wanted to know who in their right mind would inflict such a horrible format on someone. The other one was the datamap, PRGX12 = Customer link file to phone numbers!

                          Never underestimate the power of human stupidity RAH

                          OriginalGriffO Offline
                          OriginalGriffO Offline
                          OriginalGriff
                          wrote on last edited by
                          #24

                          :-D FORTRAN had a line length limit of 80 characters (after that you needed to put a Continuation character in column 7 of the next line), so lots of things got shortened as much as possible. Produced some gawd-awful code by modern standards, but good enough to get men onto the moon! And a heck of a lot better than COBOL, which had no such variable name limit.

                          Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                          G H 2 Replies Last reply
                          0
                          • OriginalGriffO OriginalGriff

                            Can we add a pistol-whipping for unnecessary use of GOTO?

                            Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                            N Offline
                            N Offline
                            Nagy Vilmos
                            wrote on last edited by
                            #25

                            OriginalGriff wrote:

                            Can we add a pistol-whipping for unnecessary use of GOTO?

                            ftfy


                            Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

                            OriginalGriffO 1 Reply Last reply
                            0
                            • N Nagy Vilmos

                              OriginalGriff wrote:

                              Can we add a pistol-whipping for unnecessary use of GOTO?

                              ftfy


                              Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

                              OriginalGriffO Offline
                              OriginalGriffO Offline
                              OriginalGriff
                              wrote on last edited by
                              #26

                              :-D Sometimes a GOTO is the best way out - it can be a cleaner solution than a bool and test, test, test, test to get out of multiple loops. I haven't used one since I started with C#, and probably haven't used one (outside assembler code where you don't get a choice) for twenty years though.

                              Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                              "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                              B 1 Reply Last reply
                              0
                              • OriginalGriffO OriginalGriff

                                Vivic wrote:

                                COBOL is better.

                                That is the first time I have ever seen those three words together, in that order, without them having the suffix "than being nailed to a wall by your eyes and having your genitals stapled together." And hopefully the last! :laugh:

                                Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                                M Offline
                                M Offline
                                Mike Winiberg
                                wrote on last edited by
                                #27

                                OriginalGriff wrote:

                                "than being nailed to a wall by your eyes and having your genitals stapled together."

                                Hey, don't knock it. There are people out there that would pay good money for that kind of experience! (APL devs for example!) ;)

                                1 Reply Last reply
                                0
                                • OriginalGriffO OriginalGriff

                                  :-D FORTRAN had a line length limit of 80 characters (after that you needed to put a Continuation character in column 7 of the next line), so lots of things got shortened as much as possible. Produced some gawd-awful code by modern standards, but good enough to get men onto the moon! And a heck of a lot better than COBOL, which had no such variable name limit.

                                  Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                                  G Offline
                                  G Offline
                                  greldak
                                  wrote on last edited by
                                  #28

                                  That would be Fortran 66 or earlier most F77 compilers allowed longer lines as an extension F90 onwards its in the language spec. Also even in Fortran IV the length of the variable could exceed 6 chars but anything beyond that was ignored by the parser and they could include lowercase. Up to Fortran IV there was no need to worry about lowercase as data entry was by teletype if you were lucky or card or tape punch.

                                  OriginalGriffO C 2 Replies Last reply
                                  0
                                  • G greldak

                                    That would be Fortran 66 or earlier most F77 compilers allowed longer lines as an extension F90 onwards its in the language spec. Also even in Fortran IV the length of the variable could exceed 6 chars but anything beyond that was ignored by the parser and they could include lowercase. Up to Fortran IV there was no need to worry about lowercase as data entry was by teletype if you were lucky or card or tape punch.

                                    OriginalGriffO Offline
                                    OriginalGriffO Offline
                                    OriginalGriff
                                    wrote on last edited by
                                    #29

                                    Guess which version I learnt? :laugh:

                                    Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                                    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                                    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                                    1 Reply Last reply
                                    0
                                    • J jpg 0

                                      Before I step into the world of linux, I always use camel case, but in the linux world, almost everything are separated by a dash Now I have to manage a cross platform project and is thinking about which naming convention to adopt

                                      C Offline
                                      C Offline
                                      Collin Biedenkapp
                                      wrote on last edited by
                                      #30

                                      I almost always use a single word (RunLogin()). Sometimes I will use '_'. For example, api_GetValue().

                                      1 Reply Last reply
                                      0
                                      • J jpg 0

                                        Before I step into the world of linux, I always use camel case, but in the linux world, almost everything are separated by a dash Now I have to manage a cross platform project and is thinking about which naming convention to adopt

                                        B Offline
                                        B Offline
                                        Bruce Patin
                                        wrote on last edited by
                                        #31

                                        camelCase/PascalCase seems to be becoming more popular in the open source world, and I would stick with that. There are some problems with other styles. Dashes can't be used in any language that uses them as subtraction operators, which is most of them. About the only place you can use dashes is in CSS, which isn't really a language and so does not have operators. You didn't mention underscores, another old style. Underscores sometimes tend to get lost visually in some formatting, and many people think that they separate words in a variable so that it is harder to scan code quickly, since the words may look like separate variables. Underscores also make variable names longer. So that leaves camelCase/PascalCase. Use lower case for the first character of variables and method names, and upper case for class names. This is especially used in PHP, and can also be used in any other language. (Microsoft uses mostly upper case for the first letter, with some complicated rules for variations, which I don't like.)

                                        1 Reply Last reply
                                        0
                                        • OriginalGriffO OriginalGriff

                                          :-D Sometimes a GOTO is the best way out - it can be a cleaner solution than a bool and test, test, test, test to get out of multiple loops. I haven't used one since I started with C#, and probably haven't used one (outside assembler code where you don't get a choice) for twenty years though.

                                          Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                                          B Offline
                                          B Offline
                                          BillWoodruff
                                          wrote on last edited by
                                          #32

                                          Hi OriginalGriff, The thought occurs to me (note the disclaimer of responsibility inherent in the phrasing there) that it would be most interesting to see an analysis (Tip/Trick ?) of what IL is produced by, for example, the C# compiler, in a complex series of nested loops with possible multiple exit-all-loop-pathways, as you eloquently described: "a bool and test, test, test, test to get out of multiple loops." Easy to imagine the 'Goto just gets IL'd into a 'jump' statement, as 'switch/case statements' condition-match code is, under certain conditions (for example, where the case conditions are a series of incrementing-by-one ints). Being quite ignorant of issues in multi-thread programming, I'd be curious to know if there are any gotchas in using 'Goto in such conditions. Of course, for many "No 'Goto'" will remain a sacred commandment revealed to us, yea, verily, even as a source of "mental illness," by Saint Djikstra.[^]. best, Bill

                                          "The greatest mystery is not that we have been flung at random between the profusion of matter and of the stars, but that within this prison we can draw from ourselves images powerful enough to deny our nothingness." Andre Malraux

                                          OriginalGriffO 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups