Moving the kernel to modern C
Moving the kernel to modern C
Posted Mar 3, 2022 3:22 UTC (Thu) by marcH (subscriber, #57642)In reply to: Moving the kernel to modern C by dvdeug
Parent article: Moving the kernel to modern C
You're mixing up operator overloading with totally unrelated things. Yes of course we have no idea what machine code runs, what micro code underneath that and of course with code-reuse (at last...) we don't know what code runs in libraries. But operator overloading and inheritance are very different: with them you don't know _which source tab in your own editor you should look at_! In other words, you get lost in _your own code_.
That's a huge difference. There is a very simple solution for all the rest: only use compilers and libraries versions that everyone else uses too. Not only it reduces the number of bugs massively, but when you hit one you can just google it. Not knowing which _code source_ runs in your own project is a totally different problem.
> a+b should add two items. If it's not obvious what it's doing, then that's a bug in the library.
I agree there's only so much damage that can be done by overloading '+'. But once again the problem is the same: where is the compiler / linter flag that limits operator overloading to only "sensible" use cases? Where do you even draw that line?
> Java's "everything is a class" is an annoying box, but when OO is useful, it's really useful.
To a hammer, everything looks like a nail..
