13 ms·
Retiring Python as a Teaching Language
- Udo 12y agoJavaScript (or rather: a subset of it) is a fine teaching language too, especially since it's easy to publish runnable code - even for beginners. However, there is no language that can do everything equally well. It's a common reaction displayed by the proponent base of many languages, even here on HN, to advocate the use of their language for every conceivable need. This can't possibly work well. Programming teachers should make a habit of pointing out that writing code is a journey that will require students to learn new tools all the time.
- elwell 12y ago> This can't possibly work well. Not that I disagree, but could you elaborate your reasoning here?
- Udo 12y agoThere are many decisions that influence language design, it's not just syntax. Differing decisions are made about runtime behavior, memory management, levels of abstraction, and the efficiency of idiomatic data structures. Even objectively, a good language to write an OS kernel in isn't necessarily equally well suited to, say, game development, or web development, or scientific computing. That doesn't mean there won't be heroic efforts to make a language work in every arena, but at some point most people draw a line based on pragmatism. Also, often overlooked, there is the aspect of a language mapping well to a given developer's brain. Different people are drawn to different languages for different reasons, including borderline-intangible ones where they just feel more "at home", which translates into tangible outcomes like productivity.
- coldtea 12y ago>It's a common reaction displayed by the proponent base of many languages, even here on HN, to advocate the use of their language for every conceivable need. This can't possibly work well. Is that some law of nature, or merely a consequence in how we've designed languages thus far? A well designed type-infered statically typed language with a REPL/interpreter, a fast AOT compiler, an optional GC, good documentation and IDE support, and a big API library could work well for all kinds of domains, from scripts and websites, to network application servers and systems programming. Note also that the money we spend on language and tooling development are miniscule and laughable compared to the IT industry's size. When there have been some decent money involved we had good results. Namely: With SUN/Java we got the fastest, more mature VM out there, with very good GC and a ton of tooling available. With Javascript, we got V8/JSC/etc, that made the language 10-100x faster compared to the nineties. With MS, we got C#, a great language that can cover tons of ground for what its designed, modern, with a huge ecosystem of tools and APIs. And from Apple, we got the great Cocoa libs and Swift (still a work in progress but very promising).
- Udo 12y ago> 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 solve specific problems. In a way the whole point of my post was that languages don't primarily exist on a one-dimensional spectrum of "good" to "bad". They're optimized for different things. The assumption that given a list of possible decisions during language design you just have to select the right one every time is based on the fallacious premise that right and wrong are the actual choices you get. > A well designed type-infered statically typed language [...] ...and those are already some key decisions you made that reflect what's important to you personally. Every time you choose one of these properties, you open doors and close others behind you. While you may personally believe these are the minimum requirements which every "good" language absolutely must have, you should also recognize that you are doing exactly the same thing as every single language designer in history.
- rtpg 12y ago>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).
- Udo 12y agoAgain, 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 the notion "if programmers only _knew_ about the one true way of doing it, they'd all use the same language and tools, namely: mine".
- dkarapetyan 12y agoIt is amazing how much of an IDE a web browser can be. I use typescript these days to prototype stuff and it is going pretty well. Reload and changes are up. Nothing else even comes close.
- dinkumthinkum 12y agoI think any REPL system does the same thing, though.
- dkarapetyan 12y agoTo some extent. I think pry comes closest to re-creating a truly interactive development experience but the browser is slightly better especially with source maps.
- cageface 12y agoIt'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 beginner a few years ago either but that's where the momentum is now and, as the author says, the ease with which a newbie can get something interactive up on screen trumps smaller concerns. For a little more rigor you can use something like Typescript.
- gobengo 12y agoWhat's pretty funny is that the new features in ES6 and ES7 makes a lot of the patterns/mishaps/X-parts from the last 15 years pretty irrelevant or less-obviously-'the way'. Examples: * "Class" syntax * Comprehensions * Modules * `let` scoping * Generators It's a whole new ball game. I think a lot (over 50%) of JavaScript devs 5 years from now will still be using <= ES5, but only because they've so settled in their ways over the last 10 years.
- saraid216 12y ago> I think a lot (over 50%) of JavaScript devs 5 years from now will still be using <= ES5, but only because they've so settled in their ways over the last 10 years. 5 years from now, there will still be people whose customers require IE6 support, too. We're still working on that.
- pjmlp 12y agoThe customer I am on, still uses IE 8!
- wwweston 12y ago> I think a lot (over 50%) of JavaScript devs 5 years from now will still be using <= ES5, but only because they've so settled in their ways over the last 10 years. Funny, I'd make the opposite prediction... the JavaScript devs I've known have been among the most curious and open-minded developers about different ways of doing things, interested in experimenting with different idioms made available by the flexibility of the fundamental language, and quick to adopt them they found them useful (possibly too quick). They're people who figured out how to get many of the benefits of the language features you've listed above starting with the language features that were available years ago. Which kindof makes sense: everybody else was too busy complaining about function scope instead of block scope or how they couldn't get their heads around Prototypes instead of Classes or having to reason about this scope or truthy/falsey values or whichever difference/wart scared them off to bother learning to use the tools at hand. No, my bet would be that ES6 adoption will take up a lot quicker than, say, Python 3. (and most of the lagging will probably happen around frameworks with imported paradigms -- Angular 1.x, I'm looking at you in particular -- and other aging codebases).
- ekianjo 12y ago> A month later, more questions: "How can I give this game I made to my friend? Even better, is there a way can I put this on my phone so I can show it to kids at school without them having to install it?" Giving a Pygame game to your friend is pretty easy. It has usually very few dependencies and should be trivial to package. And it's multiplatform (Mac, Windows, Linux including even exotic devices like the Raspberry Pi). Putting a python game on a phone is definitely more of a problem, but at the same time something that is NOT made for a Phone touch controls will anyway perform poorly if you intend to do a demonstration with it.
- ion201 12y ago> Putting a python game on a phone is definitely more of a problem Not necessarily. kivy[1] is an alternative to pygame (for desktop builds, it uses pygame/sdl under the hood iirc) but it supports exporting to android as well as desktop platforms. I haven't done a ton with it so take this with a grain of salt, but it looks like it could be a viable option in this case. [1] https://github.com/kivy/kivy https://github.com/kivy/kivy
- zarify 12y agoI might just not have played with it enough at the beginning of 2014, but kivy had some serious weirdness when it came to the way in which it approached its layouts, which I feel was down to the way in which it tried to approach being multi platform. This was mostly looking at developing a basic desktop app which I could then shift over to mobile as well.
- elwell 12y agoI would almost suggest CoffeeScript in place of JavaScript. In fact it feels more like Python. My main concern would be lack of Google-able resources compared to plain JS.
- jitl 12y agoCoffeescript is clearly in the same vein as Ruby: designed by experienced programmers for experienced programmers. The list of caveats and gotchas for both languages is a mile long, and the grammar of both is ambiguous. I love both languages dearly for letting me be a trixy wizard but would never reccomend either to a beginner.
- elwell 12y agoI would argue that CoffeeScript has less gotchas than JavaScript. And, while you can be a trixy wizard with CoffeeScript, it certainly isn't required. The leaner and more linguistic syntax would aid beginners.
- Scarbutt 12y agoCoffescript wouldn't be pragmatic since they would have to learn Javascript anyway.
- memracom 12y agoI would actually solve the game/show problem a different way. I would teach kids how to build MVC web apps and set up a cheap server so that apps could be "shown" to anyone on any device. If you use a mobile-first design philosophy for the webapps then phones are not likely to be an issue. Yes, there is still the issue of response time but no language works for everything. You have to accept certain limitations and make compromises. Actually, I might no longer even use webapps. Nowadays it is pretty cheap to give every kid a Raspberry PI so WxPython or Pygame can be used for everything. The showing problem boils down to borrowing a monitor, keyboard and mouse. You could actually carry around a small portable bluetooth keyboard and a mouse in your backpack with the Raspberry PI. So, why stick with Python? It is because Python is a leader in moving up the evolutionary curve towards functional languages and functional reactive programming. I still think that Python is easier to get into that Erlang or Scala because you can "make mistakes" but still have a working program. And by examining the implications of mistakes you have a learning opportunity too. Note that Javascript has been following Python's lead in adding more functional features. There is a general language evolution going on and Python is in the thick of it, maintaining compatibility with the old imperative style beloved of data crunching scientists along with the functional goodies that Haskell, Erlang and Scala focus on. It is not out of date. It is not mired in the past like PERL and PHP. What was good about Python 5 years ago is still good.
- cageface 12y agoI would teach kids how to build MVC web apps and set up a cheap server so that apps could be "shown" to anyone on any device. That's a pretty big hurdle for a newbie to get over before "Hello World". JS in the browser has the massive advantage of being pre-installed and requiring no special tools, with an immediate edit-run feedback loop. Wrestling with a server and code deployment etc is a problem they can learn to solve once they've been bitten by the programming bug.
- qzcx 12y agoI'm not sure your responding to the problem the OP has. He isn't saying Python isn't good for all the things you've listen. He is saying that for starting off in an introductory classroom environment, python is too complicated for simple interactive applications. MVC web app certainly goes above and beyond TkInter in complexity. If you need to develop the web app, then you'll probably end up teaching Javascript anyways to accomplish what he is addressing. Having tutored friends in introductory courses before, functional programming would certainly also go over their heads. So while I agree with you on your points. I agree with the OP that perhaps Python isn't the best language you want to use as an introductory course (if interactive GUI are on the to do list at least), but maybe bring it in during the second or third course.
- aerovistae 12y agoSo incredibly in favor of this. I love python, it's probably my favorite language. I taught a class on it in Boston. But these exact questions have indeed brought doubts into my mind. Year after year I'm disappointed by what python simply cannot provide in any straightforward way. The options are very few for making games. The options are very few for desktop GUI (I tried to do PyQt and then discovered QML with JavaScript and quickly left python behind for that project). The options are few for back-end web development-- yes, there's Django, but it just doesn't have the clarity, documentation, and community that Rails has, or Wordpress (different type of entity, I know), or many others. Flask is amazing but small in scope and community. I'm a professional JS developer by day and I used to think JS was awful for teaching, because the functional side of it is nightmarishly confusing IN GENERAL, let alone to someone new to programming. Its objective/prototypal system takes quite a bit of getting used to, also, and it has many other quirks. But, for the EXACT reasons mentioned in this linked post, I changed my mind. The fact that JS can be used for almost anything nowadays, is ubiquitously in demand, has a massive, massive worldwide "community," and allows easy GUI manipulation via HTML/CSS, makes it the best candidate for teaching by far. It'll just take some careful consideration as for how to approach it best.
- themartorana 12y agoYou had me until you said that Django doesn't have the clarity or documentation of Rails. Django is easily one of the best and most meticulously documented pieces of software I've come across in my 18+ years of writing software. It also, IMHO, has a much higher "clarity" quotient - Rails is a lot of magic for me, while Django is, in the end, much less religion and much more clear. (I will acknowledge that I chose Python and subsequently Django because they spoke to me personally, but seriously, Django's documentation is second perhaps only to Redis.)
- orangecat 12y agoAnd this is why I'd argue that Python 3 was a big mistake. In exchange for 6 years and counting of freezing and bifurcating the ecosystem, we got a smattering of minor improvements that don't substantially change the developer experience. What could we have had if that effort had instead been focused on things like real performance optimization and native browser support?
- Mithaldu 12y agoAs much as i can't disagree with the choice (the realpolitik of programming has made it the most correct choice), i am saddened that the language on which the choice falls is one not chosen based on any merit, but merely due the historical accident of being the first to be implemented in a browser and having had no appreciable opposition due to browsers at the time being in hands of corporations. In "A Deepness on the Sky", Vernor Vinge describes a future in which there is the reality of a profession called "Programmer-at-Arms", necessitated due to thousands of years of layers of indirection and cruft that will combine to make the software of that time, making it a requirement for even simple changes in a weapon system to be done by someone who can dig through all of those layers. It seems that his prediction is closer and closer to becoming reality.
- gobengo 12y agoI thought Java was the first to be implemented by the browser?
- Mithaldu 12y agoMaybe as a plugin, but from what i can tell Javascript was the first to be supported natively: http://www.javascripter.net/faq/javascr3.htm http://www.javascripter.net/faq/javascr3.htm
- olavk 12y agoJava was introduced in Netscape Navigator 2 at the same time as JavaScript. But Java was really not integrated with the html at all. It lived in its own isolated box on the page. JavaScript was integrated with html and with the browser environment.
- GFK_of_xmaspast 12y agohttp://en.wikipedia.org/wiki/HotJava http://en.wikipedia.org/wiki/HotJava ?
- lmm 12y agoI think the TCL plugin predates the Java one.
- sbov 12y agoJavascript has been around for close to 2 decades. I'm somewhat curious if there's a change in Javascript that has changed your mind, or is it something you think should have been true for the past 10+ years?
- rrggrr 12y agojust the opposite. Many teachable subjects from Journalisism to data science, biology to finance increasingly include Python. NLTK, Beautiful Soup, Pandas, Ipython Notebook, Matplotlib... Programming is a tool for getting things done, and few languages offer students more tools for doing than Python. On HN we sometimes forget the ubiquity and pure value of automation and anaysis. We focus perhaps too much on software engineering (in this case gaming).
- shadowmint 12y ago> Programming is a tool for getting things done ...and some of those things, python isnt any good at. To be fair, it's very very good at others, but you can't argue with the points he's making. They're spot on. It turns out, people learning programming in school aren't interested in processing scientific data. They're interested in games. and showing their friends what they've made on their phones. Python is flat out bad at those things. It was never the intended purpose of python, and it's not a priority for the core team. Why not teach kids with a tool that excites them, instead of one that frustrates them?
- hyperion2010 12y agoFunny, I have done a lot of game/graphics related programming using python and panda3d, which is written in c++ and has nice python bindings [0]. Sure, you can't just do "import wheemakegames" but the tools are out there. The same is true for GUI apps. If you want to click on stuff just have them use pyqt or pyside. I think that teaching students about other packages and how software actually works together is very important. Having said that packaging a python program into an executable installer or even just an executable is a pain in the ass ("What sane person DOESN'T have at least one working python interpreter?!?"). 0. http://www.panda3d.org/manual/index.php/Main_Page http://www.panda3d.org/manual/index.php/Main_Page
- zarify 12y agoOne of the issues I've had using Python to teach in the last few years has been the glacial transition to Python 3 for some packages, often with some annoying cross platform inconsistencies (trying to keep up with two or three different tool kits for one purpose because of different support for Windows vs OS X is annoying). I really enjoy Python as a language, I enjoy using it for teaching fundamentals, but I really don't enjoy using it for teaching 'the fun stuff' as far as high school kids are concerned. I might consider switching to JS in my new school. I was looking forward to perhaps using Swift but the new place is Windows-based.
- brudgers 12y agoI have a concern with Python as a teaching language in contexts where people are not necessarily into STEM and are inexperienced or marginally experienced as programmers. There's no neat and tidy way to deal with Python 2 versus 3. You can say use 2. You can say use 3. You can kick the issue down the road by requiring programming via web browser. But in the end anyone who catches the programming bug winds up facing a decision that even seasoned professionals struggle with. Python as a teaching language is great for replacing MatLab. After that it entails tradeoffs as fundamental as character encoding. Not that I'm saying JavaScript is the answer. If I were trying to get someone juiced about programming and solving the problems that MatLab does wasn't a feature the audience cared about, I'd pick Processing. It does interesting things with sound and images and exports to HTML and JavaScript to run in the browser. All that and it's small, well documented and Googles up a low noise search results page. Yet it runs as deep as you want to dive into the JVM and its languages.
- kylebgorman 12y agoTelling somone to use Python 2 is a neat and tidy solution. What problems would this possibly cause? Python 3 is fine too.
- mkesper 12y agoPython 2 is not nice as soon as you face something containing unicode chars.
- kylebgorman 12y agoI don't think mobile gaming should play a dominant role in teaching programming. (If I wanted to teach that, though, I wouldn't reach for Python, however.)
- dinkumthinkum 12y agoThis is always a hotly debated topic. When I learned to program, I started because I wanted to understand how computers work. Javascript in a Web browser so many layers above the basics of a computer; I just don't think it is a good choice for a first language. Obviously, it depends on your goals. If you are changing careers and you just heard that you can make all this money web consulting and you couldn't care less about computer science then maybe go for Javascript, I don't know much about people who got into programming via that route. I think Python is probably a useful first programming language for someone interested in doing mathematics or algorithms but I still think, and this is totally against the grain, that C is a good language for beginners to programming. However, it may not be the best language to teach undergrads and expect as many as possible to stick with CS, maybe that is not a terrible thing? Though, that is elitist, I think C provide enough of an abstraction on top of the machine while still allowing you to get some idea of how computers and memory work, from a CS rather than an EE perspective. The other benefit is that once someone wants to know how to create a game or how to make a GUI program ... the resources are readily available and in fact most of the libraries will be written in either C or C++. I think C over C++ because OOP concepts and syntax of C++ can be needlessly overwhelming for a newcomer to programming. I feel like it also gives the beginner the feeling of actually creating a program. Those interested in learning to program will always be familiar with normal executables such as EXEs on Windows or binaries that can be executed on Linux. Using C means you can create something just like those programs they are familiar with; it gives the learner a sense of really accomplishing something, in my opinion. Creating something you have to run in conjunction with another program and does not seem like a "typical executable" can leave the user feeling like "OK, how do I create a real program, though?" This is not to knock interpreted languages, at all; it's just something I think is important for some learners.
- shadowmint 12y agoAs a proponent of python and a full time python developer I fully endorse this decision. There is a compelling need to be able to distribute graphical python applications that isn't met (and that https://www.python.org/dev/peps/pep-0441/ https://www.python.org/dev/peps/pep-0441/ isn't even a step in the right direction is an indication of how far away a solution is). Don't get me wrong, python is a great language, but its not the right solution for teaching programming for exactly these reasons.
- fpgaminer 12y agoFrom the link: > This feature is not as popular as it should be mainly because no one’s heard of it Count me as one. As someone who does a lot of development in Python, I'm surprised I never heard of that feature either. Perhaps another reason this feature goes unnoticed is because it still requires the end user to have Python installed. Therefore, when distributing a Python application, most people just bundle it into an EXE/ELF/etc and don't bother looking for other solutions.
- shadowmint 12y agoBasically that's because you can't bundle c libraries in a zip file like this, so effectively you can't actually use it for any of the reasons you might want to use it. (.exe bundlers, by comparison, bind the shared library into the executable or with it)
- Demiurge 12y agoI'm sorry, your comment isn't making clear what teaching programming has to do with distributing graphical applications. Could you clarify what 'these reasons' are?
- gcommer 12y agoTeaching intro programming courses with "parse a CSV file" or "implement a text based calculator" is outdated. Modern students have grown up with smart phones and are used to being able to click around and have the computer react graphically. Students learning with C or Python have a large chasm of GUI libraries they have to cross before they can make anything like the UIs they are used to seeing. Being able to make shapes move around from day 1 in a JavaScript course seems like a much more compelling experience to me.
- istvan__ 12y agoI 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.
- gtaylor 12y agoI 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).
- crpatino 12y ago> for the author's usage case (kids wanting to learn to write games that are super easily portable) This is an artificial use case. Kids wanting to learn to write games should be concerned with whatever works on the hardware they have available. Portability is premature optimization at this point.
- yoklov 12y agoReally? You don't think they'd want to be able to show their friends? Mobile might be an artificial use case or a premature optimization, but it is solved with his choice of JS.
- gtaylor 12y ago> Portability is premature optimization at this point. It really isn't. If I am a new developer, you're raining on my parade by telling me that I or my friends will have to jump through a bunch of hoops to run my game. In the context of learning to program as a younger person, this is a pretty big deal. This is anything but an artificial usage case, and is what the author is specifically looking at (education).
- BuckRogers 12y agoI think this author has lost his focus. Maybe there's only 1 choice if you want something to sit "on top", but anything can interact with "an unprecedentedly ubiquitous cross-platform toolkit for layout, typography, and rendering". Including Python. For games, an introductory class using Python with Kivy or PyGame doesn't fit the bill because they may not always be around? If a student really wants to go deeper into game dev, they're going to need to learn at least one of Swift/ObjC/Java/C# and their respective native libraries anyway. You're not indoctrinating them into a platform like the web or iOS, you're introducing them to programming. The rant about libraries not always being maintained is really brilliant considering the library churn than in the JS space. After all, they may be "well-intentioned today but unsupported tomorrow?". TkInter? This was around before Angular 1.x was a glimmer in daddy GOOG's eye. It'll be around after Angular2.0, and long after 2.0 is buried and the next JS framework/library rears its ugly head only to be put down in short time. Given the choice of having invested my time into TkInter, or Angular 1.x, I know which I'd rather have dumped my time into. So what's the goal here, to teach programming with something you can show others? If so, then you can do it with almost anything, especially Python. Use what you want to teach, but don't delude yourself with half-baked reasoning to justify what you clearly always considered an inferior choice to do it in- for the last 2 decades. Back to the drawing board, professor.
- ajanuary 12y agoIt sounds like the goal is to get people programming. That means a combination of teaching them, and getting them excited. Being able to show the thing you created to your friends is a powerful motivator.
- TheDong 12y agoIf you get excited by showing your friend some silly webpage, but aren't absolutely thrilled by function composition in haskell then you're a coder, not a programmer. You're in the wrong class. The point of programming classes should not be to hide what programming is and show this silly mockery of it which javascript is. It shouldn't veil true programming issues, like correctly reasoning about the structure of your code, with a language which makes it easy to code in without ever programming. If you need to motivate someone to be a programmer, they should not be one at all. They should not be going on to write poorly implemented software because they didn't have a passion for implementing proper reference counting in a legacy C codebase, but instead wanted to write an iPhone app for their friends. If you need to motivate someone to be a programmer by teaching them to draw on a canvas or manipulate the dom, rather than teaching them the wonders of basic lambda calculus, then you're doing them a massive disservice by using the word "programming" to refer to something else entirely.
- chipsy 12y agoI agree. As a beginner - and even as a professional, in an average-case situation - what you need in terms of abstractive power and optimization potential tends to be something akin to a classic microcomputer Basic, plus some modern API calls. You're already way ahead of the game when you consider JS in that light. You can write a lot of practical, maintainable JS that only uses arithmetic, string manipulation, branches, loops, arrays and simple function calls. POD objects, too, if you get a little more fancy. Teaching towards that subset is also a healthy instruction in rule of least power - once you grasp how to use the basics, you have a fighting chance of picking up most other languages too. It's way more unhealthy to guide newbies into cargo cult thoughts about "proper" something-something design(insert favorite methodology here) - a learner has to make their own mistakes to learn properly, but they should do so from within the subset of programming concepts that predate current languages, because those are the things that have lasted through multiple generations of software. If we consider Python, Ruby, JS, C#, and Java - the design of most of their core features was locked down all the way back in the 1990's. So all the new ideas they brought to the table tend to be "baby implementations", frozen in a half-correct state of refinement. But the things they got _really_ right tend to be the things that were there and usable, but not refined so well in prior languages.
- bjcubsfan 12y agoYou can program in Python using Kivy [1] to create apps for Android, iOS, and the desktop. I made a simple app and took it through the entire process it is now on the Android app store. You are still using Python so you can focus on programming and not language features, but you get the benefits of programming something your students can show off. [1] http://kivy.org/docs/gettingstarted/intro.html http://kivy.org/docs/gettingstarted/intro.html
- MarcScott 12y agoThanks for pointing this out. I've been using pygame with my students but kivy looks great.
- IndianAstronaut 12y agoI figured this out when I was teaching my nephew programming. I started him on Python. He got bored quickly because he really couldn't see the results of what he did and he really wanted to make simple games. Javascript turned out to be much better for making simple games and doing simple puzzles.
- gunnm 12y agoWouldn't something like pyjs (http://pyjs.org http://pyjs.org) solve all of the author's concerns, while still teaching Python?
- aroberge 12y agoBrython is even better.
- skybrian 12y agoThere are other languages that run in a browser and might be suitable for teaching. How about Dart or Scratch?
- alextgordon 12y ago- 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.
- est 12y agoThe best part is you can't forEach or map an HTMLCollection object. You have to [].forEach.call it. lol
- bzbarsky 12y agoHTMLCollection is a messed-up puppy, sadly. Consider this markup: <img name="forEach"> <script> document.images.forEach.src = "something"; </script> This works, today, in all browsers. Adding "forEach" to the proto chain of HTMLCollection would make this code no longer work, so no browser is willing to add it for fear of breaking sites. The answer is to stop using HTMLCollection. What's worse is that NodeList doesn't have this named-lookup issue, but putting Array.prototype on its proto chain (the obvious simplest way to get all the array goodies) again breaks websites, because some people uses "instanceof Array" to assume things about how an object will interact with Array.prototype.concat. Long story short, making improvements to the DOM is very hard because of the two decades of weird website hacks that are supposed to not get broken in the process...
- Turing_Machine 12y agoTuring machines don't have any of those things either, and they are certainly computers. Universal ones, in fact
- simula67 12y agoA 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 faster in some cases. Learn about that also without switching the language. Some functional programming concepts can also be taught. Also it has a C-style syntax so switching to another similar language later on would also be easier.
- gthm 12y agoYou 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.
- gthm 12y agoI'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.
- hollerith 12y agoWarning: 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.
- MarcScott 12y agoI battle with the same problem with my students. I love teaching Python, and I think it is a fantastic teaching language. JavaScript, although harder to learn, is much more exciting for the students to play with, and libraries are always just a link away. My main reason for not switching completely over to teaching JS, is the nightmare that is debugging simple syntax errors.
- codecurve 12y agoMost editors have a JSHint plugin, which will check your code as you go and point out when you've made a syntax error or used a bad practice. I use it with Syntastic + Vim and it's a long time since I've ever loaded up code in a browser and there's been a syntax error. Definitely worth checking it out if that's the last hurdle before switching.
- frozenport 12y agoLife isn't all about game, sometimes its about matrix multiplication and NumPy and SciPy do this exceptionally well.
- jacquesm 12y agoSure, but that's not how you start.
- jfarmer 12y agoI've had good success teaching Lua with https://love2d.org/ https://love2d.org/. Super easy to create click-and-run executables that work on OS X and Windows. Mobile's a different story (obviously), but as a teaching language + environment I find it, well, lovely. :)
- Gurkenmaster 12y agoThere are some mobile game sdks that use lua like gideros and corona. It's possible to do live coding in a simulator if you use zerobrane studio but I'm not sure if it's possible on a real phone.
- leke 12y agoI taught my son JavaScript (along with html and css) because I think the browser is a great platform to expose new programmers to programming. I also think it's the most relevant because any knowledge and experience acquired is likely going to count in some way in their future. The JavaScript adventure can continue when we look at node on the server and even use it to control embedded devices like Tessel and Espruino.
- johnloeber 12y agoWhen I took an introduction to Computer Science in college, it was taught in Racket. Over winter break, I then learned Python, and I was baffled -- why would any curriculum not start with Python? Python was easy, expressive, and allowed the user to get lots done with little effort. It was great at motivating programming by showing its use and power. It seemed like an ideal introductory language. Over the last few years, however, I've back-tracked on this opinion: if you really intend to teach, not just motivate, then Python is a poor choice. A language like Racket is great for teaching because it lends itself to exploring so many core concepts: complexity of algorithms, functional programming techniques, recursion, data structures, etc. A language like C (the next course I was to take in the introductory sequence) is also an excellent language because it forces the user to understand programming at the systems-level. I don't really think Python is very good for illustrating either the theoretical or the systems-level CS concepts. It's a nice language for motivating programming and showing off how much you can do with little serious investment, but it doesn't really motivate learning Computer Science, i.e. learning Programming on a 'deeper' level. Thus, I don't really think that learning Python offers solid programming foundations. Consequently, if you really aim to teach, not just to motivate, then use languages that bring the student closer to core CS concepts.
- rattray 12y agoIf "programming foundations" must include memory management etc, you're certainly correct. However, there's a reason they use Python for intro classes at eg; MIT[0] - the language gets out of the way so you can focus on CS basics. Once you get control flow and the like, you can start to explore complexity et al. [0] http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/ http://ocw.mit.edu/courses/electrical-engineering-and-comput...
- hga 12y agoNo, Scheme was that language. MIT now uses Python because when the dot com crash cratered enrollment, which dropped by more than half after being steady and high for decades, the EECS department and I gather some higher ups panicked. They also made the 2 new mandatory introductory courses much more EE and "gadget" heavy. (Another input might have been the school having committed an insane quarter billion dollars to build a "showpiece" (but not very functional) building for CS research.)
- TheDong 12y agoI completely disagree with the argument here. The class isn't a class to teach graphics or to teach how to make android games or how to put something on a phone. Beginning computer science classes explicitly should not be about those sorts of things. Beginning computer science classes should explicitly be about what a program is, what a function is, abstractions, and so on. Not "what does code look like". Not "how do I make a hello world program". No, what a program is. Lambda calculus or a context sensitive grammar and lexer or what have you. If you look at SICP, it got it 100% right there. Now, you say, he said programming, not computer science, and your argument presumes computer science. Even so, python and javascript are terrible language for beginners if we ever want to see our craft improve. If someone wants to be a good programmer, they should be able to understand the full implications of having a proper type system, what memory safety and management is, how functions work, and so on. They should be exposed to haskell, lisp, rust, or the like. If we teach a beginning programmer to use C or Python or Javascript, we're simply teaching a new generation that memory leaks and buffer overflows are not a solved problem. That our languages are so poorly designed you have to constantly check if your type is what you think it is. That resource ownership is not a solved problem. That functions are weak and uncomposable. By God, you're withholding the true beauty of programming from them and showing them some mockery. If your students find the idea of having a webpage or a game that they produced more appealing than delving into resource allocation issues and understanding what a type system is doing then they shouldn't be told they're professional programmers, they should be hobbyists coders. I'm all for people writing toys like games or webpages in unsafe languages that have learnt little from the last 50 years of CS research... coding but not programming. That's great. I'm not all for these same people being taught that they should be writing security software, banking software, and doing this stuff professionally when they have no clue what referential transparency is. Truly, one of the reasons professionally developed software is rife with issues is that we don't teach programming or computer science in our computer science course; we teach some coding and software development and never even let them know what true programming is until the theory of computation course in senior year.
- platz 12y agoBeginners that aren't in a formal class setting (and his description more closely describes mentoring someone outside of the classroom (son/daughter)) have not yet made the decision to invest in learning things from first-principles as a university student has already locked into doing. So, for these beginners there must be some kind of reward or immediate application for their efforts if we even expect them to continue past the stage of early burn out. This is what the post speaks to.
- owlish 12y agoA lot of the discussion in here revolves around "not being able to get an interactive GUI up and running quickly". If this is indeed the main problem with teaching programming with Python, there are many ways of tackling this problem without resorting to teaching Javascript. Don't get me wrong, Javascript is an interesting language, but it has many oddities that could throw off a newcomer. Sites like OpenProcessing[1] and ideone[2] already allow users to compile and share code in the browser. Why not create a Python GUI "toolkit" that interacts with the browser and can be accessed from an interpreter implemented in Javascript? Granted, this isn't the "vanilla" Python experience, but if you're just ramping up, having shiny bells and whistles to show off to friends is definitely a plus. [1]: http://www.openprocessing.org/ http://www.openprocessing.org/ [2]: https://ideone.com/ https://ideone.com/
- vanderZwan 12y agoAn even simpler solution would be Python mode for Processing, which has most (if not all) of the benefits of Python and Processing in one: http://py.processing.org/ http://py.processing.org/
- woah 12y agoSimplest solution of all would be to just use js. I don't think that any syntactical or semantic niceties in Python matter much to an absolute beginner, and the extra layers of indirection you guys propose will just lead to more moving parts and frustration.
- Lerc 12y agoI looked at a bunch of things for teaching and I settled on JavaScript. It's not ideal as a language, but it ticks enough of the required boxes. The primary benefit was being able to teach someone without having to install any software. Quite often I would have to use locked down school computers, so doing everything from the browser was crucial. I put together a simple library that has global functions to let the very first programs do interesting things while remaining simple. I made a mediawiki Plugin so that I could have code examples that you can edit and run within the page. http://fingswotidun.com/code/index.php/Main_Page http://fingswotidun.com/code/index.php/Main_Page Having simple examples that you can see,run and change helps a great deal. This is my standard starter program. http://jsbin.com/camocarohi/1/edit?js,output http://jsbin.com/camocarohi/1/edit?js,output It does something, and the entire program can be viewed on the one screen, so you can keep it in one place and point to the parts to show what is happening. When that question comes "How can I write a game?" (and it _will_ come before the first lesson is finished, I can direct them to the list of available functions at http://fingswotidun.com/code/index.php/API http://fingswotidun.com/code/index.php/API point out the first entry "clear()" then put that in front of the fillCircle() call. The program goes from a drawing program to a moving dot game. From there you just go with the flow of "How do I make it do (X)?" This is where a single hour lesson with my own daughter (age 11) ended up after starting with that base http://jsbin.com/coguvokupu/1/edit?js,output http://jsbin.com/coguvokupu/1/edit?js,output The single greatest downside to using JavaScript is that it is not preempting/blocking. A beginner will always assume that var spaceShip=loadImage("myship.png") will have the image loaded when the next line of code is reached. Events and callbacks are not principles you want to deal with as a first step. Similarly, you have problems when they try while(true){drawCircle(rand(),rand(),rand())}; The reasons why they can't do things the way they assume are at a more advanced level.
- PythonicAlpha 12y agoOne important reason for the success of C was the library. One of the reasons for the success of Python is the big library and the plenty of add-on modules. But on the UI side, Python has its weak point. The other problem today is the trouble with the migration from Py2->Py3. But on the long run, the UI problem can be even more trouble. Python is still a good language on the server side, even when PHP was faster and still has a bigger market share.
- yCloser 12y agoI don't like this concept of "first teaching language". It does not matter at all which one one learns first! It's not the language, it's the ideas and the way of thinking... This is like talking about whether it is better for a baby to speak english or chinese, in order to learn how to walk
- bjourne 12y agoI'm saddened by the lack of academic rigour displayed in this thread. If you have not taught introductory computer science courses, then you have NO CLUE what makes a good introductory language choice. It appears James Hague isn't working as a teacher either, just giving advice to newbies, so his opinion is just that -- opinion. What you want is field studies: "This year we used Haskell and 75% of all students gave up on programming stating that it was to hard. Last year we used Visual Basic and only 20% did. Ergo Visual Basic is probably a better first language than Haskell." Lots of research is being done on the subject, see this survey: https://www.seas.upenn.edu/~eas285/Readings/Pears_SurveyTeachingIntroProgramming.pdf https://www.seas.upenn.edu/~eas285/Readings/Pears_SurveyTeac...
- cageface 12y agoPretty much everybody I know that eventually went on to write code for a living starting hacking on little toy projects long before they got anywhere near a computer science course. JS in the browser is a great environment for people to start experimenting and dabbling in the same way that things like LOGO and Basic used to be in the early PC era.
- oskarth 12y ago> What you want is field studies: "This year we used Haskell and 75% of all students gave up on programming stating that it was to hard. Last year we used Visual Basic and only 20% did. Ergo Visual Basic is probably a better first language than Haskell." Why is that necessarily a good thing? What are we optimizing for here, understanding or popularity? SICP review by Peter Norvig: > Donald Knuth says he wrote his books for "the one person in 50 who has this strange way of thinking that makes a programmer". I think the most amazing thing about SICP is that there are so FEW people who hate it: if Knuth were right, then only 1 out of 50 people would be giving this 5 stars, instead of about 25 out of 50. Now, a big part of the explanation is that the audience is self-selected, and is not a representative sample. But I think part of it is because Sussman and Abelson have succeeded grandly in communicating "this strange way of thinking" to (some but not all) people who otherwise would never get there. http://www.amazon.com/review/R403HR4VL71K8/ref=cm_cr_dp_title?ie=UTF8&ASIN=0262510871&channel=detail-glance&nodeID=283155&store=books http://www.amazon.com/review/R403HR4VL71K8/ref=cm_cr_dp_titl... EDIT: People seem to be downvoting a sentiment Knuth and Norvig expressed, rather than reflecting on the question posed - what should we optimize for in a intro to CS class and why?
- oellegaard 12y agoThe purpose of a teaching language must be to show students core concepts of programming. Since JavaScript doesn't have proper polymorphism, inheritance, hell even types, I don't see how they would benefit from being introduced to it initially. We started with Java and while it was a pain in general, the concepts were clear and you could easily go ahead with any other language afterwards. We also had some scheme and C just to have a look at other programming languages, but didn't do much with them.
- hueving 12y ago>The purpose of a teaching language must be to show students core concepts of programming. Wrong. If the student isn't inherently interested in CS, teaching them all of that up front will mask the fact that it actually takes very little to get basic programs up and running. For example, a sysadmin might want to learn some programming to automate some basic tasks. You don't need to learn about polymorphism or type systems to learn enough to become productive.
- mhd 12y agoA few months back I wondered whether one could have an introduction to programming based on the language equivalent of "Evoland"[1]. For those who don't know this, it basically recreates the history of (console) role-playing games. You start out in something that resembles Zelda, then you'll get color, 3D movement and other perks. One could do the same with a programming language, by using different features, or even slightly tweaking syntax and semantics. One approach might be similar to how some BASICs operate: line numbers and goto in the beginning, than subroutines, objects etc. Or something where people don't have to follow actual history and we're going at things from a more mathematica/functional point of view (shouldn't be a problem to do this with Racket dialects). Then again, IANAT. Never mind that I would think that the environment is actually more important than the language itself (for most normal values of "language"). So please don't inflict Eclipse on newbies. 1: http://evoland.shirogames.com/ http://evoland.shirogames.com/
- MarcScott 12y agoI think there are a lot of commentators here that are failing to appreciate that this is not about which programming language provides the best introduction to Computer Science or Software Engineering, but which language will inspire students to continue programming. The readership of HN is self-selecting. Almost everyone here was drawn to the world of programming. Very few of you probably had programming thrust upon them. I teach in the UK where all students from the age of 5 to 14 are now required to study computing. I personally teach students from the ages of 11 upwards, so when I'm looking at the best programming language to use, I don't even think about which will provide the best introduction to Software Engineering. My primary concern is what will interest an eleven year old, who's only experience with a computer is using his iPhone, and whose primary interest in life is football. Or how can I make this interesting for a student whose ambition in life is to perform on stage, and has already decided not to continue studying Computing for their GCSEs.
- facepalm 12y agoMy impression is that Python is certainly not a better language than JavaScript. They both have their quirks, so it ends up being a matter of preference. For example Python doesn't have real lambdas, on the other hand it has named parameters. The only reason to use Python that I can think of is maybe SciPy. I made me sad to witness Python gaining so much in popularity as a beginner language in the last year.
- mkesper 12y agoThe idea that readability matters influences the whole Python ecosystem and community. Python3 also eliminated quite a handful of quirks (e.g. division, Unicode). By the way, it's not since last year only that Python was used for introduction but for years now.
- boomlinde 12y agoI'm curious about this sentiment about python lambdas. What about them is not real?
- facepalm 12y agoIt's been a while, but doesn't it have restrictions, like you can only use it for one liners? Edit: found this via Google - "lambda functions can not contain commands, and they can not contain more than one expression"
- boomlinde 12y ago> and they can not contain more than one expression I don't believe that is different from e.g. scheme. Ideally, a lambda expression would look like a normal function body, but I definitely wouldn't discount them as "not real" on this basis.
- facepalm 12y agoIirc in scheme you can put anything into a lambda that you want. Of course the Python lambda is "real", the correct word to use would have been "limited" I suppose.
- br3w5 12y agoI've been through the Udacity CS101 and progressed well with their programming languages and design of programs courses. These are all in Python but I have covered interpreters, compilers, regex, recursion, types, etc. These all treat python as a tool to learn CS not just the language in itself. Alongside these courses I've also been building my own websites using Django and I'm now at a stage where I feel I can solve any problem in any technology (even though it will take me longer than someone experienced in that technology to learn it and get stuff done). I've started exploring other languages (C, Lisp, even Java at work, Haskell next, javascript) and feel much more confident with the software engineering stuff that CS courses don't necessarily cover, having managed development teams (git, deployment, CI, TDD, etc). I agree with other commenters that python gets out of the way so that you can explore CS concepts. Javascript could be a good intro language but students might want to move onto something else fairly quickly. I already tried js first and quickly started CS courses because I didn't feel that learning javascript was helping me understand how to solve problems with programming. I also don't think you can teach all of the core CS concepts with javascript as effectively as you can with other languages (e.g. OOP), so when you do start teaching js they will still come to you and say "how do I put this on a website", "use node", "ok but how does that work? why does that work? etc, etc". And when it comes to websites are you going to teach students to build a webserver in vanilla js (?!) or reach for node that abstracts so much that is going on under the hood? Smart students are always going to ask questions and I've found in my experience that I've been able to either get the answers or know where to get the answers, by knowing core CS concepts. So whatever language you choose to start off with it needs to be couched in terms of what CS it exposes.
- Beltiras 12y agoJust add HTML and a web framework at that time and all his concerns just fade into the background. Teaches marketable skills too.
- flohofwoe 12y agoIf the main focus of the class is to code games for smart phones the choice should be the Unity Engine. BUT that would be the entirely wrong choice to learn programming. Games are multi-discipline projects, programming is just a small part of it, there are many distractions when writing a game to get graphics, sound, AI 'look and sound right', and the visual 'rapid prototyping' workflow of modern game engines gives you quick results, but you don't learn anything about programming. You just cobble together code snippets from Stack Overflow and tinker around until it feels right. Python is a much better choice to learn programming then Javascript IMHO, then take a quick tour into Lisp, Forth and C, and then may be worry about creating games or UI apps.
- flohofwoe 12y agoBy the way, I earn my living with games programming.
- allendoerfer 12y agoAs already mentioned in the thread, it depends on what you want your students to learn. My universities CS courses (aside from theoretical stuff) started with Racket for the basic concepts, good choice. We were then taught Java to handle a small project, questionable. But after that we had no problems with the language, when we had to implement algorithms, which would look quite similar in most other OO languages, maybe with added memory management. I think JavaScript's prototype-based inheritance and global scope would make it hard to abstract concepts learned in it to other languages. Strict ES6 might help a bit. When switching from Scheme + Java to JS, you can get the Java+Scheme mix, that JavaScript is in my eyes, and use it accordingly. Switching the other way round you would basically have to relearn the concepts, because JavaScript does not express one distinct enough, but is an exotic mix of them (or an ugly hack as others might say). Outside of CS though, I think introducing people to JavaScript, PHP or even advanced Excel is highly beneficial.
- jacquesm 12y agoNothing got people easier into programming than good old BASIC did. MODE 4; LINE 10,10, 250,250 Instant attraction. Beginner steps need to be small and need to give an immediate reward, BASIC got that right, almost every other language stood so far away from the available devices that the spark failed to jump the gap in many places. Smalltalk is another language that got this right, people - especially beginners - need instant gratification to move from curiosity to immersion.
- adrianN 12y agoYes. BASIC also had an awesome help system, where an eight year old could learn how to draw things on the screen without any teacher, even if they barely spoke English.
- barrystaes 12y agoI learned in QuickBasic and later Pascal, and for that purpose they where great. In my first stab at Python i had my POC running within an hour.. but i do not like the hoops i had to jump through. Mostly the tabs, the v2/v3 incompatibilities and lingo. PHP and C# also are good languages for starters. Today its JavaScript, but my impression is that becoming an software architect in JS is not that easy.
- reacweb 12y agojavascript/html/css is a new lingua franca that is "understood" by all computers, all OS. It is always useful to learn it whatever the purpose of the student. If the purpose is to learn computer science, SICP remains the best source of inspiration, even if scheme is out fashioned. Do you know if scala is used for teaching ?
- saryant 12y agohttps://sites.google.com/a/trinity.edu/csci1320-f14/ https://sites.google.com/a/trinity.edu/csci1320-f14/
- bartvbl 12y agoIt's a fair point that the article makes. However, I've started out about 1.5 year ago with a programming group for kids in high school, and my choice was Python. I have since not regretted this decision because of one factor: fun. I could have gone with a weekly lecture on all sorts of theoretical things will learn again if (or when) they start at university. Instead, I wrote a wrapper around OpenGL that provided some functions like "drawRectangle()" or "drawImage()", and they have used it to build all sorts of things. Additionally, they are constantly wanting to try other stuff. I don't think they would have done this if they didn't enjoy the process of writing code.
- kinleyd 12y agoThanks for introducing me to dadgum. I read a number of his older articles and I must say his opinions resonate with me. I'm going back in for some more. :)
- jdeisenberg 12y agoFor getting people into programming with graphics quickly: Processing (http://processing.org/ http://processing.org/). Since Processing is a thin wrapper around Java, the programming concepts transfer easily. Processing also has a Python mode, and there's Processing.js for the JavaScript fans. If you're a Racket/Scheme type person, ClojureScript might be an option, with Quil for doing Processing-type graphics.
- lmm 12y agoEven if "runs in the browser" is a hard requirement, surely there are options like Dart that don't have as many horrible quirks and edge cases - quirks that are probably no trouble for an experienced developer, but can be very confusing to a newcomer - as Javascript does?
- keithpeter 12y agoLets run with the OA for a bit. What textbook is there that is easily available in English that could support a 30 lecture introductory course? What 'environment' would you use? Text editor plus browser or a browser plugin for JavaScript editing or something else? What base selection of libraries would be included with each project in your opinion? Possibly linked with my first question, what kinds of projects/assignments would you suggest?
- rbanffy 12y agoAs much as I fear a Dijkstra apocalypse and how much brain damage newbies will sustain by starting with JavaScript (and thinking arrays being hash maps to be perfectly OK), I started with 8-bit AppleSoft BASIC and I have to say that, while the concept of a function or recursion only appeared to me after my introduction to Pascal, I turned out well enough. Also, I had a good idea of how machine language programs operated - they map very neatly to what BASIC could do.
- Anthony-G 12y agoSince I first came across Scratch, the programming language / environment produced by MIT, I've recommended it to a number of friends who wanted their kids to learn programming. It covers the basics of software development (conditionals, loops, etc.) using intuitive and attractive GUI elements which can be combined and manipulated to easily create interactive programs such as animations and games. It also integrates well with the web (Scratch 2 programs can be created from within the browser) so it's very easy for users to show the results of their work to others. http://scratch.mit.edu/ http://scratch.mit.edu/
- avinassh 12y agoInteresting discussion on reddit - http://www.reddit.com/r/programming/comments/2t4pkq/retiring_python_as_a_teaching_language/ http://www.reddit.com/r/programming/comments/2t4pkq/retiring...
- deleted 12y ago[deleted]
- alexvr 12y agoMy high school's student laptops were super restricted (I was suspended for installing Eclipse on an unrestricted computer), so I played with JavaScript a lot as a senior. I didn't have a good understanding of the virtues of classical polymorphism and whatnot at the time, so JavaScript's unconventional OOP didn't bother me; I was content writing procedurally, treating objects as structs. JS was also my introduction to the notion of first-class functions, and it made them seem so natural and essential that I get angry when languages don't have them. I think JavaScript just barely misses the mark as a great programming language. But its new standard might change that and make it the best language for learning. If a language like Swift were as ubiquitous as JS I would have a different opinion.