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, Los Angeles, CA, USA
9.12.23
Senior Level Designer (Zombies)

PlayStation Studios Creative Arts

Petaling Jaya, Selangor, Malaysia
9.14.23
Lead Concept Artist

High Moon Studios

Carlsbad, CA, USA
9.20.23
Technical Designer at High Moon Studios

High Moon Studios

Carlsbad, CA, USA
9.18.23
VFX Artist
More Jobs   

CONNECT WITH US

Explore the
Advertise with
Follow us

Game Developer Job Board

Game Developer

@gamedevdotcom

Explore the

Game Developer Job Board

Browse open positions across the game industry or recruit new talent for your studio

Browse
Advertise with

Game Developer

Engage game professionals and drive sales using an array of Game Developer media solutions to meet your objectives.

Learn More
Follow us

@gamedevdotcom

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