Categories
Spur Of The Moment

FreeStyleCoding

Today I want to write a short post about something that I realized I still do from time-to-time…something that I believe most folks out there do as well. It’s something that sneaks up on you when you’re in the middle of solving a coding problem; something that I call, freeStyleCoding.

Now, I’ve never looked up this term before, so it probably exists. It may have a similar definition, or it could mean something entirely different in within the community…. All I know is that it was something that I noticed about myself…i needed a name for it and came up with FreeStyleCoding.

So what is my definition of freeStyleCoding. Well as the name suggests….your free-styling…you’re coding off the top of your head from start to finish.

When does it happen? I realized it happens more when I’m stuck on a bug in some code that i’m writing. I’ve searched on google for answers to no avail, checked out the JavaScript-MDN website and searched stackoverFlow to no avail. My brain is exhausted, I just want the damn thing to be fixed so i can move forward; however I am too stuburn to walk away for a few moments, only to then come back and knock things outta the park within a few minutes.

So what happens next? I start typing random pieces of code into my text-editor in an effort to clear the problem; not realizing that even if the random piece of code that I typed into the editor cleared the problem, that I run the risk of missing the opportunity to actually, FULLY, understand why the fix worked.

I’m sure you can see why this is a problem. — in some cases.

However, sometimes freeStyleCoding can be a good thing.

How?

Well, sometimes you have this urge to just code…you don’t know what you want to build, you’re not in the mood to write psuedocode. You just wanna type some shit out and figure things out as you move forward. It’s almost like hopping into a car and going on a long drive….just driving aimlessly, why? because it feels good. You just need to get-away — doodling, if you will.

It’s same thing with coding…sometimes you just need to get the fuck away from all the structure, the unit-tests, verification, etc..etc. You want to be free to do as you wish.

The other day I was exhausted from looking at some nodejs code I’m currently working on. I wasn’t tired enough to pull myself away from the code, I wanted to do something, code-wise…just didn’t know what…so i opened up devTools in chrome and randomly started typing in shit that I knew off the type of my dome.

var a1 = [1,2,3,4];
a1[1]
var a2 = [...a1];
var ob1 = {
	arr1: ['name','age','rand1'],
};

ob1.arr1 instanceof Array

It was literally anything that i could think of.

Then something, unexpectly, happened

I figured out how to solve a the problem that I was trying to fix within my nodejs code.

I was confused by this because generally, when you’re in “stuck-mode”, you’re “supposed” to physically and mentally remove yourself from anything that has to do with code so you can reset your brain.

That experience taught me to be more open to other ways of “resetting” the brain while still being engaged with the thing that I’m supposed to be taking a break from….its almost like putting your brain in hibernation-mode, not completely turning it off.

This may or may not work for you, it will all depend on your personality, the project you’re working on…many things.

Give it a shot.

Hope this post helped.