18

Modern IDEs have a lot of tricks up their sleeves to help with code writing, refactoring, searching. All those are very helpful, but rarely any of them looks like a real "magic" and makes me think "Wow! How did it figure that out?"

Can you name any impressive IDE code automation (or other) features that blew your mind first time you saw them?

Tamara Wijsman
  • 8,259
  • 14
  • 58
  • 94
serg
  • 2,097
  • 3
  • 17
  • 22

20 Answers20

29

Backwards Debugging

Visual Studio 2010 (and now 2012) lets me debug backwards with IntelliTrace.

Never again will I have to re-live the moment where I hit F10 one too many times and have to restart debugging.

Ryan Hayes
  • 20,139
  • 4
  • 68
  • 116
16

ReSharper's ability to guess what I want a variable named continues to amaze me. Here is a very simple example but you get the idea.

alt text

mpenrow
  • 1,653
  • 13
  • 16
16

Code completion

When all you've seen is a text editor, this is impressive

TheLQ
  • 13,478
  • 7
  • 55
  • 87
  • 3
    Not actually all that impressive, you can do that just by analyzing a TAGS file. – alternative Sep 23 '10 at 21:53
  • 2
    What I like is hippie-expand... it is *profoundly* more useful to me than code completion. – Paul Nathan Sep 23 '10 at 22:14
  • 2
    @mathepic And exactly how many people know to do that? – TheLQ Sep 23 '10 at 22:21
  • 1
    @TheLQ Ever looked at a tags file? Its remarkably simple to parse. – alternative Sep 23 '10 at 23:42
  • 1
    On-The-Fly code completion - where the list of options is presented live - is much more useful to me than the kind where you have to press a special chord to get the choices. – AShelly Sep 30 '10 at 16:10
  • But this isn't a very advanced feature. Sure, it is highly useful, but not very "impressive". – Andreas Rejbrand Sep 30 '10 at 16:15
  • 2
    It's impressive if you've been programming since the mainframe days. – AShelly Oct 04 '10 at 05:52
  • 2
    @Andreas @AShelly Its impressive **when all you've seen is a text editor**. It was pretty impressive graduating from Windows Notepad, early versions of Notepad++, nano, etc. – TheLQ Oct 04 '10 at 22:13
  • 4
    Guys, if you don't find this answer appealing, please vote for another answer instead, rather than disagreeing in the comments. It's a subjective question, so the answers given are likely to be too. – JBRWilkinson Oct 04 '10 at 22:18
12

I was very impressed with Eclipse's refactoring tools when I first encountered them. The ability to extract methods (which, when you're learning better design is a common occurrence) from a large chunk of code and have everything handled for me was quite cool.

bedwyr
  • 2,202
  • 1
  • 18
  • 21
12

Code Bubbles. http://www.andrewbragdon.com/codebubbles_site.asp

I love Visual Studio and Eclipse for the tools they give me to change code, but Code Bubbles really excites me for being able to navigate and view my code. Too bad it's not publicly available =-{

sourcenouveau
  • 6,460
  • 4
  • 29
  • 44
MBonig
  • 616
  • 1
  • 5
  • 9
7

The most impressive programming environment I have ever heard of is the Genera operating system.

You could click on any widget in the windowing system and obtain a full readout of source code & documentation of the item. Being a dynamic programming language (Lisp), you could edit the widget's source on the fly.

ZMACS from the Lisp Machine world is still said to be a better editor than Emacs, which is an editor environment without peer.

Paul Nathan
  • 8,560
  • 1
  • 33
  • 41
6

Visually showing the structure of the program (programs/functions/routines/...)

alt text

Rook
  • 19,861
  • 9
  • 53
  • 96
  • Which editor is that? – Paul Nathan Sep 23 '10 at 22:34
  • @Paul Nathan - http://www.scitools.com/features/interface.php – Rook Sep 23 '10 at 22:41
  • Bad luck... (You got mail at the very moment you took the screenshot.) But this isn't a very advanced feature. Sure, it is probably highly useful, but not very "impressive" (at all). – Andreas Rejbrand Sep 30 '10 at 16:14
  • @Andreas Rejbrand - Sorry Andreas, but what mail? What screenshot? I'm afraid I don't understand what you're talking about. – Rook Sep 30 '10 at 16:43
  • @Rook: He's talking about the image in your answer and the little blue box in the lower right that appears to be an email notification from Outlook . . . – Tim Goodman Oct 02 '10 at 01:16
  • @Tim Goodman - It is not my screenshot. It is a screenshot from Scitools's page. Funny enough, not being an outlook user, I never even noticed that thing. In any case, glad we got this cleared out. – Rook Oct 02 '10 at 02:07
4

Whyline

Whyline for Java really impressed me when I saw it. It's a dynamic analysis tool that lets you ask questions about the program's output, and not just text, but graphics too. For example, you can ask "why was that line red?" or "why didn't the paint method get called?"

It works by instrumenting your program and recording a run. For example, suppose there's a bug you can reproduce. You instrument your program with Whyline, run your program in Whyline to reproduce the bug, and then when you quit the program, you can use Whyline to inspect the execution history.

This recording and playback isn't new, but how Whyline implements it is pretty slick. You can view the history according to specific events (e.g. focusing on only mouse drag events, or only keydown events). It also associates output with what part of the program printed it, so you can navigate from the output to the code.

To work, it uses program slicing, so that you can focus on the parts of the code that are actually relevant. CMU now has a patent on it, and I don't know what their plans are, but I hope we can see more of it in production. It's a memory hog, but that's likely because it's a prototype and it can improve.

You should see the demo online, but you should also try it out for yourself to get the full experience. If anything, the online demos undersell the idea.

Macneil
  • 8,223
  • 4
  • 34
  • 68
4

ReSharper's ability to refactor. In full disclosure, I may be behind the curve here since I think Java with Eclipse has had this type of functionality for some time, but I don't regularly work with Java.

The delta in capability that ReSharper adds to Visual Studio is so great, it's unbelievable. I know I sound like an ad, but I don't think I could ever go back to using a stock Visual Studio installation without ReSharper on top.

More generally, a semantic understanding of the code would beat the pants off of a plain old text editor any day. This leads to things like "find usages of variable" or "inline function" or "opportunity to use idiomatic pattern", etc.

Mark Canlas
  • 3,986
  • 1
  • 29
  • 36
4

Smalltalk's debugger:

  • Full access to the entire call stack (What was this instance variable of that object 3 senders down the stack?)
  • Edit the code under test in the debugger, restart and carry on program execution like nothing happened.

It's perfectly normal in Smalltalk to spend most of one's time writing code from within the debugger.

(I remember being blown away by running a method, seeing something wrong, changing it, and running the method again without restarting the application back in the day with Visual Age for Java... because VA4J was written in Visual Age for Smalltalk.)

Smalltalk's Method Finder

Method Finder lets you ask "which message might I send to take these parameters and get this result?" Ask it 'abc'. 'def'. 'abcdeb'. and it tells you 'abc' , 'def' --> 'abcdef'. Ask it #(0 1 2 3) and it says #(0 1 2 3) sum --> 6. * Senders-of, implementors-of all you to find all (*) senders of a message or all objects that implement that message.

(*) Except when you do stuff like create message names at runtime: self perform: (#foo, #bar) to send yourself the message #foobar - in which case you know what you're doing, and you don't mind the potential of hoisting yourself on your own petard.

Frank Shearar
  • 16,643
  • 7
  • 48
  • 84
3

I think the most impressive IDE feature I've seen is SyncEdit, which AFAIK is only available in Delphi.

Mason Wheeler
  • 82,151
  • 24
  • 234
  • 309
  • Isn't this just renaming members? Eclipse does this in-place. Edit: Oh I see, you can do it within a selection. – Matt Olenik Sep 23 '10 at 21:22
  • 1
    Eclipse has it as well (use it all the time). Useful - very. Magical - not so sure. – serg Sep 23 '10 at 21:23
  • @Serg: Oh, Eclipse has it too? I wouldn't know; I don't use Java. I know VS doesn't have it... – Mason Wheeler Sep 23 '10 at 21:24
  • @Matt: You can do it within a selection, and *because* you can do it within a selection, you can do it across as much of the file as you want. It's not limited by scope or other constraints a refactoring parser would place on member renaming. – Mason Wheeler Sep 23 '10 at 21:25
  • Netbeans has this too. Usually ctrl-r. – Alan Pearce Sep 23 '10 at 21:25
  • Yes, this is very useful. But as I have said a few times here, it is very easy to implement and (hence) not very "impressive". – Andreas Rejbrand Sep 30 '10 at 16:17
  • I like this, but I wish it would edit the function name in the implementation section and the interface section - not sure what's so hard about that. – Peter Turner Oct 05 '10 at 20:06
2

What I'd like to see in an IDE are these features:

  • Display the code the way I'm used to (independent of how it's actually formatted)
  • Allow to embed tables (say an Excel spread sheet where I can read the cell values with sheet[A3]) and drawings in the code and access them just like any variable.
  • Allow to omit braces and other unnecessary code that is just there to make the parse happy.
  • Searching the code with a Google-like engine (especially getting search results within 35ms)
  • Displaying complex if conditions in a table-like manner (still searching the link).
  • Refactoring tools which can find similar code, extract the differences and reduce them to the max.
  • Support for code generation while obeying language rules (think: Create all getters and setters for Java classes unless a method with the same name already exists or dependent on annotations)
Aaron Digulla
  • 2,865
  • 21
  • 22
  • "Create all getters and setters for Java classes unless a method with the same name already exists" I think eclipse does that... – Hila Oct 04 '10 at 13:05
  • Are "Display the code the way I'm used to" and "Allow to omit braces" compatible goals? – TRiG Oct 04 '10 at 16:47
  • @Hila: Yes but the code is *visible*. What I'd like is that the compiler just generates them when it compiles the Java source; I don't want them to clutter the source. – Aaron Digulla Oct 06 '10 at 07:25
  • @TRiG: IMHO, there is a big overlap between the two. I indent all my code; the braces are completely useless. – Aaron Digulla Oct 06 '10 at 07:26
  • If, perhaps, the IDE saves braces but doesn't display them, that could work. – TRiG Oct 06 '10 at 12:03
  • By a table-like manner, are you talking about Schematic tables? See: http://www.subtextual.org/OOPSLA07.pdf – Macneil Nov 12 '10 at 04:41
  • Yes but I also want support for CSV data in my source code or when I have to setup 30 similar objects. – Aaron Digulla Nov 15 '10 at 15:06
2

Type Checking for Dynamic Languages

As long as your code doesn't get too 'meta', an IDE for Ruby or Python should be able run a background task which:

  • for a given function, determines all the possible classes that will get passed in as arguments
  • for those classes, ensures they respond to all the methods invoked by that function
  • presents a list of the incompatible classes with the missing methods you need to implement

I haven't yet seen an IDE which does this.

AShelly
  • 5,793
  • 31
  • 51
2

Im a huge fan of the alt click multi line ability in Vs2010 best thing I've found about the new version.

rerun
  • 2,045
  • 12
  • 24
2

Eclipse's Auto Build is the feature I most admire.... 7 years ago. Now I just take it for granted.

nanda
  • 559
  • 3
  • 9
2

Xcode 4 fixes semicolons and typos and uses arrows to show how an error occured.

E.g.:

NSString *a = [[NSString alloc] init];
[a release];
int l = [a length];

An arrow will be drawn from [a release] to [a length] to show why you can't use [a length].

  • This behaviour is down to the clang static analyser. You can run it as a separate command and view the output in a browser. No fancy arrows though. – Will Apr 18 '13 at 15:46
1

Code Templates and expansion, such as DevExpress' CodeRush. In C#, a DependencyPropertyis a major pain to create, since the syntax can get verbose, but simply typing "dp" brings up something akin to a snippet where you fill in the type, name and default value, and all else is done - including adding any necessary "using" statements, and possibly project references if memory serves.

The benefit is in creating your own templates, for code you often reuse or rewrite, such as simple implementations of INotifyPropertyChanged properties, where simply give the template the name and type of the property (if another expander hasn't handled it) you want to use, and it handles the rest, including creating the backing variable.

Hugo
  • 1,129
  • 8
  • 14
1

Pex does some pretty cool automated unit test generation. It traces your code, determines branch points, uses a conditional solver to generate inputs that hit every possible branch, and then lets you export the results as repeatable unit tests. It can humiliate complex string handling code.

nlawalker
  • 3,002
  • 20
  • 21
  • Nice! Although, I hope it gets used more for *test data* generation rather than the full *test case*! [Test data + Expected output = Test case.] That is, automatically generating the expected output means it's not actually testing what you think it is. It would need to be verified by someone who knows the spec. – Macneil Oct 30 '10 at 01:33
1

In Eclipse Generate SEtters and getters automatically , similarly create methods in implements class from an interface

GoodSp33d
  • 199
  • 8
1

IntelliJ Idea's support of JPA

Mention you have an DatabaseEntity:

@Entity
public class Customer{
[...]
String lasName;
[...]

now you have some JPA-Queries

Query q = "selecct s from Customer c where c.lasName=:lastName"

after some Time you see, that you made a typo within your Entity and you decide to refactor lasname to lastName.

That IDE will refactor the JPA-Query as well.

ckuetbach
  • 168
  • 5