Falsehoods programmers believe about languages

https://piefed.social/post/517822

Falsehoods programmers believe about languages

> I can’t believe nobody has done this list yet. I mean, there is one about names, one about time and many others on other topics, but not one abou…

Every language has words for yes and no.

Assuming yes and no means true and false, c has numbers (1, 0) for yes and no and c++ can use those numbers for yes and no because it is a superset of c.

Technically, 0 is true and 1 is false. !0 is 1, though, IIRC
That’s what I meant so I’ve edited my comment to hopefully make that a bit clearer. You’ll have to forgive my lack of clarity. It’s 03:02 and I’ve had about 2 hours sleep tonight and won’t be getting any more. Time for a coffee.

As far as C goes, 1 is true and 0 is false.

In terms of POSIX exit codes, 0 is success and 1 is error.

True is anything other than zero in C.
I think more specifically for C, 0 is false and anything nonzero is true. Idk about NaN/inf.
Confidently incorrect.

Jesus. I mistyped that horrendously to make a point about !0

I read my comment just now waking up and went wtf

Until you use exit codes, which flips the logic.
The article is not about programming languages 🫠
@PumaStoleMyBluff @MyNameIsRichard anyway let's do programming languages. Most don't have either. Shell has yes but not no, while Prolog has both yes and no, but just as results, not as values.