Hacker News new | ask | show | jobs
by glun 1662 days ago
Whenever I try to use something other than IntelliJ (generally VS Code) I'm always struck by how awful the code completion and auto-imports are. I really hope we can get a lightweight editor with those two functions working properly.

However, I don't see how you can do either of those features well without a lot of indexing of the codebase. And indexing is a major reason why IntelliJ so so clunky.

4 comments

With same languages? Whenever I stray away from C#/Java world, I am amazed how bad the IDE experience is for other languages, but that's because most other languages have features which don't play well with IDEs (dynamic typing, templates, macros, anything compile time).
IntelliJ has much superior code completion even for dynamic languages such as Python and Clojure. I seem to recall having tested Javascript too, but I could be misremembering there as its been a while since I didn't use use Typescript.
VS Code is actually pretty good at Typescript though, so I could be wrong about JS.
I don't think you are wrong. I used IntelliJ at my previous employeer because VS Code sucked for straight JS.

I will have to admit that VS Code remote features are straight up amazing.

Webstorm is amazing for typescript. I have to use VSCode for work and I'm easily 20% slower because of it.
I agree (even though it pains me to). I've thought about it a lot and I think it's because in the Java world, unlike most other worlds, the IDE is basically mandatory. I've worked in a few different java shops and the project was built around the IDE and required it.
I think you have it backwards. Java is actually very well designed in many ways, and that means that it's easy to make really good IDEs so they are popular.

In contrast it's really hard to make good C++ code intelligence features. For many many years Microsoft was the only one that had done it (as far as I know).

It's been a little while since I've worked with C++ professionally, but the project was cross platform so I'm not sure Windows and Visual Studio was ever a feasible option.

Most of us were using Xcode, but at some point I discovered CLion and it felt like a big step up. Having proper CMake integration instead of needing to regenerate Xcode projects really helped, plus I've often found Xcode to be quite unresponsive and never really liked the way it tries to be different with stuff like code navigation (recent versions seem to be better with how they handle tabs etc.)

But CLion is relatively recent. Quite possibly VS was the only IDE that did that stuff well for quite some time.

Not sure what time scale you had in mind with "many many years" but the commercial third-party extension Visual Assist has been the only serious option for robust and scalable C++ code navigation (and related features) in Visual Studio since the late 1990s, early 2000s until the present day. Visual Studio's built-in Intellisense has been trying to play catch up (and has somewhat closed the gap), not the other way around. There were also widely used products like Source Insight focusing on offline whole-program code analysis and navigation, but they weren't really designed for integrated development.

That said, your thesis about the relative difficulty of doing this for C++ vs Java seems hard to argue against, and the rapid, continuous growth in C++'s surface area and complexity since C++11 surely hasn't helped.

Auto import and code completion play nicely with IntelliJ for both Go and Rust IME.
Rust-analyzer has been improving massively in the last year or two and it's auto-import and code completion are pretty rock solid now IMO.
I came to VSCode from TextMate, so my expectations were minimal, but I can’t think of anything more to wish for from its completion and auto-imports. I’m generally using it for TypeScript which is probably its strongest use case. But even untyped JavaScript is pretty good: local type inference is alright, JSDoc types nearly on par with TS, automatic type acquisition for dependencies is better than manual installation in TS.

That said, it’s been years since I tried IntelliJ. Am I missing some significant productivity improvement, for TS/JS development?

Given that VSCode is built in TypeScript, and it existed primarily for JS/TS in the beginning this is expected. You don't get whole lot of more from JetBrains/Fleet in that case.

Usually though JetBrains' editor is used by other languages, which don't yet have as good open language servers, like Java/Kotlin/Scala/C#...

A colleague of mine and I tried to asses VS Code vs. Intellij IDEA for vanilla JS & Typescript + Vue. Him a heavy VS user, me more at home with Intellij. In both cases we concluded Intellij proved superior, though both were usable.
Even though I wouldn't classify it as "awful", I do agree with the sentiment. Whenever I use Clion, I feel I need to have vscode also on the same project to mitigate the shortcomings of it's code completion and even search.

Clion's support for CMake is particularly enfuriating, with it's propensity to actively replate a target's name with filenames, even if they do not match in caps, which makes absolutely no sense at all and feels it is doing it's best to get in the way and sabotage your productivity.

Counter argument, I tried c/cpp/cmake development in vscode, but got so fed up with breaking plugins. Configuring… fixing new config options for plugins… Or spell checkersuggesting to rename functions i call… or duplicate shortcuts from plugins…

That I bought clion and got stuff up and running for the biggest part in minutes. I am a looong time pycharm user though. Cmake integration is great for my projects. Embedded mostly.

IDE’s are very personal tools. Im an ide guy, always have been. Do use vscode occasionally though, it is great to test new prpgramming languages, or open big files pycharm chokes on.

I have a bit of an off-topic question for you: I'm developing a single app for Windows in 3 languages: C#, C++, and Typescript using Visual Studio and I get excellent autocomplete/integration support. However I'm looking towards porting it to Linux, and I'm looking at some other IDE. Is there something that can handle building/debugging/autocomplete for these 3 that's not VS?
Try moving to VSCode on Windows, see if you can re-create your workflow there using plugins.

Then, if you are successful, port your workflow to VSCode running in Linux.

Perhaps also intellij with the language specific plugins? Separately, all these languages work fine. What’s the build tool?
Msbuild haha. I use it to build the C++ and C# parts, and to trigger npm build on the typescript part. For C#, I'm perfectly happy with it, however for C++ I'm looking for something cross-platform. CMake maybe? Is there something better?
Have you tried a C/C++ lsp server like https://github.com/MaskRay/ccls? Works with vscode/whatever you want, and just targets your Makefile (using bear to generate the dependency graph).
> Have you tried a C/C++ lsp server like https://github.com/MaskRay/ccls?

I never tried it and to me that's not acceptable or desirable. I want an IDE/text editor that works, and not adopt yet another tool that needs maintenance and configuration and attention.

It takes about 5 minutes to set up. It's easier than Clion to use imo and works with far more project types, even the Linux kernel. But if your barrier to using a tool is it can't require any setup or configuration... well I can't help you there.
the language servers do the indexing now. intelliJ does not use them?