sizeof is a compile-time operation so x need to be known at compile time.
It didn't work as expected. It turns out there is an exception and the standard says that sizeof is actually calculated at runtime specifically for variable length arrays:
> The sizeof operator yields the size (in bytes) of its operand, which may be an expression or the parenthesized name of a type. The size is determined from the type of the operand. The result is an integer. If the type of the operand is a variable length array type, the operand is evaluated; otherwise, the operand is not evaluated and the result is an integer constant.
It is if the object can't be meaningfully cast to the type. I'd expect to get an exception. That's why they exist.
For example, consider explicitly casting the string "abc" to an int. Python throws a ValueError. Ruby silently ignores the problem and gives 0. I consider the Ruby behavior to be a gotcha.
The other NYC bridges are all (I think?) named Bridge, but they went with Crossing here because Outerbridge Bridge sounds weird.
Another NYC one: A lot of people think "major" in The Major Deegan Expressway means it is a significant expressway, but actually the expressway is named after (Army) Major William Deegan
The usual justification for having a concept of "undefined behavior" at all is specifically to allow compilers to "rule out this possibility" so they can make this sort of optimization.
log.exception is also usually bad when you are re-raising the exception. That often results in same stacktrace logged multiple times in a row which can be confusing or at least annoyingly verbose.
But it can be helpful to log an error message (without stacktrace) to give context that is available only in this frame before letting the exception propagate to whoever ultimately handles and logs it.
Walking past an eatery with outdoor seating, I overheard one diner say the phrase "process raw logs" and I thought, "wow, I guess that is one of those tricky problems that basically everyone ends up dealing with".
And then I heard "... with a chainsaw. It's a chainsaw mill" and realized I may have misunderstood the context.
Recycling Bin is the normal name in US English too. I'm in the US and when I search google for "Recycle Bin" (https://www.google.com/search?q=recycle+bin), the results (in order) are
The roadmap here is completely focused on ChatGPT and GPT-4. I wonder what portion of their resources is still going to other areas (DALL-E, audio/ video processing, etc.)