My take on Clion so far, from an Eclipse CDT user

Been using Eclipse CDT for many years now. Both on Linux and Windows, but doing mostly Linux development.
At this point (8.6.0) it is a rather robust implementation, but what it lacks is support for advanced refactoring.  Has to do with complex nature of C++ as a language (parsing/AST), rapid evolution (C11 -> C14 -> C17 just around the corner), templates etc. If it were easy, everybody'd do it ;)

Like the cat in proverbial Russian joke, one needs to  strive to keep his code squeaky clean and refactoring is the way to do it.

Alas, even when covered with set of unit tests, simple mechanical motions of most refactornings require manual changes to a number of files and it gets boring fast.

JetBrain has established itself as an absolute leader of the field of Dev tooling, so when I saw the Clion announcement, it perked my interest greatly.

I tried it few days ago. Imported the source tree of one of my projects, very easily. Added some include dirs to the Cmake file and was off to the races. Like I said, refactoring for me was the most important feature. At this point, I have CDT tuned to do 100% of what I need, san the refactoring.

The tremendous potential of the tool is obvious right away. Every little thing is so configurable it's gotta be illegal. Each and every key stroke could be modified - I did so for most common ones I use, so they'd match same ones I use in Eclipse.

Truly insane amt of static code analisys is performed too.

Bottom line - what I see in Clion does look like the feature is very bright :) With some minor changes (I posted some of requests), it has incredible potential to become my tool of choice for C++ dev.

Here's the list of annoyances the way I see them, in no particular order:

  • find-usages seems to be slow. It is virtually instant in Eclipse
  • seems like Clion rebuild indices upon every start. Takes a while.
  • on subject of speed - not sure how aggressive the tool is with threads, but I have 12 cores on my box, so it shouldn't be too shy
  • syntax coloring is slow too - upon opening of a source file, it sits there, looking plain,  for a while till syntax formating is applied
  • refactoring, when it comes to creation of new code, seems to place the snippets in suboptimal spot (posted)
  • would be real nice to have info hover popups (posted)
  • another killer feature to have is to have build controlled by external command.

To expand ^^^^ on this. My project is a Makefile and I'd like to keep it that way, when it comes to "build" phase. Clion creates a Cmake file upon source import and that's fine, Clion uses it as project metadata (in addition to cmake using it during build phase). But when I request a build, if I could have a way to simply run a custom build script, instead of Cmake, that'd hit the spot. In my case the script would just invoke make for a particular target.

Clion could still monitor the output of the build script to catch/report compiler errors etc.

  • parsing output of build scripts

In Eclipse, you can parse the output of the build command, parsing for file names / string #s, so each error/warning output line could be used to navigate straight to the source code location. Extremely handy.

For example, should my unit test core dump, my build script runs gdb on it - to output the stack trace and that is then fed into eclipse, so I can instantly jump to source code locations. Extremely handy.

And lastly, on subject of C++  parsing. I am sure JetBrain maintains its own parser (shared with reshaper ?) - thats the only way it can take charge of its destiny. For a while now, Clang/LLVM crowd's been advertising modular nature of its tooling, where a third party could tap into the power of its parser - might be worth a look.

I am excited about the tool and wish it all the best, as it will make lives of so many C++ dev so much better :)

1 comment
Comment actions Permalink

Two years have passed and the most important remarks still haven't been addressed (the coloring lag, external build command and parsing of its output). Really disappointing. It feels like CLion is not a tier one JetBrain's product and thus it gets neglected.


Please sign in to leave a comment.