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. Consistency...

Consistency...

Scheduled Pinned Locked Moved The Lounge
comjson
29 Posts 19 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.
  • M Offline
    M Offline
    Marc Clifton
    wrote on last edited by
    #1

    Or the lack thereof:

    {
    "token_data": {
    "AccessToken": "eyJraWQiOi..."
    }
    }

    Look, either use underscores or don't. Make Request with JWT · massgov/LicenseValidationAPI Wiki · GitHub[^] I deal with idiots when I have to work with 3rd party API's.

    Latest Articles:
    Abusing Extension Methods, Null Continuation, and Null Coalescence Operators

    Greg UtasG L Z K H 8 Replies Last reply
    0
    • M Marc Clifton

      Or the lack thereof:

      {
      "token_data": {
      "AccessToken": "eyJraWQiOi..."
      }
      }

      Look, either use underscores or don't. Make Request with JWT · massgov/LicenseValidationAPI Wiki · GitHub[^] I deal with idiots when I have to work with 3rd party API's.

      Latest Articles:
      Abusing Extension Methods, Null Continuation, and Null Coalescence Operators

      Greg UtasG Offline
      Greg UtasG Offline
      Greg Utas
      wrote on last edited by
      #2

      If I'm not using Camel case, which I rarely stray from, I'll use underscores without a second thought.

      Robust Services Core | Software Techniques for Lemmings | Articles

      <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
      <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

      N 1 Reply Last reply
      0
      • Greg UtasG Greg Utas

        If I'm not using Camel case, which I rarely stray from, I'll use underscores without a second thought.

        Robust Services Core | Software Techniques for Lemmings | Articles

        N Offline
        N Offline
        Nelek
        wrote on last edited by
        #3

        But... do you mix the styles? X| X| Next you will say, you mix gin with water :doh: :doh: :laugh:

        M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

        Greg UtasG L K C 4 Replies Last reply
        0
        • N Nelek

          But... do you mix the styles? X| X| Next you will say, you mix gin with water :doh: :doh: :laugh:

          M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

          Greg UtasG Offline
          Greg UtasG Offline
          Greg Utas
          wrote on last edited by
          #4

          I occasionally use underscores to follow low-level C++ conventions, like defining signal_t or main_t as the type for a POSIX signal or the value returned by main. And the name of a private data member ends in an underscore.

          Robust Services Core | Software Techniques for Lemmings | Articles

          <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
          <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

          G 1 Reply Last reply
          0
          • M Marc Clifton

            Or the lack thereof:

            {
            "token_data": {
            "AccessToken": "eyJraWQiOi..."
            }
            }

            Look, either use underscores or don't. Make Request with JWT · massgov/LicenseValidationAPI Wiki · GitHub[^] I deal with idiots when I have to work with 3rd party API's.

            Latest Articles:
            Abusing Extension Methods, Null Continuation, and Null Coalescence Operators

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Marc Clifton wrote:

            Look, either use underscores or don't.

            Don't!

            M 1 Reply Last reply
            0
            • N Nelek

              But... do you mix the styles? X| X| Next you will say, you mix gin with water :doh: :doh: :laugh:

              M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Nelek wrote:

              gin with water

              What's wrong with that? A dash of Angostura and you have a delicious pink gin. Which reminds me ...

              1 Reply Last reply
              0
              • M Marc Clifton

                Or the lack thereof:

                {
                "token_data": {
                "AccessToken": "eyJraWQiOi..."
                }
                }

                Look, either use underscores or don't. Make Request with JWT · massgov/LicenseValidationAPI Wiki · GitHub[^] I deal with idiots when I have to work with 3rd party API's.

                Latest Articles:
                Abusing Extension Methods, Null Continuation, and Null Coalescence Operators

                Z Offline
                Z Offline
                ZurdoDev
                wrote on last edited by
                #7

                Interesting. I wouldn't have even cared. :^)

                Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.

                1 Reply Last reply
                0
                • N Nelek

                  But... do you mix the styles? X| X| Next you will say, you mix gin with water :doh: :doh: :laugh:

                  M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                  K Offline
                  K Offline
                  kalberts
                  wrote on last edited by
                  #8

                  I suppose you know the three ways of drinking whisky? With water, without water and like water.

                  N 1 Reply Last reply
                  0
                  • N Nelek

                    But... do you mix the styles? X| X| Next you will say, you mix gin with water :doh: :doh: :laugh:

                    M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                    C Offline
                    C Offline
                    Cp Coder
                    wrote on last edited by
                    #9

                    Do not drink pure water! You absolutely have to dilute water with alcohol. 100% water will cause rust! :laugh:

                    Get me coffee and no one gets hurt!

                    1 Reply Last reply
                    0
                    • M Marc Clifton

                      Or the lack thereof:

                      {
                      "token_data": {
                      "AccessToken": "eyJraWQiOi..."
                      }
                      }

                      Look, either use underscores or don't. Make Request with JWT · massgov/LicenseValidationAPI Wiki · GitHub[^] I deal with idiots when I have to work with 3rd party API's.

                      Latest Articles:
                      Abusing Extension Methods, Null Continuation, and Null Coalescence Operators

                      K Offline
                      K Offline
                      kalberts
                      wrote on last edited by
                      #10

                      Either, you have to re-invent every wheel yourself ... Or you'll just have to be prepared for mixed styles. If you use libraries, type/class definitions, ... whatever developed by others than yourself, you better be prepared for accepting mixed styles with regard to casing, use of underscores, indentation rules (e.g. in header files - you will see them even if you don't see the source code of that library), commenting style (/* */ comment blocks, end-of-line comments, no comments, ...), use of abbreviations in identifiers, ... Sometimes you see conflicting styles even in a single product. The Win32 functions has a subset of functions taking all essential parameters as a single struct, headed by the struct size, so new extensions to the interface can add is parameter to the end of the struct; the size field indicates which version the caller wants to run. But most functions come in version Func, FuncEx, FuncExEx, ... FuncExExExExEx (yes, five times "Ex" has occurred!), each with its own parameter format/sequence. When your personal preference is strongly with the one style that is used the least, you end up bitching a lot "Why couldn't they always use..." when you type those Ex Ex Ex... In Norwegian culture, "Aunt Sophie" is a well known figure. Anyone who grew up in Norway since the 1950 knows Torbjørn Egner's "Cardamom Town"[^] story (it has been translated into many languages, so you might know it from your own childhood!). In this story, aunt Sophie is constantly complaining "If just people were like me, the world would be a much better place!" "Aunt Sophie's angry song"[^] is well know to every Norwegian child. Too bad I didn't find an English version! If you are accused of being an "Aunt Sophie", it means that you are unconditionally requiring everybody to follow your rules, your ideas of what people should think, how they should behave, and everything else, disregaring any counter argument. Being called an Aunt Sophie is certainly not meant as any sort of flattery! I would certainly not like such an accusation! So I accept reality. There are various established styles out there. You may, in the name of "consistency" cling to your own

                      P 1 Reply Last reply
                      0
                      • L Lost User

                        Marc Clifton wrote:

                        Look, either use underscores or don't.

                        Don't!

                        M Offline
                        M Offline
                        MarkTJohnson
                        wrote on last edited by
                        #11

                        tokenDon'tdata?

                        1 Reply Last reply
                        0
                        • K kalberts

                          Either, you have to re-invent every wheel yourself ... Or you'll just have to be prepared for mixed styles. If you use libraries, type/class definitions, ... whatever developed by others than yourself, you better be prepared for accepting mixed styles with regard to casing, use of underscores, indentation rules (e.g. in header files - you will see them even if you don't see the source code of that library), commenting style (/* */ comment blocks, end-of-line comments, no comments, ...), use of abbreviations in identifiers, ... Sometimes you see conflicting styles even in a single product. The Win32 functions has a subset of functions taking all essential parameters as a single struct, headed by the struct size, so new extensions to the interface can add is parameter to the end of the struct; the size field indicates which version the caller wants to run. But most functions come in version Func, FuncEx, FuncExEx, ... FuncExExExExEx (yes, five times "Ex" has occurred!), each with its own parameter format/sequence. When your personal preference is strongly with the one style that is used the least, you end up bitching a lot "Why couldn't they always use..." when you type those Ex Ex Ex... In Norwegian culture, "Aunt Sophie" is a well known figure. Anyone who grew up in Norway since the 1950 knows Torbjørn Egner's "Cardamom Town"[^] story (it has been translated into many languages, so you might know it from your own childhood!). In this story, aunt Sophie is constantly complaining "If just people were like me, the world would be a much better place!" "Aunt Sophie's angry song"[^] is well know to every Norwegian child. Too bad I didn't find an English version! If you are accused of being an "Aunt Sophie", it means that you are unconditionally requiring everybody to follow your rules, your ideas of what people should think, how they should behave, and everything else, disregaring any counter argument. Being called an Aunt Sophie is certainly not meant as any sort of flattery! I would certainly not like such an accusation! So I accept reality. There are various established styles out there. You may, in the name of "consistency" cling to your own

                          P Offline
                          P Offline
                          phil o
                          wrote on last edited by
                          #12

                          From Aunt Sophie's own dictionary: selfish adj. Defines someone who does not think of me.

                          "Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."

                          1 Reply Last reply
                          0
                          • Greg UtasG Greg Utas

                            I occasionally use underscores to follow low-level C++ conventions, like defining signal_t or main_t as the type for a POSIX signal or the value returned by main. And the name of a private data member ends in an underscore.

                            Robust Services Core | Software Techniques for Lemmings | Articles

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

                            Greg Utas wrote:

                            the name of a private data member ends in an underscore.

                            You heathen. Everyone knows that private member names begin with an underscore.

                            Software Zen: delete this;

                            Greg UtasG K 2 Replies Last reply
                            0
                            • G Gary R Wheeler

                              Greg Utas wrote:

                              the name of a private data member ends in an underscore.

                              You heathen. Everyone knows that private member names begin with an underscore.

                              Software Zen: delete this;

                              Greg UtasG Offline
                              Greg UtasG Offline
                              Greg Utas
                              wrote on last edited by
                              #14

                              X| :laugh:

                              Robust Services Core | Software Techniques for Lemmings | Articles

                              <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                              <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                              1 Reply Last reply
                              0
                              • G Gary R Wheeler

                                Greg Utas wrote:

                                the name of a private data member ends in an underscore.

                                You heathen. Everyone knows that private member names begin with an underscore.

                                Software Zen: delete this;

                                K Offline
                                K Offline
                                k5054
                                wrote on last edited by
                                #15

                                :~ Everyone knows that identifiers starting with an underscore are reserved for the implementation.

                                Keep Calm and Carry On

                                J G K 3 Replies Last reply
                                0
                                • K k5054

                                  :~ Everyone knows that identifiers starting with an underscore are reserved for the implementation.

                                  Keep Calm and Carry On

                                  J Offline
                                  J Offline
                                  John R Shaw
                                  wrote on last edited by
                                  #16

                                  It is reserved for those who implement things like the standard library that usually comes with your compiler. Using a beginning underscore for member names or inside a function is legal, but not recommended. But, that being said, when I write classes in the standard C++ format (all lowercase), I use a trailing underscore to distinguish member variables from local variables.

                                  INTP "Program testing can be used to show the presence of bugs, but never to show their absence." - Edsger Dijkstra "I have never been lost, but I will admit to being confused for several weeks. " - Daniel Boone

                                  1 Reply Last reply
                                  0
                                  • K k5054

                                    :~ Everyone knows that identifiers starting with an underscore are reserved for the implementation.

                                    Keep Calm and Carry On

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

                                    Yes, but I relented on that issue in order to achieve a compromise on underscores. I didn't want underscores in the leading position at all, while Mr. Object wanted underscores to be prohibited unless they were in the leading position indicating scope. I use underscores in locals which for me are generally all lower case. I also use underscores in globals when the name includes an acronym: ObjectABC_Factory, for example, where ABC is the acronym. Back story: My group has a naming convention and coding style document that is 1½ pages, and most of it recommends rather requires or prohibits. In fact, I think there's only one thing in it that is absolutely prohibited, and that's Hungarian notation. When we created this document in 2000, that was still quite a thing when doing Windows programming. The only place we allow it to be used is in argument names for callback functions, and they are recommended to use the same names as in the documentation. For what it's worth, we've never had a conflict between our use of leading underscores and any compiler in the last 20 years, and that's spread over tens of millions of lines of C, C++, and C# code.

                                    Software Zen: delete this;

                                    Greg UtasG StarNamer workS 2 Replies Last reply
                                    0
                                    • G Gary R Wheeler

                                      Yes, but I relented on that issue in order to achieve a compromise on underscores. I didn't want underscores in the leading position at all, while Mr. Object wanted underscores to be prohibited unless they were in the leading position indicating scope. I use underscores in locals which for me are generally all lower case. I also use underscores in globals when the name includes an acronym: ObjectABC_Factory, for example, where ABC is the acronym. Back story: My group has a naming convention and coding style document that is 1½ pages, and most of it recommends rather requires or prohibits. In fact, I think there's only one thing in it that is absolutely prohibited, and that's Hungarian notation. When we created this document in 2000, that was still quite a thing when doing Windows programming. The only place we allow it to be used is in argument names for callback functions, and they are recommended to use the same names as in the documentation. For what it's worth, we've never had a conflict between our use of leading underscores and any compiler in the last 20 years, and that's spread over tens of millions of lines of C, C++, and C# code.

                                      Software Zen: delete this;

                                      Greg UtasG Offline
                                      Greg UtasG Offline
                                      Greg Utas
                                      wrote on last edited by
                                      #18

                                      Gary R. Wheeler wrote:

                                      there's only one thing in it that is absolutely prohibited, and that's Hungarian notation

                                      FTMFW! The worst shite ever dreamt up. I found a post about leading underscores which also pointed out that the trailing __t_'s that I occasionally use are reserved in POSIX standards. Yawn.

                                      Robust Services Core | Software Techniques for Lemmings | Articles

                                      <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                                      <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                                      J 1 Reply Last reply
                                      0
                                      • K k5054

                                        :~ Everyone knows that identifiers starting with an underscore are reserved for the implementation.

                                        Keep Calm and Carry On

                                        K Offline
                                        K Offline
                                        kalberts
                                        wrote on last edited by
                                        #19

                                        k5054 wrote:

                                        Everyone knows that identifiers starting with an underscore are reserved for the implementation.

                                        Let me just check that I get this right now: Identifiers not starting with an underscore is for those modules that are not yet implemented. ... Did I get it right this time=?

                                        L 1 Reply Last reply
                                        0
                                        • Greg UtasG Greg Utas

                                          Gary R. Wheeler wrote:

                                          there's only one thing in it that is absolutely prohibited, and that's Hungarian notation

                                          FTMFW! The worst shite ever dreamt up. I found a post about leading underscores which also pointed out that the trailing __t_'s that I occasionally use are reserved in POSIX standards. Yawn.

                                          Robust Services Core | Software Techniques for Lemmings | Articles

                                          J Offline
                                          J Offline
                                          Jorgen Andersson
                                          wrote on last edited by
                                          #20

                                          Is that Apps Hungarian or Systems Hungarian? Systems Hungarian is indeed "The worst shite ever dreamt up", but Apps Hungarian I can understand even if I don't use it.

                                          Wrong is evil and must be defeated. - Jeff Ello

                                          Greg UtasG 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