Preview of CLion Nova, which uses the ReSharper C++/Rider C++ language engine
blog.jetbrains.com
blog.jetbrains.com
Now I'm working on a Rust + CUDA FFI project; RustRover has minimal support for the CUDA (essentially C++) code. It does syntax highlighting and comment-hotkey, but the introspection and refactoring appear inop. It would be nice if RustRover and CLion were combined.
Just switch to Clion and You'll problem will be solved
Multi-language code bases aren't that uncommon either. As you say mixing C and Rust is common in apps and systems level programming. Mixing JavaScript, TypeScript, Go, and other languages like Python is also pretty common in web-centric stuff.
The plugin ecosystem from VSCode is the only reason I tolerate an Electron powered editor for specific use cases.
(It still exists but seems kind of dead outside Java shops.)
Whereas you get the whole experience on Eclipse out of the box.
To keep in context, to this day you can't debug JNI on regular InteliJ, unless having CLion as well.
Something that Netbeans and Eclipse support for at least 20 years now.
These days I only do Rust dev really. I'm not clear on what their plans are for ongoing Rust support in CLion going forward now that they're rolling out RustRover. Are they going to pull it?!
Because I work at a company that is mostly C++, with some Rust. My team's project is 90% Rust, but I still need to do C++ now and then. I'd be super annoyed to lose that.
They should at least continue to offer the plugin as a paid expansion option for CLion.
> As said in the announcement, RustRover is available as a plugin to IntelliJ IDEA during the preview period. However, we have yet to determine whether this will be the case once we’ve released RustRover. This is because we’re still not certain whether users will need the plugin or whether a dedicated Rust IDE will be sufficient. Around the release time, when we make our decision. We’ll also consider the cases when IntelliJ IDEA licenses were primarily bought for Rust development with the IntelliJ Rust plugin and which options we can suggest to our users in these cases. Please stay tuned!
https://github.com/intellij-rust/intellij-rust/issues/10867#...
In reality of course it's a bit more than just compiler support, you'd want easy interop with Javascript and Web APIs and a working debugger. With the Emscripten SDK and Chrome's and VSCode's WASM DWARF support it's looking pretty good now at least for C and C++ (but I assume the WASM DWARF debugging stuff also works for Rust, since it's the same compiler infrastructure underneath).
Leptos, as a popular recent example, suffers from one major issue (that most others suffer from too): the JSX stuff is opaque to Rust Analyzer. Code completion aside, you lose the ability to hover - massively crippling any hope of tracking down how to resolve a type mismatch.
Web Rust also has the impedance mismatch that Rust has for UI. There are several success stories - e.g. Cosmic Desktop, but I'm certain that there's more love than practicality involved.
I think part of the reason is that we are trying to shove in existing patterns - which originate from OOP languages - into Rust. In both semantic and ergonomic terms I have been bitten by trying to OOP in Rust when I was first learning it.
I think that there exists an (as yet unknown) solution to the UI problem. It's just going to look nothing like React (or Elm even).
CLion might not be the best app to start your 100 line script but it works the same on 1 000 000 line projects or even single file.
CLion 2022.3 Released - https://news.ycombinator.com/item?id=33803016 - Nov 2022 (1 comment)
C/C++ facts we learned before going ahead with CLion - https://news.ycombinator.com/item?id=9954766 - July 2015 (31 comments)
CLion 1.1 EAP starts: parser re-work, LLDB, new formatter options - https://news.ycombinator.com/item?id=9857310 - July 2015 (2 comments)
JetBrains has finally released CLion – cross-platform IDE for C/C++ development - https://news.ycombinator.com/item?id=9375543 - April 2015 (5 comments)
CLion – Brand New IDE for C and C++ Developers - https://news.ycombinator.com/item?id=8295036 - Sept 2014 (51 comments)
CLion, the new C/C++ IDE from JetBrains - https://news.ycombinator.com/item?id=8283992 - Sept 2014 (146 comments)
Hey, I am curious, when do I want to do that instead of relying on auto? Mostly curious, as I have been using auto in C++ (since C++11) relatively heavily.
From Google's C++ Style Guide:
https://google.github.io/styleguide/cppguide.html#Type_deduc...
> The fundamental rule is: use type deduction only to make the code clearer or safer, and do not use it merely to avoid the inconvenience of writing an explicit type. When judging whether the code is clearer, keep in mind that your readers are not necessarily on your team, or familiar with your project, so types that you and your reviewer experience as unnecessary clutter will very often provide useful information to others. For example, you can assume that the return type of make_unique<Foo>() is obvious, but the return type of MyWidgetFactory() probably isn't.
I would typically use auto while working on something but then have to replace many of them before creating a code review. I wish Visual Studio could do that, it clearly already knows the type.
Not just reviews, but anything that involves reading the code (which is frequently usage and maintenance). Swimming in a file where everything is auto is a special kind of hell. It's like having no firm ground to step on.
I understand how type deduction works just fine, thank you. Your assumption that I (or many others) have this stance based on some lack of understanding of how type deduction works is extremely wrong, and completely missing the arguments people are actually making.
I agree that if you spend a lot of time reading code in something like GitHub, not having explicit types is annoying, but seriously, who does that?
- No review tool is capable of providing type inference hints.
- Not everybody's development workflow consists of using the IDEs.
- Development/debugging on remote machines does not even have a GUI to start with - so no IDEs there as well.
It also makes it harder to grep for usages of any given type. Of course IDEs could help with that too, but I don’t know any that provide that functionality.
Can you compute elementary functions by hand? Why not? Why are you crippled without semiconductors? This attitude leads to never being able to use better tools. We can't leverage an IDE because then we're "crippled" when we don't have it, so we continue writing code as if it was the '70s and the best we have is ed.
I wouldn't use it for my project or any new project. It's out of date with how everyone else codes C++.
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
Isn't the return type of a widget factory method obviously Widget? This doesn't seem like a great example. Of course the method name could be wrong and not enforced at the language level like something between angle brackets, but idk.
My take is: if the code is type-agnostic (i.e. should remain identical when the type changes), and writing the type wouldn't help the reader, and the type itself isn't already a simple-to-write template (like T), then use auto. (For example, this is the case when you're just taking some value and passing it along, and have no reason to care about the type at all.) Otherwise, write it out.
The intent being that you should prefer to spell out the type unless it's genuinely adding a burden (such as being difficult to read, or adding an extra location to update if it ever changes) when the benefits are also negligible, because it's frequently useful information and a good sanity check.
1. you refactor, you change the type declaration in one place, auto handles the boring work of replacing the characters throughout your project.
2. you refactor, you change the type definition in one place, auto will handle replacing all the instances in your project, hell, it might even compile afterwards.
I believe you are describing 1. I find that easy enough to do with 'Sed' or IDE refactoring tools.
2, is more subtle and the new behaviour could now be worthy of scrutiny throughout the project. I find it difficult then to 'Grep' or IDE search through the project for all instances reliably when auto is in use. It is much easier for me with spelled out types.
I would trade the benefit of auto in 1) for the safety of spelled out types in 2) every single time.
In other words, you concentrate your review on the original and new type, instead of the usages.
Yes I agree, in that case sure, but when refactoring the case can arise that a new type must no longer compatible with the old type, then auto becomes a hindrance.
std::vector and std::list have different behaviour regarding the validity of iterators after deletion (EDIT: and insertion so it seems!), to pick an example.
Maybe I'm just paranoid?
Then you make sure that whatever causes an incompatibility also causes a compilation error. You can't rely on text searches and IDEs for something like that.
>std::vector and std::list have different behaviour regarding the validity of iterators after deletion
Fair enough, perhaps not the best-chosen example. I was thinking about them purely as collections, rather than as part of resource management. Checking their behavior with automated tools becomes much more difficult once people start taking pointers into elements. But then again, that's true of any class. If, for example, a member function returns a reference to a member and someone gets its address, now that location is implicitly relying on the internal stability of the class in a way that's invisible to the type system.
Hm... Hypothetically, with a lot of effort you could design a dummy class (A) that implements only the members you want to investigate and where necessary returns a different dummy class (B) representing the element type. If someone ever tries to take the address of a B (you have to delete operator&() and/or get() if it's some kind of smart pointer) then you know you might be dealing with iterator invalidation.
The iterator invalidation occurs when push_back(), insert() or erase() are called, presumably among others, so you'd also want to overload the iterator increment and decrement operators too (oh!, not to forget end(), or rend() if you are going the other way...). I'm not sure what operators and methods would be called on passing to an std::algorithm like std::find or std::sort. Most likely the only way to find out for certain would be to make everything inaccessible and replace piecemeal until the compiler was happy to run to completion.
I'd want to take a closer look where it's instantiated, but if all the uses are 'auto', well let's just say I'd be unhappy to say the least.
But that's second priority to readability, because people read code much more often than they refactor it, and they need to be able to easily anchor their understanding when reading. Optimizing code for efficiency of editing instead of the ability to understand it is getting the priorities very wrong.
Who says this implies you can't understand what the code does at a high level? Often you know the high level behavior but need to figure out how it works so you can update the code. If anything, the high level behavior is often easier to understand, since you have the API documentation etc. available.
And in the cases where that is the case, what does "there's a problem anyway" mean? That the reader is too stupid to figure it out?
Regardless, the rest of my comment stands.
> Keep in mind hover documentation often isn't readily available for pull request reviewers. Most of the time, reviewers will use GitHub's online viewer to review pull requests.
`using` directives and typedefs are not forbidden, so this would avoid situations where a type is never explicitly declared.
Having worked in large code bases that used `auto` almost exclusively when possible… I’m not sure I agree. However, I understand.
https://docs.Godotengine.org/en/stable/contributing/developm...
var m = new Thing(); // you know its a thing
var t = a.b().c(); // what is it? var t = a.b().c(); // what is it?
Most likely bad code (on the right hand side) for (auto const & thing : container_of_things) {
thing->method ();
}
in this context (and this context alone) i love not knowing or having to explicit denote the type of "thing".- CLion Classic
- CLion Nova
- Rider
- ReSharper C++ for VS 2022
And the 'new UI' versus the 'old UI'.
When my teams mates act surprised my VS flies when compared with theirs, the answer to "Are you using ReSharper?" tends to be a yes.
Choice is good; lack of choices and unification is not that good.
Perhaps, but in this case, the same wheel (a C++ IDE) has been reinvented four times by the same company, whereas the competition (Visual Studio, Xcode) have existed for two decades or more. In this case, choice leads to fragmentation, to lack of focus, to poorer quality, and a focus on 'let's rewrite it again'.
They only have one C++ IDE. That is CLion.
Rider is a .NET IDE. ReSharper C++ is an extension for Visual Studio. Rider includes parts of ReSharper.
The preview is not for a new product. It's a preview of a new version of CLion, their existing C++ IDE.
They are unifying their two separate C++ engines, focusing on one code base.
The same functionality works quite well in vscode.
But I tried this release and everything works really well on the same project.
I recently decided it is over and moved entirely to VSCode. It's a massive improvement in terms of productivity even if it is not as rich, simply because it is more responsive.
The Nova preview is free to use. License not required until it is merged into CLion.
No one is forcing you to install it. Your rant is pointless.
I own CLion and will try it out. It probably works well enough. If not then I simply won't use it.
CLion projects are not IDE specific. CLion uses CMake.
If the trial ends and you want to continue using it then buy it. If not, then don't buy it. Your C++ project still works in every other IDE.
The preview is working flawlessly for me BTW. I prefer it to the stable release. Existing paying users are the main target for this preview.
> This is only valuable for the company because you test their products for free
None of their paying users are forced to use it. It is entirely optional to use the beta release or remain on the stable release. I have both of them installed side by side. I prefer having the option to test it out and report bugs or provide suggestions. I am effectively paying them to develop it and so am entitled to check out their work in progress and provide feedback.
They have their own internal QA department. Early access is additional to that. Improves quality overall and is a win/win for company and users.
So far I have found zero issues to report. It just works for me.
There's a lot to like about JetBrains. Their IDEs are good. I've use a few of them for Java, .Net and Kotlin and they don't suck. I used Visual Studio since version 6, but in earnest since 2003 and it has steadily decreased in quality over time. I feel like I am constantly testing their IDE for them. At least now with IDEs like Rider, I get something that is better than VS2022 in most ways and is easy to test the new release candidate of prior to it being an actual release. The IDE and eco system really works for me and the IDE also works the same on Windows as it does on a Mac so it is less jarring to change platforms. Vs Mac was a whole other level of pain and really, really was not good ever.