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. ok what are the rules

ok what are the rules

Scheduled Pinned Locked Moved The Lounge
tutorial
238 Posts 34 Posters 345 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.
  • A Offline
    A Offline
    Amar Chaudhary
    wrote on last edited by
    #1

    there were few discussions about rules for programming few days ago i am working in a company which is newly started and only two programmers there and no one to guide except CP so what are the rules which you follow and think i should also follow :):)

    K R 1 L M 18 Replies Last reply
    0
    • A Amar Chaudhary

      there were few discussions about rules for programming few days ago i am working in a company which is newly started and only two programmers there and no one to guide except CP so what are the rules which you follow and think i should also follow :):)

      K Offline
      K Offline
      Kevin McFarlane
      wrote on last edited by
      #2

      Buy a copy of Steve McConnell's Code Complete for the office. Depending on what languages you're using look up the recommended style and/or practices guides on the web. E.g., for .NET this would be MS's Design Guidelines for Class Library Developers in the MSDN library. Though I don't think this has been updated for .NET 2.

      Kevin

      A L J 3 Replies Last reply
      0
      • K Kevin McFarlane

        Buy a copy of Steve McConnell's Code Complete for the office. Depending on what languages you're using look up the recommended style and/or practices guides on the web. E.g., for .NET this would be MS's Design Guidelines for Class Library Developers in the MSDN library. Though I don't think this has been updated for .NET 2.

        Kevin

        A Offline
        A Offline
        Amar Chaudhary
        wrote on last edited by
        #3

        i am using c# .net with directx

        1 Reply Last reply
        0
        • A Amar Chaudhary

          there were few discussions about rules for programming few days ago i am working in a company which is newly started and only two programmers there and no one to guide except CP so what are the rules which you follow and think i should also follow :):)

          R Offline
          R Offline
          Rama Krishna Vavilala
          wrote on last edited by
          #4

          As Kevin stated Code Complete is a must read. For C# and .NET one should read the Framework Design Guidelines book by Brad Abrams and Krystzof Cwalina. Design Patterns book is also a must read. Steve McConnell's code complete book has a list of books that developers should read depending on their levels. I think that is a great list (except few of the books are not in print). There is also this article by Joel: 12 Steps to Better Code [^]


          Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan

          K A D 3 Replies Last reply
          0
          • R Rama Krishna Vavilala

            As Kevin stated Code Complete is a must read. For C# and .NET one should read the Framework Design Guidelines book by Brad Abrams and Krystzof Cwalina. Design Patterns book is also a must read. Steve McConnell's code complete book has a list of books that developers should read depending on their levels. I think that is a great list (except few of the books are not in print). There is also this article by Joel: 12 Steps to Better Code [^]


            Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan

            K Offline
            K Offline
            Kevin McFarlane
            wrote on last edited by
            #5

            Rama Krishna Vavilala wrote:

            There is also this article by Joel: 12 Steps to Better Code

            Re: No. 8 I've never worked in a quiet environment (unfortunately).

            Kevin

            R 1 Reply Last reply
            0
            • A Amar Chaudhary

              there were few discussions about rules for programming few days ago i am working in a company which is newly started and only two programmers there and no one to guide except CP so what are the rules which you follow and think i should also follow :):)

              1 Offline
              1 Offline
              123 0
              wrote on last edited by
              #6

              Amar Chaudhary wrote:

              what are the rules which you follow and think i should also follow

              Here are a few things that have worked for us, and that you probably won't hear from anyone else: The programmers should work as a team on a single computer with dual monitors, keyboards, and mice. They should take turns leading and following. The leader gets the mouse; the other types in the appropriate code. They should test as often as possible, typically every ten lines of code (or so). They should start each day with a review of the code, looking very hard for things to delete. Less is more. No new code until something old has been removed, consolidated, or otherwise improved. They should avoid nested IFs and nested LOOPs. They should avoid the wanton use of dialogs, and minimize the number of controls on any interface. But before they begin, they should get a copy of DarkBasic and play with it as an illustration of an alternate use of the DirectX libraries. Then they should read Wirth's Oberon book as an example of alternate interfaces and efficiency in design and implementation. Finally, they should get the Plain English development system and work their way through it to further broaden their thinking.

              J K P A M 6 Replies Last reply
              0
              • K Kevin McFarlane

                Rama Krishna Vavilala wrote:

                There is also this article by Joel: 12 Steps to Better Code

                Re: No. 8 I've never worked in a quiet environment (unfortunately).

                Kevin

                R Offline
                R Offline
                Rama Krishna Vavilala
                wrote on last edited by
                #7

                You are not alone.


                Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan

                J 1 Reply Last reply
                0
                • 1 123 0

                  Amar Chaudhary wrote:

                  what are the rules which you follow and think i should also follow

                  Here are a few things that have worked for us, and that you probably won't hear from anyone else: The programmers should work as a team on a single computer with dual monitors, keyboards, and mice. They should take turns leading and following. The leader gets the mouse; the other types in the appropriate code. They should test as often as possible, typically every ten lines of code (or so). They should start each day with a review of the code, looking very hard for things to delete. Less is more. No new code until something old has been removed, consolidated, or otherwise improved. They should avoid nested IFs and nested LOOPs. They should avoid the wanton use of dialogs, and minimize the number of controls on any interface. But before they begin, they should get a copy of DarkBasic and play with it as an illustration of an alternate use of the DirectX libraries. Then they should read Wirth's Oberon book as an example of alternate interfaces and efficiency in design and implementation. Finally, they should get the Plain English development system and work their way through it to further broaden their thinking.

                  J Offline
                  J Offline
                  Jorgen Sigvardsson
                  wrote on last edited by
                  #8

                  I wish I had a door I could slam in your face.

                  -- Please rise for the Futurama theme song

                  R 1 P N 4 Replies Last reply
                  0
                  • J Jorgen Sigvardsson

                    I wish I had a door I could slam in your face.

                    -- Please rise for the Futurama theme song

                    R Offline
                    R Offline
                    Rama Krishna Vavilala
                    wrote on last edited by
                    #9

                    BTW I like all of his points except the last one. For a moment I thought that he was reformed.


                    Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan

                    A 1 A 4 Replies Last reply
                    0
                    • 1 123 0

                      Amar Chaudhary wrote:

                      what are the rules which you follow and think i should also follow

                      Here are a few things that have worked for us, and that you probably won't hear from anyone else: The programmers should work as a team on a single computer with dual monitors, keyboards, and mice. They should take turns leading and following. The leader gets the mouse; the other types in the appropriate code. They should test as often as possible, typically every ten lines of code (or so). They should start each day with a review of the code, looking very hard for things to delete. Less is more. No new code until something old has been removed, consolidated, or otherwise improved. They should avoid nested IFs and nested LOOPs. They should avoid the wanton use of dialogs, and minimize the number of controls on any interface. But before they begin, they should get a copy of DarkBasic and play with it as an illustration of an alternate use of the DirectX libraries. Then they should read Wirth's Oberon book as an example of alternate interfaces and efficiency in design and implementation. Finally, they should get the Plain English development system and work their way through it to further broaden their thinking.

                      K Offline
                      K Offline
                      Kevin McFarlane
                      wrote on last edited by
                      #10

                      The Grand Negus wrote:

                      They should avoid nested IFs and nested LOOPs.

                      Quite harsh but I agree we should avoid deep nesting (McConnell suggess no deeper than 3). But in my experience almost no-one does.

                      Kevin

                      1 1 Reply Last reply
                      0
                      • J Jorgen Sigvardsson

                        I wish I had a door I could slam in your face.

                        -- Please rise for the Futurama theme song

                        1 Offline
                        1 Offline
                        123 0
                        wrote on last edited by
                        #11

                        Joergen Sigvardsson wrote:

                        I wish I had a door I could slam in your face.

                        Why? Is it a bad idea for programmers to work together? To test frequently? To simplify and consolidate existing code before adding more? To avoid unnecessarily complex structures and techniques? To strive for simple, easy-to-use interfaces? To be exposed to alternate ideas and ways of doing things?

                        1 Reply Last reply
                        0
                        • R Rama Krishna Vavilala

                          BTW I like all of his points except the last one. For a moment I thought that he was reformed.


                          Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan

                          A Offline
                          A Offline
                          Amar Chaudhary
                          wrote on last edited by
                          #12

                          Rama Krishna Vavilala wrote:

                          For a moment I thought that he was reformed.

                          Me too

                          1 Reply Last reply
                          0
                          • K Kevin McFarlane

                            The Grand Negus wrote:

                            They should avoid nested IFs and nested LOOPs.

                            Quite harsh but I agree we should avoid deep nesting (McConnell suggess no deeper than 3). But in my experience almost no-one does.

                            Kevin

                            1 Offline
                            1 Offline
                            123 0
                            wrote on last edited by
                            #13

                            Kevin McFarlane wrote:

                            Quite harsh but I agree we should avoid deep nesting (McConnell suggess no deeper than 3). But in my experience almost no-one does.

                            Agreed; almost no-one does. But we do, and we've found it a good idea to do so. And we've written significant programs with no nesting at all to prove the point. We believe it (1) streamlines the design, (2) increases readability, and (3) improves reliability.

                            S K 2 Replies Last reply
                            0
                            • R Rama Krishna Vavilala

                              BTW I like all of his points except the last one. For a moment I thought that he was reformed.


                              Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan

                              1 Offline
                              1 Offline
                              123 0
                              wrote on last edited by
                              #14

                              Rama Krishna Vavilala wrote:

                              BTW I like all of his points except the last one. For a moment I thought that he was reformed.

                              But what's wrong with the last one? Since the project involves DirectX, why not take a peek at DarkBasic and see what they've done with it? And no one can deny that Wirth doesn't know his stuff and is worth reading - especially when such a compact example of his mature work is readily available. And since the Plain English development system is the only program I know that illustrates not only the desirability but the feasibility of eliminating nested IFs, LOOPs, and spurious widgets, why not recommend it? It's an excellent example of thinking "outside the box" that can't be found elsewhere.

                              M 1 Reply Last reply
                              0
                              • R Rama Krishna Vavilala

                                BTW I like all of his points except the last one. For a moment I thought that he was reformed.


                                Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan

                                1 Offline
                                1 Offline
                                123 0
                                wrote on last edited by
                                #15

                                It's curious that you quote Kernighan in your signature. Take a moment to review a list of his ideals for programming languages as found, say, in early writings on "C", and then ask yourself whether our Plain English system is closer to satisfying those ideals, or whether something like C# plus managed DirectX is...

                                1 Reply Last reply
                                0
                                • A Amar Chaudhary

                                  there were few discussions about rules for programming few days ago i am working in a company which is newly started and only two programmers there and no one to guide except CP so what are the rules which you follow and think i should also follow :):)

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

                                  Consider reading this http://www.netobjectives.com/download/Code%20Qualities%20and%20Practices.pdf[^]

                                  K P 2 Replies Last reply
                                  0
                                  • A Amar Chaudhary

                                    there were few discussions about rules for programming few days ago i am working in a company which is newly started and only two programmers there and no one to guide except CP so what are the rules which you follow and think i should also follow :):)

                                    1 Offline
                                    1 Offline
                                    123 0
                                    wrote on last edited by
                                    #17

                                    Amar Chaudhary wrote:

                                    so what are the rules which you follow and think i should also follow

                                    Sorry, forgot one - a very important one: Abandon the "object oriented" way of thinking and write the thing, as much as possible (with the language you've chosen), as traditional procedural code. Keep your nouns (data definitions) and your verbs (operations on those nouns) separate.

                                    P J E 3 Replies Last reply
                                    0
                                    • J Jorgen Sigvardsson

                                      I wish I had a door I could slam in your face.

                                      -- Please rise for the Futurama theme song

                                      P Offline
                                      P Offline
                                      Paul Conrad
                                      wrote on last edited by
                                      #18

                                      Joergen Sigvardsson wrote:

                                      I wish I had a door I could slam in your face.

                                      :laugh:

                                      1 Reply Last reply
                                      0
                                      • 1 123 0

                                        Amar Chaudhary wrote:

                                        what are the rules which you follow and think i should also follow

                                        Here are a few things that have worked for us, and that you probably won't hear from anyone else: The programmers should work as a team on a single computer with dual monitors, keyboards, and mice. They should take turns leading and following. The leader gets the mouse; the other types in the appropriate code. They should test as often as possible, typically every ten lines of code (or so). They should start each day with a review of the code, looking very hard for things to delete. Less is more. No new code until something old has been removed, consolidated, or otherwise improved. They should avoid nested IFs and nested LOOPs. They should avoid the wanton use of dialogs, and minimize the number of controls on any interface. But before they begin, they should get a copy of DarkBasic and play with it as an illustration of an alternate use of the DirectX libraries. Then they should read Wirth's Oberon book as an example of alternate interfaces and efficiency in design and implementation. Finally, they should get the Plain English development system and work their way through it to further broaden their thinking.

                                        P Offline
                                        P Offline
                                        Paul Conrad
                                        wrote on last edited by
                                        #19

                                        The Grand Negus wrote:

                                        programmers should work as a team on a single computer

                                        Ah, pair programming. Sometimes two pairs of eyes are better than one :)

                                        1 Reply Last reply
                                        0
                                        • 1 123 0

                                          Amar Chaudhary wrote:

                                          so what are the rules which you follow and think i should also follow

                                          Sorry, forgot one - a very important one: Abandon the "object oriented" way of thinking and write the thing, as much as possible (with the language you've chosen), as traditional procedural code. Keep your nouns (data definitions) and your verbs (operations on those nouns) separate.

                                          P Offline
                                          P Offline
                                          Paul Conrad
                                          wrote on last edited by
                                          #20

                                          The Grand Negus wrote:

                                          Abandon the "object oriented" way of thinking and write the thing, as much as possible (with the language you've chosen), as traditional procedural code.

                                          Nope, I don't think so.


                                          If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa

                                          1 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