#1 2018-01-20 22:23:41

mdbs99
Member
From: Rio de Janeiro, Brazil
Registered: 2018-01-20
Posts: 99
Website

Pascal Generics are great or we are just following other languages?

I'm consider a old-school programmer.
Nowadays we see a lot of use of generics. I can't see a Java code that doesn't have generics.

My question is: We really need generics or we are just following other languages like Java or C#?

For me, most code that use generics are much more confuse. I think there is an abuse of generics.

We can live without them? What do you think?

Offline

#2 2018-01-21 09:04:17

edwinsn
Member
Registered: 2010-07-02
Posts: 1,049

Re: Pascal Generics are great or we are just following other languages?

Yes, we can live without generics, but life is much better with it, especially with a collection library provided by Spring4d smile

Last edited by edwinsn (2018-01-21 09:04:34)


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#3 2018-01-21 09:27:52

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 11,689
Website

Re: Pascal Generics are great or we are just following other languages?

Most of the time you don't need generics.
I agree with https://en.m.wikipedia.org/wiki/Smart_P … f_Generics

With FPC you have now good generics support.
Especially with maciej new collection units.

But they tend to bloat the executable size.

Offline

Board footer

Powered by FluxBB