25 February 2019

#007 - Learn to Code Like a Human Debugger

When I encounter a coding project, I always like to visualise the bigger picture and tally nifty features that I would like to challenge myself to develop.

I am sure this process can act as a personal motivator to see through a project. However, much like a computer - I need to learn to accept and process one problem at a time. Not only will it help me to focus on one problem at a time, but I can scope out the wider project into bite-size problems.

Despite my natural creative approach to everyday problems, I am learning to discern how to design code that can possibly accommodate such ambitious changes. For this, you need to solidify the groundwork of your own codebase.

The one effective tip that I am learning about programming is to build and test each new component block. I recognise it feels like taking two steps forward and one step back. However, I am learning to appreciate the disciplined mindset. Also, you can catch bugs and errors at every iteration, when new changes are made to the program. Unlike my early academic years when I was coding a C++ project at university, I ended up compiling a program that unintentionally shut down a PC (my own terminal).

As I continue to relearn JavaScript from scratch again via Treehouse, I am understanding the syntax and logic much better the second time round. I think certain rules and conditions glazed over my head the first-time round, so it is refreshing to digest the information a whole lot quicker. I also use the Mozilla Developer Network (MDN) for my go-to resource, as it offers a wealth of information surrounding open web technologies including HTML, CSS and JavaScript.

Admittedly, the one feature in JavaScript that I will likely revise is the for (var key in object) for looping objects. However, with the type of projects that I am firing to the DOM (Document Object Model), the dot notation is ideal for my current needs.

I also wish to be careful not to overcomplicate my code, otherwise I will struggle to maintain the codebase, never mind understand the logic (despite my intentional comments).

The one component of programming I am beginning to factor when coding in JavaScript is discerning the state of memory management. I know for the most part, modern computers can process countless calculations and instructions quicker than the blink of an eye.

With this mind, I don't want to write lazy functions or hack a solution the AGILE way, but rather, I want to write functions that will be process efficient to the user's hardware and supporting web browsers. I believe this will make or break me as a software developer to be, especially when I want to transition from web programming to software development using C# and C++.

~Richard