• Post Reply Bookmark Topic Watch Topic
  • New Topic

Turning an int into a String  RSS feed

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I've inherited a codebase. And pretty much everywhere that an object returns an int, where a String is desired, I find code like this:



Is there some sort of advantage to that code, that I don't understand? I mean: why not just this:

 
Sheriff
Posts: 23090
45
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's possible that the advantage was simply that the original programmer knew how to write that code but didn't know how to write your suggested replacement.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!