4 ms·
I think java has very good tooling. Java's main issue is the barrier to entry is lower because it has good tooling, which means really bad, inexperienced progr
by amiga_500 7y ago
I think java has very good tooling.
Java's main issue is the barrier to entry is lower because it has good tooling, which means really bad, inexperienced programmers can write bad code, and have more tooling to bail them out, allowing them to continue down that path until they have a huge ball of mud.
There ought to be some kind of phrase for this "the tooling curse".
GDB isn't bad, IMHO, but the inability of IDEs to deterministically parse templates / index code without huge problems is problematic.
- saagarjha 7y ago> the inability of IDEs to deterministically parse templates / index code without huge problems is problematic. More like the inability of text editors to parse templates; most IDEs rely on a full compiler backend that can usually figure things out.
- amiga_500 7y agoBut it shouldn't require a full compilation. The ultimate result, given the slow compile times of c++, is that you cannot know in your editor if your code is correct.
- saagarjha 7y agoThe IDEs I have used, or IDE-ified editors, run compilation ("indexing", or whatever) in the background to make this work.
- still_grokking 7y agoMaybe you want to share which IDEs you've been using? It sounds like a wonder if there is one that can handle C++ in a way comparable to, say, IntelliJ for Java, or VSCode for TypeScript. My experience is frankly more that the usual IDEs I know of can't even handle syntax coloring 100% correct when it comes to C++…
- saagarjha 7y agoXcode for well-structured (read: Xcode) projects. Sublime Text with clangd for random editing (not an IDE, but it gets good autocompletion and syntax checking from it).
- amiga_500 7y agoThis is problematic on large code bases. Huge mistakes were made on C++ design.
- saagarjha 7y agoHow large are we talking about? I've been able to use these tools on codebases such as WebKit and LLVM…
- amiga_500 7y agoLLVM has 2.5 million lines of code, but I think it also depends upon the number of templated methods etc, not just LOC. I'm surprised you haven't seen this point made many times. It would be a full-time job on the internet asking people why they have code completion issues with C++ IDEs.
- saagarjha 7y agoNo, I know what you're talking about; this is an issue in general if you'd not using tooling that's aware of the ins and outs of C++. The point is that the IDEs I have used essentially run the compiler on the file, so they can actually understand what the templates are doing and get through them.
- Too 7y agoTemplates can inherently not be understood. It's duck typing 3 degrees of freedom with 3 unknowns. You need concepts which adds 1 known into the equation, (the final missing degree of freedom is the dreaded ctrl-click-into-an-interface-instead-of-the-concrete-class which is hard to avoid). Tell me one IDE that will give any meaningful information about buzz in the example below: template<typename T> void foo(T bar) { bar.buzz(); } Other than that, finding foo<T> is usually easy, i've had good experience with qtcreator or clangd, you just have to be very very sure that your include paths are correct, qtcreator is good in that it uses CMakeLists as project-files so all this is done automaticaly.
- 7y ago
- twic 7y agoNot in my experience. IntelliJ can't even figure out where a make_shared call goes.
- saagarjha 7y agoDoes IntelliJ actually support C++?
- ivankolev 7y agoProbably talking about CLion, their C/C++ offering.
- twic 7y agoYes, CLion, my mistake, sorry.
- saagarjha 7y agoHmm, that's a bit disappointing…might I suggest trying out a LibClang-based IDE, if CLion isn't using it already? It can do wonders even to "stupid" applications. For example, my Sublime Text (by itself, with only basic knowledge of C++ keywords and such) with clangd tells me that std::make_shared comes from this code in <memory>: template<class _Tp, class ..._Args> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < !is_array<_Tp>::value, shared_ptr<_Tp> >::type make_shared(_Args&& ...__args) { return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...); }
- twic 7y agoOh no, what i mean is that it can't help me find the constructor of the thing i'm creating. Resolving a make_shared call to the implementation of make_shared is completely useless; the only thing you ever want to do is find the constructor it's forwarding to.
- jkoudys 7y agoLots of languages suffer there -- eg there's no reason you _couldn't_ be a really excellent PHP developer who specializes in WordPress sites, but it's an uphill battle to prove you're a good dev because there so many bad ones in that space. For that matter, most of the so-so devs resumes that come across my desk will list "HTML and CSS" as skills. Even among experienced devs, being legitimately good with HTML or CSS is extremely rare. I'd give my eye teeth to have a dev on staff who was an actual HTML expert (knows the w3c docs, can write clear, correct, semantic html using the right tags, organizes and expresses their intent, etc.), but since the barrier to entry is barely above basic literacy, so finding one is tough.