Ask HN: memorization of syntax
A professor at my college that has helped me out with projects before has said that he thinks memorization of syntax is important for first year programming students to learn. This was sort of a WTF moment for me. Is this a common position? It's not how I learned and it sounds harmful. If HN agrees, what should I say to convince him otherwise?
11 comments
[ 3.9 ms ] story [ 46.4 ms ] threadA Computer Science professor is unusually likely to use the word "syntax" very precisely.
FIRST ISSUE: What syntax is available.
Memorization is the way to go here.
For example, write this in C, and you look like a moron:
... as well as violating DRY and thus producing less maintainable code, etc., etc., because you can do it this way: But if you don't already know that C has a loop construct with the test at the end, then you'll never write the second version.SECOND ISSUE: Exactly how the syntax is put together.
Maybe this needs to be memorized, and maybe not.
Consider the above example. I write a "do-while" loop maybe a couple of times a year (?). If I forget exactly how to type it in (semicolor at the end, or not?), then I can look it up. So I figure, as long as I know that "do-while" exists, I can look up the details when I need them.
On the other hand, I write a "for" loop once a week, at least. If I hadn't memorized the pattern
then I would waste huge amounts of time looking it up every time I needed it.However, I don't really need to predict in advance exactly what syntax I need to memorize the details of. If I find myself looking something up more than once in a week/month/whatever, then it's probably time to memorize that.
Disclaimer: If you're taking a college class, and the instructor says to memorize something, then you'd better know it, at least until the final exam is over.