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. Linter?

Linter?

Scheduled Pinned Locked Moved The Lounge
questionhelptutorial
54 Posts 18 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.
  • K Kevin Marois

    Just curious, how many of you have heard of & used Linter? [What Is a Linter? Here's a Definition and Quick-Start Guide](https://www.testim.io/blog/what-is-a-linter-heres-a-definition-and-quick-start-guide/)

    If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

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

    Static analysis tools do not provide any value in modern programming. When they were first invented compilers had almost zero effective error reporting so using a second tool with pattern matching to find those before compilation seemed like a good idea. The authors or companies pushing them often claim benefits that do not exist. Bugs in software which are actually significant, where significant means costing time (and thus money) to fix come from logic errors and system errors which static analysis tools cannot identify by their very nature. Adherence to static analyzers can actually end up creating code that is not as easy to maintain and even end up introducing bugs. This happens when developers just try anything to get it to pass. The argument proponents make about that problem is that developers should be more diligent. But of course the same argument applies to why one might claim that a static analyzer is a good idea in the first place. Why are those very same diligent developers being nit-picked in the first place?

    K M J C 4 Replies Last reply
    0
    • J jschell

      Static analysis tools do not provide any value in modern programming. When they were first invented compilers had almost zero effective error reporting so using a second tool with pattern matching to find those before compilation seemed like a good idea. The authors or companies pushing them often claim benefits that do not exist. Bugs in software which are actually significant, where significant means costing time (and thus money) to fix come from logic errors and system errors which static analysis tools cannot identify by their very nature. Adherence to static analyzers can actually end up creating code that is not as easy to maintain and even end up introducing bugs. This happens when developers just try anything to get it to pass. The argument proponents make about that problem is that developers should be more diligent. But of course the same argument applies to why one might claim that a static analyzer is a good idea in the first place. Why are those very same diligent developers being nit-picked in the first place?

      K Offline
      K Offline
      Kevin Marois
      wrote on last edited by
      #9

      From what I can see, all we're using it for is ensuring code formatting is correct. So now I have to go back and remove extra lines, or empty spaces at the end of line, etc. Seems like a real time waster to me

      If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

      Greg UtasG H 2 Replies Last reply
      0
      • Greg UtasG Greg Utas

        I developed at C++ static analysis tool[^] that I regularly use on my code.

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

        J Offline
        J Offline
        jmaida
        wrote on last edited by
        #10

        I'll check this out.

        "A little time, a little trouble, your better day" Badfinger

        1 Reply Last reply
        0
        • K Kevin Marois

          From what I can see, all we're using it for is ensuring code formatting is correct. So now I have to go back and remove extra lines, or empty spaces at the end of line, etc. Seems like a real time waster to me

          If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

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

          Could be, but those kind of things can point to sloppiness that is more problematic.

          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>

          1 Reply Last reply
          0
          • J jschell

            Static analysis tools do not provide any value in modern programming. When they were first invented compilers had almost zero effective error reporting so using a second tool with pattern matching to find those before compilation seemed like a good idea. The authors or companies pushing them often claim benefits that do not exist. Bugs in software which are actually significant, where significant means costing time (and thus money) to fix come from logic errors and system errors which static analysis tools cannot identify by their very nature. Adherence to static analyzers can actually end up creating code that is not as easy to maintain and even end up introducing bugs. This happens when developers just try anything to get it to pass. The argument proponents make about that problem is that developers should be more diligent. But of course the same argument applies to why one might claim that a static analyzer is a good idea in the first place. Why are those very same diligent developers being nit-picked in the first place?

            M Offline
            M Offline
            Mircea Neacsu
            wrote on last edited by
            #12

            That is quite an opinionated answer. Responding to it would almost certainly create a flame war. @GregUtas has made a static analyzer and described it in an article. Maybe, if you have a different opinion, you can write an article explaining your point of view. That way we would all be able to evaluate its merits. Simple, definitive statements like "Static analysis tools do not provide any value in modern programming." remind me of the famous H. L. Meknken quote: "For every complex problem there is an answer that is clear, simple, and wrong."

            Mircea

            1 Reply Last reply
            0
            • K Kevin Marois

              Just curious, how many of you have heard of & used Linter? [What Is a Linter? Here's a Definition and Quick-Start Guide](https://www.testim.io/blog/what-is-a-linter-heres-a-definition-and-quick-start-guide/)

              If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

              M Offline
              M Offline
              maze3
              wrote on last edited by
              #13

              😶all my software without already has a bunch of warnings about async no await, and none reachable code, why would I want to add to that list and then c#10 is used, and gives more warnings about shortening and rewriting things to be even more compressed then before ......I think I might fix some of these warnings first then add linter 😞

              1 Reply Last reply
              0
              • K Kevin Marois

                Just curious, how many of you have heard of & used Linter? [What Is a Linter? Here's a Definition and Quick-Start Guide](https://www.testim.io/blog/what-is-a-linter-heres-a-definition-and-quick-start-guide/)

                If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                M Offline
                M Offline
                Martin ISDN
                wrote on last edited by
                #14

                in my opinion, it's one of the greatest ideas. in the spirit of non-standardized C, from the original K&R book: "For those situations where strong type checking is desirable, a separate version of the compiler is used. This program is called lint, apparently because it picks bits of fluff from one's programs. lint does not generate code, but instead applies a very strict check to as many aspects of a program as can be verified at compile and load time. It detects type mismatches, inconsistent argument usage, used or apparently uninitialized variables, potential portability issues, and the like." this is the ultimate separation of concern. you can have original C type checking: "Existing compilers provide no run-time checking of array subscripts, argument types, etc." or you can have strong type checking (as strong as it gets), but it's up to you. more in a hippie manner, than in a ____ wing political manner, telling you what is good (therefore allowed) and what is evil (therefore forbidden). cheers

                J 1 Reply Last reply
                0
                • K Kevin Marois

                  Just curious, how many of you have heard of & used Linter? [What Is a Linter? Here's a Definition and Quick-Start Guide](https://www.testim.io/blog/what-is-a-linter-heres-a-definition-and-quick-start-guide/)

                  If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                  M Offline
                  M Offline
                  Mark Starr
                  wrote on last edited by
                  #15

                  Yes, I use a linter in some circumstances, usually just to provide a quick check on my code. I don’t assume I know and write everything correctly, so I’ll employ a tool to give it a ‘once over’ before testing or committing. I don’t always agree with the alerts/suggestions, but it makes me aware so I can make a conscious decision about it. I also use Jet Brain’s ReSharper when using the Visual Studio IDE, as it does real-time code evaluation (when I don’t agree with a rule, I just modify the configuration) Whether to use a linter or other code-analysis tool seems more like a personal preference: keep it in your toolbox, know how to use it, and use it when you want.

                  Time is the differentiation of eternity devised by man to measure the passage of human events. - Manly P. Hall Mark Just another cog in the wheel

                  1 Reply Last reply
                  0
                  • J jschell

                    Static analysis tools do not provide any value in modern programming. When they were first invented compilers had almost zero effective error reporting so using a second tool with pattern matching to find those before compilation seemed like a good idea. The authors or companies pushing them often claim benefits that do not exist. Bugs in software which are actually significant, where significant means costing time (and thus money) to fix come from logic errors and system errors which static analysis tools cannot identify by their very nature. Adherence to static analyzers can actually end up creating code that is not as easy to maintain and even end up introducing bugs. This happens when developers just try anything to get it to pass. The argument proponents make about that problem is that developers should be more diligent. But of course the same argument applies to why one might claim that a static analyzer is a good idea in the first place. Why are those very same diligent developers being nit-picked in the first place?

                    J Offline
                    J Offline
                    Jeremy Falcon
                    wrote on last edited by
                    #16

                    jschell wrote:

                    Static analysis tools do not provide any value in modern programming. When they were first invented compilers had almost zero effective error reporting so using a second tool with pattern matching to find those before compilation seemed like a good idea.

                    Strongly disagree. I've learned a ton about the quirks of a language, etc. just by using them. Here's an example in JavaScript, always explicitly setting the radix for parseInt. A static analyzer will tell you why you should do that.

                    Jeremy Falcon

                    H J 2 Replies Last reply
                    0
                    • J jschell

                      Static analysis tools do not provide any value in modern programming. When they were first invented compilers had almost zero effective error reporting so using a second tool with pattern matching to find those before compilation seemed like a good idea. The authors or companies pushing them often claim benefits that do not exist. Bugs in software which are actually significant, where significant means costing time (and thus money) to fix come from logic errors and system errors which static analysis tools cannot identify by their very nature. Adherence to static analyzers can actually end up creating code that is not as easy to maintain and even end up introducing bugs. This happens when developers just try anything to get it to pass. The argument proponents make about that problem is that developers should be more diligent. But of course the same argument applies to why one might claim that a static analyzer is a good idea in the first place. Why are those very same diligent developers being nit-picked in the first place?

                      C Offline
                      C Offline
                      chrisseanhayes
                      wrote on last edited by
                      #17

                      i agree. using a linter for suggestions is great, being bound to its 'rules' isn't. code reviews would be better, some type of paired programming would be better. If the code compiles, then a linter may interfere with the writer's intentions. If the code compiles and it wasn't the writer's intention, then having a second eye is better than a linter. AND if someone is writing code that requires linting I would think that person shouldn't be writing code. I've never been happy with linters; they force you to write code according to someone else's style. If we're just using linters to 'teach' people how to write code then that person probably shouldn't be writing code. like the quote from Ratatouille cartoon, "Anybody one can cook, but not anyone should cook"

                      J 1 Reply Last reply
                      0
                      • K Kevin Marois

                        Just curious, how many of you have heard of & used Linter? [What Is a Linter? Here's a Definition and Quick-Start Guide](https://www.testim.io/blog/what-is-a-linter-heres-a-definition-and-quick-start-guide/)

                        If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                        M Offline
                        M Offline
                        megaadam
                        wrote on last edited by
                        #18

                        We use linters&static code analysis for C++, Go and Python. I love them all. For all three they increase readability. For C++ they even catch potential bugs, such as memory leaks. For C++ we also have clang-format to remove hand editing.

                        "If we don't change direction, we'll end up where we're going"

                        J 1 Reply Last reply
                        0
                        • K Kevin Marois

                          Just curious, how many of you have heard of & used Linter? [What Is a Linter? Here's a Definition and Quick-Start Guide](https://www.testim.io/blog/what-is-a-linter-heres-a-definition-and-quick-start-guide/)

                          If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                          K Offline
                          K Offline
                          Kirk 10389821
                          wrote on last edited by
                          #19

                          I use plpgsql_check which is a linter for PostgreSQL. It's been amazingly helpful in reviewing code for mistakes and other warnings (like applying a conversion to an indexed column, as opposed to the other variable! The former (it tells you) will prevent the index from being used!) NICE! Of course, working with converted code... I was not thrilled with the first 35,000 errors, warnings and hints! LOL But after clearing them, I feel MUCH better about the converted code!

                          J 1 Reply Last reply
                          0
                          • K Kevin Marois

                            From what I can see, all we're using it for is ensuring code formatting is correct. So now I have to go back and remove extra lines, or empty spaces at the end of line, etc. Seems like a real time waster to me

                            If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                            H Offline
                            H Offline
                            honey the codewitch
                            wrote on last edited by
                            #20

                            Most of the open source projects I've contributed to have a code formatting script that will do that part for you.

                            To err is human. Fortune favors the monsters.

                            1 Reply Last reply
                            0
                            • J Jeremy Falcon

                              jschell wrote:

                              Static analysis tools do not provide any value in modern programming. When they were first invented compilers had almost zero effective error reporting so using a second tool with pattern matching to find those before compilation seemed like a good idea.

                              Strongly disagree. I've learned a ton about the quirks of a language, etc. just by using them. Here's an example in JavaScript, always explicitly setting the radix for parseInt. A static analyzer will tell you why you should do that.

                              Jeremy Falcon

                              H Offline
                              H Offline
                              honey the codewitch
                              wrote on last edited by
                              #21

                              Okay wait a minute. @jschell was clearly talking about compiled (and implied strongly typed) languages in their post. I can think of a ton of reasons why someone would want to lint JS code, or for that matter any duck typed code, but even moreso JS with it's sort of haphazard evolution from ECMAScript and the syntax weirdities that brings. None of them really apply to C and C++, unless you stretch. Modern compilers are really good at teasing out potential problems in your code that would otherwise be caught by static analysis tools. That doesn't really apply to JS. So this is apples and oranges.

                              To err is human. Fortune favors the monsters.

                              J 1 Reply Last reply
                              0
                              • H honey the codewitch

                                Okay wait a minute. @jschell was clearly talking about compiled (and implied strongly typed) languages in their post. I can think of a ton of reasons why someone would want to lint JS code, or for that matter any duck typed code, but even moreso JS with it's sort of haphazard evolution from ECMAScript and the syntax weirdities that brings. None of them really apply to C and C++, unless you stretch. Modern compilers are really good at teasing out potential problems in your code that would otherwise be caught by static analysis tools. That doesn't really apply to JS. So this is apples and oranges.

                                To err is human. Fortune favors the monsters.

                                J Offline
                                J Offline
                                Jeremy Falcon
                                wrote on last edited by
                                #22

                                Don’t be that person. I could give static analysis examples too, but I’m at a point in my life where I refuse to entertain these types of posts. Thanks for reminding me why I don’t visit this place.

                                Jeremy Falcon

                                H 1 Reply Last reply
                                0
                                • J Jeremy Falcon

                                  Don’t be that person. I could give static analysis examples too, but I’m at a point in my life where I refuse to entertain these types of posts. Thanks for reminding me why I don’t visit this place.

                                  Jeremy Falcon

                                  H Offline
                                  H Offline
                                  honey the codewitch
                                  wrote on last edited by
                                  #23

                                  Don't be what person? The person that dared disagree with you and politely said so? Gosh, maybe you really *shouldn't* visit this place.

                                  To err is human. Fortune favors the monsters.

                                  J 2 Replies Last reply
                                  0
                                  • H honey the codewitch

                                    Don't be what person? The person that dared disagree with you and politely said so? Gosh, maybe you really *shouldn't* visit this place.

                                    To err is human. Fortune favors the monsters.

                                    J Offline
                                    J Offline
                                    Jeremy Falcon
                                    wrote on last edited by
                                    #24

                                    You are not polite.

                                    Jeremy Falcon

                                    H J 2 Replies Last reply
                                    0
                                    • J Jeremy Falcon

                                      You are not polite.

                                      Jeremy Falcon

                                      H Offline
                                      H Offline
                                      honey the codewitch
                                      wrote on last edited by
                                      #25

                                      Excuse me? You came in here being like "don't be that guy" and then basically "you're the reason I don't post here" after I simply disagreed with you. Right after you got done disagreeing with the original poster. Physician, heal thyself.

                                      To err is human. Fortune favors the monsters.

                                      J 1 Reply Last reply
                                      0
                                      • H honey the codewitch

                                        Don't be what person? The person that dared disagree with you and politely said so? Gosh, maybe you really *shouldn't* visit this place.

                                        To err is human. Fortune favors the monsters.

                                        J Offline
                                        J Offline
                                        Jeremy Falcon
                                        wrote on last edited by
                                        #26

                                        Also, if you were such an expert (you’re not) you’d know the ES oddities are not due to its syntax at all. It has them but not because of syntax. You’d also know linting in static code is useful. I guess in your very limited view Rust got it wrong too. And I can guarantee you I know enough enough professionals that would agree with me. But hey, this is the Internet. You don’t need friends or to learn. You just need to argue and assume. At least you stayed true to your signature. People like you bring this site down. My career improved improved after I left because I don’t waste as much time dealing with the likes of you here. See, I can be polite too.

                                        Jeremy Falcon

                                        H 1 Reply Last reply
                                        0
                                        • J Jeremy Falcon

                                          Also, if you were such an expert (you’re not) you’d know the ES oddities are not due to its syntax at all. It has them but not because of syntax. You’d also know linting in static code is useful. I guess in your very limited view Rust got it wrong too. And I can guarantee you I know enough enough professionals that would agree with me. But hey, this is the Internet. You don’t need friends or to learn. You just need to argue and assume. At least you stayed true to your signature. People like you bring this site down. My career improved improved after I left because I don’t waste as much time dealing with the likes of you here. See, I can be polite too.

                                          Jeremy Falcon

                                          H Offline
                                          H Offline
                                          honey the codewitch
                                          wrote on last edited by
                                          #27

                                          Wow, that escalated. Maybe you should take your own advice and shouldn't post here. I'm not the one attacking other commenters for simply disagreeing, insulting their professional skills, and generally being a nuisance. I had to look at your profile to make sure you weren't a troll on a temporary account. *I* bring the site down? Again, some self awareness might do you some good.

                                          To err is human. Fortune favors the monsters.

                                          J 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