informa
2 min read
News

Feature: Programming Sins - Obfuscated Code And Cut-And-Paste

In a new feature, originally published in Game Developer Magazine and brought to you now in association with Intel, various game developers discuss their pet peeve
In a new Gamasutra feature, originally published in Game Developer Magazine and brought to you in association with Intel, various game developers discuss their programming pet peeves and how to avoid them. Michael Carr highlights numerous coding nuisances, including obfuscated code, which he says can be a real, unnecessary hassle for a forgetful person such as himself. "I couldn't tell you the intimate details of a function I wrote three weeks ago, let alone six months or a year ago," he says. "It's because of this that I consider obfuscated code a sin." "This also fits nicely with working in a team of programmers where someone might have to debug and/or add new functionality to someone else's code. The quicker it is to understand, the easier it is for them to make the required modifications," he continues. Noel Llopis warns about the dangers of vertical syncing during loading, noting that load times can be heavily affected if you're not careful. Citing his own work, he says, "There was nothing horribly wrong with that approach... the rendering code drew the progress bar, and then did a present call with vertical sync on. That meant that most of the time the console was waiting for vertical sync instead of doing an actual load. Once I removed the vsync, loading times went down to about 20 seconds!" A contributing anonymous developer also discusses the act of creating specific functions in place of cutting and pasting blocks of code over and over again. "I frequently go for the cut-and-paste "solution" first simply because it gets me the result I want quicker," he admits, "but I pay for my sins, and usually end up having to refactor it away later, sometimes after a few more needless duplications." The feature can now be read in full on Gamasutra.

Latest Jobs

Treyarch

Playa Vista, California
6.20.22
Audio Engineer

Digital Extremes

London, Ontario, Canada
6.20.22
Communications Director

High Moon Studios

Carlsbad, California
6.20.22
Senior Producer

Build a Rocket Boy Games

Edinburgh, Scotland
6.20.22
Lead UI Programmer
More Jobs   

CONNECT WITH US

Register for a
Subscribe to
Follow us

Game Developer Account

Game Developer Newsletter

@gamedevdotcom

Register for a

Game Developer Account

Gain full access to resources (events, white paper, webinars, reports, etc)
Single sign-on to all Informa products

Register
Subscribe to

Game Developer Newsletter

Get daily Game Developer top stories every morning straight into your inbox

Subscribe
Follow us

@gamedevdotcom

Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more