• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Turning an int into a String

 
Mike Fourier
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:

 
Paul Clapham
Sheriff
Posts: 21117
32
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic