Do everything in Java…

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 5 18:12:20 PST 2014


On Sat, Dec 06, 2014 at 03:01:44PM +1300, Rikki Cattermole via Digitalmars-d wrote:
> On 6/12/2014 11:28 a.m., Freddy wrote:
> >On Thursday, 4 December 2014 at 13:48:04 UTC, Russel Winder via
> >Digitalmars-d wrote:
> >>It's an argument for Java over Python specifically but a bit more
> >>general in reality. This stood out for me:
> >>
> >>
> >>!…other languages like D and Go are too new to bet my work on."
> >>
> >>
> >>http://www.teamten.com/lawrence/writings/java-for-everything.html
> >
> >My problems with java:
> >   no unsigned ints
> >   primitive are passed by value; arrays and user defined types are
> >passed by reference only (killing memory usage)
> >   no operator overloading(looks at java.util.ArrayList)
> >   no templates
> >   no property syntax(getters and setters are used instead even if
> >you know the field is never going to be dynamic)
> >   only and exactly one class per file(ALL THE IMPORTS)
> >   every thing must be inside a class(globals and free functions
> >are static fields in a class)
> >This is all i can remember.
> 
> You forgot type removal for generics during compilation.

I dunno, while type erasure is certainly annoying when you actually need
information about the type, it's also eliminates template bloat. I think
the ideal system should be somewhere in between, where type erasure is
actively performed by the compiler where the type information is not
needed, while template instantiations are retained when it is needed.
This should keep template bloat under control while still offering full
template capabilities. D currently leans on the template bloat end of
the spectrum; I think there is much room for improvement.


T

-- 
"The number you have dialed is imaginary. Please rotate your phone 90 degrees and try again."


More information about the Digitalmars-d mailing list