Comment

Comment by lionkor

The only thing worse than no benchmark is a bad benchmark.

I don't think this really shows what `final` does, not to code generation, not to performance, not to the actual semantics of the program. There is no magic bullet - if putting `final` on every single class would always make it faster, it wouldn't be a keyword, it'd be a compiler optimization.

`final` does one specific thing: It tells a compiler that it can be sure that the given object is not going to have anything derive from it.

parent lionkor 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton