logoalt Hacker News

jeswintoday at 7:05 AM1 replyview on HN

Hmm yeah good point. I didn't think of it. It might even be cheaper to do this when the list of possible types are closed and few.

I am still inclined to believe AI just made up the documentation though, because this has its own tradeoffs.


Replies

fookertoday at 7:15 AM

> might even be cheaper to do this

Oh yeah, very often. Especially if it's a loop and resolves the same way very often.

Modern CPUs just blaze through code like this, after three decades optimizing for object oriented and dynamic languages.