4 ms·
This is extraordinarily normal C code. I’ve worked with several large code bases that look like CPython code. Heck, a lot of Linux looks like that. It really
by jnwatson 6y ago
This is extraordinarily normal C code. I’ve worked with several large code bases that look like CPython code. Heck, a lot of Linux looks like that.
It really speaks more to the failure of C++ than anything about CPython. C++ is so much more than C with objects, and all that extra is what folks don’t want.
- mastrsushi 6y agoI never understood the argument of C++ being too big of a language. Code bases can enforce restrictions on what can be used.
- stinos 6y agoCan you give a practical example of how a codebase can prevent restrict typical 'here's a bazooka to shoot yourself in the foot' C++ code?
- gjvc 6y ago> This is extraordinarily normal C code. I’ve worked with several large code bases that look like CPython code. Heck, a lot of Linux looks like that. Manually-implemented dispatch / vtbls you mean?
- steerablesafe 6y agoYes, a lot of C libraries reinvent dynamic dispatch with vtables or some other way. Sometimes they reinvent exceptions as well with longjmp.
- gjvc 6y agoWell then, I agree with jnwatson.
- enriquto 6y ago> reinvent exceptions as well with longjmp. What a bizarre way to phrase it. Shouldn't it be the other way round? Exceptions are just a "reinvention" of longjmp under a different name (yet identically noxious to program readability).
- richardwhiuk 6y agoExceptions are a programming flow control concept. longjump is a specific family of processor op codes. This is the same idea that while loops are implemented using goto.
- miohtama 6y agoOther C vtable implementations - GTK (Gnome / GIMP) - COM (Windows - though it is more intervined with C++) - Quake / Doom and other old game engines though nobody uses C anymore today