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 counts for bad code? finding its level...... [modified]

what counts for bad code? finding its level...... [modified]

Scheduled Pinned Locked Moved The Lounge
cssquestion
26 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.
  • L Lost User

    How do u measure the level of bad code? A bad code is tough to understand or maintain...or one that doesnt work as intended.... or is made more personal by programmer..... How do u rate it as bad..... from 1 to 10 less severe to intense......?

    Ravie Busie Coding is my birth-right and bugs are part of feature my code has!

    modified on Tuesday, September 8, 2009 10:34 AM

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

    Well, as far as understandability and maintainability are concerned try running some code metrics over any piece of code you see. I use a tool that displays real-time cyclomatic and maintenance complexity (dynamically updated as you type). Low figures won't necessarily indicate good code but high figures definitely indicate bad code, at least with respect to understandability and maintainability. (The code might otherwise be correct and performant for all I know.)

    Kevin

    L 1 Reply Last reply
    0
    • K Kevin McFarlane

      Well, as far as understandability and maintainability are concerned try running some code metrics over any piece of code you see. I use a tool that displays real-time cyclomatic and maintenance complexity (dynamically updated as you type). Low figures won't necessarily indicate good code but high figures definitely indicate bad code, at least with respect to understandability and maintainability. (The code might otherwise be correct and performant for all I know.)

      Kevin

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

      consider for example: all programmers write as per standards, use proper css for looks, use proper logic, even then code is said to be bad, when some change so called big changes of scalability, or increase in users or feature rich functionality add-on........ code is always blamed to be badly written over a period of time. is readability of code measure of time....or there are techniques to help ur self with better coding.....?

      Ravie Busie Coding is my birth-right and bugs are part of feature my code has!

      K 1 Reply Last reply
      0
      • L Lost User

        consider for example: all programmers write as per standards, use proper css for looks, use proper logic, even then code is said to be bad, when some change so called big changes of scalability, or increase in users or feature rich functionality add-on........ code is always blamed to be badly written over a period of time. is readability of code measure of time....or there are techniques to help ur self with better coding.....?

        Ravie Busie Coding is my birth-right and bugs are part of feature my code has!

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

        Ravi Sant wrote:

        when some change so called big changes of scalability, or increase in users or feature rich functionality add-on........ code is always blamed to be badly written over a period of time.

        The best thing to do is to apply a code metrics tool every so often. If the numbers are bad then do some refactoring. However, this depends on the context, e.g., how much time and freedom you have for refactoring, whether the code base has unit tests so you can perform it more safely and so on. It's also easier to do refactoring with the help of software such as ReSharper or Refactor! Though, as always, you still need to keep your brain engaged. A few years ago I was specifically assigned a bug fix, feature enhancement and refactoring project. So I was able to apply a code metrics tool and then refactor until the bar charts decreased sufficiently. :)

        Kevin

        1 Reply Last reply
        0
        • D Dan_Martin

          Clearly the decision to fully qualify the names was taken after the comment was written and possibly done automatically.

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #16

          That would make sense. A very simple vowel search in the algorithm would have prevented it - but heigh ho, that's probably why I don't work for MS.

          Dave
          Generic BackgroundWorker - My latest article!
          BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
          Why are you using VB6? Do you hate yourself? (Christian Graus)

          1 Reply Last reply
          0
          • L Lost User

            How do u measure the level of bad code? A bad code is tough to understand or maintain...or one that doesnt work as intended.... or is made more personal by programmer..... How do u rate it as bad..... from 1 to 10 less severe to intense......?

            Ravie Busie Coding is my birth-right and bugs are part of feature my code has!

            modified on Tuesday, September 8, 2009 10:34 AM

            R Offline
            R Offline
            Rage
            wrote on last edited by
            #17

            Here you go[^]

            L 1 Reply Last reply
            0
            • R Rage

              Here you go[^]

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

              :laugh:

              Ravie Busie Coding is my birth-right and bugs are part of feature my code has!

              1 Reply Last reply
              0
              • OriginalGriffO OriginalGriff

                See TWOTD just above this thread, search for 502. That's the difference between good and bad code!

                No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

                Z Offline
                Z Offline
                Zhat
                wrote on last edited by
                #19

                Beat me to it...8-)

                1 Reply Last reply
                0
                • L Lost User

                  How do u measure the level of bad code? A bad code is tough to understand or maintain...or one that doesnt work as intended.... or is made more personal by programmer..... How do u rate it as bad..... from 1 to 10 less severe to intense......?

                  Ravie Busie Coding is my birth-right and bugs are part of feature my code has!

                  modified on Tuesday, September 8, 2009 10:34 AM

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

                  Ravi Sant wrote:

                  how do u rate it as bad..... from 1 to 10

                  Bad when:

                  Ravi Sant wrote:

                  bugs are part of feature my code has

                  Good When: Bugs are not feature and are not a part of the code.

                  1 Reply Last reply
                  0
                  • L Lost User

                    How do u measure the level of bad code? A bad code is tough to understand or maintain...or one that doesnt work as intended.... or is made more personal by programmer..... How do u rate it as bad..... from 1 to 10 less severe to intense......?

                    Ravie Busie Coding is my birth-right and bugs are part of feature my code has!

                    modified on Tuesday, September 8, 2009 10:34 AM

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

                    Code is only bad if it needs to be touched after it's been written. And then, any code is bad. ;) Marc

                    Will work for food. Interacx

                    I'm not overthinking the problem, I just felt like I needed a small, unimportant, uninteresting rant! - Martin Hart Turner

                    1 Reply Last reply
                    0
                    • L Lost User

                      How do u measure the level of bad code? A bad code is tough to understand or maintain...or one that doesnt work as intended.... or is made more personal by programmer..... How do u rate it as bad..... from 1 to 10 less severe to intense......?

                      Ravie Busie Coding is my birth-right and bugs are part of feature my code has!

                      modified on Tuesday, September 8, 2009 10:34 AM

                      F Offline
                      F Offline
                      Fatbuddha 1
                      wrote on last edited by
                      #22

                      here you see :laugh: Cheers

                      You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)

                      1 Reply Last reply
                      0
                      • L Lost User

                        How do u measure the level of bad code? A bad code is tough to understand or maintain...or one that doesnt work as intended.... or is made more personal by programmer..... How do u rate it as bad..... from 1 to 10 less severe to intense......?

                        Ravie Busie Coding is my birth-right and bugs are part of feature my code has!

                        modified on Tuesday, September 8, 2009 10:34 AM

                        M Offline
                        M Offline
                        Mark_Wallace
                        wrote on last edited by
                        #23

                        I wish I'd found this thread earlier. I'd have started a sweepstakes on the first person to mention braces.

                        I wanna be a eunuchs developer! Pass me a bread knife!

                        L 1 Reply Last reply
                        0
                        • M Mark_Wallace

                          I wish I'd found this thread earlier. I'd have started a sweepstakes on the first person to mention braces.

                          I wanna be a eunuchs developer! Pass me a bread knife!

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

                          That's suspenders to you in the good ol' US of A. Not sure about Canadians though...

                          1 Reply Last reply
                          0
                          • D DaveyM69

                            Dario Solera wrote:

                            code that contains grammar errors in comments.

                            I came across one of these the other day from MS in all the OnEvent methods in the BackgroundWorker (C# at least), for the e parameter: "An System.EventArgs that contains the event data."

                            Dave
                            Generic BackgroundWorker - My latest article!
                            BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
                            Why are you using VB6? Do you hate yourself? (Christian Graus)

                            P Offline
                            P Offline
                            PIEBALDconsult
                            wrote on last edited by
                            #25

                            "System." is silent.

                            D 1 Reply Last reply
                            0
                            • P PIEBALDconsult

                              "System." is silent.

                              D Offline
                              D Offline
                              DaveyM69
                              wrote on last edited by
                              #26

                              Ah... it all makes sense now. English - UK English - US English - MS :laugh:

                              Dave
                              Generic BackgroundWorker - My latest article!
                              BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
                              Why are you using VB6? Do you hate yourself? (Christian Graus)

                              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