C++ ain't my favorite language, but by George it has the `[[nodiscard]]` function decorator and I have used *so many* other languages that should either have that decorator or should have semantics that don't require that decorator... Instead, the average case for languages I use is "If you call a function and ignore its return value completely, sucks to suck."

In Go, in particular, the easiest way to introduce bugs to your code is to call a function that returns an error and then just ignore the return value.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.