Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Applying generics to old code?

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • 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: 10777
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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......
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic