Linter?
-
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?
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
-
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?
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"
-
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.
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"
-
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.
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!
-
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.
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.
-
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
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.
-
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.
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
-
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
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.
-
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.
You are not polite.
Jeremy Falcon
-
You are not polite.
Jeremy Falcon
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.
-
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.
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
-
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
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.
-
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"
Yeah they can get out of hand with the rules. But you can configure them to be more lax. Linters are nice as an automated code review of sorts for gated check-ins, etc. Devs that code review daily don’t want to waste their time with the silly stuff that can be automated.
Jeremy Falcon
-
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.
I treated you how you treated me. Enough of your garbage kid.
Jeremy Falcon
-
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.
You need self-awareness. Run along now kiddo.
Jeremy Falcon
-
You need self-awareness. Run along now kiddo.
Jeremy Falcon
You're just in attack mode now. It's not professional. I'm done with you.
To err is human. Fortune favors the monsters.
-
I treated you how you treated me. Enough of your garbage kid.
Jeremy Falcon
The thread is there for everyone to see. I'm satisfied with my estimation of this exchange. You were the one attacking other people here. Not me.
To err is human. Fortune favors the monsters.
-
You're just in attack mode now. It's not professional. I'm done with you.
To err is human. Fortune favors the monsters.
No, I'm treating you like you treat me. You just don't like it. Btw, I noticed your profile too and to not surprise you don't even have a real profile picture. Guess you haven't reached that level of maturity and think you're special because of the articles. Guess what... you're wrong. Deal with it.
Jeremy Falcon
-
The thread is there for everyone to see. I'm satisfied with my estimation of this exchange. You were the one attacking other people here. Not me.
To err is human. Fortune favors the monsters.
I was polite. That's how it works right? You can argue but say you're polite and then magically you're polite... right? That's your logic, never admit wrongdoing and just double down on arguing. Then just blame the other. So, I was polite. Don't get mad at me for doing what you did. This is the part where you do deny being upset. May as well add one more lie to the conversation.
Jeremy Falcon
-
No, I'm treating you like you treat me. You just don't like it. Btw, I noticed your profile too and to not surprise you don't even have a real profile picture. Guess you haven't reached that level of maturity and think you're special because of the articles. Guess what... you're wrong. Deal with it.
Jeremy Falcon
My profile picture is in fact me. Now find a hobby that doesn't involve me.
To err is human. Fortune favors the monsters.