3 ms·
> How would you write your code today if you knew it would of been your last commit and still in use in 30 years ? Separate the engine from the I/O and user in
by WalterBright 7y ago
> How would you write your code today if you knew it would of been your last commit and still in use in 30 years ?
Separate the engine from the I/O and user interface. This is also the key to porting it to different systems.
For example, if your engine #include windows.h or stdio.h, you're doing it wrong.
- einpoklum 7y ago<stdio.h> is part of the C standard library. It's been formally available since 1989 (if C can be used at all), and is one of the headers most likely to be available 30 years from now.
- WalterBright 7y agoTrue, but if your host has a GUI interface, writing to stdout will not work.