views:

145

answers:

6

We already have things like static analysis that tells us what's wrong with our code and where, so should we be endowing our IDEs with more AI features and, if so, which ones? I'm looking for ideas!

+5  A: 

Detection of duplicate code is a number one wish for me ;-).

Gamecat
Check out Simian: http://www.redhillconsulting.com.au/products/simian/
Mitch Wheat
A: 

Interactive code coverage test would be great.

 m = 1;
 if (m > 0) {
       // do something
  } else {
      // do something else <- Never gonna happen.
  }

Something like this would throw up a red flag. But the code coverage test would have to be optional or unobtrusive. Since some people use Preprocessors, and DEBUG = 1;

J.J.
ReSharper alreday does this (and more)
Mitch Wheat
I think Eclipse already done this.
Dennis Cheung
@Mitch: cool I will look into that.@Dennis: I have not seen this in eclipse. Maybe I have it turned off.
J.J.
The else block *could* execute, if m were volatile and changed in another thread...
Rob
Rob is correct. Although it would require precise timing, another thread could modify the value of m and cause the else statements to execute. This is one of the reasons I don't want my IDE to be "smart". I want it to make tasks more convenient, not butting in where it doesn't belong (logic).
William Brendel
Yes there are several places where this feature probably be ignored. For about 95% of what I code it would be useful.
J.J.
+4  A: 

AI? As in those "smart" menus in Office 2000? Zero! Perhaps in 2700 or so, when AI has surpassed human intelligence.

More static/contextual analysis? Absolutely. There is lots of room for more advances here and I honestly welcome just about anything. There is far too much reliance on humans and computer assisted analysis is the best way to change it.

Sander
+1  A: 

I'm kind of with Sander here. Every instance I've encountered where the application was trying to be smart, or guess what I wanted, it was an automatic failure. Don't hide stuff from me, and don't think you know what I'm want unless I've confirmed it. Things like autocorrect and autoreplace in Word are especially frustrating. Intellisense and the like are fine, because they don't actually guess what you want, they just give you a quick list of all the possibilities.

Kibbee
+2  A: 

Hmmm...apart from the code itself, it might be useful if the machine could be "taught" some UI standards as far as element layout, and suggest or alter the layout if it didn't match what is "human friendly".

I'm thinking things like spacing, text size, layout of the elements, etc. Don't know if this would take "true" AI to accomplish though.

Sam Schutte
+1  A: 

AI is a catch-all for computer projects that we really wouldn't know how to do on arbitrarily powerful computers. Hence, AI techniques are complicated, quirky, and downright unreliable. (Once an AI technique becomes repeatable and reliable, it's no longer AI.) How much flakiness you want in your IDEs is another question.

I wouldn't mind some AI as an analysis option, maybe to notice bad code smells I don't. I wouldn't want to have it always on, and I certainly wouldn't want it to do anything by itself. I'd regard it like the Microsoft Word grammar checker, which catches roughly twice the grammatical irregularities and infelicities I make - useful, but far from definitive.

David Thornley