Haskell Live: A Live Coding Adventure
haskelllive.com
haskelllive.com
First, it's difficult to google/copy-paste. Second, it just goes against the way I learn new programming languages - I generally read it, then try it, then experiment with it in some other ways, list few pages back/forth, experiment more, fail, then continue. Usually copypasting/rewriting chunks of code. "What happens when I do THAT? Oh, it fails miserably. Why? Oh, that's why."
I can easily reread some parts. I can easily skim back/forth. While with the video, I don't want to hear the person more than twice, usually. The voice becomes annoying for the third time you hear it.
I feel that videos work great for demonstrating a language. I can never actually learn any language from a video tutorial.
(If you will bring the analogy of lecture - yes, this is partly true, but good lectures should be somehow interactive. The lecturer asks students, they can ask the lecturer back.)
I like video tutorials/screencasts as long as they have the following :
1. Trainer starts with a basic list of topics/table of contents. Nothing fancy but give me an overall overview of what I will learn out of this.
2. A particular topic is taught gradually i.e. by starting with a simpler or even wrong way (as in best practices) and then improving it to show the more standard way. For don't just show me the final end product.Show me how to do it in a crude/simpler way, then improve the code (may be refactor etc) or add more features. Explain each improvement while you are doing it and WHY you are doing it.This makes us learn the gotchas and pitfalls and may be even best practices.For example, I can put all the code in one file to start with but then how can/should I refactor it in some recommended way? (MVC?)
2. Show me more than 1 way of doing something if it helps me learn the concept. Again, kind of related to #1.
3. Break the code on purpose and explain what the error message means. Then fix it and re-run. For example, in learning Django/Flask, if you are missing a template, it will crash/error out. So don't create the template right away. Build the code without template and let me see how it crashes. Then add the template and re-run to show me success.
4. Unless you are teaching design specifically, save the HTML/CSS/JS tricks/enhancements for the end. Show me the core product.
I am sure there are more but these help me a lot personally. In fact, I am learning Python/Flask right now and looking to write my own tutorials on how I learnt it.
For a .Net guy with a little knowledge of Haskell like me, in the video you can show not only the language but the IDE and the programming experience.
That's a feature! No seriously. Among an august audience like HN people might have more discipline to properly grok the code they're copying, but I know of plenty of places where people will just copy and paste disparate chunks of tutorial code into their editor then start randomly changing lines and variables (with a hundred questions demanded of the poor folks in some irc channel) until it sort-of-but-not-quite works. Forcing people to write it from scratch, having had the construction demonstrated, seems to aid the mental digestion of the code much better. That's just my anecdotal experience anyway.
And it's plain faster. Having this tutorial in text will probably take you more time to read than you could have saved copy pasting.
Of course, opengl/webgl isn't a language, and the hand-holding might be more necessary.
Finally, all of his code (each finished milestone, of which there were at least a dozen) was available on github.
For the lazy: http://www.youtube.com/watch?v=me3BviH3nZc
For another thing , the assertion that enumerating all the cases for a given function instead of using a lookup makes the code more obviously correct is somewhat flawed - it violates DRY, which is, like exploitation of compositionality, important in programming in general. Suppose the showPiece function had twice the number of cases. Would enumerating the cases individually or making the assertion that the code is more obviously correct as a result be reasonable?
In my view, you are solving the same problem whether you use a lookup or enumerate the cases individually, and it's not even a very big problem - just put your tokens in the right order.
An unobtrusive way to introduce editor tips that just came to mind would be to add subtitles with selected key-combos that might be nontrivial or not obvious. More than that would be a distraction, I think. Also, I don't know if YouTube supports multiple subtitle tracks... so that might be a big fu to deaf or hearing impaired programmers who want to follow along.
My biggest focus in using vim was to get it out of the way so that I could focus on the Haskell. I wanted the environment (editor, compiler, window manager, test runner, etc) to be as transparent as possible. This is not, in point of fact, a series of vim tutorial videos.
I will make a video that explains my dev environment as a supplement, however.
I'd be happy to answer any vim questions in the comments (github issues, which I will hopefully figure out how to embed in the site eventually), and I do like the idea of adding call out boxes (no need to use subtitles, they can go on the video itself) to highlight interesting vim trickery.
No, I wouldn't want them to casually say anything... that's why the subtitles would be an unobtrusive compromise, since you can just turn them off. I think this would be even more important if the screencast was targeted at new users of the language or framework or whatever, since the viewer might be confused and wonder if ":tab" was something to do with the syntax of the language.
Really nice video, looking forward to more!
<3 HN
It can be verified in the code, and in the REPL when it's being tested.
Left: vim with Vim Haskell Mode[1], a pale imitation of emacs haskell minor mode that nevertheless gets the job done. ;)
Top right: GHCi
Bottom right: Guard, as mentioned, using guard-shell[2] to compile the file and run main using runghci.
[1] https://github.com/lukerandall/haskellmode-vim [2] https://github.com/guard/guard-shell