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. What sort of best practices coding do you use?

What sort of best practices coding do you use?

Scheduled Pinned Locked Moved The Lounge
comtoolsquestiondiscussioncode-review
43 Posts 26 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

    Do you/your company enforce best practices? Do you do code reviews to enforce them, or use FxCop or other automated means? If you don't adhere to any best practice document/utility, why not? Would you agree or disagree that most of us don't use coding best practices? Marc

    Thyme In The Country

    People are just notoriously impossible. --DavidCrow
    There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
    People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

    L D S A E 18 Replies Last reply
    0
    • M Marc Clifton

      Do you/your company enforce best practices? Do you do code reviews to enforce them, or use FxCop or other automated means? If you don't adhere to any best practice document/utility, why not? Would you agree or disagree that most of us don't use coding best practices? Marc

      Thyme In The Country

      People are just notoriously impossible. --DavidCrow
      There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
      People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

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

      Marc Clifton wrote:

      use coding best practices

      The best practive is not to allow crap coders near code. Seriously though, dont let crap coders near code. No, but seriously, if you have god engineers, who know their job and you can trust, you dont need any controll at all. Provided you test heavilly. Mind you, drivers are GUI less, with simple interfaces, that go wrong spectacularly. So they are kind of easy to test... Q: 'Did it BSOD yet today?' A: 'No' 'OK, it passed testing'

      Truth is the subjection of reality to an individuals perception

      V L 2 Replies Last reply
      0
      • L Lost User

        Marc Clifton wrote:

        use coding best practices

        The best practive is not to allow crap coders near code. Seriously though, dont let crap coders near code. No, but seriously, if you have god engineers, who know their job and you can trust, you dont need any controll at all. Provided you test heavilly. Mind you, drivers are GUI less, with simple interfaces, that go wrong spectacularly. So they are kind of easy to test... Q: 'Did it BSOD yet today?' A: 'No' 'OK, it passed testing'

        Truth is the subjection of reality to an individuals perception

        V Offline
        V Offline
        Vikram A Punathambekar
        wrote on last edited by
        #3

        fat_boy wrote:

        No, but seriously, if you have god engineers, who know their job and you can trust, you dont need any controll at all.

        ... if God were working for me, I would trust him all right. ;P

        Cheers, Vikram.


        "Life isn't fair, and the world is full of unscrupulous characters. There are things worth fighting for, killing for and dying for, but it's a really small list. Chalk it up to experience, let it go, and move on to the next positive experience in your life." - Christopher Duncan.

        L 2 Replies Last reply
        0
        • M Marc Clifton

          Do you/your company enforce best practices? Do you do code reviews to enforce them, or use FxCop or other automated means? If you don't adhere to any best practice document/utility, why not? Would you agree or disagree that most of us don't use coding best practices? Marc

          Thyme In The Country

          People are just notoriously impossible. --DavidCrow
          There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
          People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

          D Offline
          D Offline
          Dustin Metzgar
          wrote on last edited by
          #4

          I would agree most places don't have best practices.  Only one place I've worked at actually does code reviews and that was because they were using the agile programming methodology.  It would be nice to work at a place that actually does code reviews because I think it would make people think twice before putting in kludges or failing to comment complicated sections.


          Logifusion[^]

          M K 2 Replies Last reply
          0
          • V Vikram A Punathambekar

            fat_boy wrote:

            No, but seriously, if you have god engineers, who know their job and you can trust, you dont need any controll at all.

            ... if God were working for me, I would trust him all right. ;P

            Cheers, Vikram.


            "Life isn't fair, and the world is full of unscrupulous characters. There are things worth fighting for, killing for and dying for, but it's a really small list. Chalk it up to experience, let it go, and move on to the next positive experience in your life." - Christopher Duncan.

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

            I really hate this fucking keyboard...

            Truth is the subjection of reality to an individuals perception

            P 1 Reply Last reply
            0
            • M Marc Clifton

              Do you/your company enforce best practices? Do you do code reviews to enforce them, or use FxCop or other automated means? If you don't adhere to any best practice document/utility, why not? Would you agree or disagree that most of us don't use coding best practices? Marc

              Thyme In The Country

              People are just notoriously impossible. --DavidCrow
              There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
              People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

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

              Marc, it is very much like "quality control". The word "quality" is subjective meaning different things to different people. Of course, we all want the highest quality but not everybody is either prepared to pay the extra cost to ensure that quality or time factors do not allow extensive quality testing. In an ideal world you would insist on the very best quality testing procedures, the very best documentation regime, very best coding practices, AND have full and thorough post mortems. Alas, that ideal world don't really exist so you have to minimize any imperfections to an acceptable level - namely that with you can live with.

              M 1 Reply Last reply
              0
              • L Lost User

                Marc, it is very much like "quality control". The word "quality" is subjective meaning different things to different people. Of course, we all want the highest quality but not everybody is either prepared to pay the extra cost to ensure that quality or time factors do not allow extensive quality testing. In an ideal world you would insist on the very best quality testing procedures, the very best documentation regime, very best coding practices, AND have full and thorough post mortems. Alas, that ideal world don't really exist so you have to minimize any imperfections to an acceptable level - namely that with you can live with.

                M Offline
                M Offline
                Marc Clifton
                wrote on last edited by
                #7

                Richard A. Abbott wrote:

                Of course, we all want the highest quality

                Not necessarily. As you pointed out, there is a balance. But when it comes to quality, I've found that quality can be objective if you recognize that it is not a fixed, intangible goal, but rather a process of continual improvement. More like the way it's defined in TQM and ISO900?, document your current practices and pick something to improve, and repeat. Marc

                Thyme In The Country

                People are just notoriously impossible. --DavidCrow
                There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                L 1 Reply Last reply
                0
                • D Dustin Metzgar

                  I would agree most places don't have best practices.  Only one place I've worked at actually does code reviews and that was because they were using the agile programming methodology.  It would be nice to work at a place that actually does code reviews because I think it would make people think twice before putting in kludges or failing to comment complicated sections.


                  Logifusion[^]

                  M Offline
                  M Offline
                  Marc Clifton
                  wrote on last edited by
                  #8

                  Dustin Metzgar wrote:

                  It would be nice to work at a place that actually does code reviews because I think it would make people think twice before putting in kludges or failing to comment complicated sections.

                  I would like it because I feel like I would learn something. But then again, if one is in a position of constantly reviewing code from less senior people, and there really isn't anyone senior to oneself in experience, I guess that's where places like Code Project come in. :) Marc

                  Thyme In The Country

                  People are just notoriously impossible. --DavidCrow
                  There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                  People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                  E B 2 Replies Last reply
                  0
                  • V Vikram A Punathambekar

                    fat_boy wrote:

                    No, but seriously, if you have god engineers, who know their job and you can trust, you dont need any controll at all.

                    ... if God were working for me, I would trust him all right. ;P

                    Cheers, Vikram.


                    "Life isn't fair, and the world is full of unscrupulous characters. There are things worth fighting for, killing for and dying for, but it's a really small list. Chalk it up to experience, let it go, and move on to the next positive experience in your life." - Christopher Duncan.

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

                    Vikram A Punathambekar wrote:

                    if God were working for me, I would trust him all right.

                    Not me... remember He created both good[^] and evil[^]. ;P

                    "Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind." - Dr. Seuss

                    P 1 Reply Last reply
                    0
                    • M Marc Clifton

                      Do you/your company enforce best practices? Do you do code reviews to enforce them, or use FxCop or other automated means? If you don't adhere to any best practice document/utility, why not? Would you agree or disagree that most of us don't use coding best practices? Marc

                      Thyme In The Country

                      People are just notoriously impossible. --DavidCrow
                      There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                      People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                      S Offline
                      S Offline
                      Stuart Dootson
                      wrote on last edited by
                      #10

                      We're a C++ shop, mostly doing non-UI stuff. We tend to work to Herb Sutter and Alexei Alexandrescus C++ Coding Standards[^]. They are enforced through code review. I think we're the exception rather than the rule - and that's because we're an adjunct to a safety critical software team that works to DO178B level A, so has very stringent standards (we code safety-critical stuff with SPARK Ada[^]).

                      K 1 Reply Last reply
                      0
                      • M Marc Clifton

                        Richard A. Abbott wrote:

                        Of course, we all want the highest quality

                        Not necessarily. As you pointed out, there is a balance. But when it comes to quality, I've found that quality can be objective if you recognize that it is not a fixed, intangible goal, but rather a process of continual improvement. More like the way it's defined in TQM and ISO900?, document your current practices and pick something to improve, and repeat. Marc

                        Thyme In The Country

                        People are just notoriously impossible. --DavidCrow
                        There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                        People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

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

                        Marc Clifton wrote:

                        Richard A. Abbott wrote: Of course, we all want the highest quality Not necessarily

                        To strive for the highest quality must be the overriding driving force for any organisation. But this comes at odds with the concept "Value for Money". [Principle 4 of ISO9000 – risk assessment] Neither ISO9000 nor the BS EN 9000 defines a minimum standard of quality, they specify a structure for a quality management system, and this is a base framework from where to begin the quest for quality. The perception of quality, as I stated earlier, is subjective, subsequently, the management of quality is individual to an organisation. [Principle 4 and Principle 2 of ISO9000] The imposition of quality (or improved quality) from external entities (threats of the loss of marketplace position, threats to the loss of corporate confidence/credibility etc.) is usually the driving force. [Principle 6 and Principle 4 of ISO9000] You might also be interested to know of the existence of The British Quality Foundation [^],and they have an Excellence Model of the "5 P’s" – Purpose, Principles, People, Processes and Performance is also relevant and equates to ISO9000. And the BS EN 9000 is a full British Standard. So it shouldn't be just a case of "document your current practices and pick something to improve, and repeat", it has to be much more than that.

                        M 1 Reply Last reply
                        0
                        • M Marc Clifton

                          Do you/your company enforce best practices? Do you do code reviews to enforce them, or use FxCop or other automated means? If you don't adhere to any best practice document/utility, why not? Would you agree or disagree that most of us don't use coding best practices? Marc

                          Thyme In The Country

                          People are just notoriously impossible. --DavidCrow
                          There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                          People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                          A Offline
                          A Offline
                          Andy Brummer
                          wrote on last edited by
                          #12

                          We have turned on FxCop on a large existing code base, so we have thousands of failures that we are slowly getting under control. One of my previous jobs added code reviews and I really liked it. It was effective at improvin quality, and it was always a learning experience from both sides reviewee and reviewer.

                          Using the GridView is like trying to explain to someone else how to move a third person's hands in order to tie your shoelaces for you. -Chris Maunder

                          1 Reply Last reply
                          0
                          • M Marc Clifton

                            Dustin Metzgar wrote:

                            It would be nice to work at a place that actually does code reviews because I think it would make people think twice before putting in kludges or failing to comment complicated sections.

                            I would like it because I feel like I would learn something. But then again, if one is in a position of constantly reviewing code from less senior people, and there really isn't anyone senior to oneself in experience, I guess that's where places like Code Project come in. :) Marc

                            Thyme In The Country

                            People are just notoriously impossible. --DavidCrow
                            There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                            People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                            E Offline
                            E Offline
                            Ed K
                            wrote on last edited by
                            #13

                            Marc Clifton wrote:

                            I guess that's where places like Code Project come in

                            So we need a CodeReview forum!!

                            ed ~"Watch your thoughts; they become your words. Watch your words they become your actions. Watch your actions; they become your habits. Watch your habits; they become your character. Watch your character; it becomes your destiny." -Frank Outlaw.

                            B 1 Reply Last reply
                            0
                            • L Lost User

                              Marc Clifton wrote:

                              Richard A. Abbott wrote: Of course, we all want the highest quality Not necessarily

                              To strive for the highest quality must be the overriding driving force for any organisation. But this comes at odds with the concept "Value for Money". [Principle 4 of ISO9000 – risk assessment] Neither ISO9000 nor the BS EN 9000 defines a minimum standard of quality, they specify a structure for a quality management system, and this is a base framework from where to begin the quest for quality. The perception of quality, as I stated earlier, is subjective, subsequently, the management of quality is individual to an organisation. [Principle 4 and Principle 2 of ISO9000] The imposition of quality (or improved quality) from external entities (threats of the loss of marketplace position, threats to the loss of corporate confidence/credibility etc.) is usually the driving force. [Principle 6 and Principle 4 of ISO9000] You might also be interested to know of the existence of The British Quality Foundation [^],and they have an Excellence Model of the "5 P’s" – Purpose, Principles, People, Processes and Performance is also relevant and equates to ISO9000. And the BS EN 9000 is a full British Standard. So it shouldn't be just a case of "document your current practices and pick something to improve, and repeat", it has to be much more than that.

                              M Offline
                              M Offline
                              Marc Clifton
                              wrote on last edited by
                              #14

                              Richard A. Abbott wrote:

                              So it shouldn't be just a case of "document your current practices and pick something to improve, and repeat", it has to be much more than that.

                              Quite true. Thanks for the correction. And thanks for the ISO quotes. It's nice that someone else at least knows about this stuff. When I went through TQM training and the company I worked for was getting ISO9000 certified, it seemed like I was the only one that bought into the ideas. It met major resistance with the other engineers, but management was pushing it through so that they could sell their equipment in Europe (not without grumbling though, hehe). This was, oh, 14 years ago or so. Anyways, it changed how I thought about programming, and since then, I always try to put some thought into improving the quality of my own work. Being a one-man-shop, no, I don't document how I work. I ought too! Marc

                              Thyme In The Country

                              People are just notoriously impossible. --DavidCrow
                              There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                              People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                              1 Reply Last reply
                              0
                              • M Marc Clifton

                                Do you/your company enforce best practices? Do you do code reviews to enforce them, or use FxCop or other automated means? If you don't adhere to any best practice document/utility, why not? Would you agree or disagree that most of us don't use coding best practices? Marc

                                Thyme In The Country

                                People are just notoriously impossible. --DavidCrow
                                There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                                People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                                E Offline
                                E Offline
                                Ennis Ray Lynch Jr
                                wrote on last edited by
                                #15

                                Is one of the most misused issues in the field. Often best practices migrates into programming exactly like person X wants because person X is the boss and the justification is best practices. Deviation from "best" practices becomes an offense. And slowly the code migrates into an unmaintainable heap. But it doesn't matter, the project will be scrapped in a few years and a new guy can dictate "best" practices.


                                On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage

                                1 Reply Last reply
                                0
                                • M Marc Clifton

                                  Do you/your company enforce best practices? Do you do code reviews to enforce them, or use FxCop or other automated means? If you don't adhere to any best practice document/utility, why not? Would you agree or disagree that most of us don't use coding best practices? Marc

                                  Thyme In The Country

                                  People are just notoriously impossible. --DavidCrow
                                  There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                                  People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                                  _ Offline
                                  _ Offline
                                  _Zorro_
                                  wrote on last edited by
                                  #16

                                  We have to do peer reviews every 2 or 3 weeks and we must use FXCop. I have to admit I hated it in the first place, but it forces you to take the good habits. Now I actually could not use FXCop just because I learned how to do it "well" or at least compliant :~ . We are actually trying to get the third level of CMMi...

                                  1 Reply Last reply
                                  0
                                  • M Marc Clifton

                                    Dustin Metzgar wrote:

                                    It would be nice to work at a place that actually does code reviews because I think it would make people think twice before putting in kludges or failing to comment complicated sections.

                                    I would like it because I feel like I would learn something. But then again, if one is in a position of constantly reviewing code from less senior people, and there really isn't anyone senior to oneself in experience, I guess that's where places like Code Project come in. :) Marc

                                    Thyme In The Country

                                    People are just notoriously impossible. --DavidCrow
                                    There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                                    People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                                    B Offline
                                    B Offline
                                    bwhittington
                                    wrote on last edited by
                                    #17

                                    There is code review at the company I work for and it is good and bad. Almost everyone who does .Net programming is on a code review team. Each team is a mix of experienced senior level developers, mid-level developers, and then novices. This approach works well as everyone is learning from everyone else. However, it is detrimental in a way because each group looks at different items more closely than others and as a result application have more trouble meshing will with other applications than they should have. Also, there are two types of comments that code reviewers make. Critical items and recommended. A developer can choose to ignore recommended comments depending on how difficult or time consuming a change, or how lazy the programmer is. The critical items however can only be overturned by two managers. In ways, code review does slow down development but if done right, everyone learns from everyone else and applications follow a certain standard company wide.

                                    L 1 Reply Last reply
                                    0
                                    • L Lost User

                                      Marc Clifton wrote:

                                      use coding best practices

                                      The best practive is not to allow crap coders near code. Seriously though, dont let crap coders near code. No, but seriously, if you have god engineers, who know their job and you can trust, you dont need any controll at all. Provided you test heavilly. Mind you, drivers are GUI less, with simple interfaces, that go wrong spectacularly. So they are kind of easy to test... Q: 'Did it BSOD yet today?' A: 'No' 'OK, it passed testing'

                                      Truth is the subjection of reality to an individuals perception

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

                                      In-house crap coders - you can train them to do better. Out-sourced coders - there are too many variables. See earlier thread from Marc Clifton and my replies to him.

                                      G 1 Reply Last reply
                                      0
                                      • M Marc Clifton

                                        Do you/your company enforce best practices? Do you do code reviews to enforce them, or use FxCop or other automated means? If you don't adhere to any best practice document/utility, why not? Would you agree or disagree that most of us don't use coding best practices? Marc

                                        Thyme In The Country

                                        People are just notoriously impossible. --DavidCrow
                                        There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                                        People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                                        A Offline
                                        A Offline
                                        Allen Anderson
                                        wrote on last edited by
                                        #19

                                        we use most Microsoft best practices with a few exceptions. We put _ in front of class variables (among a few other things).

                                        1 Reply Last reply
                                        0
                                        • M Marc Clifton

                                          Do you/your company enforce best practices? Do you do code reviews to enforce them, or use FxCop or other automated means? If you don't adhere to any best practice document/utility, why not? Would you agree or disagree that most of us don't use coding best practices? Marc

                                          Thyme In The Country

                                          People are just notoriously impossible. --DavidCrow
                                          There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                                          People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                                          M Offline
                                          M Offline
                                          Michael P Butler
                                          wrote on last edited by
                                          #20

                                          Marc Clifton wrote:

                                          Do you/your company enforce best practices? Do you do code reviews to enforce them, or use FxCop or other automated means?

                                          Well I tried... I tried to get the company to adopt some best practises but I haven't met with much success. I work to my own guidelines for the stuff I write and whilst I can't code-review my own stuff, I do use FxCop where I can. I bet most of use don't fully use coding best practises. We all have our own ways of thinking about what is best which means we soon come into conflict with other people's defined best practises.

                                          Michael CP Blog [^] Development Blog [^]

                                          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