Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

21
  • 55
    \$\begingroup\$ You had me at snippet of the code. \$\endgroup\$ Commented Mar 5, 2014 at 2:29
  • 25
    \$\begingroup\$ Whenever someone describes test-driven development as "do the minimum thing to make the new test pass", this type of code always pops into mind... \$\endgroup\$ Commented Mar 5, 2014 at 4:09
  • 24
    \$\begingroup\$ You know you could make this longer if you use else if. \$\endgroup\$ Commented Mar 5, 2014 at 6:04
  • 43
    \$\begingroup\$ You could also define separate named constants for each of the integers (LEFT_SIDE_NEG_2147483648 = -2147483648)... it's good practice to use descriptive names instead of hard-coded values, you know. \$\endgroup\$ Commented Mar 5, 2014 at 6:17
  • 37
    \$\begingroup\$ Did they pay you per line of code? \$\endgroup\$ Commented Mar 5, 2014 at 8:51