• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Applying generics to old code?

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on a project which is quite old. But as usual, JDK is already upgraded to JDK 6.

Application works good and there are no big issues. But periodical enhancements are on.
Can you please suggests if it is good to spend time on replacing existing data-structure code with generics?

thanks.
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Shiva.Om Kumar wrote:I am working on a project which is quite old. But as usual, JDK is already upgraded to JDK 6.

Application works good and there are no big issues. But periodical enhancements are on.
Can you please suggests if it is good to spend time on replacing existing data-structure code with generics?

Without seeing the code, it very difficult to answer.

On the one hand, there's the old adage: if it ain't broke, don't fix it.
On the other, adding generics may make things easier (and safer) for future enhancements.

One approach might be to add generics piecemeal as and when a structure gets changed, but as I said, without seeing the project itself, it's awfully difficult to advise.

Winston
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have faced this question with some of my old code, and so far i always choose against it. at least against a total rewrite. i might add a new feature that happens to use generics, but for now i just ignore the compiler warnings when i dont rewrite the whole thing. like someone famous once said "if it aint broke dont fix it"

but then i am talking about homework and you are talking real code so......
 
mooooooo ..... tiny ad ....
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic