Generics is a waste of time

P

Phillip Lord

HalcyonWild> Apart from collections, is there any other place we can
HalcyonWild> think of using Generics.


Anything with a data model. Swing is an obvious example--instead of
ListModel, you will use DefaultListModel, and the contents of the
ListModel will be generic'd.


HalcyonWild> Plus you wont use generics if you are keeping instances
HalcyonWild> of different objects in a Vector,
HalcyonWild> eg. (String)vec.elementAt(0); and
HalcyonWild> (Hashtable)vec.elementAt(1);

In almost all cases, this is a bad idea anyway. If you do this, you
are either going to dispatch the object returned based on it's class
(which is okay, but not normally necessary), or you are using
implicit structuring in an vector (first element is a name, second a
phone number perhaps). In which case you should be using an object.

Phil
 
T

Tim Ward

Sharp said:
The new Java construct generic is a waste of time - I just read about it.
Not sure if construct is the correct word to use,
but the point is using generics only slows down development.

Tee hee. Clearly a BCPL fan!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

generics puzzle 57
Generics Amanuensis? 2
Generics annoyance 18
Generics 12
Generics for a multiplevalue hashmap 8
Is using splint a waste of time ? 6
Generics, for non collection types 33
Studying Generics 3

Members online

No members online now.

Forum statistics

Threads
473,786
Messages
2,569,626
Members
45,328
Latest member
66Teonna9

Latest Threads

Top