Hacker News new | past | comments | ask | show | jobs | submit login

Most large C projects end up succumbing to something like this at some point.



I participated in the coding of several arcade games in Z80 assembler in the late 80s. Not "a" large project but a collection of small ones.

These programs, by the time I came aboard and started sharing code with those to make the games I was involved in, had also "succumbed" to this force.

The shared bedrock of all these games was code that used certain Z80 registers as pointers to take advantage of instructions that read or wrote fixed offsets from those pointers. The first byte of the record pointed at by the pointer was the type and the next 4 bytes were the position. The rest of the record depended on the type.

That was us doing the best we could with 8-bit processors when our competition was using 68000.


Many C projects indeed have polymorphism (I believe io libraries do exactly that to implement the idea that "everything is a file"), but this is rather different from object-oriented polymorphism.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: