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. Is this an acceptable practice?

Is this an acceptable practice?

Scheduled Pinned Locked Moved The Lounge
jsonquestion
55 Posts 16 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.
  • L Lost User

    Whehe; the compiler accepts it - what trouble are you having with it, and what makes it unacceptable to you?

    Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

    C Offline
    C Offline
    Colborne_Greg
    wrote on last edited by
    #12

    Its valid code. Coding practices is the topic.

    P 1 Reply Last reply
    0
    • L Lost User

      System.Runtime.Serialization sucks.

      C Offline
      C Offline
      Colborne_Greg
      wrote on last edited by
      #13

      Indeed.

      1 Reply Last reply
      0
      • D Dave Kreskowiak

        I have yet to find a compiler that has to support and maintain the code it compiles.

        A guide to posting questions on CodeProject

        How to debug small programs
        Dave Kreskowiak

        C Offline
        C Offline
        Colborne_Greg
        wrote on last edited by
        #14

        Visual Studio 2013 for windows 8.1 apps

        D 1 Reply Last reply
        0
        • C Colborne_Greg

          For lazing about and discussing anything in a software developer's life that takes your fancy. The Lounge is rated PG. If you're about to post something you wouldn't want your kid sister to read then don't post it. No flame wars, no abusive conduct and please don't post ads. This tickles my fancy.

          Richard Andrew x64R Offline
          Richard Andrew x64R Offline
          Richard Andrew x64
          wrote on last edited by
          #15

          Colborne_Greg wrote:

          This tickles my fancy.

          You conveniently left out:

          Quote:

          Technical discussions are welcome, but if you need specific help please use the programming forums.

          The difficult we do right away... ...the impossible takes slightly longer.

          C 1 Reply Last reply
          0
          • Richard Andrew x64R Richard Andrew x64

            Colborne_Greg wrote:

            This tickles my fancy.

            You conveniently left out:

            Quote:

            Technical discussions are welcome, but if you need specific help please use the programming forums.

            The difficult we do right away... ...the impossible takes slightly longer.

            C Offline
            C Offline
            Colborne_Greg
            wrote on last edited by
            #16

            I DO NOT NEED HELP Quit behaving like you know what the fook is going on. THE QUESTION IS - is this an acceptable practice, please learn to read English before getting on my case.

            D J 2 Replies Last reply
            0
            • C Colborne_Greg

              Visual Studio 2013 for windows 8.1 apps

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #17

              And what does that have to do with what I said??

              A guide to posting questions on CodeProject

              How to debug small programs
              Dave Kreskowiak

              C 1 Reply Last reply
              0
              • C Colborne_Greg

                I DO NOT NEED HELP Quit behaving like you know what the fook is going on. THE QUESTION IS - is this an acceptable practice, please learn to read English before getting on my case.

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #18

                Your question will only get opinions for an answer. The answer all depends on who you ask. I hate it because it isn't explicit. It requires you to know how the compiler is going to behave.

                A guide to posting questions on CodeProject

                How to debug small programs
                Dave Kreskowiak

                C 1 Reply Last reply
                0
                • D Dave Kreskowiak

                  And what does that have to do with what I said??

                  A guide to posting questions on CodeProject

                  How to debug small programs
                  Dave Kreskowiak

                  C Offline
                  C Offline
                  Colborne_Greg
                  wrote on last edited by
                  #19

                  That's the compiler and libraries used for the code.

                  D 1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    Your question will only get opinions for an answer. The answer all depends on who you ask. I hate it because it isn't explicit. It requires you to know how the compiler is going to behave.

                    A guide to posting questions on CodeProject

                    How to debug small programs
                    Dave Kreskowiak

                    C Offline
                    C Offline
                    Colborne_Greg
                    wrote on last edited by
                    #20

                    It is only one line of code, broken into multiple lines via the _ character.

                    <System.Runtime.Serialization.DataMember>
                    Private mLastUpdated As DateTime, mLastUpdatedBy As String, mClearanceRequired As Int64, mClearanceIsRequired As Boolean

                    D 1 Reply Last reply
                    0
                    • C Colborne_Greg

                      That's the compiler and libraries used for the code.

                      D Offline
                      D Offline
                      Dave Kreskowiak
                      wrote on last edited by
                      #21

                      Considering I wasn't commenting on that at all, your post makes no sense. I was merely commenting that the compiler is never responsible for supporting the application, YOU are.

                      A guide to posting questions on CodeProject

                      How to debug small programs
                      Dave Kreskowiak

                      C 1 Reply Last reply
                      0
                      • C Colborne_Greg

                        It is only one line of code, broken into multiple lines via the _ character.

                        <System.Runtime.Serialization.DataMember>
                        Private mLastUpdated As DateTime, mLastUpdatedBy As String, mClearanceRequired As Int64, mClearanceIsRequired As Boolean

                        D Offline
                        D Offline
                        Dave Kreskowiak
                        wrote on last edited by
                        #22

                        So what? It seems like you're doing this and your looking for absolution from the community. Again, it's a matter of opinion and in a real environment with coding standards, what you've done may be outlawed.

                        A guide to posting questions on CodeProject

                        How to debug small programs
                        Dave Kreskowiak

                        C 1 Reply Last reply
                        0
                        • C Colborne_Greg

                          <System.Runtime.Serialization.DataMember>
                          Private mLastUpdated As DateTime, _
                          mLastUpdatedBy As String, _
                          mClearanceRequired As Int64, _
                          mClearanceIsRequired As Boolean

                          Visual basic code; class members for serialization - declaring a group of variables as data members.

                          F Offline
                          F Offline
                          Fabio Franco
                          wrote on last edited by
                          #23

                          I don't see any problem with it, as a matter of fact it actually reminds me of C++ member declaration.

                          To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson ---- Our heads are round so our thoughts can change direction - Francis Picabia

                          C 1 Reply Last reply
                          0
                          • C Colborne_Greg

                            <System.Runtime.Serialization.DataMember>
                            Private mLastUpdated As DateTime, _
                            mLastUpdatedBy As String, _
                            mClearanceRequired As Int64, _
                            mClearanceIsRequired As Boolean

                            Visual basic code; class members for serialization - declaring a group of variables as data members.

                            D Offline
                            D Offline
                            Dan Neely
                            wrote on last edited by
                            #24

                            "It is a vessel of fertilizer, and none may abide its strength."

                            Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

                            C 1 Reply Last reply
                            0
                            • C Colborne_Greg

                              <System.Runtime.Serialization.DataMember>
                              Private mLastUpdated As DateTime, _
                              mLastUpdatedBy As String, _
                              mClearanceRequired As Int64, _
                              mClearanceIsRequired As Boolean

                              Visual basic code; class members for serialization - declaring a group of variables as data members.

                              G Offline
                              G Offline
                              Gates VP
                              wrote on last edited by
                              #25

                              At a first glance, I find this confusing. In particular because the DataMember attribute actually accepts a constructor parameter. - So if I set the constructor parameter, which field does it apply to? - Likewise, if you want to switch out serializers and use something like Protocol Buffers this syntax simply won't translate. You would need to break out each one as the constructor is required. - On top of this all, there's a mixing of types. I'm not a big fan of the "multi-declaration" syntax, especially when it doesn't save any actual lines like this example. But there are some cases where it is useful. That stated, if you're mixing types on the "multi-declarations", it's time split them out. I wouldn't call this "unacceptable" practice, especially in the context of firing someone over this. I would however call this "non-standard" and "confusing" and ask that it be changed.

                              C F 2 Replies Last reply
                              0
                              • C Colborne_Greg

                                Its valid code. Coding practices is the topic.

                                P Offline
                                P Offline
                                patbob
                                wrote on last edited by
                                #26

                                Colborne_Greg wrote:

                                Coding practices is the topic

                                Coding practices are a form of communication to the next developer to assist them in their understanding of the code. There are no absolutes -- a syntax acceptable to one group might not be acceptable to another group. In general though, use of an oddball syntax in one place in the code is a poor practice. So, the only realistic answer to your question is "it depends". It depends on whether that's the common syntax used throughout the rest of the code, or an oddball one.

                                Colborne_Greg wrote:

                                Its valid code

                                I have three words by way of countering this line of thought: Obfuscated C Contest.

                                We can program with only 1's, but if all you've got are zeros, you've got nothing.

                                C 1 Reply Last reply
                                0
                                • P patbob

                                  Colborne_Greg wrote:

                                  Coding practices is the topic

                                  Coding practices are a form of communication to the next developer to assist them in their understanding of the code. There are no absolutes -- a syntax acceptable to one group might not be acceptable to another group. In general though, use of an oddball syntax in one place in the code is a poor practice. So, the only realistic answer to your question is "it depends". It depends on whether that's the common syntax used throughout the rest of the code, or an oddball one.

                                  Colborne_Greg wrote:

                                  Its valid code

                                  I have three words by way of countering this line of thought: Obfuscated C Contest.

                                  We can program with only 1's, but if all you've got are zeros, you've got nothing.

                                  C Offline
                                  C Offline
                                  Colborne_Greg
                                  wrote on last edited by
                                  #27

                                  I keep a common structure, thank you for a straight answer.

                                  1 Reply Last reply
                                  0
                                  • G Gates VP

                                    At a first glance, I find this confusing. In particular because the DataMember attribute actually accepts a constructor parameter. - So if I set the constructor parameter, which field does it apply to? - Likewise, if you want to switch out serializers and use something like Protocol Buffers this syntax simply won't translate. You would need to break out each one as the constructor is required. - On top of this all, there's a mixing of types. I'm not a big fan of the "multi-declaration" syntax, especially when it doesn't save any actual lines like this example. But there are some cases where it is useful. That stated, if you're mixing types on the "multi-declarations", it's time split them out. I wouldn't call this "unacceptable" practice, especially in the context of firing someone over this. I would however call this "non-standard" and "confusing" and ask that it be changed.

                                    C Offline
                                    C Offline
                                    Colborne_Greg
                                    wrote on last edited by
                                    #28

                                    This is what it looked like before

                                    <System.Runtime.Serialization.DataMember>
                                    Private mLastUpdated As DateTime

                                        <System.Runtime.Serialization.DataMember>
                                        Private mLastUpdatedBy As String
                                    
                                        <System.Runtime.Serialization.DataMember>
                                        Private mClearanceRequired As Int64
                                    
                                        <System.Runtime.Serialization.DataMember>
                                        Private mClearanceIsRequired As Boolean
                                    

                                    The first example I wrote, stands on in the document, where writing datamember so many times with the word private seems to be a waste of space.

                                    G D 2 Replies Last reply
                                    0
                                    • D Dan Neely

                                      "It is a vessel of fertilizer, and none may abide its strength."

                                      Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

                                      C Offline
                                      C Offline
                                      Colborne_Greg
                                      wrote on last edited by
                                      #29

                                      Refrain for abusive comments

                                      D 1 Reply Last reply
                                      0
                                      • F Fabio Franco

                                        I don't see any problem with it, as a matter of fact it actually reminds me of C++ member declaration.

                                        To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson ---- Our heads are round so our thoughts can change direction - Francis Picabia

                                        C Offline
                                        C Offline
                                        Colborne_Greg
                                        wrote on last edited by
                                        #30

                                        right on

                                        1 Reply Last reply
                                        0
                                        • D Dave Kreskowiak

                                          So what? It seems like you're doing this and your looking for absolution from the community. Again, it's a matter of opinion and in a real environment with coding standards, what you've done may be outlawed.

                                          A guide to posting questions on CodeProject

                                          How to debug small programs
                                          Dave Kreskowiak

                                          C Offline
                                          C Offline
                                          Colborne_Greg
                                          wrote on last edited by
                                          #31

                                          White space. It's more important to people. Also as a programmer if you do not understand how a compiler is going to handle your code, you might consider another profession.

                                          D 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