41

Recently saw a piece of code left by a former coworker where he converted an int to a long, by converting it to a string, then parsing the string.

Comments
  • 1
    one can only assume they are a former coworker due to abominations such as this?
  • 1
    Maybe he was just trying to be funny.
  • 1
    I had something similar to this in different layers of an enterprise application. One layer took everything as strings. Layers on either side tried to work around this. One used decimal to parse numbers, the other used int. The issue was two values not being equal in that abomination because "1" != "1.0000" when comparing strings.
  • 0
    are you sure the co-worker is not UA past self?
  • 0
    in javascript it happens naturaly, sometimes you are comparing strings, other numbers, or a mix of both. Just put several programmers in, no coding standards and voila!
Add Comment