5 ms·
Watching someone learns basics of programming in Python, I realized that Python is actually not that easy to learn for beginners as I thought: 1. Types in Pyth
by deepsun 5y ago
Watching someone learns basics of programming in Python, I realized that Python is actually not that easy to learn for beginners as I thought:
1. Types in Python are implicit. It's really hard to explain that they need to always think about what type something is, especially when they haven't grasped the concept of types yet.
2. Indentation as part of the language. I thought it's a great thing for beginners, but it's actually confuses beginners that empty space affects your program, e.g. they think that spaces around assignment or arithmetic operators should affect their program too, which is not the case.
3. Ranges for iteration -- they just memorize the syntax blindly :(
So I started to wonder whether Pascal is better to learn for beginners -- you have to list all the types at the beginning, and no implicit conversions are done.
But now I think what about TCL? Maybe it'd be even easier for total beginners?
- rscho 5y agoYou could try something with a regular syntax. It doesn't work for everyone, but when it works it works really well. Racket comes to mind, and it has a progressive suite of languages from neophyte to full-blown. In addition to a community focused on pedagogy and CS fundamentals. https://racket.discourse.group/ https://racket.discourse.group/
- layer8 5y agoThe traditional answer was to use a BASIC dialect. Minimal syntax, minimal structure, simple imperative commands. A lot simpler than Pascal. I don’t know TCL very well, but its scope semantics may be confusing. I’d take a look at LOGO also.
- utucuro 5y agoHaving learned Basic (Commodore as well as Qbasic), Pascal (not Delphi) and TCL in my youth, TCL is the only one I used in production. TCL is fairly simple to learn, it only takes a few concepts really, and it is quite a joy, if memory serves right. Of those I mentioned, it is the only one that I would touch again, for any reason, whether for fun or profit.
- buescher 5y agoThe only problem with BASIC is that it's kind of gross scaled up for medium-sized applications. It's downright charming at the Tiny-BASIC, VIC-20 BASIC, or even BASIC-52 level though. LOGO has real depth, an elegant syntax, and there's an alternate universe where it has Python's niche as everyone's favorite scripting language. But it's effectively a toy language so there's nowhere to go from "learning". Here's my hot take: before you teach anyone "the basics of programming", teach them how to enter formulas in a spreadsheet.
- analog31 5y agoI think the beauty of BASIC for teaching is that it's easy to "think like the computer," because the computer holds very little information other than the values of the variables that you used. For this reason things like loops are quite concrete. Those who break past "the wall" and achieve any fluency at programming, can and will learn to start thinking in layered abstractions. And their programs will start to get bigger. Then it's time to move away from BASIC. I moved to Pascal. Today, Python. But I agree with the above and about Python, that you are forced to handle abstractions, almost from the git-go. Perhaps what saves it is the ease of trying things, so if the functioning of a loop like "for i in range(10)" is confusing, just try it with a print() statement in there. BASIC was also preferable on a timeshare machine. Waiting 10 seconds per line for a response seemed more tolerable than waiting 10 minutes for an entire program to compile and link.
- funstuff007 5y ago+1 for LOGO. It's a great pedagogical language, and many primary school children would benefit greatly from its return to wide usage.
- mmargerum 5y agoI think Go is the easiest language , outside of basic, that i've ever had to learn
- mdaniel 5y agoI'm glad you had that experience, but as a "2nd" language, it was rough for me because it was the uncanny valley of programming languages: things _almost_ worked like in other languages but were not syntatically distinct enough to easily keep them separate in my mind. It'd be like if some new regex decided "{}" was range and "[]" was repetition And we shall not discuss the horrors of its build and dependency system, which I appreciate isn't the "language" but what good is a programming language if one cannot compile it?
- dgb23 5y agoI second that. Go instantly came to mind as a fantastic beginner language. - Go is also inspired by Pascal, but it has more of a foothold today, it shares the simplicity and the syntax is more natural and convenient than C and similar. - It's a light language. You can approach it in terms of just functions (procedures) and data, as opposed to say Java (which unfortunately is one of the most used languages in to teach programming). - The tooling is approachable, it compiles fast, there is no friction when it comes to automated testing, you get a static binary out of it etc. - The std library is comprehensive and very easy to use. You can teach a ton of concepts with just that without ever having to worry about third party dependencies. A full web server, a CLI etc. - It's low level enough so you can teach a bunch of important concepts such as pointers and constructs around pointers, allocation etc.
- deepsun 5y agoGood idea, my project is on Go right now. Will try teaching it and come back... Nitpicks: > compiles fast That is totally irrelevant for beginners, as their programs <100 lines long. The best would be not having to compile at all. > as opposed to say Java Not really a big problem, actually. I watched how people learn Java in college (I was a pro at the time so helped them) -- they usually get main() definition from professor, and then just copy that file around. They write everything right in main() or in other static methods, so not a biggie it's all wrapped in some mystic "class Main {...}". But I think it's much better that: 1. They have to write types for all variables and no implicit conversions made. 2. If it's not in autocomplete -- it doesn't exist. Compare that to Pythons "len()", or Go's "append()" (and explain why result of append() needs to be assigned if it works without it).
- codeflo 5y agoI've seen beginners, especially those without a very strong maths background, struggle with the concept of syntax. The idea that you need to put the thing you want the program to do into a very specific form. That any deviation is an error, even though "it's clear" to humans. I think that's something fundamental beginners need to learn, regardless of the language they use. But once you accept that there are rules to follow, and that they are somewhat arbitrary, languages do differ wildly in the amount and obscurity of syntactic forms you need to learn just to get started. Just count the amount of different syntactic concepts in this simple program: #include <stdio.h> int main(int argc, char **argv) { printf("Hello world\n"); return 0; } and compare it to the Python version.
- qsort 5y ago> struggle with the concept of syntax I agree, and I think the problem you mention is a special case of the difficulty some people have to grasp the concept of definition in the mathematical sense. Unlike "dictionary" definitions, they can be arbitrary: if I say "let S be the set of prime numbers greater than 13" you pretty much have to accept it, as long as it's well-formed and consistent. On the other hand definitions need to be very precise. Natural language relies on "you know what I mean", which is a feature for most human-to-human communication, but it's not how mathematics and computer science work!
- analog31 5y agoWhen my mom was learning to program, she was annoyed that the computer did not recognize that "O" means zero, and "l" means one. Her old manual typewriter didn't have 0 and 1 keys. So her typing habit resulted in a lot of errors. Later she taught programming. The first thing she told students was: "Computers are dumb. They will only do exactly what you tell them."
- mvaliente2001 5y agoI was lucky and that was also the first thing I learned about programming (with the amazing 80's "The Home Computer Course" magazine). I still remember the first program I read: 10 REM Computers are never wrong 20 PRINT "Please type a number" 30 INPUT A 40 LET A = A + 1 50 PRINT "The number you typed was" 60 PRINT A After a few paragraphs of explanation I learned that computers do what you tell them to do, not what you want them to do.
- cardanome 5y agoI had the pleasure to actually learn Pascal (Delphi actually) at school. I think it is a awesome teaching language. Though it also showed the problem with teaching languages: The students were not that eager on it. They would have preferred a languages with better job prospects. As motivation is the key for success to learning, yeah sometimes the language that offers the quickest benefits is a good choice. The strength of Python is that it has great libraries in very trendy fields that allow to get stuff done with very little knowledge. That is why both Python and JS (easiest to get a job) are good beginner languages. (That really hurts me to write as learning should not be solely focused on external rewards but such is the world currently) That said, if I were to choose a language to teach programming then Lua would be the perfect candidate. It avoids the syntax pitfalls of Python as well as having much lower complexity while still being very powerful. Plus really great for gamedev so many motivating examples.
- deepsun 5y agoSame thing, I'm looking for a good explanation why it's not that important what language you learn first. E.g. if they learn carpentry, and the classes teach them how to do dining chairs (proper tools, wood characteristics, drilling and gluing techniques). But in real world they'll have to make tables. Does it really matter if they learned to make chairs not tables?
- liveoneggs 5y agoLua is the new tcl and is great.
- leke 5y agoI think Dart would be pretty easy for beginners.