IDEs (Was: Mainstream D Programming)

Robert Fraser fraserofthenight at gmail.com
Sun Oct 14 12:49:34 PDT 2007


Janice Caron Wrote:

> On 10/14/07, Ary Manzana <ary at esperanto.org.ar> wrote:
> > Please tell me the steps you perform to do the refactor... Say, for
> > example, you are renaming the name of a method of class A, and suppose
> > there is another class B with the same method name (but you don't want
> > to change B's method's name).
> 
> Change the method name, then recompile. The compiler will find all the
> references using the old name, because they are now compile errors.
> Obvious!

That works, but on an enterprise codebase where there could be 100+ references to that method, this becomes tedious.

I think the point is that IDEs, while not essential, can certainly do a lot of things that are helpful. For example,

* Show exactly where in a huge string mixin an error occurs
* Show the particular instantiation of templates
* Manage imports automatically, so whenever it comes across an undefined symbol, you just need to press a button to import the required module, not look up what module it's in, etc. Never write another import statement! This could also improve code quality, since you could make it only use selective imports and never pollute your namespace by importing an "all" module.
* Mark errors instantly (and have suggested fixes for some of them), rather than having to compile every time.
* Automatically implement stubs for inherited abstract methods/interfaces.
* Track TODOs, etc.
* Show formatted Ddoc on hover.
* Integrate debuggers to visually step through code.
* Format source code
* Autocomplete
* Go-to definition (even across files)
* Additional warnings and static analysis if you want them (for example, it could warn for "x == null" or integrate Coverity-like nulll checking)
* Automatically organize/sort source code
* Generate an interface or abstract superclass from the intersection of one or more classes' methods.
* A "use supertype where possible," where all references to a subtype are changed to references to the supertype if they can be (encourages more modular code in a highly OO system).
* Change "auto" to its actual type.
* Move functions/classes between modules and automatically update modules that reference them.
...

Anyway, the point is not that "an IDE is essential," and for smaller projects, it's arguably overkill, but for huge projects, it can be helpful.

I think one of the things stopping a lot of people from adopting IDEs is this implicit fear of having to learn something new. There is a learning curve associated with everything, and if you've been using ed for the last 30 years, an IDE can be a scary place.



More information about the Digitalmars-d mailing list