
Just a guy who loves to write code and watch anime.
Search for a command to run...

Just a guy who loves to write code and watch anime.
No comments yet. Be the first to comment.
Qualities that make outstanding builders.

Bipedal vs quadrupedal: how many legs This is about the number of legs the creature walks on. Bipedal. Two legs. Humans, ostriches, T-rex, kangaroos, most fantasy humanoids. Quadrupedal. Four legs. Do

Intro You hear "lerp" and "smoothstep" everywhere in game dev. They sound like math jargon. They're not. Both are small tools that do the same job: smoothly move from one value to another. The problem

What is Kinematics Kinematics is the math field. It's the study of how things move without worrying about forces (which would be dynamics). FK and IK are the two branches: forward kinematics and inver

Intro Textures are usually the biggest cost in a 3D scene. Memory, bandwidth, and load time all get eaten by them. Resizing them is the obvious lever. There's more. This post is about the less obvious

In this article, we will have a look at 5 ways you can improve the existing code.
Sometimes you have a small piece of logic that when extracted to a function with a meaningful name, the code can become more readable and easier to work with and because you know what the function's intent is, you may also know whether you need to have a look into that function or not when reading the code.
Separate intent and implementation
From

To

In some instances, it is more readable to inline the function.
From

To

This one is pretty simple, but will come in handy many times, renaming variables, for them to become more readable and requiring less cognitive load to understand.
From

To

Sometimes you come across variables being reassigned, which itself is a code smell, oftentimes in such cases, the variable in one of the positions has a bad or wrong name.
This can be improved by instead of reassigning the variable, declaring a new one with a proper name.
Personally, from my experience, reassigning variables makes the code confusing, and often requires a lot of cognitive loads to understand the code.
From

To

In some instances, you may have a lot of logic going on, and by breaking up the logic into variables, it is not just easier to read the code and requires less cognitive load to understand, but also easier to debug the code because you can put in a debugger or log out the values.
From

To
