Re:The 4-chan Go programmer
by binary132 on Wednesday August 28, 2024 @04:10PM
(#41383710)
imagine allowing invalid values to exist
[ Parent
| on HN ]
Re:The 4-chan Go programmer
by withinboredom on Wednesday August 28, 2024 @04:23PM
(#41383880)
This is actually my preferred approach. If you want to put a 4gb base64 as your phone number, go right on ahead; best believe I will truncate it to a sensible length before I store it, but sure. Who am I to question your reality.
Sadly, people abuse shit like that to pass messages (like naming Spotify playlists with messages to loved/friends/colleagues while in jail) and maybe we have to assert a tiny bit of sanity on the world.
Re:The 4-chan Go programmer
by steezeburger on Wednesday August 28, 2024 @05:59PM
(#41384892)
How do prisoners have access to Spotify?
Presumably some feature/jailbreak of JPay (and the like) tablets.
Sounds awful.
Re:The 4-chan Go programmer
by quectophoton on Wednesday August 28, 2024 @04:27PM
(#41383950)
> imagine allowing invalid values to exist
Pretty common, for example when using databases as a mostly dumb store with all the logic in application code, and then a second application (or big refactor) appears and they introduce a subtle bug that results in an invalid `INSERT` (or whatever), and the database happily accepts it instead of rejecting it.
imagine enforcing invariants as part of the design of a software system
Re:The 4-chan Go programmer
by nickpeterson on Wednesday August 28, 2024 @05:33PM
(#41384654)
The nerve, taking good jobs away from young qa testers. Wait till the IT Union hears of this!
I’m just saying enforce invariants at construction time / type-designing instead of with the validity checks
Re:The 4-chan Go programmer
by zimpenfish on Thursday August 29, 2024 @04:07AM
(#41388456)
This wasn't that kind of validation - it was "is this token allowed to do this thing?" Like "validate your parking" kind of scenario.
(And yes, it should probably have been "CheckAuthorisation")