RECENT TOPICS » View all
Has anyone used an SRS like Anki to learn programming languages? I've just started learning an obscure language called "Q" for work (http://en.wikipedia.org/wiki/Q_(program … x_Systems)). It's got particularly obscure and difficult syntax. I'm "sentence mining" short code snippets from a manual, but I wanted to see if anyone else had any suggestions or lessons learned for this kind of thing.
Hmmmmm
Doesn't the manual provide 'example questions' for which you can write programs using the code you've learnt?
I feel like I'm repeating myself here, it may or may not work, but I don't think you'll be as competent as a person who learnt the langauge the proper way. I've only ever written in engineering type languages, C, Assembly, FPGA, Matlab etc. The usual way I learnt that was;
1. Output "hello world" - lessons you learn, basic syntax, compiling issues, input output functions
2. Basic Mathematical algorithms programs - you get alittle messier this time, working with slightly more complex data structures, arrays, lists, what not
3. Programs - bla.
*Use* the stuff you've learnt. There's no other way dude lol. I don't know how hard it can be. If you're having problems then you should go back to page one, the crux of anything, and with programming languages especially is in the fundamentals, which is why I always see first year kids copying solutions off their friends, not because they couldn't remember the syntax, but because they didn't actually attempt to program anything. I forget syntax here and there, but I'm sure there's a look up table somewhere.
So in summary, no no no, program, get your hands messy, learn loop holes, learn as you go. I had to learn LabView in 2 weeks for my thesis project and I survived, I didn't even learn it through fundamentals (which is why my program sucked) I just learnt off example templates as I didn't have enough time to learn it 'properly'.
first martial arts through srs, then music through srs, now programming through srs
I blame this all on khatz!!
liosama wrote:
Hmmmmm
If you're having problems then you should go back to page one, the crux of anything, and with programming languages especially is in the fundamentals
I think thats exactly why the SRS would work for a programming language. Put code snippets and/or explanations of the fundamentals of the language into your SRS and then never forget them; instead of having to go back to page one unnecessarily often. That way you have a solid foundation from which to build your understanding and you can start to actually use the language and applying the concepts.
SRS and actual application are not mutually exclusive. The SRS will only help for the memorisation. And that also means that one cannot replace the other; you have to do both. The SRS won't do it all for you, but it will probably help.
Last edited by blackmacros (2009 June 23, 9:23 am)
I'm curious though as to what would go on the cards?
front: explanation in english
back: code?
or
front: pseudocode
back: code?
or
front: code
back: explanation in english
either way, srs is helpful in that it keeps you from going to the manual every three seconds but, liosama has got a point here, the only way to learn how to program is by programming.
blackmacros wrote:
liosama wrote:
Hmmmmm
If you're having problems then you should go back to page one, the crux of anything, and with programming languages especially is in the fundamentalsI think thats exactly why the SRS would work for a programming language. Put code snippets and/or explanations of the fundamentals of the language into your SRS and then never forget them; instead of having to go back to page one unnecessarily often. That way you have a solid foundation from which to build your understanding and you can start to actually use the language and applying the concepts.
Programming languages are the most 'perfect' languages so to speak, since they were created by humans in the Post-Chomsky era. They are logical, they build on top of each other in most cases (both syntactically, and logically).
There is no point memorising 'snippets' of code. You ought to understand them instead, and to understand them you have to go back to page one, building blocks.
Programming is purely an immersion thing, after a few weeks in of you kicking it in and actually writing things instead of wasting time SRS'ing random crap that you should be typing in, you will be able to speak it fluently.
Every programmer forgets syntax, that's why they create look-up tables in the first place, [5 years since one hasn't programmed] "oh shit what's the syntax of linked lists in C", *looks up* 0.5 seconds later "kk" [Memory kicks in]
Programmers should focus more on algorithms and data structures instead of syntax and 'programming'. Competent programmers know their languages well not because they memorised manuals, but because they got their fingers dirty. You can memorise manuals, look up tables using an SRS if you want to, but while you're doing that I'm pretty sure a company would have hired someone else who was concentrating more on creating a more efficient algorithm. That person most likely got to where they were by going through a book from page 1 which asked you to write a program from scratch and continually build on it.
I've never written in any database type of language before, and I know they're usually syntax heavy, but a programming language is a programming language.
In any case you can ask khatz, isn't he a programmer himself? ![]()
I have thought about using SRS to improve my understanding of a programming language that I am already familiar with.
What separates an intermediate programmer from a great one? Probably the amount of tricks you know for solving various problems.
Mining open source projects for interesting fragments of code could be highly productive. Also, you could use the SRS to learn all the commands available to the language and their usages. Might be useful if your language has several thousand built-in or easily accessible commands.
To become good at Japanese, you have to use it. I don't see how it's any different at all from a programming language.
Question is, will you need to be fluent in a programming language? Probably not. That's why no SRS is needed, there's no need to memorize anything. APIs, references etc can be found anywhere.
I think it could be useful to SRS some Design Patterns or similar knowledge. Learning facts for specific programming language would be too inefficient from my point of view as you should be able to understand and be able to use any programming language with the help of some more abstract and general knowledge... and the API (as Tobberoth pointed out).
But my point of view is that of a computer scientist so it could be differ greatly from the point of view of a programmer.
Last edited by thorstenu (2009 June 23, 10:57 am)
I think an SRS would be perfect. SRS is for remembering things you don't want to forget. The supermemo site has a lot of information on how to formulate questions correctly. I was thinking of using such a technique to learn a new computer language but I haven't made the time yet. If I do, I'll make a post about it.
I absolutely agree that the best way to get fluent in writing code in a programming language is to get your hands dirty. It's much easier to learn a programming language than a speaking language because you can get instant feedback from the compiler, from the results of running your program, etc.
However, I think that for the specific task of quickly getting fluent in reading a new programming language is different. When you have to dive into a large codebase, particularly in a language that has very odd syntax like Q, I think it may be helpful to know all the weird syntactic idioms.
For instance, in C++ there's pretty much just one way to define a function: "returnType functionName(params)". In Q, you could see "f:{[x;y] stuff }", or "f:{[x y] stuff }" or "f:{ stuff }" (you get access to x and y anyways in Q) or "f:g[42;]" or a couple other possibilities.
If I just started writing code, I would just pick one of these styles, probably the most verbose, and stick with it. Over days or weeks or months, I would learn about the other styles.
But if I have to read code that others wrote, I need to know whichever style they used, and if it's production code I often don't have the luxury of messing with it to see how changes affect program behavior. That's why I'm experimenting with SRS in this case.
Like I said, I don't know if it will work, but we'll see.
I'm putting stuff like
front: How do you code this simple task
back: The code that does it (typically only 1 line)
or
front: What is the output or return value of this code: (code here)
back: The value
dbh2ppa wrote:
I'm curious though as to what would go on the cards?
front: explanation in english
back: code?
or
front: pseudocode
back: code?
or
front: code
back: explanation in english
either way, srs is helpful in that it keeps you from going to the manual every three seconds but, liosama has got a point here, the only way to learn how to program is by programming.
Been thinking about that before. Learning a programming language with a SRS, actually I'm doubtful we are learning just about anything with a SRS... as opposed to "memorizing"... but this could easily become a pointless discussion about our definition of "learning".
Anyways.. for programming languages, there is very real value in taking the time to read docs, and read about a language in full. It's usually very boring to do, and if you're like me you'll jump straight into the code and also google up anything that you don't know. It's not wrong per se, as you learn on the fly, .. but there are all the finer points that you never learn, if you don't discipline yourself to study a language with a book and do many of the examples etc. Frankly I never took the time to do so recently, but I once took the time to read part of the W3C specs for CSS 2, and it was surprising how much a difference it made, when I understood clearly how the layout model works. Until you read the docs and learn the finer points, you just keep on punching in the dark, adjusting a little bit here, a littile bit there.. until it works.
So I don't know if you can do that learning with a SRS, you could just use the SRS to memorize the various language implements.
Which brings me to my first thought about programming + SRS : memorizing cheat sheets. That has value but I don't think I would bother. In my experience the biggest obstacle to become more efficient and skilled wiht a language is just NOT knowing what you can do with it, for lack of having taken the time to learn it. There's a funny quote from Douglas Crockford (Yahoo's Javascript evangelist) about how Javascript is the only language in the world everybody feels they can do without having to learn it! But I think we do a lot of that after we learned our first 2-3 languages the hard way.
Using SRS you can spend a couple of weeks memorizing a programming language manual and, then, write a program without a cheat sheet - like a professional programmer.
liosama wrote:
first martial arts through srs, then music through srs, now programming through srs
I blame this all on khatz!!
I know people who use it to learn creative writing, public speaking, self developement, preserving health, magic tricks, and seduction skills!
ahibba wrote:
I know people who use it to learn creative writing, public speaking, self developement, preserving health, magic tricks, and seduction skills!
Just as an aside, I'm horrendously terrible with names, but I've been using Anki with pictures from the company directory to get much much better at this
ahibba wrote:
I know people who use it to learn creative writing
How does that work, then?
I used Anki so that I didn't forget lots of syntax for a language called ML that I new I would need a while after I learnt it. I didn't really use the SRS for learning, I just did reading and writing code, solving problems etc. But when it came to remembering syntax I used the SRS like this:
Front: English explanation or pseudocode
Back: Actual code.
It's to easy to say "Yeah I get that" When you don't have to produce anything. I always review with a pen and paper so that I can't cheat too.
The important thing is that this is to remember, not to learn. This doesn't teach you how to solve problems at all, it just stops you forgetting syntax.
Even if you are quite good at programming in a language, it can help SRS:ing code snippets that reveals the subtle properties that can cause unexpected bugs.
Here is some things I have run into in Java that is not obvious:
Declaring the reference as "private final static" does not protect the object if it is mutable; you need to make a copy if you have an getter for the object.
If you want to override equals() you also need to override hashCode() as well.
If you have a loop that parse information into an array and add that array to an array of arrays, make sure to create a completely new reference in every loop. Otherwise the result will be an array containing several references pointing to the exact same object.
I'm going to learn jQuery with the help of anki. First, I'm going to focus on getting one of the many "cheat sheets" for it and create cards based on that. Later on commonly used code patterns (not exactly design patterns), little hints/tips about how this language is different from a language I already know... I'll probably figure out some more stuff while doing this, also, this thread might give me some ideas.
I don't expect becoming good just from SRSing, getting good comes from coding a lot.
The SRS has its place the beginning stages. I think it'll speed up getting from complete novice to slightly competent, after that its all about coding A LOT. This is what I think, and so, this is what I will try. If I fail, so be it.

