163 karma · joined April 23, 2024
That’s not a realistic benchmark though. I’ve never seen real-world non-benchmark code which pre-initializes exceptions. They’re always created completely from scratch. Beyond it being uncommon, pre-initializing would also unnecessarily waste memory when you don’t throw the exception.
When it comes to no_inline, I think one should go the opposite direction. Because no_inline here just showed that error codes can be made slower when compiler knows less about code, bringing it closer to exceptions. What’s disputed though is not that you can make ordinary code slower, but that compilers will realistically make your exception-throwing code faster. So I’d annotate with always_inline instead.
EDIT: updated the ratio to reflect the GP comment instead of the SO post.
Many people will try to explain to you that they can shoot everything on their smartphone. What is left unsaid is that those people never shoot in demanding light conditions, scarcely ever shoot anything faster than a human etc.
In mamy of those discussions there is also a token asterisk added “except in sports and wildlife” and continuing with blanket statements, as if those two avenues were some fringe activities that the reader probably doesn’t want to do.
I wish people were more cognisant of the diversity of photography different people do and not make universal judgements about gear or techniques in general.
And a minor point: operator arguments (as well as curried arguments) are evaluated left-to-right, not right-to-left like in OCaml.
Edit: yeah, a speeding bullet caught at 1/5000th: <https://flickr.com/photos/hoohaaphotos/5587502201/>
See also: <https://web.archive.org/web/20040821031811/http://monster-is...> (that one is from 1999)
In mathematics maximum and minimum of a set are elements of said set. So the empty set has neither a maximum nor a minimum.
There is another pair of terms that obeys the rules you want max and min to obey: supremum and infimum: <https://en.wikipedia.org/wiki/Infimum_and_supremum>. And indeed supremum of the empty set is -inf. And infimum of the empty set is +inf. That’s because supremum and infimum of a set don’t need to belong to said set. They only need to belong to the set of bounds (upper for supremum; lower for infimum) of said set.
Regarding love of complexity and C++, they’re sitting on the C++ committee. Complexity is their bread and butter. :)
I also kinda doubt “Trillion dollar ultra low latency / high throughput high frequency trading/AAA+ games running on 4 x 4k monitors at 200+ fps” people are such enthusiasts of the bleeding-edge of C++. The standard library and the style of programming popular in the committee isn’t very concerned with high performance it seems.
I have a website with my photos, which doesn’t use any JS for layout. When I was making it, I considered using JS masonry libraries, but I wasn’t satisfied with the results. Proper masonry layouts which fill all available space in practice actually crop some images. Leaving space around photos is required when you don’t want cropping and want to preserve aspect ratio. The only way not to do that is to have infinite scroll, which I guess is what corporate addiction machines want, but that’s not what I want on my own website. Here is what I did:
https://yakubin.com/photography/albumless/
https://yakubin.com/photography/album/kenya-2023/
I used display:inline-block to achieve this result, effectively treating photos as text that needs to reflow into new lines. I’m very satisfied with the result and prefer it over what the masonry libraries do.
https://yakubin.com/photography/albumless/
https://yakubin.com/photography/album/kenya-2023/
Proper masonry layouts which fill all available space in practice actually crop some images. Leaving space around photos is required when you don’t want cropping and want to preserve aspect ratio. That’s why I prefer my solution over what JS libraries for masonry layouts do.