Understanding closure on an intrinsic level is easy. Humans are motivated to seek it. Loose ends can leave us with an uneasy feeling of ambiguity, misunderstanding and, often, dissatisfaction.
The irony of closure is that it’s elusive and fleeting. Although ambiguity can be a fun place to visit once in awhile and it’s challenging to explore new concepts. Satisfaction with a completed project, task or goal is rewarding, and the level of difficulty is strongly associated with the satisfaction we feel.
The low of difficulty and the highs of satisfaction have been on my mind a lot since I started learning to code several months ago. To be honest, it’s been mostly difficult, but it’s changed the way I look at the learning process and how I interpret closure.
How I got started
I like to make things. It’s in my blood. It’s why I trained and worked as an industrial designer. Often when I set out to create, the result is rarely how I imagined it in my mind’s eye. I’m not sure why, but I usually attribute it to lack of time, understanding or planning.
The process makes me better and what I am able to create going forward is stronger. But my satisfaction and need for completion are not met. This is frustrating. I feel that I’m just not skilled enough or smart enough to figure it out.
When building software, the material is lines of code. But learning to code is one thing and truly understanding code is another. The biggest difference is the feeling of closure that comes from the latter.
Learning to code
Picking a language to study is difficult. The best bet is pick one and stick with it or decide early it’s not a good choice and switch to something easier. I chose JavaScript because it’s relevant, easier to understand than lower-level languages and it’s interpreted. With no compiler step, all that is required is a browser and a text editor.
I’d read that Eloquent Javascript by Marjin Haverbeke is a great place to start. What it should have said is Eloquent Javascript is a great place to start for those with a background in computer science. It assumes a foundation in programming that I didn’t have.
Halfway through the third chapter the book has lessons on JavaScript closures. I convinced myself that I understood it and was ready for the problem sets. What followed was days of frustrating moments that mostly involved guess and check. The feeling after finishing the chapter on closures was anything but closure.
Taking a step back
What I forgot was that learning requires patience. It’s a process of struggle that is not mastered with one resource. I had to relearn how to learn.
I took a step back by using a more basic resource. Codecademy is a brilliant tool that teaches an array of Web-related technologies in simple terms. That’s what I needed. I moved on to Udacity and then Code School. Each of these resources include challenges in order to move on to the next step.
Do all of them. If you don’t understand the question or the concept, then Google it. Use the hints and try to figure out what is happening. Don’t be tempted to just Google the answer. I did not get any closure out of having someone else answer the question for me.
Branching off on my own
Learning JavaScript didn’t quite satisfy my appetite for closure either. It only exacerbated the problem. I still felt as if I was trying to access a local variable outside of a function’s scope.
Finally feeling creative in a medium that I had just begun to scratch the surface of was exciting. A friend suggested I create a basic image gallery. Unfortunately I hadn’t realized that a simple image gallery isn’t actually simple.
Sometimes it’s best to take a step back and think about a problem in non-technical terms. In other words, learn to write pseudo code. I also learned to compartmentalize and break a problem down. I listed all of the functions the photo gallery needed to do then tackled those one by one by replacing my pseudocode with real JavaScript.
I spent about five weeks on the gallery page. I cooked up enough spaghetti code to feed an entire family, but I did it.
Closure
Closure can be a constant push and pull journey with varying degrees of learning, failure and satisfaction – or lack thereof. Computer science is far too vast for one person to know everything.
I once thought of closure as a final understanding or fulfillment from completion of an objective. Studying code has showed it’s more nuanced than that. Sometimes closure can be as simple as understanding a way to solve future problems or it can be realizing to not beat myself up over a lack of domain knowledge.
My feelings of fatalism, inadequacy and frustration have been replaced with understanding. I’m now equipped with a set of tools to manage daunting tasks. And that to me is closure.