Hacker News new | ask | show | jobs
by atemerev 2619 days ago
I teach coding. Here are some of my insights:

— Remove the instrumental barriers first. I start with teaching the basics of UNIX shell, navigating the file system, processes, editing files etc. Students will move much faster if they do not stumble on basics.

— Continue with the notion of system libraries, dependencies and teach how to use system package managers to install stuff.

— Explain what APIs are and teach how to call them manually for some useful results. E.g. use curl and Twilio API to make phone calls.

— Write simple scripts: call multiple API endpoints, use variables to store intermediate results, use simple loops. I hate bash, though, so any other language will do.

— The lowest-level API is machine code / CPU instructions. Write simple assembler code to calculate something, translate it to ASCII string (explain how symbols are encoded in ASCII and Unicode/UTF-8), and package it to the boot sector / boot it via QEMU.

— Move to C, learn about data types, arrays, pointers, etc. Use some fancy GUI library for additional immediate gratification.

2 comments

Interestingly, I learned to program in a completely different way. When I started in 1979, the computer terminal where I learned could only run BASIC. There were no directories, just BASIC. We had one book that could teach you most of the commands, IF--THEN GOTO, SET, PRINT, FOR, NEXT, GOSUB. There was no WHILE statement. I think I spent months playing with those before learning about arrays. The biggest breakthrough was finding a Star Trek game in BASIC. I was amazed at what could be done with such simple commands. After a year or two, my father bought a TI 99 4A computer and I got a Commodore 64 about a year after that. You could write assembly code on the C64. I learned about ASCII file input and output in 1982. I don't remember learning about directories until I got to college in 1983. I don't think I used any libraries before 1986. (I did use punch cards in 1982). I think the first time I saw UNIX was 1990. I don't think I saw a package manager before the 1990's after I had been programming for over 10 years. The first time I did object oriented programming was about 1994 I think, C++. I got an MSCS in 1996.
I learned how to program BASIC in the early 80s from magazines, when program source code was printed out and you had to type it into your computer verbatim. At some point, you switch from being a typing drone to trying to understand what you were typing.

The worst part was when there were bugs in the printed source code. If you didn't know how to fix it, you had to wait until the errata showed up in a future issue of the magazine.

Similarly enough I went from BASIC to Pascal to C. Actually I tried to go from BASIC to C, but that was a bridge too far due to my lack of visceral appreciation for structure. At that time, Turbo Pascal was a god-send as a development environment - crazy fast, decent editor and library all in one tiny thing. In some sense, I owe any advancement in CS to that tool.
So did I, but we live in 2019 now. The optimal path for productive coding looks different these days.
It's definitely good when you can make the time and space to build up all the concepts from scratch. In retrospect, I should have done this with my last trainee. Smart person, fast learner, but so many pieces were missing. The worst thing was being deeply hesitant to do anything at a command prompt. There's only so far you can get if everything you do is mediated by a GUI. If I had it to do over, I would have forbidden IDE use for the first month. I think it was deeply damaging.
Yes, that’s what I do — forbid the use of IDEs (they only become indispensable for large projects, and we don’t do anything large-scale yet).

This is an excellent gamified CTF to learn the ins and outs of UNIX command line: http://overthewire.org/wargames/bandit/ . I usually require my students to reach at least level 10 to pass, and everybody liked it so far.

Nice, i got hooked up the same second i started and needed to force me stopping.

Good Link.

That looks fun! I'll run through it myself and see what it covers.