(no title)
todd8 | 2 years ago
I enjoyed that year and, for the most part, my "students" were easy to teach, and Pascal held up well. They were all programmers already, so I didn't have to go slow through the basics and introducing ideas like recursion (absent in Fortran, COBOL, and assembly language of the period) kept the classes new and interesting to the students.
Unfortunately, standard Pascal isn't really a good choice for a first programming language today, even though modern Pascals have removed many of early Pascal's limitations (packages, batteries included libraries, etc.)
So, how can we decide if a language is a viable first language? Employing the wisdom of crowds, here are the top 30 languages in the 2023 IEEE Spectrum rankings:
1-10: Python, Java, C++, C, Javascript, C#, SQL, Go, TypeScript, HTML.
11-20: R, Shell, PHP, Ruby, SAS, Swift, Dart, Rust, Kotlin, Matlab.
21-30: Scala, Assembly, Perl, Visual Basic, Objective-C, Lua, Fortran, Verilog, Groovy, Julia.
I contend that we should limit our choice of first-languages to some language in the top 30. This rules out many languages that I consider important, but we should stick with a language that is likely to benefit the student more than others as a first-language. That means not teaching Lisp or Racket or Ada or Ocaml or Prolog or even D for that matter as a first language.
To narrow our top 30 down to a handful of alternatives, I'm going to use my own subjective difficulty rating and remove C++ and Rust and Scala from the list because they will be too hard for beginners.
Furthermore, let's remove languages that aren't general purpose; this knocks out SQL, HTML, R, Shell, PHP, SAS, Matlab, Assembly, Visual Basic, and Verilog.
Some languages require more complex build or execution environments; I would remove Java, Dart, Kotlin, and Groovy from our list for this reason.
Finally, there are some languages that are not as easy to use outside of specific hardware or operating systems; I consider these languages C#, Swift and Objective-C to be ruled out.
For good measure, I'm removing Perl from the list (a bit too irregular) and Fortran (not widely used outside of some important areas).
Our condensed list now look like this:
Possible first languages: Python, JavaScript, Go, TypeScript, Ruby, and Julia.
To narrow it down even a bit further we can observe that one should learn JavaScript before learning Typescript. (Is this opinion shared by HN?)
Ruby and Python seem like close cousins with Ruby being a bit prettier and Python being much much more popular.
Julia is a bit specialized and a bit harder than the others so now we are left with just three: Python, JavaScript, and Go.
tmm84|2 years ago
teleforce|2 years ago
For proper pedagogical approach we should refer to the experts and educators. There is one paper from Monash University that have come up with major sins of introductory programming languages that are not suitable for new learners including Pascal that you used during your teaching time. I have provided the link to the paper in my other comment.
[1] TIOBE Index for January 2024:
https://www.tiobe.com/tiobe-index/
samatman|2 years ago
For one reason: it's a dynamic language with types. It's good to have types in a first language, they're too important to neglect. But with Julia, you just introduce them later.
Also, 1 based indexing is easier on anyone who hasn't already gotten used to 0 based indexing, and it's the only language in your last paragraph where zero isn't false.
But it depends more on why they want to learn than anything else. If they want to make web apps, for some reason, obviously JavaScript, and if they like games, it should be Lua. Data and numerics stuff, AI? Julia obviously ;)
mike_hock|2 years ago
On the other hand, the reason given for excluding Java is seriously reaching. The JVM isn't "complex" from the student's point of view, and hello world (and other exercises) can be compiled with a simple javac invocation.
jacquesm|2 years ago
nhellman|2 years ago
bastijn|2 years ago
jacquesm|2 years ago
Gormo|2 years ago
Just a nitpick, but modern PHP is definitely a general-purpose language, and quite a decent one. Assembly is also inherently general-purpose, and might have a much higher learning curve, but its foundational nature also makes it an important step in a layered approach to learning (a la Nand2Tetris).
tmtvl|2 years ago
* <https://github.com/attractivechaos/plb2>
bmoxb|2 years ago
From a learning perspective, a slower language could actually be beneficial in the sense that it's impractical to brute force a solution to a problem in a way that you can get away with in C or similar.
anta40|2 years ago
For beginners, whose main concern is implementing basic data structures/algorithms, Python is fine.
I still use Python for daily scripting (sorry, don't get along with Bash) and it's runs pretty fast.
CogitoCogito|2 years ago
I'm not sure I follow you. Are you saying using e.g. numpy is not okay because it's implemented in C? How does that make any sense? The cpython interpreter itself is implemented in C so everything interpreted by cpython is just as much "in C" as something else like e.g. numpy.
AstroJetson|2 years ago
I can see why people think the tool chain may be hard for adults, but if the focus is on children learners, you can get Lua with the batteries included.
poulpy123|2 years ago