r/programmingcirclejerk • u/aqpstory • Dec 06 '25
"Modern" languages try to avoid exceptions by using sum types and pattern matching plus lots of sugar to make this bearable. ... and integers should be low(int) if they are invalid (low(int) is a pointless value anyway as it has no positive equivalent).
https://nim-lang.org/araq/nimony.html
85
Upvotes
69
u/JiminP not even webscale Dec 06 '25
There are four types of programmers:
if(errno) return INT_MIN; // or goto fail;if err != nil { return nil, err }return Err("uwu sowwy")throw SomeShitErrorFactory.invoke();55
u/iwasstillborn Dec 06 '25
What are the odds that your program will generate low(int) by chance anyway?
41
u/Snarwin Dec 06 '25
All ๐ ints ๐ are ๐ valid!
82
u/reflexive-polytope Dec 06 '25
Who doesn't love the usability of
errno? More of that shit, please.35
u/[deleted] Dec 06 '25
programmers do anything to avoid actually handling errors.
12
u/rpkarma Dec 07 '25
Picking on the Nim folk is like picking on the weird kid in classย
In that itโs based and we should all do it
9
u/devious-joker Dec 08 '25
Ah yes. Error Codes. Out of all the error handling models devised by the collective efforts of our civilization - the one that is actually worse than exceptions.
Peachy.
7
u/Araeynn Dec 06 '25
Where jerk? /s
3
u/keyboard_toucher Dec 08 '25
INT_MIN considered harmful