Re: Any tool to convert java raw code (a la java 1.4) into generics
code
RedGrittyBrick wrote:
Daniel Pitts wrote:
Roedy Green wrote:
On Wed, 13 Feb 2008 06:34:56 -0800 (PST), Royan <romayankin@gmail.com>
wrote, quoted or indirectly quoted someone who said :
I wonder if someone has ever tried to convert Java 1.4 style code into
code that is using generics? What tools did you use and what was your
overall experience?
Just put the generics on the declare and the allocations. Compile. Fix
the errors. Run IntelliJ inspector and it will tell point you to the
places to pull the casts.
USING generic classes is a snap once you get the hang of it. You can
convert a program is a few minutes. The tricky part is writing a
Collections class. There you do it by monkey-see-monkey do looking
for a similar collection.
Programming should *never* be monkey-see-monkey-do! If you don't
understand what you're writing, then you're probably making a bug.
OTOH I find reading examples can be a useful way of arriving at a better
understanding.
Agreed. Acceptable for training for programming. Not production
programming.
According to Wikipedia monkey-see-monkey-do means different things in
different locales.
But they both involve mimicry without understanding.
--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>