Do you need to understand every algorithm?

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Do you need to understand every algorithm?

      Maybe this question is somewhat silly, but it is quite a blockade on my path: When I started reading the book I came across the part about implementing the Mersenne Twister algorithm. This brought up the question if I am actually meant to understand such algorithms as an engine programmer or if its quiet usual that one implements basically the psudeo code printed in proper literatur without really understanding it? At this point I got somewhat demotivated as I started thinking maybe I am not the expected type of reader without a BSc in mathematics. This example is quiet narrow, but it can be generalized quiet easily as there are lots of algorithms and papers out there that make up the underlying theory of many aspects of an engine.

      Btw. I am really glad this forum is still up and running, despite its sparse activity!
    • In my opinion, no, you don't need to understand every algorithm.

      Engines are complex things and have many modules: 2D/3D math, rendering, physics, audio, scripting, networking... While it's arguably unrealistic to master all those topics, it's reasonable to specialize in a single one of them, and just trust the rest.

      To quote Stallings in Cryptography and Network Security, "if one is prepared to accept the results given in the chapters, an understanding of the theories the topics are based on is not strictly necessary. However, to gain a full appreciation of the topics, some understanding is required."

      You should understand the most important algorithms of the particular area you're responsible for, and have some knowledge of the less important ones. That's the code you'll be writing, documenting, maintaining, reviewing, debugging, and fixing.
      As for the other areas: if the code and/or algorithms come from trustworthy sources, are properly licensed, work the way they're supposed to, and fit well in your project, just use them without worrying about the details. OpenAL Soft comes to mind.

      To wrap up: Write Games, Not Engines; apply the YAGNI and KISS principles; avoid NIH; have fun.