Skip to content
Ordered Code Versus Efficient Code episode artwork

EPISODE · Jul 24, 2015

Ordered Code Versus Efficient Code

from Real Stories! Amazing Adventures! · host Assaf Koss

Listen to this blogcast in MP3 Audio. The less I say in a single short phrase, the more meaning I pass with less effort. This is also true about coding computer software & websites. Commands can be passed in a simple, very readable fashion, similar to how we would talk to another person. Or, commands can be passed in sophisticated, complex, and convoluted ways, which logically give the same results. But these complex methods, while more efficient for a computer, are much harder for a human to follow and figure out. Making voxels with colors, lights, and different selection modes. I have spent the last few months working on a new project in Node.js, using a front-end library for WebGL, called THREE.js. I am creating a 3D virtual world that uses voxels - 3d particles, usually cubes, for all its objects. Two choices were in front of me: One, put a keyboard key-press event where it happens, which would be efficient. Two, put the event in a fast loop, where all events are checked at a rate of sixty frames per second, which is not efficient, but very readable and orderly. When checking the event in the fast loop, I use an IF statement that must be passed, in order to execute anything else. Not surprisingly, for a computer this is insignificant effort, so the performance is not impacted, at all. If performance would be impacted, then I would choose efficiency over readability. But as long as it is not, then readability is always my priority. If you cannot quickly read through it, then it is too complicated to be practical!

Episode metadata supplied by the publisher feed · Published Jul 24, 2015

Embed this episode

Ready to play

Ordered Code Versus Efficient Code

0:00 0:00

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

Frequently Asked Questions

When was this Real Stories! Amazing Adventures! episode published?

This episode was published on July 24, 2015.

Can I download this Real Stories! Amazing Adventures! episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.
URL copied to clipboard!