29 March 2019

#012 - Orchestrating Objects Like Hans Zimmer

To help me better understand the data structure when using objects within an object, I find it useful to listen to the Inception soundtrack by Hans Zimmer.

For those familiar with the Christopher Nolan movie, Inception – it is a very crafty movie that has many layers. I won't spoil the movie for you if you haven’t seen it yet – but it is worth watching.

As a coding newbie, I am slowly growing more confident with nested programming including modular arrow functions and concise data structures.

I am quickly learning that if a function appears to be too nested, then I will want to splice the function into separate function modules. Otherwise, I will recode the function to be more efficient using fewer lines of code. I understand it feels counter-productive to write further code, merely to simplify and tighten the functionality of code blocks, but I like the modular approach to programming.

The challenging pitfall to modular programming is understanding where the data is being transferred from function to function. It's also important to maintain the integrity of the data and ensure it is stored inside appropriate data variables when passing the data across functions.

Even my side project, which is the 'deluxe' quiz appears to be simplistic in principal. However, since I am integrating another side project within this quiz - I am willing to craft more modular functions to accommodate supplementary data to my project. Nonetheless, I am liking the challenge so far.

I use Microsoft's Visual Studio Code to program my web projects. I ported over from Adobe Brackets last year, which I have a soft spot for, but I dig the stability and versatility of VS Code and the countless extensions and themes available in the marketplace. Above all, VS Code is free and regularly maintained by Microsoft. I also have Visual Studio Community installed on my PC, as I want to dip my toes in C# (and eventually C++) - on top of my JavaScript endeavours.

You also don't need to listen to the Inception soundtrack when reminding yourself to avoid overly nested code. I personally use the free VS Code extension, Bracket Pair Colorizer by CoenraadS, which helps you visualise your nested code in true technicolour.

I shall keep this blog post brief for this week, as I am expecting new goodies to arrive for my PC... a watercooler block for my CPU and a shiny new case. One day, I will reflect on why I am a Windows guy. Meanwhile, I want to squeeze more code before the delivery man arrives...

~Richard