News for hackers. Stuff that matters.
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by karolkozub on Friday January 07, 2022 @12:40PM (#29842084)
I really like the idea of automated code review tools that point out unusual or suspicious solutions and code patterns. Kind of like an advanced linter that looks deeper into the code structure. With emerging AI tools like Github Copilot, it seems like the inevitable future. Programming is very pattern-oriented and even though these kinds of tools might not necessarily be able to point out architectural flaws in a codebase, there might be lots of low-hanging fruits in this area and opportunities to add automated value.
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by lumost on Friday January 07, 2022 @12:52PM (#29842240)
Consider that you may be describing a compiler. Typos are not generally a problem in statically typed languages with notable exceptions such as dictionary key lookups etc.

Even without static typing, argument length verification etc. can be done with a suitable compiler. In python we are left chasing 100% code coverage in unit tests as it's the only way to be certain that the code doesn't include a silly mistake.

Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by samhw on Friday January 07, 2022 @01:17PM (#29842623)
I think 100% code coverage is folly. Spreading tests so widely near-inevitably means they're also going to be thin. In any codebase I'm working on, I would focus my attention on testing functions which are either (a) crucially important or (b) significantly complex (and I mean real complexity, not just the cyclomatic complexity of the control flow inside the function itself).
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by lumost on Friday January 07, 2022 @01:21PM (#29842671)
Fully agree, but I never want to see a missed function argument programming error in customer facing code. In python you really do need code coverage to achieve this goal - static languages have some additional flexibility.
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by lanstin on Friday January 07, 2022 @02:04PM (#29843282)
Or a rich suite of linters religiously applied. Never save a file with red lines in flymake or the equivalent. Ed: actually, I am unsure if my current suite would miss required parameters. I tend to have defaults for all but the first parameter or two, so not a big issue for me I guess. I do like a compile time check on stuff tho, one of the reasons I am doing more and more tools in Go.
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by joatmon-snoo on Friday January 07, 2022 @02:08PM (#29843349)
I actually recently joined a startup working on this problem!

One of our products is a universal linter, which wraps the standard open-source tools available for different ecosystems, simplifies the setup/installation process for all of them, and a bunch of other usability things (suppressing existing issues so that you can introduce new linters with minimal pain, CI integration, and more): you can read more about it at http://trunk.io/products/check or try out the VSCode extension[0] :)

[0] https://marketplace.visualstudio.com/items?itemName=Trunk.io

Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by rikatee on Friday January 07, 2022 @03:32PM (#29844411)
cool product :) it is just linting or do any of the tools do code transformation to offer the fix for the lint failure? (code review doctor also offers the fix if you add the github PR integration)
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by joatmon-snoo on Tuesday January 18, 2022 @07:05PM (#29988050)
If a linter provides autofix suggestions, we will propagate it all the way back to the user!
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by atleta on Friday January 07, 2022 @01:18PM (#29842646)
This is basically linting, i.e. code analysis. The techniques used might be more current (as they have been evolving, as you say, for pattern matching) but linting is just that: a code review tool to find usual bugs. (This is what did happen in this blog post. It wasn't looking for unusual solutions but usual mistakes.) The packaging, form of the feedback seems also different and that in itself may make a lot of difference in ease of use and thus adoption.
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by joatmon-snoo on Friday January 07, 2022 @01:29PM (#29842798)
Admittedly, the difference here is that codereview.doctor spent time tuning a custom lint on a variety of repos. In an org with a sufficiently large monorepo (or enough repos, but I don't really know how the tooling scales there) it's possible to justify spending time doing that, but for most companies it's one of those "one day we'll get around to it" issues.
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by rikatee on Friday January 07, 2022 @01:04PM (#29842423)
yeah something like sonarqube or https://codereview.doctor (if you use GitHub)
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by rak1507 on Friday January 07, 2022 @04:03PM (#29844780)
Or people could just write it correctly in the first place! Controversial I know! Seems like people would rather half-ass things and then let some AI autocorrect fix it up for whatever reason rather than doing it properly.