Live data from Hacker News

Why We Should Teach Python instead of Racket

acbart.github.io

11–20 of 69 posts

Re: Why We Should Teach Python instead of Racket

#11
post #5

Earlier quoted context omitted.

You can teach the principles of computer science without forcing some obscure and difficult language on new programmers. Learning programming is hard enough, no need to add more bullshit on top of it!

What is particularly more difficult about Racket, other tha maybe using a paradigm you are not familiar with?

Did you read the linked article? It is a pretty thorough explanation along with surveys of students. Only 22% liked racket!

Re: Why We Should Teach Python instead of Racket

#12
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.)

Re: Why We Should Teach Python instead of Racket

#13
post #9

Earlier quoted context omitted.

> It’s like teaching someone grammar by forcing them to use Esperanto Or Latin, which for the longest time wasn't called "Latin", but simply something that was taught in "grammar school", because it addresses the underlying fundamentals quite clearly without getting bogged down with semantics. Latin is still used for that, btw, but only in "top schools". >Teach students using languages with the absolute minimal frict…

You have an ivory tower elite mindset. My mindset is to actually help students learn and get excited without being scared on day 1. Save whatever functional nonsense you want to teach for “Obscure Languages 401” class. CS101 should be getting people into programming and teaching them using languages that they can actually do stuff with. If you teach someone python they can do statistical analysis and have a huge numb…

> Save whatever functional nonsense you want to teach for “Obscure Languages 401” class.

Do you also talk to your students like that when, say, one of them mentions an interest in different languages or mentions anything that doesn't agree with your "mindset"?

> using languages that they can actually do stuff with

Didn't you just state: "The fundamentals of programming exist in all languages." ?

I was only commenting on your "minimal friction" that scheme naturally provides and how elegantly fundamentals can be demonstrated by it (right up to and including meta-circular evaluators).

Re: Why We Should Teach Python instead of Racket

#14
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.

Re: Why We Should Teach Python instead of Racket

#15
"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.

Re: Why We Should Teach Python instead of Racket

#16
post #6
post #4

Earlier quoted context omitted.

That's ridiculous. It's computer science , not computer programming technician. You teach with the tool that most clearly distills the principles of what you're trying to teach. Racket and Scheme arguably do that much better than Python. In fact, Racket 15 years ago still has more cutting edge features than Python has to this day . There is simply no language that provides the breadth of features available in Racket,…

I thought the person that you're replying to made a very good point about Esperanto. Why do we teach linguistics with messy real-world languages instead of conlangs that most clearly distill the principles we want to teach?

One of the chief concerns in introductory linguistics programs is introducing students to the great typological diversity of the world's languages. There are a number of different ways in which languages can inflect (or not), structure word order, derive new words from existing vocabulary, etc. Conlangs, however, tend to choose a very limited set of approaches, for example agglutinative inflection is popular because creators feel it makes the language easier to learn. Just as some North American departments have been mocked for doing all their theoretical work purely on the basis of English (or other European languages), using a conlang would make students miss out on the full range of human linguistic expression.

All human languages have at least some irregularities, and the way in which speakers deal with those irregularities is an interesting series of phenomena in itself, but most conlangs aim to be fully regular. A similar situation holds for phonology in which most languages have a developed system of allophony and sandhi, but conlangs typically don't aim to represent those phenomena at all.

Re: Why We Should Teach Python instead of Racket

#17
post #6

Earlier quoted context omitted.

I thought the person that you're replying to made a very good point about Esperanto. Why do we teach linguistics with messy real-world languages instead of conlangs that most clearly distill the principles we want to teach?

One of the chief concerns in introductory linguistics programs is introducing students to the great typological diversity of the world's languages. There are a number of different ways in which languages can inflect (or not), structure word order, derive new words from existing vocabulary, etc. Conlangs, however, tend to choose a very limited set of approaches, for example agglutinative inflection is popular because…

Right. And doesn't that apply to programming languages too? Aren't the ways that Python is irregular to support real-world needs (the Zen of Python even says "Practicality beats purity") worth CS students studying?

Re: Why We Should Teach Python instead of Racket

#18
post #3

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 bec…

> It’s like teaching someone grammar by forcing them to use Esperanto Or Latin, which for the longest time wasn't called "Latin", but simply something that was taught in "grammar school", because it addresses the underlying fundamentals quite clearly without getting bogged down with semantics. Latin is still used for that, btw, but only in "top schools". >Teach students using languages with the absolute minimal frict…

If your argument is that teaching Scheme is as good an idea as teaching Latin, I think there will be no disagreement....

Re: Why We Should Teach Python instead of Racket

#19

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 Schem…

Ive been programming for 20 years and recently started playing in racket and all my faded enthusiasm sprung back and got excited about programming again. Is it that its a new thing to me and we like new shiny things? Well, I find thats not the case. To me it feels that I can express ideas/idioms much much easier within Racket/scheme and after a few weeks i started enjoying the parens quite a bit. I’ve also been playing with htdp libraries and it’s been quite fun, simple and effective. My new personal projects are going to be in Racket now.

Re: Why We Should Teach Python instead of Racket

#20
post #4
post #3

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 bec…

That's ridiculous. It's computer science , not computer programming technician. You teach with the tool that most clearly distills the principles of what you're trying to teach. Racket and Scheme arguably do that much better than Python. In fact, Racket 15 years ago still has more cutting edge features than Python has to this day . There is simply no language that provides the breadth of features available in Racket,…

[deleted]
Post reply on HN