Proposal: Package aliases

Leandro Lucarella llucax at gmail.com
Fri May 16 07:46:03 PDT 2008


Ary Borenszweig, el 15 de mayo a las 18:58 me escribiste:
> Leandro Lucarella escribió:
> >Ary Borenszweig, el 15 de mayo a las 11:07 me escribiste:
> >>Bill Baxter wrote:
> >>>I think it would be convenient if packages could be aliased.
> >>I'm really amazed that this is a problem. For example in Java, I almost never need to 
> >>worry about the name of a package or if the package name is long, or how many characters 
> >>I'll have to write in the import. Why? Simply because I use an IDE that does that for 
> >>me. 
> >IDEs help to to write code, not read it. Code is readed much more times
> >than it's written, so having a clean reable code is a good thing =)
> 
> Exactly. If you read "Float.toString(5);" you first say "Ok, toString must be some static 
> method of some class or struct Float". Then you start searching and realize it's an alias, 
> or an aliased imported symbol. So to actually understand the code you need to make some 
> jumps through the source code... indirections. I prefer to write the fqn if there are 
> ambiguities.

This is not a problem when there is locality. If modules, classes and
functions are small (they should be :), you don't have to remember a lot
of stuff. I find myself doing a lot of aliases and I never find myself in
the situation where I don't know where things come from.

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
- Que hacés, ratita?
- Espero un ratito...



More information about the Digitalmars-d mailing list