"I have to write code!", said my wife, day 1 after starting her masters, quite excitedly.
"I have to write code....", said my wife, after getting her first assignment, dejectedly.
"I wrote code, but the code doesn't work!", said my wife, after spending a few hours on her first assignment.
"I wrote the code, and it is working, but now I want it to do more!", said my wife, after completing her first VBA assignment.
I sat there, slightly amused. There was something always fascinating of writing a bunch of code, and then hitting a button, and then seeing something happen. I still get that feeling - although the stakes are a bit higher now. It is now more along the lines of doing a big refactor, and have the integration and unit tests pass first time. Or slogging through a bunch of code, only to be left frustrated and walking away for a few minutes, and then coming back, making a small tweak, and things start working again.
"I don't understand how to do this. Why can't I just do X and have Y happen?", says my wife, as she now starts a slightly more complicated assignment.
"I dimmed this and now its not working!", said my wife, after trying to declare and define a variable (I politely explain that Dim is short for Dimension, and dimmed as a verb is not in the standard nomenclature).
"... I then do range open parenthesis quote A two colon B twenty two...", as my wife tries to recite code over the phone to me during a live debugging session.
She found her next assignment quite daunting - iterate over a list paragraphs, find words with more than N characters, count the number of occurrences in all paragraphs.
"Have they gone over loops? No? What about data structures? Yes... array thingies are data structures", as I quiz my wife about she has learned as I try to guide her to coming up with a solution for her latest assignment.
"Here is what the output of your macro should look like, once you are done.", I say showing her the output after writing about 20 lines of ruby code.
"Is this in your ruby thingy you use for work? HOW DOES THAT HELP ME?!", says my wife, somewhat annoyed at how easily I wrote the ruby script.
I admit I was showing off.
But, these few interactions have reminded me that there is more to what we (as people who push buttons to make the rectangle of lights do what we want) than write code. And further, teaching code - that is the syntax and grammar of software - without high level theory, such as data structures or algorithms, or at least how to use arrays with sorting or search algorithms (if not how to implement them), is a tremendous disservice.
It would be like teaching someone the english language, and then ask them to write a sci-fi novel, without teaching them the basics of literary elements.
So, I kept telling my wife to take a step back, and not to worry about the VB code just yet. I asked her to describe the problem she was trying to solve. Then, to break problem down into smaller problems. Soon, she realized that the entire project boiled down to a few core problems, that were repeated in a larger and larger scope.
Now, armed with her VBA for Dummies book (assigned course reading, apparently), she started working through each of the smaller problems. When she ran into something she didn't know, she would turn to google, like she did before. But to her surprise, she was able to find results now, especially on that "stack overflow thing".
Before, she would search for "find unique words in a list of paragraphs VBA". Now, her queries were more specific - "split words on space VBA", "find word in range VBA", "loop through cells in a range".
As her assignments grew more and more complex, I kept reminding her that before she can start solving a problem, she needed to understand the problem. Once you understand the problem, then you can go about asking for help.
I think that last bit of advice is important, even for me, and even for things unrelated to coding, or engineering. We are often in such a rush to solve the problem, we try to short circuit to find a solution, without stopping to understand, I mean really understand, what the problem was to begin with. Understand it so that you can confidently explain it to someone without prior knowledge of the situation, so they too can understand it.
My wife was able to handle the coding assignments with ease, and pass the class with a grade she was proud of.
I still can't get her to stop calling snippets of code "A code".