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. Other Discussions
  3. The Weird and The Wonderful
  4. How to make thing more complicated for nothing...

How to make thing more complicated for nothing...

Scheduled Pinned Locked Moved The Weird and The Wonderful
devopstutorial
29 Posts 17 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 Maximilien

    in the same header file, 5 lines apart.

    #define szSTATUS_DONE "D"
    #define cSTATUS_DONE 'D'

    they represent the same status (and values) (yeah, we use type prefix !! :-( )

    CI/CD = Continuous Impediment/Continuous Despair

    J Offline
    J Offline
    jschell
    wrote on last edited by
    #20

    I had to work on a code base with a static code checker enforcement. And if you used a 'constant' more than twice it would flag it. Static code checkers are absolutely worthless.

    T 1 Reply Last reply
    0
    • J jschell

      I had to work on a code base with a static code checker enforcement. And if you used a 'constant' more than twice it would flag it. Static code checkers are absolutely worthless.

      T Offline
      T Offline
      tronderen
      wrote on last edited by
      #21

      jschell wrote:

      Static code checkers are absolutely worthless.

      You must have encountered an (or several) really bad code checkers. Some of them are really good. On the other hand: The good ones are far from cheap. You get what you pay for. Also, all the ones I have been in touch with, from the very top down to simple lint, has provided mechanisms for suppressing reports on each specific 'defect'. I see no viable justification for treating >2 uses of constant as a defect, so I would disable that test immediately.

      Religious freedom is the freedom to say that two plus two make five.

      J 1 Reply Last reply
      0
      • M Mircea Neacsu

        Trust me, it's much worse when you go through your own's and go: "What was I thinking!" :laugh:

        Mircea

        A Offline
        A Offline
        aero smart
        wrote on last edited by
        #22

        thanks for your information

        1 Reply Last reply
        0
        • T tronderen

          jschell wrote:

          Static code checkers are absolutely worthless.

          You must have encountered an (or several) really bad code checkers. Some of them are really good. On the other hand: The good ones are far from cheap. You get what you pay for. Also, all the ones I have been in touch with, from the very top down to simple lint, has provided mechanisms for suppressing reports on each specific 'defect'. I see no viable justification for treating >2 uses of constant as a defect, so I would disable that test immediately.

          Religious freedom is the freedom to say that two plus two make five.

          J Offline
          J Offline
          jschell
          wrote on last edited by
          #23

          trønderen wrote:

          Some of them are really good

          None of them can be that good by their very nature. They can only look for simple problems. And that is only appropriate with a lot of junior programmers and with little, poor or non-existent code reviews. Often the problems are stylistic in nature as well. Complex real bugs originate from execution flow which static code checkers cannot detect at all.

          trønderen wrote:

          mechanisms for suppressing reports on each specific 'defect'.

          However they are put in place in the context of process. So people fixate on the process and will not allow that. As I have encountered multiple times. They fixate on the idea that it is 'better' without understanding what is going on.

          trønderen wrote:

          down to simple lint,

          I worked at hard core linux/unix C and C++ shops along with reading tech journals for years. And far as I recall no one ever considered lint to be a good idea.

          trønderen wrote:

          You get what you pay for.

          It was a paid product.

          K T Greg UtasG 3 Replies Last reply
          0
          • J jschell

            trønderen wrote:

            Some of them are really good

            None of them can be that good by their very nature. They can only look for simple problems. And that is only appropriate with a lot of junior programmers and with little, poor or non-existent code reviews. Often the problems are stylistic in nature as well. Complex real bugs originate from execution flow which static code checkers cannot detect at all.

            trønderen wrote:

            mechanisms for suppressing reports on each specific 'defect'.

            However they are put in place in the context of process. So people fixate on the process and will not allow that. As I have encountered multiple times. They fixate on the idea that it is 'better' without understanding what is going on.

            trønderen wrote:

            down to simple lint,

            I worked at hard core linux/unix C and C++ shops along with reading tech journals for years. And far as I recall no one ever considered lint to be a good idea.

            trønderen wrote:

            You get what you pay for.

            It was a paid product.

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

            To me, it seems obvious that you never have been in touch with a high quality static code analyzer. It also sounds like you most likely would turn down an offer to try a good one, because you know in advance that no good analyzers can exist. So it is a waste of time. You are in your full right to think so. I am in my full right to disagree with you.

            1 Reply Last reply
            0
            • J jschell

              trønderen wrote:

              Some of them are really good

              None of them can be that good by their very nature. They can only look for simple problems. And that is only appropriate with a lot of junior programmers and with little, poor or non-existent code reviews. Often the problems are stylistic in nature as well. Complex real bugs originate from execution flow which static code checkers cannot detect at all.

              trønderen wrote:

              mechanisms for suppressing reports on each specific 'defect'.

              However they are put in place in the context of process. So people fixate on the process and will not allow that. As I have encountered multiple times. They fixate on the idea that it is 'better' without understanding what is going on.

              trønderen wrote:

              down to simple lint,

              I worked at hard core linux/unix C and C++ shops along with reading tech journals for years. And far as I recall no one ever considered lint to be a good idea.

              trønderen wrote:

              You get what you pay for.

              It was a paid product.

              T Offline
              T Offline
              tronderen
              wrote on last edited by
              #25

              jschell wrote:

              None of them can be that good by their very nature. They can only look for simple problems.

              It seems quite obvious to me that you have never been introduced to a high quality static analyzer. It seems to me that if you were offered an opportunity to try out an advanced code analyzer you might reject it as a waste of time, because you know in advance that such animals do not exist. You are in your full right to think so. And I am in my full right to disagree with you.

              Religious freedom is the freedom to say that two plus two make five.

              J 1 Reply Last reply
              0
              • J jschell

                trønderen wrote:

                Some of them are really good

                None of them can be that good by their very nature. They can only look for simple problems. And that is only appropriate with a lot of junior programmers and with little, poor or non-existent code reviews. Often the problems are stylistic in nature as well. Complex real bugs originate from execution flow which static code checkers cannot detect at all.

                trønderen wrote:

                mechanisms for suppressing reports on each specific 'defect'.

                However they are put in place in the context of process. So people fixate on the process and will not allow that. As I have encountered multiple times. They fixate on the idea that it is 'better' without understanding what is going on.

                trønderen wrote:

                down to simple lint,

                I worked at hard core linux/unix C and C++ shops along with reading tech journals for years. And far as I recall no one ever considered lint to be a good idea.

                trønderen wrote:

                You get what you pay for.

                It was a paid product.

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

                jschell wrote:

                Often the problems are stylistic in nature as well.

                It must be possible to disable a lot of the warnings about "code smells" based on things like the C++ Core Guidelines and MISRA. Some of these act as if everyone started development inh C++20, exaggerate their importance, and lead to so many warnings as to make the tool useless. As you say, it gets out of hand if people focus on process--the metrics that these tools spit out--without assessing whether the code really needs to change.

                jschell wrote:

                Complex real bugs originate from execution flow which static code checkers cannot detect at all.

                Coverity and Sonarcloud both highlight execution flows that could lead to the use of a null pointer. For example, they'll tell you that if the following 6 branches are taken, you could end up using an invalid pointer. In some cases, they even detect it across a chain of function calls. Perhaps you don't call this static analysis, because it actually analyzes execution flows, but both of these are classified as static analysis tools. Some warnings can be false positives for reasons that the tool can't understand, but they're worth investigating.

                Robust Services Core | Software Techniques for Lemmings | Articles
                The fox knows many things, but the hedgehog knows one big thing.

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

                J 1 Reply Last reply
                0
                • T tronderen

                  jschell wrote:

                  None of them can be that good by their very nature. They can only look for simple problems.

                  It seems quite obvious to me that you have never been introduced to a high quality static analyzer. It seems to me that if you were offered an opportunity to try out an advanced code analyzer you might reject it as a waste of time, because you know in advance that such animals do not exist. You are in your full right to think so. And I am in my full right to disagree with you.

                  Religious freedom is the freedom to say that two plus two make five.

                  J Offline
                  J Offline
                  jschell
                  wrote on last edited by
                  #27

                  trønderen wrote:

                  that you have never been introduced to a high quality static analyzer.

                  Perhaps. You can suggest one if you wish. I have however, as a principle programmer, been tasked with fixing many bugs which have shown up in production and none of which a static analyzer could have detected.

                  1 Reply Last reply
                  0
                  • Greg UtasG Greg Utas

                    jschell wrote:

                    Often the problems are stylistic in nature as well.

                    It must be possible to disable a lot of the warnings about "code smells" based on things like the C++ Core Guidelines and MISRA. Some of these act as if everyone started development inh C++20, exaggerate their importance, and lead to so many warnings as to make the tool useless. As you say, it gets out of hand if people focus on process--the metrics that these tools spit out--without assessing whether the code really needs to change.

                    jschell wrote:

                    Complex real bugs originate from execution flow which static code checkers cannot detect at all.

                    Coverity and Sonarcloud both highlight execution flows that could lead to the use of a null pointer. For example, they'll tell you that if the following 6 branches are taken, you could end up using an invalid pointer. In some cases, they even detect it across a chain of function calls. Perhaps you don't call this static analysis, because it actually analyzes execution flows, but both of these are classified as static analysis tools. Some warnings can be false positives for reasons that the tool can't understand, but they're worth investigating.

                    Robust Services Core | Software Techniques for Lemmings | Articles
                    The fox knows many things, but the hedgehog knows one big thing.

                    J Offline
                    J Offline
                    jschell
                    wrote on last edited by
                    #28

                    Greg Utas wrote:

                    Perhaps you don't call this static analysis,

                    I do.

                    Greg Utas wrote:

                    they even detect it across a chain of function calls

                    That I have not seen. Unclear if the tool did not look of if they did not exist.

                    1 Reply Last reply
                    0
                    • M Mircea Neacsu

                      Trust me, it's much worse when you go through your own's and go: "What was I thinking!" :laugh:

                      Mircea

                      M Offline
                      M Offline
                      Member 16171156
                      wrote on last edited by
                      #29

                      Things get complicated when we are not able to understand them clearly. The other possible reason can be Overthinking, which exaggerates a simple situation and makes it appear worse. A person ends up imagining certain situations which in reality won't happen.

                      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