Why We Should Teach Python instead of Racket

by albertoCaroMon 4/11/20, 10:15 AMwith 66 comments
by skillpasson 4/11/20, 3:19 PM

Full disclosure - I took 3 classes in Racket: Intro to CS, Programming Languages, and Compilers.

> Racket is not a very popular language in teaching communities

This list of schools with introductory Racket classes isn't accurate, because the author did not look beyond the naming of the courses on the Github page. My school was missed.

> Students are unlikely to have had prior experience with Racket

This is good because it means students from varying backgrounds of programming experience start from a level playing field.

> Racket’s aesthetic beauty has limited relevance to CS1

Computer Science is first and foremost an ivory tower and students are (imo) better off being confronted with this fact up front. Software Engineering is probably better taught with a more practical language.

> Students do not use Racket again later in their degree

At my school the Programming Languages core curriculum all used Racket. A good percentage of students funneled into at least the first PL-core class as part of their requirements. The class was very popular.

> Students do not like Racket

Sorry, but I don't think we should base our decisions on what Intro students like/dislike. People hate leaving their comfort zone - that doesn't mean they shouldn't be pushed out of it.

> The Design Recipe Is Not Well-Evidenced

Valid criticisms. On the other hand, no evidence is presented that other languages are better.

by Xophmeisteron 4/11/20, 3:46 PM

I write Python, amongst other things, professionally and have been playing with Racket in the sidelines. I recently started a new project and decided to take the plunge and write it entirely in Racket, so I can actually learn it better: its (extensive) standard library, idioms, quirks, etc. in a real (rather than toy) engineering setting.

Now I love Racket. Whether it’s Racket, or Scheme, or Racket facilitating Scheme, it doesn’t matter, I haven’t had so much fun coding for a long long time! Of course my job isn’t concerned about my enjoyment (at least not primarily), but it turned out to be no harder to code the project than it would have been in Python.

I’m heavily biased towards functional style and I appreciate that this is completely anecdotal, but I’d urge people to jump in :) It took me about a week to become productive in the language and, to be honest, most of that was getting over S-expression syntax and correctly pairing deeply nested parentheses. The documentation alone is a thing to behold! While it’s true that the community is smaller than Python’s, it’s friendly and eager to help; say on StackOverflow, r/Racket or IRC.

I hope I can continue writing it professionally and can convince others in my team to adopt it.

by hedoraon 4/11/20, 3:41 PM

Python is a terrible choice as a first language. Idiomatic python is just glue code that obfuscates the underlying algorithms.

Object oriented programming (implementation inheritance) is increasingly regarded as an antipattern, and it encourages that too.

The massive performance penalty of writing logic in python vs calling out to external libraries mostly forces developers to program by lego-brick assembling external modules instead of reasoning about algorithm design.

There’s no concept of types, either, and instead of attempting to detect programming errors early on, it leaves them to runtime.

It’s not surprising that Java and also C/C++ are more popular than python for introductory CS courses.

(I could see using python as an intro course for non-CS majors, fwiw.)

by StreamBrighton 4/11/20, 5:48 PM

>>>> Specific, formal survey question (T/F style): “Please Indicate if you like and are comfortable with each of the following languages:”

Java: 93% C/C++: 74% Python: 38% JavaScript: 21% Racket: 7%

This is absolutely hilarious. Students are comfortable with C/C++ and Java the most. I guess they haven't seen segmentation faults and null pointer exceptions enough in production ruining businesses yet.

It is kind of funny how almost all of my peers who studied CS ended up wanting to work on ML languages (F#, OCaml, Haskell, etc.) after spending 10+ years with Java, C, C++ or C#. At the time they were learning Prolog and SML they did not like it much. This survey should be done after some time spent on deploying production ready applications for living and see how it will change.

by michaelmroseon 4/11/20, 6:13 PM

This entire post utterly strains credulity. It has the vibe of a bad Facebook post that your relatives shares that makes you groan.

Halfway through I find myself doubting not merely the authors thesis but wondering if it's meant to poke fun or entertain.

Can statements like

>The hardest thing to capture in this site is the trauma in some students’ eyes.

> I have also seen first-hand the trauma that it has caused students.

possibly be meant seriously?

Was racket the wrong tool to teach programming or did it eat their dog and set fire to their dorm?

I picture Michael Keaton appearing after Geena Davis says c++ c++ c++ saying wait until they get a load of me.

Everything has a certain amount of cognitive overhead. Perceptively python and racket both have fairly low overhead and quick feedback and ought to be in the same ballpark insofar as learning basics.

I wonder if discontent as described derives from dissimilarity with existing material.

A person with some knowledge but not much may be disproportionately dissatisfied with not being able to use such. Speculating that the best students have no problem, the worst students blame the instructor or the materials, the bottom middling who know a little python or Javascript are frustrated that they cannot benefit from existing skills.

Students perception of value of instruction may be a useful metric for the school insofar as attracting students but one questions if the students are the best qualified at the start of their education to access the value of individual components of their education.

by rgoulteron 4/11/20, 3:50 PM

"Which programming language" to start with is something people can have strong opinions on. (e.g. I could understand people saying C is a great language to start with, or that C is a terrible language to start with).

There are always going to be reasons why any language will be bad as a first language to learn. I'm sure there will be reasons why a language would be a good one to learn.

Python is a nice language to start with. I think Racket is a nice language to start with, too.

The intro to programming course I took was loosely based off of SICP. (My batch was the last taught using Scheme; the next was taught the same material using a subset of JavaScript).

As an example of something nicer about Racket than Python: There was a nice 'simplicity' to the material. A list is either empty, or some item followed by a list. Computing stuff either deals with a base case, or deals with a recursive case. Almost all the functions we used (car, cdr, map, accumulate, member, etc.) could be implemented with what we'd learned. -- This feels more analogous to seeing how the proof works rather than learning just a bunch of formulae.

by credit_guyon 4/11/20, 4:24 PM

Being in lock-down mode, I thought it would be a good time to finish reading (and doing) the "Structure and Interpretation of Computer Programs" that I started many years ago and abandoned. Ever since I read Paul Graham's essays on Lisp, I dreamed that I'd like to be able do build domain specific languages "when I grow up". Life always gets in the way, but I now decided to give Lisp another chance.

And now this. Hm, should I abandon SICP again? Maybe the guy is right that beyond all the grand philosophizing of the amazing power of Lisp there's little substance. On the other hand, I also know the website I'm posting this comment on is built on Lisp. I'm torn.

by kyawzazawon 4/12/20, 12:00 AM

I think most people here are commenting as graduates/professional so I thought I would chime in.

As a student, I love being taught in Python for introductory CS classes. I have been a course assistant as well.

The language is easy to pick and has great/easy applications that doesn't require learning another additional language.

(I am not opposed to learning another and carry the sentiment that you can relatively pick up another language.)

The second part is important to me as a student because I can quickly use it in my web programming projects, in my data-related projects and for scripting purposes as well(I admit I rarely do this).

by willswireon 4/11/20, 7:50 PM

Great read. I’m a senior studying comp sci at University of Delaware, and I couldn’t agree more! We learned Racket freshmen year - and I can confidently say that Racket had no perceivable advantage to my computer science education over any other language. In fact, the course introduced python towards the end of the semester which made it more of a headache since we had to take a final exam in both syntaxes. It would’ve been better to have used python from the start.

by acheronon 4/11/20, 2:54 PM

Note: the title is overstated, this is actually a pretty good discussion of Racket and not just the kind of bashing you would think from a title “I hate Racket”.

by DeathArrowon 4/11/20, 5:59 PM

We did CS courses in C and C++ 22 years ago. I recently did an MsC program at the same University and most courses are being done using Java. But for assignments teachers allow any programming language - if the task permits - so I did mine in C#. Some colleagues used Java, one guy used Python.

by seibeljon 4/11/20, 2:59 PM

Could not agree more. Top schools like MIT gave up on their silly dedication to obscure languages in introductory programming classes and switched to Python. It seems like there was a generation of professors who decided there was a “correct” way to teach computer science and it involved languages completely isolated from the mainstream industry. It’s like teaching someone grammar by forcing them to use Esperanto because it’s “The Best” language (according to tenured professor who doesn’t give a shit about their students).

All Turing complete languages can execute any program. The fundamentals of programming exist in all languages. Teach students using languages with the absolute minimal friction so they aren’t spooked in their first exposure to programming.

Academia has scared away an untold number of aspiring students with their nonsense languages. Such a damn waste of talent. The absolute worst programmers in terms of craftsmen-ship are academics - if you want to see some truly WTF code look at what underpins research papers.