Live data from Hacker News

Retiring Python as a Teaching Language

prog21.dadgum.com

61–70 of 238 posts

Re: Retiring Python as a Teaching Language

#61

I still recommend Ruby as the first language because it has all of the features you want to know about as a newbie and at the same time there are very few quirks. The things you sacrifice are performance and memory efficiency. I have seen junior programmers picking up Ruby as be able to write production ready code in couple of weeks. I guess the learning curve is not as steep.

I don't think it's a performance and memory issue that the author is raising. Ruby, much like Python, mostly wraps some lower level libraries for game dev. In both cases, you either make sure your users have dependencies installed, or you use one of the clumsy "compiler" solutions that don't always work well.

Consequently, Ruby isn't any better for the author's usage case (kids wanting to learn to write games that are super easily portable). It can be done, but it's not going to be as easy as some of the other languages/toolkits (for that specific usage case).

Re: Retiring Python as a Teaching Language

#62

A language like Perl 6 would probably be a good first programming language if some good libraries become available for it. Printing one line of text is one line of code. Then you can start teaching branching, loops etc. Object-orientation is also baked in. Oh and by the way, there is this thing called "types". It helps you catch some types of bugs early and can potentially make your programs be compiled and thus run…

You could also not use Perl 6 for that.

Today, you could use almost any language for that.

Thanks, people who got stuck with Perl 5 code and now have to deal with it. May the whole concept die in a fire.

Re: Retiring Python as a Teaching Language

#63
post #28
post #5

It's with all of this in mind that my recommended language for teaching beginners is now Javascript. I know, I know, it's quirky and sometimes outright weird, but overall it's decent and modern enough. Javascript is a flawed, quirky language, but with the upcoming ES6 and ES7 standards it's going to be a much, much better. I'd call it a tossup comparing it to Python or Ruby. I wouldn't have recommended JS to a beginn…

I hope you at least wait until those standards are thoroughly supported "in the wild" because the wild provides the entire point of choosing Javascript. Even then, the argument that ES6+ will make everything better ignores that those standards layer more stuff on top of a lot of bad old stuff that isn't going away. And the community status quo is bad documentation, messy APIs and things breaking all the time. If I di…

Programming education doesn't have to center on browsers, but it's very likely that someone interested in programming as a career in 2015 will have to make programs which interact with browsers in some way. So, while class chicken inherits from Animal and can override Animal's speak() method, that's not quite as fun as having .chicken.animal::after put chicken memes all over your homework.

Visual Basic was also pretty awesome for this, and I'm sad to see that give way to e.g. Java, which has probably turned many people off initially to how fun and rewarding programming can be.

TL;DR public static void main is not as fun as making more internet.

Re: Retiring Python as a Teaching Language

#64
post #5

It's with all of this in mind that my recommended language for teaching beginners is now Javascript. I know, I know, it's quirky and sometimes outright weird, but overall it's decent and modern enough. Javascript is a flawed, quirky language, but with the upcoming ES6 and ES7 standards it's going to be a much, much better. I'd call it a tossup comparing it to Python or Ruby. I wouldn't have recommended JS to a beginn…

Is rigor even that important? Is a flawed and quirky language really a problem when you are learning? I'd expect that keeping the learner's momentum going is more important – if they keep producing they will be able to engage with the crap, or make their own new kinds of crap. Quantity over quality, you know? With that in mind, stuff like developer tools is more important... and maybe community (which is eclectic for Javascript – there's lots of material out there about Javascript, but a lot of it is crap material).

Re: Retiring Python as a Teaching Language

#65
post #33
post #32

Earlier quoted context omitted.

>It's a game of tradeoffs I find that less and less true. The canonical example for me are abstract data types. They're pretty much free on a runtime level, enable clean code, and allow for more static checking. Basically a superpowered version of enums. I can't see any argument against having it in the language unless the express goal is to have no syntax (lisp).

Again, that's a personal preference, not a statement of fact. There is a cost associated with different type systems, and that cost can vary with the problem you are trying to solve. It's not that I argue against the benefits of having such a system in place, but you should be aware of the fact that this too might not represent the end-all-be-all for all programmers. One of the basic mistakes made here seems to be th…

Again, this is not about personal preference.

In the real world, 90% of programmers use either C#, Java, C/C++, JS or Python/Ruby/Perl in their jobs.

We could restrict ourselves to this set of languages and syntax style, and design a super-set language that does everything, gets rid of their historical warts, and can go from scripting to HPC.

Stuff like using significant whitespace or not, are BS bikeshedding, which we can bypass.

The thing is, were it matters (speed, expressivity, availability of REPL and IDE, large SDK) nothing but money prevents us from making such a language...

Is there anything preventing a top notch team working for 10 years and come with one ready, including all the trims and works, JIT, AOT native compiler, ports to 2-3 architectures, batteries et al?

Sure, some people would still like their Java or their Lisp or whatever.

But there's not some logical impossibility preventing us from creating a language that's better for 90% of the tasks than what's our there.

In a sense, that's what MS did with C# -- but they stopped too soon because they have their own agenda. So it was Windows only, in the CLR with no supported AOT option, etc.

Re: Retiring Python as a Teaching Language

#66
Warning: this is a very opinionated comment.

One reason I haven't learned how to write web apps is because (sorry, but) I consider the web-app software ecosystem to be not very good. One of the modern web's defects relative other "software ecosystems" is that it is too specialized IMHO for media consumption, media distribution, entertaining and being entertained and persuading and being persuaded by "emotional" appeals (more precisely, appeals to System I rather than System II). Another one of its defects is that it is more complex (and consequently harder to adapt to new situations and new purposes) than most other software ecosystems.

The topic under discussion is what programming language (and by extension, what programming environment and what software stack) to recommend to beginners. Here is my suggestion: it depends on whether the beginner has the kind of mind that can stay engaged while alone and while staring at a white screen containing only black text all day. If the beginner can do so, then I suggest that Emacs (the version from the FSF) is the best software stack for most beginners to learn.

Emacs is often considered complex, but its complexity is of a different kind than the complexity of the modern web. Emacs consists of a small core that anyone would have to master to be able to modify Emacs and to build upon Emacs and a large amount of optional add-ons. This kind of complexity is more acceptable than the kind of complexity the web has as long as the beginner is competent enough at deciding which optional add-ons are worthy of his attention. In the case of Emacs, 95% of them are probably not. (More on this 3 paragraphs down.)

Most of the changes I want to make to my personal software environment (as a heavy Emacs user and experienced Emacs-Lisp programmer) can be made in Emacs. In other words, Emacs is a kind of non-proprietary "middleware" just as the web is a kind of middleware (which is admittedly non-proprietary in the parts most essential for a beginning programmer) and just as terminal-emulation apps plus TTYs and PTYs plus ssh plus the ncurses library and cursor-address using ANSI terminal codes is a kind of non-proprietary middleware on which a wide range of software applications (or the user interfaces of the applications) can be built. And I recommend Emacs over the "platform" consisting of terminals, TTYs, cursor-addressing and traditional Unix shells (including rc) because (very briefly) that platform has too many of it design decisions came out of an environment so constricted in computing resources as to be mostly irrelevant for today and because the common mouse idioms really did represent an advance in the state of the user-experience-design art. Hey, since I've already risked offending a large HN contingent (web programmers), why not risk offending a second large contingent (those who like apps that use a terminal for interacting with the user)!

I am aware that not all prospective programmers can stay engaged while staring at plain text all day. They would get bored. To stay engaged, they need more stimulation, e.g., colors, graphical elements, things that move around on the screen (or they need a social element, social interaction being very stimulating for humans). For them, maybe the web is the best environment in which to learn how to program (since it is difficult to learn programming while continuously staying engaged socially). I concede that I have not really studied the issue, so I am (provisionally) willing to believe the general consensus on this page -- but only when it comes to beginners who cannot stay engaged while staring at plain text all day.

Since 95% of Emacs's add-ons (including almost everything in ELPA and MELPA and much of what is distributed in the Emacs app itself) is not worth learning or embracing, perhaps I should add to my recommendation of Emacs the further recommendation that before tackling Emacs, the beginner should first explore and learn how to use OS X so as to give him or her a fighting change at learning how to tell which 5% of Emacs is worth learning and worth adopting. (I consider most popular apps on OS X to be well-enough designed to be worth learning, and my hope in making this recommendation would be that those examples of good-enough design will rub off on the beginner to the extent that he or she would be semi-competent in deciding what parts of Emacs to learn. Textmate in particular has a very well-designed user interface, but Textmate is just text editor for coders, not a flexible middleware like Emacs is, so stay with Textmate only long enough to get an idea of what good user-interface design is.) Certainly, I believe that most beginners should stick to graphical Emacs so that the common mouse idioms (moving the insertion point, selecting by dragging) are available, leaving Emacs running in a terminal to experienced employed programmers who need to ssh in to servers a lot. Also, stick to dired mode as opposed to other ways of navigating and making changes to the file-name space, and avoid org mode, shell mode, eshell mode and especially term mode: org mode makes you learn too many new commands and keyboard shortcuts, and shell mode, eshell mode and especially term mode are too rooted in the very old "ANSI terminal, cursor addressing and Unix command line" way of doing things, which IMHO is overrated on HN unless the goal is to become a professional sysadmin or maybe devops person. And all 4 of those packages / libraries, org mode in particular, do not allow the user to use the mouse enough IMHO.

A more important reason I haven't learned how to write web apps is because the web is our civilization's most important medium for reading, publishing writings and browsing (in the old sense of "browsing" as in browsing through a section of a book store) through collections of textual documents, and IMHO the more people writing web apps, the less suited the web becomes for this essential civilizational function -- because as a general principle, when a software ecology such as the web is adapted for a purpose A then it naturally tends to become less useful and less good for purpose B. In other words, a complex software system serving 2 masters serves those masters less well than a system serving only one master.

Again, I realize that not everybody finds reading static textual documents on the web stimulating enough to keep at for large blocks of time. however, for those of us that do, and who are using the web for a serious purpose (e.g., learning, teaching, inventing, creating new scientific information) the web of 1998 (when the web was already pretty good for reading, publishing and the old pre-electronic sense of "browsing", but had not been significantly adapted or specialized for writing web apps) was generally superior to the web of today. And I believe that the people for whom the web of 1998 was generally superior to web of today deserve some consideration, and I choose to show them some consideration by refraining personally from learning how to create web apps.

I am receptive to follow-up questions via email, especially from beginning programmers.

Re: Retiring Python as a Teaching Language

#67
post #56
post #30

Earlier quoted context omitted.

+1 on the interactivity aspect. Not having to go through a bunch of compiler configuration (C/C++ land) to get a basic GUI up and running is a huge plus. And HTML is a lot easier to understand for people with no experience than a bunch of tkInter classes.

i kindof believe all languages should have some ability to run with a browser-based GUI... why bother with all the hair-brained implementations (Swing, Qt, etc.) when we could just have a "desktop mode" (altered security) version of Chrome pop up to provide GUI. it wouldnt even have to follow same rules as browser really (navigation could be via buttons only, no back/refresh), just be based on html & perhaps js to al…

I think this is easier than you think. About 8 years ago I was working on a big project in Qt that was two parts -- one part a 3d rendering engine, one part an interactive web view. Having the two interoperate was surprisingly straightforward, and we could do all kinds of HTML/CSS layouts and use JavaScript hooks to call to the Qt classes. I can't imagine it's regressed much since then, though I'll admit it's been a while since I touched it.

PhoneGap provides this kind of experience for mobile.

The issue always ends up being performance -- running the JS runtimes in sandboxed webviews is always* slower than native code.

Re: Retiring Python as a Teaching Language

#68
post #57
post #17

Earlier quoted context omitted.

> Is that some law of nature, or merely a consequence in how we've designed languages thus far? It's a game of tradeoffs, same as everything else in nature, isn't it? I would rarely say that a given language's design or implementation is universally flawed, instead it's the result that comes out of a set of premises and decisions. Yes, some of them may be objectively bad, but mostly they are just decisions made to so…

> It's a game of tradeoffs, same as everything else in nature, isn't it? My question is if tradeoffs are inherent in programming language design (some mathematical inevitability) or due to lack of resources and other "real world" concerns that can be overcome given enough care and money. I'm not convinced by anything that I've seen that we don't just have the latter. E.g. one could say in 1995 "JS is an awful languag…

I think the issue here is that we have two opposing theses on how this works. I posit that the programming ecosystem is very much like any other ecosystem in that there is are many organisms within it, for a good reason. For example, looking at nature, you might ask yourself why biology hasn't converged on a single lifeform yet, and whether it's not simply an issue of having all the right genes and discarding those that are not so good. But that's obviously not how it works. There are niches and different strategies for solving different problems. There is no one genome that solves everything. And yes, every single codon is a decision that opens doors and closes others as well.

If I understood you correctly, your position is the inverse of that thesis. You argue that there is a base abstraction that should work equally well in every context, and that specialization could come in the form of optionals piled on top of the one true base. There is no mathematical reason why this should be unworkable, but a solution so far eludes both programmers and evolutionary processes alike. That doesn't mean you shouldn't go ahead and try solving it. It's a worthy project. If you believe you can come up with common denominators that cover all aspects of all previous languages, by all means: give it a try!

Re: Retiring Python as a Teaching Language

#69

- No memory management - No pointers - No cache - No branch predictor - No interrupts - No endianness - No alignment What exactly are we teaching students to program? It's certainly not a computer.

The best part is you can't forEach or map an HTMLCollection object. You have to [].forEach.call it. lol

Re: Retiring Python as a Teaching Language

#70

A language like Perl 6 would probably be a good first programming language if some good libraries become available for it. Printing one line of text is one line of code. Then you can start teaching branching, loops etc. Object-orientation is also baked in. Oh and by the way, there is this thing called "types". It helps you catch some types of bugs early and can potentially make your programs be compiled and thus run…

I'm sorry to come off as harsh, but I -- without any joke -- thought I would have better things to do with my time on this planet than deal with some scumbag's Perl 5 code. I don't think the solution to the "shitbrain writing Perl" problem is more Perl. Fuck that in the ass.

Well, you say, isn't that a problem in every language?

Perhaps. But I don't have to deal with it in every language. And every other language seems to have a type system that will let me know when something idiotic is being done, or exception handling, or "well, that pointer was null, so I'm done for the day" behavior that Perl doesn't have.

And as I've (sometimes reluctantly) given up on old relationships I'd invested a lot of time in as being not for me, or anyone for that matter, so is fucking Perl. It's not FOR ANYONE.

Post reply on HN