3 ms·
Yeah I think learning pattern matching like regexps before learning control flow and state with variables could be a good thing. I can imagine a curriculum whe
by chubot 9y ago
Yeah I think learning pattern matching like regexps before learning control flow and state with variables could be a good thing.
I can imagine a curriculum where you go from HTML (data) -> regex (patterns) -> full source code. One thing I noticed is that a lot of people who want to learn to program aren't that proficient at using a text editor and generally using a computer, and doing HTML first will solve that.
But I also think that regexes have the obvious problem of syntax too. I have taught regexes along with Python to non-programmers, and it works OK, but the material didn't demand too much. I think it was basically \d+ and one or two other constructs.
FWIW one of my goals is to combine bash, awk, and make, although this is sort of far off: http://www.oilshell.org/blog/2016/11/14.html http://www.oilshell.org/blog/2016/11/14.html
Awk is an OK first language but honestly it's worse than JavaScript, because you can't even return an array from a function. Also, functions can't be used as parameters or return values to other functions.
Although I suppose it has the advantage of being very stable and immediate, and not requiring NPM and what not. However JavaScript has the advantage of integrating with the web.
---
As far as the blog, it's a bunch of custom shell, Python, and CSS that I cobbled together over the years, and then wrapped in a Makefile. I use markdown.pl but I'm thinking of switching to CommonMark. I've made several static websites before so I copied the best bits, with not too much cruft.
It also evolved over the course of the blog. It looks really simple but there are some details that I spent awhile on.
(And honestly I wish Oil existed so I could write it all in one language, not shell + make + Python!)