I agree. But there is a huge class of people that this argument tends to miss - all the people who learn programming as a tool and not a way of life, like scientists or engineers from other departments. For those, it's ideal to learn one language, and it's OK if they don't completely understand CS. For them it's better to know a language that has wide range of practical applications.
So unless you are absolutely sure that you're going to learn CS, I would still suggest Python as a first (and possibly only) language.
I would also say that doing GUI in like PyQt is really easy, but the documentation and tutorials are lacking.
Most people :)
I am not a programmer at all, but did learn a little bit of ASP.NET at university. I never use it anymore, but I ended up teaching myself PHP.
I use PHP regularly, not to build anything grand - but it gets me by. I can write little scripts like working out who's unfollowed me on Twitter, small information systems, reminder applications, hack Wordpress plugins, etc.
I wish I was taught Python at uni right out of the blocks. I've tried to learn it a few times, but ended up forgetting to do lessons and just going back the the crutch that is PHP.
The theory of CS is way beyond me at this stage of life, but a little bit of programming knowledge is a very useful thing (even if it is only PHP)
Learning another language is easy, just try it :) Also a language like Python really is a breath of fresh air if your only experience is PHP.
I certainly support including C as a core part of any university's Computer Science curriculum. But such a curriculum should include as many languages as possible, each deliberately picked for what it can emphasize and convey. For a Computer Science curriculum, any discussion about language choice that doesn't end in at least three picks is, to me, a failure.
But there is a lot of learning to program that happens outside of university settings. Students who have no explicit professor or TA to talk with need wider community support. They need more basic guidance. In these cases, a language like C would do poorly: there are too many systems-level concepts that need to be understood before it stops feeling like magic. For this, Python is far superior to C, because it makes understanding what you're doing far more accessible far sooner.
Whether or not Javascript is a better choice for this than Python is something I'm undecided on. I can see the merits offered in the OP, but I'm not convinced they outweigh the faults in JS. The newbies I give recommendations to generally have an interest in going into data analysis. I think Python is the better choice for that, as a language that can form a bridge between "whoa, hello world" to, say, playing with scikit, and if they end up going in a different direction, they're unlikely to have picked up any particularly bad habits. Javascript? I am not convinced.
(This sort of stopped being a response to you in particular and turned into a response to the OP, but it'd be confusing to move it now. So... whatever.)
C is superb for teaching how to manually implement polymorphic behavior in the absence of object-oriented features. Using it to demonstrate how (class-based) OO languages work should be standard in any course that has CS in its title. (Using it to demonstrate how to implement prototype-based inheritance would be an advanced course).
Building a complex language from scratch is fine, but doing it by extending C isn't the best way.
I happen to like C. I'm good at C. I understand the C mindset, to the extent it has one, and it isn't especially conducive to OO. (It's absolutely horrible with FP, because the fact you have to manage memory manually does terrible things to function composition.) Which would be fine, if C were actually a low-level language. It isn't.
C gives you a simplified, high-level machine model. It isn't that close to the machine; if it were, you'd have access to things like SIMD hardware and everything else C can't give you because it would break portability.
(OK, you could possibly have access to them if you used C to implement an interpreter for a virtual machine. But that kind of defeats the purpose.)
So sure, implementing a non-trivial programming language is a fine goal; however, I'd do it by generating assembly language, because doing it in terms of C forces the programmer to adopt C's limitations (every function has a single return value because there's no real stack access; there's no access to processor flags; no access to parallelism of any kind; etc. etc. etc.) for no real benefit in that context. (School projects don't have to be portable.)
Edited to add: And if you're writing a compiler, C isn't especially interesting. Haskell and parser combinators are interesting; Common Lisp and macros are interesting; Python is, again, not especially interesting, but at least with Python you're debugging errors related to the problem domain, as opposed to errors related to the intricacies of manual memory management.
(Edited for comprehensibility as well.)
I'm not sure if you meant to put it that way, but that is a horrible standard for "any course that has CS in its title". I would not like to walk into a course on, say, intro to AI, and have a session demonstrating how class-based OO languages work using C.
For the general thrust of your point, cbd1984 pretty much covered everything I would have said in response.
[0] http://ocw.mit.edu/courses/electrical-engineering-and-comput...
(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.)
It wasn't the case in our past. In the middle ages, before the printing press, teaching was 99% passing on knowledge, and motivation was assumed to be a given. Today, in the post-internet age, access to knowledge is a given, and teaching is 99% motivation.
If only that were true.
http://data.worldbank.org/indicator/IT.NET.USER.P2/countries...
It's getting better every year but we're definitely not there yet.
Admittedly a lot of uni teaching is just a data dump. But the data dump at least tells which topics to investigate, and regular reviews tell you when you're not getting it.
Without that you may never know why - say - compiler design is important in CS, and not just to compiler writers.
Every professor is extremely careful to make sure nobody leaves the course believing "This was a python course" or "This course taught me Java"; rather they emphasize the topics covered, using whichever language as the tool for exploration. Python is a great choice in this regard BECAUSE of how rapidly prototyping happens, perfect for a course built for exploration.
Some languages make exploring certain concepts easier, but the lack of that feature isn't a hard barrier.
I think learning efficiency is an exponential function of the latency between hypothesis and result. Python just happens to have great tooling to minimize that.
>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.
Could you explain what you mean by Racket lending itself to algorithm complexity, recursion, etc better than Python? I really don't see why one or the other is more conducive in this respect.
The documentation is also almost obscenely robust, the teaching languages provide a great sandbox for easing into various concepts, and the learning material in How to Design Programs is more or less a complete first-year zero-programming-required CS text.
I have a FAR different education. I start with Fox 2.6 (DOS) and Acces. At the end of the semester, We have a FULL done application with: Menus, Forms, Small procedures, database, Reports, with colors and very crude idea of custom controls. From the side of Acces, we get the idea of how a Windows application was done.
This was NOT the university. The university teaching was so useless in comparasion (I was the one to teach the OO classes, because the teacher don't have a clue about it. And that was the 2d semester).
Then the instrucction of algos was terrible. And so on.
---- Rant objective?
Good, focused, NOT DIVERTED, teaching is far better than the core language. I have done some teach, and know dozen languages.. I believe python/pascal are far better to start - and probably pascal, if we want a C-like understanding without the badage of slow tools, weird syntax and crazines of the C family, but well, that my thing- and don't see why it could be problematic to teach any of the fundamental concepts of programing.
The key thing, apart of the quality of the teaching, is the focus. I think if the goal is teach "programming" in the general sense, python/pascal are the better. C, C++, Haskell, Java requiere a lot of divertion of the attention (setup and take care of a project, do make files, wait... wait...wait, "monads"?, etc).
In contrast, if the teach is learn how "a computer works" so C/C++/Pascal/ADA could be great. Again, is the focus.
Looking at HN threads we see many people who claim this one thing created very many programmers.
But back when it was happening we had teachers giving remedial classes to force BASIC users to "unlearn" bad habits. (There's probably a "BASIC considered harmful" somewhere).
What language would you recommend for 8 year olds?
Edsger Dijkstra: "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."
I do not subscribe to this opinion. I think BASIC (at least the flavor Dijkstra was talking about) does encourage bad programming habits, but everything can be remedied with exposure to better languages and practices.
I actually agree with you: BASIC helped make a lot of people interested in programming. I know GW Basic, and later Quick Basic, did this for me.
Now, JavaScript certainly has some ugly parts, but the difference between it and the old-school BASICs is that it's possible (with care) to avoid most of the ugly parts in JavaScript. That wasn't possible with BASIC.
You can explore all of those in Python, even though some may not be idiomatic in Python (many FP approaches), and some may not be suitable for non-trivial use in Python (recursion). And, in fact, there are plenty of introductory CS course that do use Python to explore all of these.
> Thus, I don't really think that learning Python offers solid programming foundations.
Languages don't offer foundations, curricula do that. And for a solid programming foundation, I think a curriculum that does that can be organized around almost any language -- there's a small set of essential features, but very few languages don't have serviceable implementations of what is minimally needed.
At the end of the day most jobs in the real world want to get stuff done rather than explore CS concepts. Visual Basic was a very popular choice for many years despite being a poor language. I am sure it was simple enough for many people to start programming (that has benefits as well as downsides).
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.