13.2.9 Strings To Integers 'link'
| Do | Don't | |----|-------| | Always validate before conversion | Assume input is clean | | Use exception handling for user input | Ignore NumberFormatException | | Trim whitespace manually if needed | Use casting ( (int) "123" in Java/C#) | | Specify radix for non-base-10 strings | Convert binary strings without radix | | Test edge cases (negative, zero, overflow) | Hardcode conversion logic per use-case |