Code Memorization 101

As we learn to code, we have probably all experienced the frustration of stumbling over the basics and feeling like we will never get to the more advanced material because we keep forgetting the simplest things.  How do we remember that HTML command or learn that CSS protocol to make the magic happen on the page a little faster? How do we, like the pros, keep the basics in the forefront of our minds where we need them so we can become pros, too?

Paradigm Shift

I don’t know about you, fellow classmates, but when I signed up for Writing on the Web, I didn’t read the course description.  It simply sounded like a good class to take to be better prepared for the multi-modal-ness that has infused the writing profession. 

From the name of the class, I thought we would be learning some design principles concerning texts or visuals that make for interesting websites; you know, as in, Writing FOR the Web.  I assumed we would be working with template applications like Word Press, Jigsy, or Weebly.  With these apps, we only have to learn how to use a limited set of functions already thought out and laid out for us. 

Despite the ease of these and other Web 2.0 features, the learning curve is high for me because I don’t know much about computers or using these programs.  Coupled with assignment deadlines and never having enough time in the day to explore and experiment at my leisure, thoughts of the above ventures onto the Web were intimidating enough.  

After the first class and a good look at the syllabus, I realized I should have been thinking about the class along the lines of Writing THE Web.  We are going into the Web, Dr. Martin informed us, not just onto it!  As it sank in that we would be learning to write computer code so we could build our own websites (:-0), truly, I was downright nervous.  

As the weeks have progressed in class, though, my interest and fascination for programming languages has become stronger than my intimidation:  I want to go into the Web instead of just onto it; I want to thoroughly learn this skill; I want to be able to code my own work.  And the faster, the better. But how to do that when there is so little time and so much to know?

How the Pros Do(n’t) It

I chose this topic as one of my three blog articles so I could answer these questions.  Because I knew I would have to do tons of research for these articles, I thought it would be a great way to inform and to help us as a class with any “noob” frustrations that were sure to reveal themselves as the class and the code progressed.  I couldn’t think of a better way to find the time to study how veteran coders learn and retain all they know than to think of it as a requirement for class.

However, I was not expecting what I have learned about the subject:  How the pros memorize code is, mostly, they don’t!  Many experienced programmers swear it is not necessary to memorize commands because the more we use them, the more embedded in our long-term memory they will become.  Few, if any, of us will ever be able to memorize all the commands associated with a program; even coders of many years still use “cheat sheets.” 

The majority claim “. . . [i]t is more important to know how to look it up rather than to know the information itself.” (programmers.stackexchange)  They point out that as long as there is a solution to a problem encountered (sometimes there isn’t!) and an accurate programmer resource like Mozilla Developer Network (MDN) or w3schools is referenced, that is enough.  In other words, they preach what our parents always preached when they wanted to annoy us:  “Look it up!”

They blow off the extra time spent and the ribbing we will surely take when other programmers see us using a ref manual every step of the way.  Do it anyway, they say, and be grateful that reference manuals are there to guide us.  It is far more productive to understand the concepts behind the function rather than to recall the function itself.  If we understand why an attribute, a tag, or a selector is used, knowing what to do to create it will come more intuitively, the experts assure. (blog.treehouse)  

Programmers advise against rote memorization for exactly that reason—our goal should be to hone our intuition skills, not memorization skills.  Tom, a developer commenting on an article about the subject of code memorization apps at smashingmagazine.com, says, “That’s not a learning program, but a way to memorize facts.” [Emphasis added.]

Another reason this is a best practice is because the programming languages change so rapidly.  Again, understanding the underlying connections between computers and programming will always serve us better than knowing many commands in just one or two languages.  As we strive to fully understand the concepts of developing, we will save ourselves a lot of new “basics” learning when Ruby goes off her Rails and onto something else.  When she does, or when we get those fabulous tech jobs where Python or PHP is used, knowing the principles that all languages share will allow us to apply them regardless of the fact that we may not yet know the syntax or specifics of these languages.  (This is also when we will be very thankful for the ingrained habit of reaching for our handy-dandy, accurate, reference manuals!)

Programmers think that memorization might have a limited usefulness, but warn that it makes us lazy and being lazy about really learning or collaborating on new methods poses the risk of us getting stuck in a familiar rut, a comfort zone that lacks creativity or curiosity.  It is constantly exposing ourselves to new techniques and then patiently, but consistently, practicing and applying them that pays dividends.  

We should be creating something all the time, whether it is a mistake-ridden first attempt at a new trick or a masterpiece of perfection, it makes no difference.  Just keep coding because that is the only way.  We will notice that our code consequently gets better as we gain more knowledge and hands-on experience.     

Getting heavily involved in open source projects and sharing our own creations with others to receive feedback are also critically important ways to properly and truly learn code and understand the deeper complexities of computer science and programming.

But, If You Insist . . .

Yet, there are times when we as new coders might feel the need to recall more automatically some of the foundational steps in JavaScript, CSS, or another language.  For such a time as this, recording and studying a function or a piece of code in an app like Anki, a stacked repetition program, can help.  The stacked repetition technique is a glamorous way of saying we can make and use flash cards for frequent study.  We no longer have to spend hours hand-writing on index cards, though; applications on our computers and phones have taken some of the labor out of the process.  Anki is perhaps the most well-known, but there are several other programs like it:  Revisy, Supermemo (not free!), and Memrise, to name a few.

Programmers have better strategies than memorization for keeping up with code they want to refer to in the future.  An expert in her own right, our very own Professor Martin has revealed in class that she practices the following and has strongly advised that we should consider doing so, too.  Other seasoned programmers offer the same advice.

  • Keeping a code journal in an editor like Gistbox, “the beautiful way to organize code snippets,” to copy and paste code for future reference and practice is an invaluable learning tool.

  • Evernote invites us to use their “workspace for your life’s work.” Do any of us feel like the code we are working so hard to learn is not our life’s work? Using this or a similar app to record detailed notes while learning is another way to regularly study and review code and methods with which we are trying to get familiar.

  • Much can be learned from looking at the source elements in websites we like to find out how the programmer turned a cool trick we would like to imitate—write it down or copy and paste into a note-taking editor and then go practice it!

  • Just as valuable as studying on our own, open source spaces like CodePen—they bill themselves as “the developer’s playground,” who can resist?—will get us in the know faster and give us experience working with other programmers. CodePen is also an excellent resource for learning by studying what others are doing and how they are doing it.

Conclusion

The best way to learn something is to repeat it and apply it over and over as quickly after being exposed to it as possible.  The more hands-on we are with it and the more we apply the item or information we want to retain in context, and especially, the more we collaborate as we learn, the faster and easier it will happen. 

That is not to say that learning, or even memorizing, code is easy, especially when new to a language or trying to learn a few languages at a time.  But with practice, patience, and a little self-forgiveness, we will be able to recall the proper command when we need it.  If not, we can always do what the pros do and look it up.


Works Cited

http://blog.teamtreehouse.com/retain-code-youre-learning

http://programmers.stackexchange.com/questions/154497/is-it-necessary-to-memorize-code

http://www.smashingmagazine.com/2014/08/mastering-a-programming-language-using-spaced-repetition/

 

11 thoughts on “Code Memorization 101

  1. I agree with what you stated in this post-the best way to learn how to code is to practice it. Learning a new skill, such as coding, can be challenging for many such as myself. I used CodePen and Editey because I need a visual aid to help guide the coding process-both allow me to code with the iimage next to it. I was intrigued by SuperMemo and how to optimize learning as you stated and as outlined in this article below:
    http://www.wired.com/2008/04/ff-wozniak/

    Also, scientists have discovered that coding is more than just math-learning to code activates the language learning processes and help improve analytical skills in the human brain as discussed in this article:
    http://www.fastcompany.com/3029364/this-is-your-brain-on-code-according-to-functional-mri-imaging.

    Liked by 2 people

    1. I haven’t read the wired article, but I will this weekend. It looks interesting. However, I used the other article as one of my sources in the post. It is such a fascinating study! Thanks for reading and commenting 🙂

      Liked by 1 person

  2. You know, I wasn’t expecting to learn coding when I signed up for this class either! I wasn’t sure what to expect, but I am always willing to learn something new. I couldn’t possibly remember all the different selectors and attributes and specific formatting. I do well enough to remember the syntax, like you said!

    It’s been really interesting to try to approach this as learning a language, especially because it doesn’t use the same pieces: spoken languages conjugate verbs and have structures for how verbs and nouns and other words interact. Code does those things too–just without the concepts of “nouns” and “verbs.”When I took Spanish, I was able to learn using familiar words like verb, noun, adjective, subjunctive, etc. I could look at how Spanish was different than the English I knew and apply the rules accordingly. However, I can’t take English syntax and figure out how coding is different. It’s not the language of another country–it’s like it’s from another planet! That’s kind of what the Internet is, though: a whole new world where hundreds of millions of computers communicate using this bracket-filled language that forms the home of our strange human words.

    Liked by 2 people

    1. I think the same could be said about American Sign Language (ASL). It is advised that when learning ASL, you try not to form English sentences in your head. It will trip you up because ASL lexiconizes and conceptualizes many of the noun and verb functions. I never found the shapes and facial cues hard, it was remembering verb placement before noun or topic first, comment second. Your comment reminds me of the example @expena used in her “Polygot” article. Yet, it is easier to know the facts about the language than it is to execute it smoothly without a lot of practice and I think the reason for that is, like you said, the learner has no familiar cues to lean on.

      Like

  3. I’ve got to admit that I have really enjoyed coding. It’s fascinating to me that you can type in a few things and create pictures or graphs or lists.

    I’ve heard four or five people discuss Evernote this semester, so I think I’m going to try that. I want to memorize some basic code so I don’t have to look it up–– that always gets me into trouble, as I have ADHD and tend to go down the rabbit hole, so instead of taking an hour to do something, it’ll take four, but I’ll be able to tell you about the issues and trends of that specific code. It’s rather frustrating, actually.

    I’ve gone back and looked at Code Academy a few times just to make sure I’m doing things correctly. I can see, as Tonisha brings up, how coding can access the language section of one’s brain.

    I’ve recently seen a trend with my students in which they want to learn to code, and I think it’s great. I’ve got a few students trying out Code Academy, and I think I want to try Java during the Christmas break. We’ll see, though.

    Liked by 2 people

  4. I’m with you too! All I knew when applying for this class was that I would be fulfilling my requirements for PTW major. I never realized that we would actually be writing THE web, as you said. I remember taking a javascript and C++ class in high school, which ended in failure. Now that I’m older, I see that writing on the web IS all about practice and repetition. There is no other way around.
    I guess I’ll just have to suck it up and get to practicing some more on my individual website. Best of luck on code memorization, aka repetition.

    Liked by 2 people

  5. I love this post!! When I first started learning how to code I wondered how “real” coders were able to memorize all this code and didn’t want anyone to see my googling but then I realized even the best coders look up how to do stuff all the time and that made me feel so much better!! I love that this field is constantly growing and changing and that everyone has to look stuff up. LOL!

    Liked by 2 people

  6. I’m not in any way a “real” coder, but I’ve coded enough and long enough to know that memorization is something that comes with experience. And just like everyone is saying, even the most experienced coders look stuff up!

    Having a good reference is invaluable for coders at any level, and what that reference looks like will vary by individual. Some of us prefer to have a printed book to flip through, and others will be content to work with online resources. Some editors will help you along as you code, which can be helpful for beginners tool.

    (Also, Evernote is everything. Evernote for president!)

    Liked by 2 people

  7. True…true…true! It seems to be all about practice and repetition! I’m happy to know that even the pro’s don’t remember this stuff; guess I’m not so bad off after all.
    I can see that notes are key as well- while in class I took notes from Dr. Martin’s instructions and also while using codecademy, I noted many things I found challenging and had I not done so, I’d be a mess right now feeling that I needed to start the learning process all over again!
    With all that said, this course has definitely set a foundation and I do feel confident that I could confidently continue in the field of study- WITH A MANUAL OR CHEAT SHEET of some sort which says a LOT because before now, all of this was Greek to me!

    Liked by 1 person

Leave a comment