Do you put code in your engine/game you don't fully understand?

Started by
23 comments, last by bioglaze 9 years, 4 months ago

I have been doing a lot of code porting lately, and I can understand the issues of just copying and pasting code in that you don't understand.

I look for code that has no dependencies first, where all of the code is self-contained.

This is one of the issues I find working with an API or Library created by someone else, you don't really know their mindset.

I have been thinking creating a website where nothing but algorithms are posted (and explained), which can work independent of the syntax of the particular language you are using.

Even if you find code that works, is it the code that is most efficient for what you are doing? I think there is a website with various algorithms for game development. I will post when I find it.

First, understand what it is you want to do, and then find code that is adaptable to that.

Edit: The key word is Chrestomathie

http://www.gamedev.net/topic/656764-anyone-know-of-any-game-programming-chrestomathies/

They call me the Tutorial Doctor.

Advertisement

I'd never include code I don't understand. If you don't understand your own code - and it's yours once you put it in your project - your making it harder for you to use your own code, to change it, etc. Also, you could include a bug (or create one through interactions of your original code with this code) you'll never be able to fix because you don't know what's going on.

"You all look like lions to me. Lets be rabbits again."

Request for Comments => https://github.com/ts-williams


So as the title suggest, do you copy code from the internet and put it in your game/engine without fully understanding it?

Sometimes. Less and less as time goes on. I do always go back, however, and work on that code later, to gain an eventual understanding.

Unbelievable. I have never done it, not becouse there were worms of doubt in my head, it was just becouse it was not doable for me. And when I got to point of understanding spectated solution I wrote it and applyed myself into my project (one example that strikes my head was decoding ogg audio files)

At the very least in my engine "DDSTextureLoader.cpp" is integrated as is and I don't fully understand some of its macro voodoo but I do understand the crux of the texture creation part where the pixels are mapped from memory into the buffer.

I sometimes use snippets of code that I don't understand fully, but in most cases include the original URL and learn the theory later.

Aether3D Game Engine: https://github.com/bioglaze/aether3d

Blog: http://twiren.kapsi.fi/blog.html

Control

This topic is closed to new replies.

Advertisement