"Be explicit" - embarrassment

I hesitate; it’s not easy to share embarrassment… but it’s too iconic to pass up. (No actual help is needed, by the way, but this is the only category that made sense.)

My way over-simplified line of code:

foo(blah); // we don't care about the result this time

The comment is my real comment, a holdover habit where I’ve occasionally wanted to clarify, but the language doesn’t offer a clarification construct. You see where I’m going now. Of course, I got the following error: “return value from foo() ignored”! Well duh! That’s what I said, isn’t it?! Of course, it’s so much easier to write:

_ = foo(blah);

AND it has the side-benefit of actually compiling. :slight_smile: The only problem is that it deprives me of the opportunity to write a needless long //comment… and inspires me to write a needless long post instead. But maybe I’m not the only one who brainfarts while transitioning from other languages. The rest of you just wasted your time and you’re trying not to laugh just a little.

9 Likes

You can still write the comment. In fact you should, as punishment.

2 Likes