[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-dev] User survey: More CDT Refactorings - toggle function definition/namespace refactorings
|
Hello Marc-Andre, hello others,
>
> It seems users are particularly interested in:
> - More refactorings
> - Bug fixes
> - CMake integration
> - LLVM/Clang integration
>
> What are you thoughts after looking at the results?
>
thank you for the survey and the encouragement that more refactorings are actually needed. It feels great that the work we started around 2005 and nobody believed it could be done now actually gets appreciated... :-)
One participant asked for "change function signature" refactoring and I have to say this is very very hard to do well for C++. We tried! There are several reasons, especially when you expect call sites to be adapted, one is overload resolution that might change due to a changed signature, so even if you called the function before the change changing it actually might select a different overload at the call site, another issue my students suffered with is to make the UI useful and pleasing and actually faster to use than changing manually, we couldn't find a good way to implement it and make it usable. Just consider how ugly the Java Change Method Signature dialog is and C++ is much more complex syntactically. **
Therefore, I invented the "toggle function definition" pseudo-refactoring that at least allows one to do the signature change only once without having to use copy-paste or manually edit the signature twice in header and implementation file. This is already part of CDT.
We are working on more refactorings, but if money would be involved we could do much more than we can do with students, public grants and profits from other projects.
So if companies out there with a budget and interested in better C++ refactorings tell us what you desire.
For all the others, have a look what we usually provide as preview of refactorings to come within our unit testing plug-in CUTE. Version 2.0 for beta tests can be found at the following update site http://www.cute-test.com/updatesite/development-2/cute/
From the refactoring perspective most notable is its "namespactor" refactoring feature that allows to rid your code from either "using namespace" directives or from too many "::" scope resolution operators in fully qualified names. It even allows you to cheat, when your programming conventions forbid using namespace std; by first writing your code with it and then refactoring it away.
Feedback is welcome.
Best regards
Peter.
P.S:
**Any (great) ideas on what cases to support (wrt overloading) for "change function signature" and how to make it usable in the UI are appreciated.
--
Prof. Peter Sommerlad
Institut für Software: Bessere Software - Einfach, Schneller!
HSR Hochschule für Technik Rapperswil
Oberseestr 10, Postfach 1475, CH-8640 Rapperswil
http://ifs.hsr.ch http://cute-test.com http://linticator.com http://includator.com
tel:+41 55 222 49 84 == mobile:+41 79 432 23 32
fax:+41 55 222 46 29 == mailto:peter.sommerlad@xxxxxx