• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applying generics to old code?

 
Shiva.Om Kumar
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.
 
Winston Gutkowski
Bartender
Pie
Posts: 10422
63
Eclipse IDE Hibernate 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
 
Randall Twede
Ranch Hand
Posts: 4439
3
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......
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic