6 ms·
Python squeezes out JavaScript, C as best starter programming language
- pjmlp 13y agoWell, that was always one of Guido's goals if I am not mistaken.
- sdegutis 13y agoLately I'm way more excited about Julia than I've been about any language for years. My son is learning programming, and I was debating between starting him off with Ruby, Python, or Clojure. But I think Julia might just be it. Out of all the languages I've learned it definitely feels the most intuitive. As I read the docs, I constantly find myself saying "yes! this is how it should work!" way more than I did when I learned any of the aforementioned languages (except maybe Clojure).
- csense 13y agoI think the Python community is more mature in terms of the number and quality of applications and documentation. Julia is getting close to critical mass, but it's still "niche," but Python is firmly "mainstream." I think it's important that a beginner's first "real" language is a mainstream language, due to the existence of libraries and a community which will help them through and beyond the "beginner" phase. Clojure suffers from the same problem as Julia (not mainstream), and Ruby suffers from the same problem as JavaScript (most applications are tied to web development, which is such a Gordian knot of related technologies all tied together that it will simply overwhelm most beginners.) EDIT: Seriously, parent was downvoted? Why?
- sdegutis 13y agoLack of community isn't a problem for him, since he has me to help him, and I'm proficient in all these languages. However you bring up a good point, I am somewhat concerned about lack of tooling and libraries.
- csense 13y ago> he has me to help him, and I'm proficient in all these languages I think we have different assumptions about the goal of teaching your child programming. Your goal appears to be "create an activity where parent and child can spend time together." My goal (if I had children) would be "get them to be able to program independently as soon as possible," because IMHO that will ultimately both increase the amount they learn (because they'll start learning on their own time to scratch their own itch, just like mature hackers do, so the amount of learning your child does is no longer so dependent on the amount of time you spend teaching them) and increase the probability they'll stick with it for the long term (because being able to do their own projects and have their own ideas makes it much more attractive, especially as they head into the teenage years and start to establish their own identity). Having an activity parent and child do together which increases emotional family bonds is great, but I think the more important goal is the transfer of knowledge, skills and the hacker mindset. Disclaimer: I don't actually have kids, but if I did, the above would describe my philosophy.
- bayesianhorse 13y agoWhile I think Julia is great, for children I have to say Python is better, especially in various subcategories that might keep a teenager interested: Games, 3D Animation (blender), Websites and Mobile Apps.
- _random_ 13y agoYes, it's a good option to pick a language with no powerful IDEs (static analysis and proper automated refactoring) as those are harder to move on from later on (IntelliJ IDEA or Visual Studio vs any typical Python/Ruby notepad). If you are using a basic text editor then you really have to learn the language and have fun debugging.
- csense 13y agoI'm not so sure about that. One big conceptual hurdle that many beginners have is the notion that a program is a sequential sequence of steps, and at any point in time during a program's execution, there is a unique "current statement" [1] and "current state" (content of variables). Single stepping through your program with a good visual debugger makes these concepts very clear. [1] Of course this is not true for multi-threaded programs, but multi-threaded programs are well out of "beginner" territory.
- yeukhon 13y agoPython certainly makes sense to new programmers because the only thing that makes people wonder is the indentation. But with good resource out there (books, stackoverflow, Codeacdemy, Coursea, visual Python), Python tutorials have been better. The language also makes reading code quite easy. On the other hand, Javascript seems to be always start with HTML and CSS. That's where the obstacle is. People begin playing around with three separate technology and the learning is really high. however, if you ask me "yeukhon do you recommend freshman start with C / C++" I'd say absolutely. I am a bit bias since I knew a bit C++ before I started Python (although my first official programming class in college was Python and Matlab... funny right?) but I think the learning curve in statically typed languages like C++ is absolutely helpful in the long term. If people want to learn Python without Hello World, try http://www.youtube.com/watch?v=RrPZza_vZ3w http://www.youtube.com/watch?v=RrPZza_vZ3w
- nawitus 13y agoThese days you can start JavaScript with Node.js and create simple command line applications.
- yeukhon 13y agoTrue, but remember, if you google javascript or look around books in the book store, many are still teaching with web technology :) which is unfortunate (although the intent is great).
- bphogan 13y agoI agree with this. I currently teach beginning programming using JavaScript in HTML, and we currently just provide pre-made web pages for the students to write their basic programs in. They come in already knowing basic HTML as they've taken a previous class. But I've been thinking of rewriting the curriculum to use Node.JS for about a year now. The only reason I haven't yet is that the students seem to enjoy doing things in web pages. I think there's something awesome about writing console apps, but I don't know if they really hold the attention that today's students have.
- rtpg 13y ago
- pera 13y agoWhere is Scheme? :'(
- eternalban 13y ago> :( More like ((((.)))) But seriously, given how much effort the folks behind DrRacket have put in making programming accessible [1] it really makes you wonder if m-expressions are not such a bad idea .. [1]: http://en.wikipedia.org/wiki/Racket_features#Educational_Tools http://en.wikipedia.org/wiki/Racket_features#Educational_Too...
- anaphor 13y agoIt's funny how often I see people criticize lisp's syntax and write things that aren't even valid syntax like (() ()) or (()) (assuming they don't get autoquoted).
- eternalban 13y agoFine, let's see your 'syntactically valid' LISP smilie .. and also one for 'tin ears' while you're at it. TIA!
- Derbasti 13y agoI have taught an introductory course for programming in Python, and there certainly are a few areas that are less than ideal for beginners. 1) Setting up Python, a text editor and a shell is easy on Windows (using WinPython), but pretty confusing for Mac users. 2) It is actually surprisingly difficult to teach object oriented programming in Python, since most simple problems are much more easily solved in a functional manner than with classes. 3) It is more or less impossible to peek under the hood. There is no way to teach integer logic really (Python has auto-growing arbitrary precision integers) and floats can lead to strange errors (x=1; for i in range(10): x+=0.1 does not yield 2). 4) It can be very difficult for students to grasp the difference between different types and when or how they are to be used. I suspect that these kinds of problems might be more easily explained in C. All that said, I feel that the students did learn quite a few things that would have been more or less impossible with C or Javascript. In many ways, Python provides a happy medium between full-on dynamicism and strictness. Four stars, would teach again.
- csense 13y ago> introductory > object-oriented programming Unless I was mandated to make my syllabus match the language reference's table of contents, I would defer most of object-oriented programming to a second semester. How to use particular objects from the standard library would likely be covered on an as-needed basis in an introductory class -- for example, "you use the syntax d.keys() to get a list of a dictionary's keys" without attempting to explain that "keys" is a function attribute of a class of which d is a member, and thus by MRO rules d.keys triggers a lookup of the "keys" member from the built-in dict class, and d will be passed as the first parameter when the function call operator denoted by the parentheses is executed ...You may be tempted to include such detail for various reasons, but trust me, your students will thank you if you save that content for a more advanced course. > There is no way to teach integer logic really (Python has auto-growing arbitrary precision integers) You can still teach binary representation and use bit-wise operators. Also, I once wrote a storage-efficient bit vector class with the built-in bytearray module, which is a good exercise to tie together object-oriented programming and binary representation. However, a student at the level of doing that exercise is no longer beginner, but firmly intermediate or advanced. > floats can lead to strange errors These are a natural consequence of the floating-point representation and this problem exists in each of the article's top three language choices.
- gravedave 13y agoHow about picking a focus, then a language? I see no point in "becoming a programmer". Want to make web apps? JS. Want systems? C. And so on. Going for a "first" programming language seems to assume certain things: * That you ARE going to become a programmer and that you will NOT change your mind/priorities * That somehow whatever language you first pick will definitely be useful for your final goal. Sure, C will teach you all the ins and outs of manual memory management, but why go through it if all you really need is Processing? * That there is some special point in time when you're supposed to learn how to deal with the grave dangers of the misplaced semicolon/memory leak/etc. How many of those "learning to code" really become programmers and end up doing it for a living, or making habitual use of pointers or some other concept that a programmer must/must not deal with in their first programming language?
- a3n 13y agoThis kind of question, "what first?" can still make sense if you think of all of the vaguely technical tasks that many non-programmer/engineer types will encounter. Then, what's a good language to server as a good enough tool if they go no further, and a good enough foundation if they do. Python would serve that, especially given all the batteries that people can draw on. In fact "batteries" should be part of that introductory course, so that you know to look for a battery first instead of jumping to writing it.
- dinkumthinkum 13y agoBut some people are actually interested in being competent in computer science and not just whipping out blog engines in the latest fad framework.
- sirseal 13y agoThere's too few of us...
- gravedave 13y agoThe main idea still applies. C and Scheme show very different aspects of computer science, so even those people will need to choose a focus. If all you want to do is "become a programmer" you'll discover that you'll never get there, as there's always more to know. If you're asking yourself now what language to pick, you'll later ask what to learn next, and once you've done that, ask again. Asking what first language to pick is just the first manifestation of a potentially never-ending bad habit of never gaining focus. This applies to both web apps and computer science.
- _random_ 13y agoBest for starting... You just need to remember to move on later!
- bayesianhorse 13y agoWhy do you have to move on? The one disadvantage to Python as a beginning language is that there are few strong motivations to move elsewhere...
- _random_ 13y agoDynamic typing and it's consequences. It's handy when you start and want to cut the amount of things you have to care (safety).
- bayesianhorse 13y agoI don't care about "type safety" discussion. Hardly have I heard this argument from serious Python users at all. You won't hear Python users bitching about bugs that could have been caught by some compiler magic. I do hear programmers bitching about other compilers and their anal retentiveness though... For me type safety just isn't an issue in practice. Guido also says, and rightly so, that every moderately large project, especially in a strongly typed language, eventually implements all sorts of mechanisms for dynamic typing, even if these mechanisms are then called something else.
- _random_ 13y agoHardcore Python fans will always defend it. I am just asking to think out side of the box. http://evanfarrer.blogspot.co.uk/2012/06/unit-testing-isnt-enough-you-need.html http://evanfarrer.blogspot.co.uk/2012/06/unit-testing-isnt-e...
- bayesianhorse 13y agoHardcore Fans of static typing will always attack our state of well being. We shouldn't feel this good about Python because we are "clearly wrong". Is that it?
- neoyagami 13y agoI wish they( my teachers back then ) had python but instead we ended learning cobol :( unforgiving syntax but boring as hell
- anaphor 13y ago>“Python, because you do not need a compiler and it's very VERY easy to run your programs and test.” That really depends on your definition of "compiler". If your definition is "translates a high level language into machine code" then the popular implementations don't do that. But the most popular implementation does pretty much act like a typical compiler except that it generates code for a VM, not a physical machine. On a more on topic note, these sorts of things are pretty pointless because it's just the Emperor's nose thing really. "Nobody was permitted to see the Emperor of China, and the question was, What is the length of the Emperor of China's nose? To find out, you go all over the country asking people what they think the length of the Emperor of China's nose is, and you average it. And that would be very "accurate" because you averaged so many people. But it's no way to find anything out; when you have a very wide range of people who contribute without looking carefully at it, you don't improve your knowledge of the situation by averaging. "
- eshyong 13y agoI think the original meaning of that quote is more "I don't need an intermediate compiling/linking step before I run my program," not "Python doesn't need a compiler because it doesn't lex/parse/generate code." I agree it's an ambiguous and confusing statement though.
- bayesianhorse 13y agoHow come most discussions about the merits of Python devolve into praising Julia?
- atmosx 13y agoSure, and Ruby squeezes out Python as a starter language because it's closer to English and the identation doesn't have to be strict. That said, I find both Ruby and Python considerably user-friendly and extremely powerful. JS of course is today's hot stuff and if you want to be on-top of the game, you have to know and understand JS. But once you've become comfortable with any other OO language JS is easy.
- marcosdumay 13y agoStrict identation is a good thing. A teacher can compensate a non-strict compiler by being strict himself, but identation is one of the most important concepts you should be teaching to beginners.
- reuven 13y agoI've been teaching programming to many people, for many years. The majority of my students are experienced programmers, but no small number are new to programming beyond very simple stuff. I've found that Python has a number of aspects that are ideal for first-time programmers: - It's dynamically typed. Say what you want about static vs. dynamic typing, but this is one less thing that newbie programmers have to get right. There's no chance of an error when they say "i = 'abc'", if you've defined i to be an int. - It's interactive. The fact that you can "play" with the language within the interactive shell is a huge selling point. IPython and the IPython Notebook are easy to get working, and for people to work with. - Python's restricted command set and simple, regular syntax let you concentrate on ideas: Yes, many newbies to Python (and to programming in general) get confused by indentation, blocks, colons, and the like. But they're going to get confused by the syntax of nearly any language. Python has a simpler syntax than most other languages, meaning that there's less to learn, and less to remember. This lets the new programmer concentrate on the ideas that they're learning, or the implementation of what they're doing. - It's cross platform. The fact that people can use Python on any computer they like is a big selling point. - You can easily teach object-oriented and functional-style programming. Python is obviously object-oriented, but can also be used to introduce functional programming. In this way, you can expose programmers not only to multiple paradigms in Python, but also in other languages. - You can use it for real applications. People are often surprised to discover that real-life applications are being written and used in this language that they're learning, which seems so simple. I'm sure that there are more reasons than these. But let's consider the alternatives that the article suggested: - I would be hard-pressed to think of a worse first language than C. You want to introduce people to the concepts of programming, which means abstractions and high-level thinking. C forces you to think in terms of the computer and its memory, which is just the opposite. The fact that it's compiled to binary form, that you don't have an interactive C shell, and pointers are just three reasons why I think that C would be a very bad choice. Sure, everyone should learn C at some point -- although I often point out that I'm a much happier person since I moved to dynamic, high-level languages many years ago -- but if you want to teach the concepts of programming, C is going to require too much learning just to get simple things done. - JavaScript has many good points for beginning programmers -- but the chief problem, in my mind, is the language's syntax, which is far too inconsistent and forgiving/flexible for newbies. I think that someone coming to JavaScript from Python will have a very easy time; the mapping of data types is fairly straightforward, and even the notion of passing functions is pretty easy to get. But the learning curve in JavaScript seems steeper to me than in Python, despite the obvious advantages of being able to work within a browser.
- atomicdog 13y ago>“I see JavaScript as the modern equivalent of BASIC. ...because of its simplicity, it is a great language for learning fundamental programming concepts.” So what's wrong with BASIC? It still exists...
- sehr 13y agoBecause people still use JavaScript
- alkonaut 13y agoTo be a good developer you'll need to learn several languages, but that is beyond the scope of the article. But in terms of a "first" language, are those who learn python first and THEN C, Haskell and C# in the end more likely to be better developers than those who learn the same four languages in another order? I think it's unlikely that the language you start with has much effect in the end. Those who never use a low lever language or never use a functional language will be worse developers than those who do, however. So for a first language: just pick a fun one. If you happen to pick JS you can always choose again later.
- vorg 13y agoI'd go with 3 first languages simultaneously, in 3 tracks, PL focused on programming concepts and constructs, OS focused on low-level interfaces, and SE focused on what the job market requires. From first to last in each track... PL: Python, Prolog, Clojure, Haskell/Parsec OS: C, assembler, Bash, regex/sed/awk SE: Java, Javascript, HTML/CSS, Django
- marcosdumay 13y agoMy impression is that if you follow that order you are way more likely to get through the end than if you followed any other order (except by switching Haskell and C#, I don't think that'd matter). But yes, if you did go through those languages in another order, there is no reason to think you'd know any less than somebody that followed the "easy" sequence.