5 ms·
Two Wishes for Dev Tooling
- jeremydeanlakey 5y agoI like the refactor bot idea. I'd be a little nervous to lean on Copilot to refactor, but I'd love a bot that just implements the changes that IntelliJ can already recommend to me. A bot that did other logically straightforward refactors (like extracting mapper methods from big functions) would also be nice.
- blacktriangle 5y agoYeah the Copilot reference came out of nowhere. Given how important Copilot is to Github and how it's been getting trashed pretty hard, this article reads like some lowkey astroturfing for Copilot.
- mdaniel 5y agoYou'll want to keep an eye on Qodana[0] which when combined with ReviewDog[1] (and some glue script since Qodana has its own snowflake output JSON that RD doesn't read natively; engineering!) can offer suggested changes on MR/PR platforms which support such a thing [2] I have the first two working together but not the last part yet, and Qodana is for sure a moving target but is what I've been praying for them to do for years now 0: https://github.com/JetBrains/Qodana/blob/2021.2/topics/getting-started.md#qodana-at-a-glance https://github.com/JetBrains/Qodana/blob/2021.2/topics/getti... 1: https://github.com/reviewdog/reviewdog https://github.com/reviewdog/reviewdog 2: https://docs.gitlab.com/ee/user/project/merge_requests/reviews/suggestions.html https://docs.gitlab.com/ee/user/project/merge_requests/revie...
- anonydsfsfs 5y agoThe refactor bot idea seems like it'd cause a lot of problems. If you're asked to review a PR that has a bunch of formatting issues, you now need to wait for the "prettier" bot to run and fix it. And if the PR author has to make additional changes, they could accidentally overwrite the commit made by the bot if they use "git push --force", which I've seen happen several times with Github's "suggested change" feature (you can prevent that by using "git push --force-with-lease" instead, but most devs are unaware of that IME). An alternative solution to the problem with Prettier and other tools being closely tied to your editor/IDE is to adopt editor-agnostic formats like https://editorconfig.org/ https://editorconfig.org/ .
- SNosTrAnDbLe 5y agoI am guessing this applies more for javascript tooling In Java, for 1 we use Sonar which is a very mature tool for code quality and for 2,IntelliJ does refactoring very well. Looking at code climate, it looks like it was inspired by Sonar but I may be wrong
- vips7L 5y agoSonarlint is propbably the best all around linter for every language that I’ve used.
- kristopolous 5y agoUsually my biggest two wishes that seem to never be able to be satisfied is Ability to connect a debugger that sanely steps through code without getting lost in a library maze Get a useful stacktrace that's not just lines of framework wrapper garbage and then an elipses. Also a few more, which I can usually get satisfied: 1 Don't fail silently, ever. Use UTC time in the log, I shouldn't have to say this. 2. Don't replace the default logging mechanism. Your wrapper version with the fancy colors isn't better. It just blocks the versatility and functionality of the actual language logging feature written by the language team who are far more competent than you. Stop that, you don't know what you're doing. 3 Inherit the environment in the process forks. Don't make me manually go in and pass things down. 4 Please Stop writing fancy error handlers. They often have bugs so the generated error will just be from a bug in the error handler thus hiding the original defect. It's a defect, all bets are off. When they are working right they're frequently HTML/CSS/JS which is terrible for testing, statistics, and logging. Also they won't do the lower level exception throwing of the language that allows it to be caught by a debugger so the tooling breaks. You don't need to do this. It only makes things suck. Stop. Alright that was cathartic
- zeusk 5y ago> Ability to connect a debugger that sanely steps through code without getting lost in a library maze Depends on your environment? I use WinDbg and it does pretty well when symbols are loaded. User-Kernel jumps are still a bit of pita, but breakpoints work
- kristopolous 5y agoI like how you pull out the best debugger ever made out of your back pocket. Yes, windbg deserves shrines and holidays. After switching away from fulltime windows dev about 13 years ago, it's one of my fondest memories of how amazing windows can actually be.
- stinos 5y agosanely steps through code without getting lost in a library maze I'm not completely sure what you mean here? Debugger not stepping into 3rd party code? The debugger cannot know what you consider to be a maze and what not: are you developing said library? Then you want that code. You want only your code? Then you'll have to tell the debugger which is yours. Example implementation is debugging C or C++ with Visual Studio which has regex-based 'do not step into'. Get a useful stacktrace that's not just lines of framework wrapper garbage and then an elipses. Isn't this essentially the same as previous point? You want a relevant stacktrace, i.e. without 'getting lost in a library maze' so you'd need to filter. Don't know if that is implemented somewhere. I personally haven't encountered much need for that though: stacktraces contain the origin of the call (shared library or for Python etc the module path) so glancing over it I skip the 3rd party bits automatically.
- globular-toast 5y ago> My projects typically use two tools that statically analyze code: linting, and tests. Erm. Tests aren't static analysis. I don't see the problem with running formatters in CI and I don't see how it could cause "chaos". The first stage in my CI pipelines is a QA check which includes running linters, formatters etc. It's up to each developer to make sure it passes and this can easily be achieved by installing the pre-commit hooks in their environments.
- thrower123 5y agoI do chuckle a little bit when I think about how all the linters and formatters and bundlers and transpilers and braindead test suites that have agglomerated onto JS development are effectively just a bad compiler with extra steps.
- gjvc 5y agoJS is the biggest local maxima for this sort of thing that the world has ever seen.
- matharmin 5y agoI strongly disagree with "bot refactors". Automated or semi-automated refactoring is great, but it's best run offline on a developer's machine. Even if the system to do that works perfectly, you've still added more noise to the commit history, and in my opinion it still doesn't have any real advantages over doing it locally. Our system for formatting code (actually similar to the author's current system): 1. The developer can choose whether or not to do auto-format on save. 2. The developer can run a single command in the repo to format all staged files. (Formatting all files in the repo is too slow). 3. A pre-commit hook checks that all changed files are correctly formatted. 4. On CI we check that all files are correctly formatted (in case any of the above didn't happen on the developer's machine). It takes some effort to setup the system initially, but from then on it works really well. You get these advantages: 1. Formatting (or making any other change to a file) is always an explicit action. 2. The developer can review all changes before committing. 3. Every step of the process is easy to debug if something goes wrong (which is very rare). 4. There is minimal overhead to applying the auto-formatting. 5. Developers still have freedom in their personal workflows. One example I've seen of a bot automatically creating PRs is dependabot to automatically update dependencies, but in my opinion it adds way more noise than value. Running a command locally to do the updates is just as easy, without any of the noise.
- Cthulhu_ 5y agoIs it too much to ask to a contributor to make contributions that match the code style guidelines? No arguments, if the code doesn't pass code style guidelines it's rejected. Also, normalize (interactive) rebase to pretend the code was perfect when written - "fix" and "style" commits should simply never make it into the main branch.
- michelledepeil 5y ago>One example I've seen of a bot automatically creating PRs is dependabot to automatically update dependencies, but in my opinion it adds way more noise than value. Running a command locally to do the updates is just as easy, without any of the noise. It's just that you need to set up some kind of recurring reminder to do that kind of work, which ends up also being noise, and the work is a chore, nothing more. IMO the noise of a bot emailing you a ready-to-merge PR (usually 1 click) is better than the noise of a calendar event with at least 3 manual steps.
- TonyBagODonuts 5y agoA simple vscode addon that puts functions in alphabetical order, if they can be.
- mdaniel 5y agoIJ supports topological sorting which I think is much better, especially if combined with sane visibility ordering such that the most important are at the top As as asterisk to the alphabetical order suggestion, for Java (and maybe others) it would separate the get, is, and set method pairs from one another, making read only properties harder to spot
- paulddraper 5y agoOoooh...
- paulddraper 5y ago> Nonbinary code quality At a tool level, yeah that should be configurable. GOLANG, I COMMENTED OUT ONE LINE. YOU KNOW HOW TO COMPILE WITH AN EXTRA IMPORT JUST F---ING DO IT. But at the commit/merge request level, either the changes are merged or they aren't. They are either mergable or not mergable. You can decide what things are errors and what are not, but printing tons of warnings is a great way to get ignored.