5 ms·
Except in a programming language designed for learning programming. Ideally, we would have a good educational language with a clear path mapping the notation fr
by ht_th 6y ago
Except in a programming language designed for learning programming. Ideally, we would have a good educational language with a clear path mapping the notation from that language to more common notation used in programming languages designed for computer science, software engineering, or software development.
- marcosdumay 6y agoI think Python filled that niche. It's not perfect by any means, but it's better than what people used before (Basic, Pascal). Anyway, if you want an actually good option, Logo is still around. But it does not let you create anything really interesting, so you better get through it fast or your courses will become boring.
- beagle3 6y agoI've been thinking about this a lot lately, and I agree Python is way better than Pascal or Java which it replaced as an introductory language. But I'm not sure it's better than old basic. Python is definitely more readable - but it is less helpful than e.g. line numbers in helping form a mental model of a running program; and from my experience, "goto" and then "gosub + return" are easier to explain than funcs with local scope. If I had to teach newcomers today, I would definitely teach Python -- because, once they do get it, it is actually useful for whatever they need to get done tomorrow morning. But I suspect e.g. BBC Basic (which has goto, gosub but also proc and local) would be easier for them to learn, and would get them farther in understanding programming in a shorter time.
- 8fGTBjZxBcHq 6y agoI have taught newcomers quite a bit and until you've done it you probably shouldn't trust your intuition about what non-programmers will and won't get hung up on. Also like you mentioned, in even the medium-short term the thing that will get people learning the fastest is the thing that gives them a reason to code. Pretty much always right now that's going to be JS or sure maybe python.
- beagle3 6y agoI have taught GW-BASIC, and also Python, C, Fortran and a couple of other languages through the years. But I don't trust my experience because it spans three decades, in which my experience changed, my student's backgrounds changed, etc. Looking backwards, it is my experience that line-numbers and goto/gosub clicked more quickly and more deeply than function calls. But, as you say, and as I alluded to in my first post, motivation to write code tomorrow morning is likely a better thing to optimize for. I would refuse to teach JS, though; it has way too many warts one can't avoid, creating damage that would take a while to undo.
- int_19h 6y agoGOSUB/RETURN may be easier to explain, but of course it also doesn't cover many things that functions with local scope do. Explaining functions and recursion is tricky in general, but necessary for other things to make sense. There are ways to do so that might be more intuitive for a newbie to grasp. For Python specifically, take a look at https://thonny.org https://thonny.org - it's particularly well suited to forming a mental model of a running program, including function calls, in a very visual way.
- beagle3 6y agoOh, of course. GOSUB/RETURN are easier to explain, but only as a stepping stone towards functions; I like them because unlike functions+locals, which are much more "all or nothing" - whereas when I taught basic, I would start with "GOTO" which is trivial for everyone to understand; then go to GOSUB+RETURN, which is just a tiny bit harder, but still very capable - my complex gosub+return example was flood fill[0]: 9000 REM F=FOREGROUND COLOR, X AND Y ARE COORDINATES 9010 IF POINT(X,Y)=F THEN RETURN 9020 PLOT(X,Y,F) 9030 X=X+1 : GOSUB 9000 : X=X-2 : GOSUB 9000 : X=X+1 9040 Y=Y+1 : GOSUB 9000 : Y=Y-2 : GOSUB 9000 : Y=Y+1 9050 RETURN Which does recursion, visually, with only gosub/return, lets me touch on stack overflows (trying to fill too big an image would on most interpreters). I have never had the chance to teach BBC Basic, but if I did, even though it has PROCs and LOCALs, I would still go the GOTO -> GOSUB/RETURN route, and only then proceed to DEFPROC / LOCAL. [0] This would also be introduction to multiple statements - I would show this with one statement per line and multiple statements per line and discuss pros/cons
- DonaldPShimoda 6y agoThe problem at hand is not the notation of actual implemented languages, but rather the notation of programming language theory. In other words, when you read a paper published at a PL conference (POPL, PLDI, ICFP, SPLASH, etc.), the notation you are likely to encounter therein. There's like 50 years of notational history, and it can be wildly inconsistent. Some things are somewhat standardized, but there's no central location to look this stuff up. Probably one of the better resources is Benjamin Pierce's "Types and Programming Languages" (often referred to simply as TAPL), but I've seen even recent papers deviate from TAPL's treatment. So when new people are trying to break into the PL research sphere, there's a huge barrier to entry. Invariably, they'll need to ask other researchers to decipher some of the notation in whatever papers they read because the authors just assumed the notation was prevalent enough to not warrant explanation. This works fine for people privileged enough to already be working in PL research as undergrads, but it's much tougher if you're coming from a different background. The PL research community is fairly active on Twitter, but explanations of decades-old notation do not conform to 280-character text messages very well. It's a big issue that a lot of us younger PL researchers talk about often. I ask myself: how did I learn this stuff? Many meetings with my first PI as I had to bring up symbol after symbol from whatever papers I was trying to read. I took a graduate course in PL semantics which also helped, but then I've also seen deviations from that notation, so...??? And there's still notation I'm unfamiliar with. I was reading about substructural type systems recently (which are super cool, by the by) and encountered some symbols I didn't know and my current PI didn't know and none of my lab mates knew, so I resorted to a PL Discord server where some grad student at another university across the country was able to chime in with the answer. Such a headache.
- lilott8 6y agoThis fact almost killed my Ph.D. I wrote a programming language and type system for biologists and chemists. But the PL theory syntax nearly did me in. TAPL was like banging my head against a brick wall -- completely opaque to me. My PI wasn't familiar with the space either, so I was sort of on my own. The school eventually brought in a PL theory faculty and things sort of got better. But yes, the syntax for PL is certainly one of the more complex, nuanced, and difficult notations I've worked with.