Code Quality Week part 7 of 8

This week we at Little Chicken are celebrating code quality. Resident Developer and Code Quality Guru Joris Van Leeuwen penned eight bytesized posts on this subject. Each day will see a new post on this subject.

joris_van_leeuwen_1

PART 7: Quality Code is Soft

Code that has high quality means that it is soft; it’s easy to tweak because values are set outside of any algorithmic code.

Let’s do a quick scan over the following example.

 

 asd3

So we have an inventory that we can add items to. It can contain a limited amount of items and its items are rendered in a grid layout using the relatively complex algorithm in the Render() method. This code is soft because all tweakable values are set outside of the algorithmic code.

We can easily tweak the amount of columns that are rendered by simply changing the COLUMN_AMOUNT constant in the top of the class. Likewise we can increase the item capacity by changing the associated constant without having to dive into the complex algorithms.

Soft code is great for a lot of reasons. To tweak a value in soft code, we won’t have to read up into complex code, won’t have to change the value in multiple places and won’t have to deal with any magic values (values without a name to make it make sense).

What makes your code soft? Tell us on facebook

Related

Rekt stunt game

Rekt!

18 april 2018

Ever wanted to kickflip a car? Get behind the wheel in this high octane stunt driving game and get Rekt!     With super realistic physics, Rekt is easy to learn and hard to master! The game has fifty unique automobiles that are unlocked by your trick scores. It’s a single player arcade experience, but you can test your skills when you compete with players around the world on the global leaderboards. Rekt is designed with adaptive visuals that adjust to your driving. The classic trick gameplay can be mixed […]

New game Track Lab create music

New Playstation VR Game – Track Lab!

18 april 2018

Construct the beat and unleash the music! Our new game for Playstation VR Track Lab is finally announced! After two years of near silence, we can now proudly show you what we’ve been working on for so long. The full release of Track Lab is expected this year, more information about this will follow soon! Enter the virtual space of Track Lab and create music in seconds. Musical training isn’t required, anyone can create beats from scratch simply by moving musical building blocks around in their virtual environment. Satisfied with […]

Little Chicken at Gamescom 2018

We are attending Gamescom

18 april 2018

Yes! Just like last year, you can find us at Gamescom! Gamescom is the leading European trade fair for digital gaming. During 21-25 August we will showcase our newest games and you can test the games before everybody else can. Please send us an email (info@littlechicken.nl) if you would like to set-up a meeting at Gamescom. See you in Cologne, Germany!

Inspiration Lab

Shadow's Edge Logo

Shadow’s Edge

18 april 2018

A captivating 3D adventure game! Your words & art restore life to a mysterious, shattered city.         Shadow’s Edge is a captivating 3D adventure; the first narrative therapy game designed to help young people with health challenges, chronic conditions, medical needs, emotional health issues, depression and other illnesses to discover the depth of their resilience. A self-help tool for teens. Created by the non-profit team behind the journaling book Digging Deep (35,000 copies distributed to children’s hospitals, parents, professionals and children’s health organisations), the game guides players […]

Art

Hoe maak je een wetenschappelijk correcte dino voor Virtual Reality!

28 juni 2016

Door Olof Moleman   Binnen het team van Little Chicken en &samhoud media team ben ik verantwoordelijk geweest voor het modelleren van de 20 verschillende prehistorische dieren voor de AH dino VR app. De meeste hiervan waren dinosaurussen, maar er zat ook een aantal andere prehistorische dieren bij uit de dino tijd. De bedoeling was om de beesten te maken volgens de huidige wetenschappelijke kennis die we hebben van dino’s. Maar hoe maak je een wetenschappelijke dinosaurus? Het beeld dat de wetenschap heeft van dinosauriërs verandert steeds als er weer […]

Code Quality Week part 7 of 8

31 mei 2016

This week we at Little Chicken are celebrating code quality. Resident Developer and Code Quality Guru Joris Van Leeuwen penned eight bytesized posts on this subject. Each day will see a new post on this subject. PART 7: Quality Code is Soft Code that has high quality means that it is soft; it’s easy to tweak because values are set outside of any algorithmic code. Let’s do a quick scan over the following example.     So we have an inventory that we can add items to. It can contain a limited amount […]

Alles bekijken