Re:The Unreasonable Effectiveness of C
by dakimov on Thursday January 10, 2013 @01:45PM
(#5038871)
IntelliJ Idea for Java?
[ Parent
| on HN ]
Yes.
There are lots of refactorings that cannot be done by simple search and replace, even for C, because they require semantic knowledge of the language.
Re:The Unreasonable Effectiveness of C
by matthavener on Thursday January 10, 2013 @02:59PM
(#5039357)
Very true, especially when you considering how many namespaces C has. In C++, its even harder.
Re:The Unreasonable Effectiveness of C
by andrewcooke on Thursday January 10, 2013 @09:42PM
(#5041052)
you know that the c/c++ plugin for intellij is broken? so what are you using that is smart enough to parse and refactor c? (serious question as i've had to switch to eclipse).
I seldom use C or C++ nowadays and when I do it is only C++.
I rarely do IDE refactorings when in C/C++ because of what you state.
QtCreator and CDT do offer some nice things, although still far from what is possible in another languages.
If JetBrains produced a proper C/C++ IDE I would probably buy it for C++ work.
Re:The Unreasonable Effectiveness of C
by andrewcooke on Friday January 11, 2013 @07:29AM
(#5042375)
confused by this response i re-read the thread and it turns out i mis-read your comment (thought you said "can" instead of "cannot"). sorry!
There is a problem that each and every tool for semantic-aware C/C++ refactoring I have tried does not work 100% of the time (i.e. it sucks more than 0%). This happens particularly because C/C++ have header files that expand to huge source files and preprocessor macros driving the parsers nuts because the parsers of the refactoring tools are simplified for speed, and also in a typical C/C++ program there is a number of combinations of macros that can be active or non-active depending on compiler options. So in case of C it always comes out faster, easier and more reliable for me to use basic tools such as search/replace because C has very simple semantics without namespaces. I often do that even in C++ because of the mentioned reasons.
Re:The Unreasonable Effectiveness of C
by alexchamberlain on Thursday January 10, 2013 @07:38PM
(#5040689)
If you are using macros in C++, you are doing it wrong. They are a relic of a bygone age.
Thanks for letting me know, I try to use the macros as little as possible, but there are such things as platform-specific code, compiler differences, third-party libraries, standard libraries such as WinAPI and legacy code.
Re:The Unreasonable Effectiveness of C
by alexchamberlain on Friday January 11, 2013 @03:35AM
(#5041913)
Platform-specific code is a very good use that precluded me at 1 o'clock this morning.
I tend to wrap legacy code in a C++ wrapper if I can; allowing me to code to a C++ idiomed API, rather than the choice of that particular developer. More often than not, it adds no overhead through the use of inlined functions...