3 ms·
I actually like the video of the author writing in the source better than the ray-tracing. What kind of editors is he using, anyway? What I _don't_ like is his
by einpoklum 6y ago
I actually like the video of the author writing in the source better than the ray-tracing. What kind of editors is he using, anyway?
What I _don't_ like is his coding style. If he's writing C++, let him use modern C++...
* He should use C++ standard library header names, not C library headers.
* He should use std::array's rather than plain arrays.
* He asks whether there's a way to define arithmetic ops that's simpler/shorter than using macros - perhaps not, but using lambdas, `std::arrays`, and `<algorithm>` and `<numeric>`, you can get pretty close.
* Way way way too much magic numbers.
* Seems like a bunch of wheel-reinvention. Aren't there libraries for raw interaction with the hardware? e.g. EGA/VGA palettes?
etc.
- seabird 6y agoHe's writing this in Borland C++. If my memory serves me correctly, there wasn't even a widely available STL implementation for this compiler, let alone standard header names, standard containers, lambdas, <algorithm>, <numeric>, hardware abstraction libraries, etc. etc. etc. The title is verbatim "I wrote a Raytracer for DOS, 16 VGA colors." Everything you take for granted today was bought and paid for with what people learned yesterday. You're judging technology that's likely close to 25 years old and the person using it by today's standards.
- adamddev1 6y agoYes. And in his editor README he explains why he has to use Borland C++ >I wrote the editor for 16-bit DOS because I thought there would be significant troubles trying to mix 16-bit interrupt callbacks with 32-bit protected-mode code. Also I don’t think I knew back then, that DJGPP has been as modernized as it indeed has. If it even was. So I used Borland C++ 3.1. >This compiler by Borland was created before C++ was standardized, and it required me to make many sacrifices about style / sanity in the source code. For example, it did not support namespaces or templates. No STL! As such, the code is not representative of good programming practices for C++ programming, not by a long shot. https://github.com/bisqwit/that_editor https://github.com/bisqwit/that_editor
- pan69 6y ago> What kind of editors is he using, anyway? He's using his own editor: https://github.com/bisqwit/that_editor https://github.com/bisqwit/that_editor
- matvore 6y ago> What I _don't_ like is his coding style. If he's writing C++, let him use modern C++. In situations like this, I recommend acclimating yourself to the unusual style as a mental exercise. You will likely have to read a lot of quirky and/or legacy code in your career.
- pjmlp 6y agoFirst learn what it was to program for MS-DOS, then comment, without bashing.