No, I was asking because you said Java IDEs have this feature but VS doesn't. Yet Visual C# out of the box has support for rename, method extraction, reorder parameters, field encapsulation, finding the usage of an identifier across the code base, generating a class graph, etc...
Where exactly is Visaul Studio lacking here compared to your Java IDEs? Or are you comparing apples and oranges -- C++ to Java?
> No, I was asking because you said Java IDEs have this feature but VS doesn't. Yet Visual C# out of the box has support for rename, method extraction, reorder parameters, field encapsulation, finding the usage of an identifier across the code base, generating a class graph, etc...
No it does not.
The amount of refactoring support out of the box differs for each Visual Studio version (professional, premium, ultimate, ...).
Plus if I were to produce a comparison table, there quite a few refactorings from Java world that don't exit in Visual Studio out of the box.
As a small example, finding the usage of identifiers only provides partial information of what Java IDEs are able to. Which can search for different ways the identifier is being used, being called, as a method, being assigned to, etc.
As for plain C++, KDevelop, Eclipse CDT, Netbeans and QtCreator all provide much more refactoring support than Visual C++ ever did.
I do like Visual Studio and use it since the first 32 bits only version, Visual C++ 2.0. But I am also aware of its defects.
VC++ seems to have been given so little attention over the past years. I mean, even something like the new project wizard (which IIRC was due to be replaced when VS 2008 was around) is still untouched and completely different to the managed wizard. Maybe they've been too busy with C++11 feature implementation to actually improve the experience (and before that I imagine that .Net stole a lot of their resources). Of course now with C++14, they've got more work to do, so I'm not sure when we'll ever see significant improvements. It makes me sad, because being a C# dev, VS is very familiar, and to get a similar experience on the odd occasion I do write native code would be awesome!
Windows C++ development on Visual Studio is composed of a lot of tribal knowledge. I am surprised WTL isn't even an officially supported framework, while they leave their ATL and MFC kits rotting in neglect.
On the Visual Studio 2013 release it was communicated they are still looking to what might be the C++ GUI framework for desktop Windows, but it won't be MFC.
It is too old, based on C++ concepts that don't have place in a modern post C++11 world.
For quite some time, the .NET field had the upper hand and VC++ was left with a small team mainly dedicated to bug fixing.
When the going native turnaround came about, they started staffing the compiler team again, but it does take years to recover what the .NET has enjoyed in the meantime.
On the other side, the going native also seems to affect .NET side, with AOT compilation for WP8 and the new JIT/NGEN compilers being developed for the next release.
There was no value in moving to a new wizard for VC, so they didn't. To their credit, they did accept some restyling work for their wizards.
n.b. I worked on Visual Studio for four years and was the PM behind the managed wizard framework introduced in 2005 (which I've noticed is still around today).
I take a look at Visual Studio every couple of years. Looks like the Project Settings dialog is still the same from VC6(?) days, with confusing controls and tiny text fields.
I remember a VS developer once saying that they'd love to include more refactoring functionality; it's just that they want to be very, very sure that it cannot ever destroy your code. Eclipse doesn't seem to have that restriction and manages to mangle my code from time to time. Choosing names for automatically-generated members that clash with variables or fields already there (I know you are in rename mode afterwards, but this shouldn't strictly be necessary), or not recognizing the difference between this and SomeClass.this when extracting a method (it puts it in the wrong class).
Perhaps there are people who take working refactorings over those that sometimes need massaging to prevent semantic and syntactic errors.
(That being said, I probably never really used that much of what Eclipse offers in refactoring apart from Extract Method, Rename and Extract Local Variable. And I do understand that refactoring for C++ code is downright hard, if not impossible in the general case.)
I find it really short sighted to say the IDE should never destroy code. Yes in an ideal world. However we have VCS to ensure our code is never lost. Before and after any refactoring you should be checking in.
If the IDE got it wrong I'd revert and submit a bug report, no biggie.
I want my IDE to be stable, fast and do as much for me as possible.
I think the problem is refactored code that still compiles but fails in subtle ways now. Of course testing should catch that, but we have to accept that the reality of most testsuites is very different from the ideal.
I'm constantly refactoring my code. Yes, not all of them are solution-wide changes, but it would be a huge drain on productivity to check in my code between each refactor. I need to be able to trust my IDE that it will refactor properly and not destroy my code
Probably an impedance mismatch here, i think the parent is thinking in terms of git (or a.n. other DVCS) where constantly making atomic commits is very natural.
I suspect from what you're saying you're using something else.
E.g. day to day i use subversion. It's possible to adopt this workflow in subversion but it definitely takes more effort on my part.
I think that's a problem of still using text and the filesystem as our codebase storage format. Databases have transactions, query languages, backup capabilities, and a number of other extraneous features which can be removed or replaced with generally simpler versions (clustering with version control for example). If code is data, why arn't our codebases databases?
Of course, the flippant answer to this is that our codebases are already databases - the filesystem is our storage engine, commits are our transactions, etc. But is this the optimal way to store information?
It would be very interesting to look at code as a graph database (of the https://github.com/tinkerpop/blueprints/wiki family, for instance). In a way, one could see how a functional programming language defines entities and their relationships, and how a function is just a composition of other functions to which it could be linked. But do we want to write a graph operation every time we want to make an edit or add a feature to our code? Perhaps the textual codebases we have are the most easily editable visualization of the underlying "graph."
This IDE refactoring tool clearly doesn't understand the language either, or it wouldn't screw up your code (as they clearly warn you it might).
Personally, I'd much rather use a simple tool (like sed), with reliable, deterministic results, than something that's right "99% of the time".
Sure, it tries to spot edge cases and flag them up to you, but if it's wrong some of the time, who's to say that it won't fail to spot an edge case 1% of the time too? So if it fails 1% of the time, and it fails to realise the problem in 1% of those cases, then it's introducing subtle bugs one time in every 10,000??
The very idea gives me cold shivers.
Note: if they "improve" the tool so that it's right 99.9% of the time, then they've only made the situation worse. Now the bugs only crop up one time in 1,000,000 - and now they are even more subtle.
tl;dr - a refactoring tool is 100% reliable, or useless. There's no in-between case.
And what about XCode? Yes! That's right! It can't refactor C++!
It can only refactor Obj-C and C. Quality!
(I understand that C++ is not the focus of the Mac ecosystem but it was a shock when I attempted to refactor some C++ and it told me that it doesn't refactor C++. I was mildly sad.)
35 comments
[ 3.1 ms ] story [ 77.8 ms ] threadSimilar to the functionality all Java IDEs have out of the box, but in Visual Studio you need Visual Assist or ReSharper.
What kind of refactoring? What do you mean by code navigation?
Refactoring:
- Semantic renaming of any identifier consistently across the whole source code
- Transform code blocks into methods, functions
- Move code blocks across modules, classes
- Generate accessors, setters for a given instance, class variable
- Change type of a given variable consistently across all the places it is used
- ...
Code Navigation:
- Show call stack for every use of a certain method/function
- Show all descendents of a given class, interface across the code base
- Show all ascendents of a given class, interface across the code base
- Show which classes, interfaces introduce, redefine a certain method
- Show which binary provides the implementation of a given class, function
- ...
Where exactly is Visaul Studio lacking here compared to your Java IDEs? Or are you comparing apples and oranges -- C++ to Java?
No it does not.
The amount of refactoring support out of the box differs for each Visual Studio version (professional, premium, ultimate, ...).
Plus if I were to produce a comparison table, there quite a few refactorings from Java world that don't exit in Visual Studio out of the box.
As a small example, finding the usage of identifiers only provides partial information of what Java IDEs are able to. Which can search for different ways the identifier is being used, being called, as a method, being assigned to, etc.
As for plain C++, KDevelop, Eclipse CDT, Netbeans and QtCreator all provide much more refactoring support than Visual C++ ever did.
I do like Visual Studio and use it since the first 32 bits only version, Visual C++ 2.0. But I am also aware of its defects.
My employer won't pay for the listed plugins, given what is already being paid for MSDN subscriptions.
It is too old, based on C++ concepts that don't have place in a modern post C++11 world.
WTL was never an official framework.
When the going native turnaround came about, they started staffing the compiler team again, but it does take years to recover what the .NET has enjoyed in the meantime.
On the other side, the going native also seems to affect .NET side, with AOT compilation for WP8 and the new JIT/NGEN compilers being developed for the next release.
n.b. I worked on Visual Studio for four years and was the PM behind the managed wizard framework introduced in 2005 (which I've noticed is still around today).
Perhaps there are people who take working refactorings over those that sometimes need massaging to prevent semantic and syntactic errors.
(That being said, I probably never really used that much of what Eclipse offers in refactoring apart from Extract Method, Rename and Extract Local Variable. And I do understand that refactoring for C++ code is downright hard, if not impossible in the general case.)
If the IDE got it wrong I'd revert and submit a bug report, no biggie.
I want my IDE to be stable, fast and do as much for me as possible.
I suspect from what you're saying you're using something else.
E.g. day to day i use subversion. It's possible to adopt this workflow in subversion but it definitely takes more effort on my part.
It would be very interesting to look at code as a graph database (of the https://github.com/tinkerpop/blueprints/wiki family, for instance). In a way, one could see how a functional programming language defines entities and their relationships, and how a function is just a composition of other functions to which it could be linked. But do we want to write a graph operation every time we want to make an edit or add a feature to our code? Perhaps the textual codebases we have are the most easily editable visualization of the underlying "graph."
Also I should have said, "why aren’t are codebases like modern databases".
Personally, I'd much rather use a simple tool (like sed), with reliable, deterministic results, than something that's right "99% of the time".
Sure, it tries to spot edge cases and flag them up to you, but if it's wrong some of the time, who's to say that it won't fail to spot an edge case 1% of the time too? So if it fails 1% of the time, and it fails to realise the problem in 1% of those cases, then it's introducing subtle bugs one time in every 10,000??
The very idea gives me cold shivers.
Note: if they "improve" the tool so that it's right 99.9% of the time, then they've only made the situation worse. Now the bugs only crop up one time in 1,000,000 - and now they are even more subtle.
tl;dr - a refactoring tool is 100% reliable, or useless. There's no in-between case.
>tl;dr - a refactoring tool is 100% reliable, or useless. There's no in-between case.
lol..
(I understand that C++ is not the focus of the Mac ecosystem but it was a shock when I attempted to refactor some C++ and it told me that it doesn't refactor C++. I was mildly sad.)