2 ms·
Adding to my list of security vulnerabilities that static typing would have prevented.
by codygman 11y ago
Adding to my list of security vulnerabilities that static typing would have prevented.
- jtokoph 11y agoIsn't an empty string still a string?
- codygman 11y agoRight, the issue here is just using null or "". You could use an Optional or Maybe type here. Even better you could define: data SessionKey = ValidSessionKey | InvalidSessionKey Then the developer making the modification code would have been much less likely to type "InvalidSessionKey" whereas the None/"" behavior is just an idiom. The problem here is that the domain knowledge of: "" is a valid session wasn't communicated by the code.