On Mon, Jul 10, 2017 at 12:14 PM, Graeme Geldenhuys
<mailingli...@geldenhuys.co.uk> wrote:
> * I seem to have grasped Generics in Java much easier than in FPC or
> Delphi. I don't fully know why that is. Maybe the syntax, more examples etc?
> Not sure.

Well, Java Generics are very limited in comparison with C++ / Object
Pascal generics (Java generics accepts only Objects never primitives),
so that's make them much simpler to use/understand of course.

Maybe Java is right and that's all we'll ever need and the performance
improvement of templates do not justify the added complexity and the
difficulty in debugging. But it is a big limitation, so your
comparison is not exactly fair here.

If Object Pascal had generics which accept only TObject I'm pretty
sure it would be just as easy to use and understand and debug as in
Java!

OTOH: The improved exception handling is indeed something we miss, in
particular try-with-resources.

Java has a very significant problem in my opinion: At least where I
live, Java is never utilized for any interresting projects. Only for
JavaEE with Spring+Hibernate and a little for Android (although
Android people don't care that much for Java, they want specific
knowledge of Android APIs and libraries, and dislike the Java generic
APIs). Its even surprising like: wow, such a nice framework and noone
ever does anything interresting with it o.O

It looks like that C++ and C# are utilized in much more varied and
interresting projects than Java.

-- 
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to