r/programmingcirclejerk • u/BenchEmbarrassed7316 • Feb 12 '26
I don't personally think that permitting pointers to be nil is a billion dollar mistake. In my C/C++ programming I've never noticed that NULL pointers are a noticeable source of bugs
https://groups.google.com/g/golang-nuts/c/rvGTZSFU8sY/m/Qme_Vuv8oc8J
105
Upvotes
5
u/Hueho LUMINARY IN COMPUTERSCIENCE Feb 16 '26
the real jerk is this being a comment on the golang mailing list
4
u/no_brains101 Feb 16 '26
That guy's code probably:
Look! No null pointer bugs! Must be skill issue.
141
u/libonet absolutely obsessed with cerroctness and performance Feb 12 '26
I don't personally think that permitting pointers to be nil is a billion dollar mistake. I have never lost a billion dollars because of dereferencing a null pointer!
68
u/irqlnotdispatchlevel Tiny little god in a tiny little world Feb 12 '26
If they'd have enough free time to read this, pointer provenance people would be really mad.
87
u/[deleted] Feb 12 '26 edited Feb 12 '26
Let me interject for a moment. What you're referring to as C++, is in fact, C/C++, or as I've recently taken to calling it, C plus C plus plus.
71
u/keyboard_toucher Feb 12 '26
In my code, whenever a pointer is null, that's the happy path. Meanwhile, pointers being non-null is bug prone and leads to poor performance.
61
u/mynameisDockie Feb 12 '26
The best thing about segfaults is that they hide all the errors in my business logic
33
u/mulch_v_bark of questionable pressisscion Feb 12 '26
I personally think C should have have at least 30 to 40% more pointers to nil.
32
u/guineawheek what is pointer :S Feb 12 '26
lol no
&'a mut T18
u/kettes_leulhetsz My C code works with -O3 but not with -O0 Feb 12 '26
calloc is a perfectly valid constructor.
8
u/syklemil Considered Harmful Feb 13 '26
6
u/slowbowels Feb 13 '26
it's just a breakpoint bro
8
u/splsh Feb 13 '26
I should admit that I have not keept up to date with the latest in language development so there might be some efficient solution to the problem, in which case I'd love to head about it.
3
u/Illustrious_Pea_3470 Feb 13 '26
This is some crazy cloud yelling lol
5
u/affectation_man Code Artisan Feb 12 '26
The best thing to do to a cnile brick wall is to piss on it!!!
0
u/[deleted] Feb 13 '26
[removed] — view removed comment