7 ms·
Retiring Python as a Teaching Language
- dundercoder 9y agoPython was my first foray into programming, and I still pay the bills with it. I still love it. Trying to not let that bias influence my opinion, I too have been frustrated with some of its shortcomings. Distribution, concurrency, and GUIs have been excersizes more in patience and persistence than utility. I’ve moved most of my efforts into Nim and haven’t been disappointed. I don’t know if it’s a suitable teaching language yet. But JS as a general purpose language? For web, web, web.
- fooker 9y agoI feel Python is a terrible teaching language, the only saving grace being the abundance of libraries. There is just so much magic involved that you can not give reasonable answers to the inevitable 'why' questions coming from intuitive students.
- haloux 9y agoIt feels reasonable to assume that a majority of his teaching has been for boot camp style instruction and not the traditional, 4-year formal academic route. I say this because, across the board, I know my staff would gaff at the prospect of trying to incorporate JS into anything other than an elective. Honestly, even to that, they would throw their pinkies in the air in retort of the thought that JS be taught at all in a 4-year institution. “Nay, let it be relegated to the community college. ...I know I know, ‘burn him at the stake’
- LA_Banker 9y agoWhich only further demonstrates the gap between a 4-yr Comp Sci degree and software development. Which, don't get me wrong, I'm a university snob and think software engineers should understand things all the way down to the machine level, but the snobbery in reaction to JS* being taught in 4-yr curricula (which I wouldn't doubt as a widely held reaction) is saddening. *JS wouldn't be my first choice for an actual university course on real-world coding; but I do resent the the chasm between applicable and theoretical software engineering skills... though this problem isn't confined to Comp Sci.
- ralusek 9y agoIt's unfortunate how despised JavaScript is on Hacker News, because JavaScript is objectively the best language suited for teaching people to program. Want to work with data from any API? Well JSON, industry standard data protocol, happens to already use exactly the syntax you're familiar with! Want to give them a sandbox to mess around in...take your pick between jsfiddle, plnkr, codesandbox, etc. Many of these let you collaborate realtime with people to help them work through problems directly. Most people learning to program have 0 familiarity with using a terminal, and having to go through the process of getting an environment set up correctly ALONE is enough to turn off the vast majority of people to programming. As the author already mentioned, rendering a UI in JS is going to happen on the most ubiquitous platform on the planet: the web browser. If a programmer starting today goes into UI work, the odds are that they'll be building UIs for a web browser is astronomically high, the odds that they'll be using a one-off python toy library is highly unlikely. And last but not least, the syntax of JavaScript is very much like the syntax for Java and C. Learning JavaScript first makes it very easy to read code from other mainstream languages and have a good idea of what's going on. Particularly with ES6, there is very little to complain about in the syntax of JavaScript.
- minimaxir 9y agoThere’s a difference between “teaching people to program” and “teaching people to program apps.” Sure, JS is the hip language for making SPAs, but not the best way to show what boolean logic is and the difference between for and while loops.
- spraak 9y agoWhy can't you reach someone those things in JS? JS has all of what you mention...
- catnaroek 9y agoUsing JavaScript to teach the design of appropriate data structures and algorithms for a computational problem is bound to be an uphill battle. And anyone who seriously considers teaching a first language that students can't use in a data structures and algorithms course (without having to learn a second language) isn't worth paying much attention to.
- jaytaylor 9y ago(2015) is missing from the title.
- donovanm 9y agoIt seems absurd to recommend a teaching language without any consideration for the technical merits of the language to me. The argument in the article is among the lines of lets use javascript because it has the most shiny things.
- valuearb 9y agoJust wrote my first Python program today, to massage some text files. It was super easy. I also found the syntax, uh, interesting. Mainly the lack of braces to denote blocks, ie functions, loops, if statements, etc. Indentng to me seems problematic and a learning hurdle. But as a long time Pascal/C/Objective C/Swift/JavaScript developer, what a virgin programmer thinks I’ve long since forgot. Better than that garbage JavaScript though.
- featherverse 9y agoThere are a whole lot of people who think that the web is the future of computers and that everything is going to run in your browser and everything on the internet is going to use the web. Those people are _new to the game_, they don't understand the technology, or how it evolved, and they most definitely have no f'ing clue where it's going. I laughed when he said Javascript, because I thought it was a joke. I can see what he means tho, at least in the limited context of this topic "For beginners", it's a fine way to teach basic programming concepts. But if you aren't building a website, you should not be writing in web languages. You know what's a good teaching language for beginners? Anything they can actually use 5 or 10 years later so they haven't wasted months of their lives learning something with an incredibly limited practical scope. Languages are not lessons. Hello World is a lesson, and it works in any language.
- dragonwriter 9y agoThere's lots of different potential approaches and contexts for teaching beginners. For low-contact teaching where the students were going to be doing lots of independent work between contacts, that was more concerned with enabling students to try stuff out, I'd generally agree with this. For other contexts, maybe not; I think Python (or Scheme, or some others) a better choice for a first language in a broad, structured CS curriculum. Though I'd certainly still agree JS is a useful thing to have in your toolkit fairly early on in programming these days.
- myaso 9y agoI think Python would be the best choice for an absolute beginner, I almost always recommend it when I'm asked what to start with -- it's objectively more pleasant to use than js. The thing about js is, you can get your hands dirty actually making some fairly interesting things quickly, it's just that things are much messier overall.
- ohyes 9y agoTeaching what, exactly? I don’t see why anyone would need a specific “teaching language,” in the first place. You don’t teach a language, you teach concepts. You teach about variables and call-stacks, function calls, how the hardware works, computational complexity, and common algorithms that are used. In any application you’ll likely be using multiple languages and throughout a career you’ll be using many languages or you’ll be unemployed frequently. I don’t have particularly positive feelings about Python as a language, in fact there’s a lot about it that I think sucks. But I feel the same way about Javascript and Lisp and C. Which doesn’t take anything away from any of them. But it does highlight to me a deficiency in programming education if someone strongly believes that we should put off exposing students to new languages. The syntaxes and libraries can be slightly different but the concepts are all very closely related. So I think it’s a huge problem that we allow people to have these complexes where they say “I’m a C programmer,” or “I only know Java.” Not that I’m against specialization but I think it causes some artificial intransigence that’s undesirable at any level and hard to break otherwise successful individual contributors of.
- zaro 9y agoSo aticle is from 2015. End of 2017 I wanted to make really simple GUI for a python script. It turned out making a GUI with 5 buttons and shipping it as exe in Python 3.6 is extremely complicated and convoluted. I wrote the main logic in 30min, and spend 2 days figuring out the GUI and the packaging to Exe.
- pen2l 9y agoPerhaps the real problem is GUI framework fragmentation or confusing docs, because I ship GUI applications with tkinter and pyinstaller without great issues (pyinstaller -m hehe.py and you’re done! Single file exe you have).
- zaro 9y agoWell. I tried cxfreeze first, an sit failed on including tkinter properly. And while pyinstaller handled tkinter w/o issues, it failed miserably with scrapy requiring workarounds and many trial and errors. Anyway, having packaged apps in Javascript (nodejs) , Java and several other languages/tools/frameworks , I find the state of packaging and GUI in Python simply pathetic, it really takes you 20 years back :)
- jftuga 9y agoThe next time you need a .exe with GUI, you might want to also try C# with the free version of Visual Studio (Community Edition). C# is pretty easy and there are lots of examples, stackoverflow questions, github projects, etc. to learn from. If you target .net framework 4.5.2, then your app will run on any computer running Windows 7 or newer. Also, the executable size will probably under 200k for a simple application. Visual Studio makes it really easy to build a GUI and attach widget event handlers, too.
- zaro 9y agoThanks for the suggestion. I kind of already know that. But does c# has something like scrapy? Scrapy is really good for scraping, makes it really easy to write all kind of scrapers and the performance is excellent for something you hack up in 30min.
- deepsun 9y agoOk, so I want to quickly read a text file and save something back to another file. JS anyone?
- charlysl 9y agoI believe that teaching programming should be centered around teaching programming concepts as opposed to languages, a la SICP or Concept Techniques Models of Computer Programming. The languages used there (Scheme and Oz) are just vehicles to teaching timeless concepts. Teach a language and you will prepare someone for the present. Teach concepts and will you prepare someone for the future. By concepts I mean things like closures, higher-order-programming, concurrency, explicit state, inheritance, security, encapsulation, complexity, laziness, etc
- iovrthoughtthis 9y agoI think your on the money here. Also, I believe that you need to learn more than one language to full appreciate those concepts. There is some irony in the fact that i developed my own indepth, initiative understanding of these concepts while learning JS.
- charlysl 9y agoYou can certainly learn many concepts and techniques using js, but it is still a severily limited language for general programming. You could learn using many different languages for sure, but I believe it would be more efficient with one language that is truly multiparadigm, where no paradigm is favoured and there are primitives for all core concepts. With all these general concepts, techniques and design principles under your belt, learning the core of a new language is a breeze, almost just like translating the syntax. Maybe it has all the primitives, or you have to use a lib or build your own, or apply a design pattern, it might be more or less verbose, but you would be just implementing the crucial thing, the design. Of course, then you have to learn the idioms too to become proficient.
- iovrthoughtthis 9y ago> but it is still a severily limited language for general programming. I don't understand where this concept comes from? It is as turing complete as any other language. From a "General Programming" perspective, it is also one of the most prevalent run time environments. > You could learn using many different languages for sure, but I believe it would be more efficient with one language that is truly multiparadigm, where no paradigm is favoured and there are primitives for all core concepts. I find being in a single language can lead you to associate the abstract concepts with the syntax too much. In moving the concepts between different syntax and forms the abstract notion becomes clearer, for me at least. I appreciate that learning everything in a single would likely be more "efficient". > With all these general concepts, techniques and design principles under your belt, learning the core of a new language is a breeze, almost just like translating the syntax. Absolutely! :)
- mythrwy 9y agoI still think Python is a superior teaching language. Less weird behaviors and just easier to get the basics of things like manipulating arrays and strings, reading/writing from a file, creating a "for" loop, etc. etc. That being said there is a solid point to the article. If students want to delve into graphical displays great. Suggest they investigate JavaScript (after they get the basics of traversing an array down). Or teach both languages at once switching to JS for graphical portions. They are similar enough this shouldn't be too difficult. Plus it would help prevent language tunnel vision or language clinging and/or new language phobia.
- raphman 9y agoprevious discussion on HN from 2015: https://news.ycombinator.com/item?id=8921320 https://news.ycombinator.com/item?id=8921320 and a Twitter thread from 2018: https://twitter.com/mkennedy/status/949688651058835456 https://twitter.com/mkennedy/status/949688651058835456
- ianamartin 9y agoLike many others in this thread, I think the question boils down to what you are trying to teach. How to deliver an app? Have fun with Python. :( Doesn't matter how you cut it, if your Python program needs a gui, it's going to be a challenge. You're either going to have to go the executable route, which is difficult to figure out your first time. Or you're going to go the web route, which is also difficult to figure out the first time, and you're going to have to not only learn html, css, javascript, but also WSGI, nginx, and a few other things as well. I happen to think that going the web route is a really good way of doing things as a teacher because you get to teach a lot of general computing things along the way. But the bottom line is what are you trying to teach? You can teach almost anything with almost any language, and in this case I'd say take the "programming" out of the "Programming Language" and ask yourself a different question: is there any one best language in which to teach people arithmetic, or art history, or physics, or music theory? There's obviously not. It doesn't matter if you're speaking English or German or Japanese or Russian. These concepts can be described and explained just fine. I think a conversation about what language to teach in has to boil down at least to the context it's being taught in and what is being taught. This author's decision is as reasonable as anyone's based on what he's saying he wants to teach. And I think I have some sympathy. I don't have a 4-year degree in comp sci. Or anything. But if there's one thing I wish teachers everywhere in the tech world spent more time on, it would be deployment strategies. Someone should be teaching that class at schools if they are not already.