17 ms·
Dijkstra on Haskell and Java (2001)
- Uchikoma 13y agoClassical progamming language is important fallacy.
- brendano 13y agoHere's a positive report on teaching "back to basics" first-semester programming with Java. They only teach procedural concepts and no OO at all. The point is, while Java itself is non-ideal for this and slants towards OO, you can just ignore that part and teach with it anyway. Lots of people here have raised concerns that the way Java forces class and static declarations is confusing for beginners. Interestingly, the instructors were concerned about that too, but found that students don't seem to mind. http://homes.cs.washington.edu/~reges/sigcse/basics.pdf http://homes.cs.washington.edu/~reges/sigcse/basics.pdf http://homes.cs.washington.edu/~reges/sigcse/basics.ppt http://homes.cs.washington.edu/~reges/sigcse/basics.ppt The second major concern being discussed here, that functional programming isn't possible in Java, I think is a non-issue for a true introductory first-semester class, which needs to focus on more basic issues of procedural programming and abstraction. The SICP approach is beautiful and great for already advanced and highly motivated students, but that's honestly a small minority. (You can find many more examples of reports like this if you search for "CS1", which is the shorthand for intro-to-CS that's used in the CS education literature.)
- Pxtl 13y agoI tend to think Java is a good first programming language, much like Basic and Pascal were the "first programming language" for so many of us back in our youths. Not every high-school offers programming, and of the ones that do there's no guarantee students have actually been properly introduced to programming. And like all "first programming language"s, it should be discarded as you learn proper languages. 2001ish-era Java was a fine vehicle for introducing programming. Just not much else. The second programming classes should move in both directions away from Java - to properly academic and expressive languages like Haskell, or getting their hands dirty with the nitty-gritty of C and assembly languages.
- the_af 13y agoWhat are Java's merits as a first programming language? Keep in mind all of its warts would have to be unlearned later by the prospective student. It can, like Dijkstra argued, introduce unhealthy thinking habits. Why not a simpler higher-level language as a first language? (pick one, there are lots of simpler languages than Java).
- Pxtl 13y agoMost of the good "simple high-level languages" are dynamically typed... which is also worth considering - Python would be a fine "first language" too if you were okay with putting off the concepts of static typing into a later course. But if you wanted to include static typing and were trapped in 2001? I'd be hard-pressed to come up with a better language than Java, at least without getting into some pretty obscure platforms.
- michaelochurch 13y agoI have to say that Java is the absolute worst language for pedagogy. Before people can write "Hello world", they're told they have to write "public static void main(String[] args)", which are presented as magic incantations, "don't worry about those yet". Thus begins the corporate-style coding culture of bashing stuff without understanding it. The stated reason for starting in Java is so that students can get coding jobs based on one or two CS classes, but two issues come to mind there. First, I generally wouldn't hire someone (in a technology company) who took one CS class and didn't continue-- but at least if she passed an SICP-style course, I'd know that she learned how to think about computational problems. Second, you don't "know Java" when you come out of school. Java is actually highly complicated (in good ways and bad) and the average college student hasn't been exposed to all the mess of it (and that's probably good, because, while OOP means about 20 different things to different people, business-style OOP is cataclysmic).
- yarou 13y agoNo more magic than: int main(int argc, char **argv) There is always a level of hand waving that will go on in any introductory course, for a lot of reasons. You have to keep in mind that the majority of students come from highly different backgrounds.
- CJefferson 13y agoWhile I personally agree with teaching something other than Java, there is one big advantage of Java you have overlooked-- as the core language is so simple, bugs caused by incorrect use of the language tend to be "shallow" (bugs caused by algorithmic mistakes can still be very complex of course). An easy example of this is compile-time errors -- the most complex compile time error you can get of Java tends to be nothing more than "mismatched bracket" or "incorrect function call", whereas even fairly simple Haskell code can produce very complex error messages, and ghci (for example) tends to make things worse rather than better. Java isn't perfect and has been getting more complicated, boxing & generics for example, but still is not close to the pain one can create in a handfu of characters in Haskell (of course, C++ has the same problem, for different reasons). Personally, I see Haskell as the C++ of functional language, and therefore would prefer not to teach either Haskell or C++ as a first language.
- ElliotH 13y agoA problem I've noticed in my degree is that for a certain percentage of students Java just doesn't stick. I'm in my fourth year now and there are plenty of people who just can't program, because they've only been taught Java, and they didn't get that. It's far too big a language to teach in a semester or two to a previous non-programmer. Even if it does sink in they rapidly find that the simplified Java being taught at first year undergraduate level is far below the standard required for real world Java programming.
- RyanZAG 13y agoJava is definitely a terrible language for teaching and as a student's first introduction to arrays, memory handling and flow control it's pure terrible. However, Java is incredibly effective as a language for large teams. Since most of the companies coming to hire CS grads are big teams in need of extra hands on their software projects, they are looking for CS grads who know Java. So Java in universities is generally the ivory tower being forced by business constraints to adapt to outside business interests. My university down here taught in Scheme for the introduction and theory classes, and in Java for algorithms and networking. Seemed to work well as a balance, although I'm not sure if they still do that.
- sheetjs 13y ago> Java is definitely a terrible language for teaching and as a student's first introduction to arrays, memory handling and flow control it's pure terrible Sadly, teaching OS classes with Java is a thing: http://www.amazon.com/Operating-System-Concepts-Abraham-Silberschatz/dp/047050949X/ http://www.amazon.com/Operating-System-Concepts-Abraham-Silb...
- RyanZAG 13y agoThat's not really a bad thing. First, no beginner is going to be learning about coding OSes so teaching the basics isn't a problem. Secondly, Java OSes are far more common than you'd think, although this was more true of 5 years ago when many phones/smartcards/etc used Java in their OS internals. A lot of the topics in OS concepts would probably be useful if you wanted to hack on OSS Android too. So I don't think there is anything wrong with that book which sounds more like an example and reference book on using Java in OS internals (received mention a shotgun approach). I don't see any problem with teaching CS concepts in Java. The concepts of message passing or a heap are the same everywhere. I was referring more to the basics of programming where you should either teach at a very low level (pascal is great), or at a very high level (python can work). I think people taught originally in something low level like pascal or C often have the best understanding of memory management and what their instructions are doing. If I was teaching someone coding, I'd probably start with Pascal (incl inline ASM), then any language based on lambda calculus to get a good understanding of recursion, and then Java in a large team environment so they could understand why encapsulation, delegation and code quality are important. It's a shame more classes don't actually just have all 100 students work together on a single code base - it would be incredibly beneficial. The code would likely be terrible with 100 newbies to Java all hacking in their own required feature to the detriment of everyone else. That would drive the lesson home quick!
- mattdeboard 13y agoLots of good quotes in here, particularly: > It is not only the violin that shapes the violinist, we are all shaped by the tools we train ourselves to use, and in this respect programming languages have a devious influence: they shape our thinking habits.
- Arnor 13y agoI'd love to see an introductory course using Haskell on an open courseware channel.
- kabouseng 13y agoI would guess Haskell would be perfect if the goal is to produce academics. But if most of your students are destined for industry, Haskell is in my opinion the absolute worst language. - You'll probably get a high drop out rate because of the complexity (recursion, pure / first class functions etc). - You rely that your students already have experience at high school with imperative languages - The industry by far still don't use functional languages. But then again Java is an equally bad choice, for the reasons mentioned, but also you jump immediately into OOP, again expecting the student to have former experience. What is wrong with laying a solid foundation with the introductory class in C or Python, and then moving on to the more advanced OOP or functional worlds?
- sounds 13y agoDownvoted because OOP is not necessarily more difficult than C for a beginning programmer, and Haskell is not a "purely academic" language.
- namelezz 13y ago> "The industry by far still don't use functional languages." What industry are you talking about? I note a few programming languages trying to introduce functional programming features into their languages
- mattgreenrocks 13y agoIndustry is far too low a bar to aim at. College should give them the fundamental understanding of programming that they can apply to a variety of situations. Employability flows out of that.
- hashtree 13y agoI truly wish this was a more commonly held view point. You would think, speaking with many, that college was nothing more than a corporate worker mill.
- mattgreenrocks 13y ago
- parenthesis 13y agoAt the University of Edinburgh, they teach first year undergraduates Haskell and Java (Haskell in semester one and Java in semester two).
- mschlafli1 13y agoBut I bet that's only because Phil Wadler is there advocating functional programming and Haskell to bits.
- warmfuzzykitten 13y agoHow successful are they with this approach in terms of student learning? What are the success, drop-out rates, etc?
- timje1 13y agoDijkstra assumes that students will already have been exposed to imperative languages before joining university, and will appreciate the change. I think that this assumption might leave behind students that have not yet been exposed to any programming (that stuck). Over in the UK I certainly hadn't encountered anything more complicated than html before I hit university, and was very happy with sticking with Java for the entirety of first year. I had been exposed to C++, ADA(!), Prolog and had an in depth look at Erlang by the time my course finished...
- mbrameld 13y agoWhat year did you enter university? I know the number of kids exposed to programming before university now is much higher than it was when I entered in 1996. I think it's safe to assume (but would love to have some real data) that most CS freshmen these days have dabbled with at least one of the mainstream imperative languages before they hit uni.
- tfgg 13y agoIt may be turning around now, but applicants for compsci at Cambridge were apparently getting pretty dire by 2006, and this formed a significant part of the motivation for the Raspberry Pi (http://www.raspberrypi.org/about http://www.raspberrypi.org/about) > The idea behind a tiny and cheap computer for kids came in 2006, when Eben Upton, Rob Mullins, Jack Lang and Alan Mycroft, based at the University of Cambridge’s Computer Laboratory, became concerned about the year-on-year decline in the numbers and skills levels of the A Level students applying to read Computer Science. From a situation in the 1990s where most of the kids applying were coming to interview as experienced hobbyist programmers, the landscape in the 2000s was very different; a typical applicant might only have done a little web design. I joined at about that time and found it noticeable that having experience with C++ and a few other languages marked me out as more advanced than many of the other students. Also relevant to this discussion is that in the first term we learnt ML, a functional language. This was partially because of advantages in talking about algorithms in it, but also to put everyone on a level playing field and introduce something that even keener students won't have encountered before. We did Java later, which I found much less rewarding.
- gerjomarty 13y agoThe first programming language we learned at university was ML. It was a very simple language for teaching functional programming, it has a minimal syntax that makes some sort of sense and it was likely that everyone was starting off at the same point with it. Like Dijkstra said, getting these high-level concepts in there early is very important.
- bunderbunder 13y agoAround the same time, my alma mater was switching from Scheme to Java for their introductory courses. Last time I went back to homecoming, it seemed that most the professors were feeling pretty dissatisfied about the decision. One of the big reasons mentioned was that Java's just too big and hairy of a language. They end up spending all their time teaching API quirks and software engineering principles (such as pretty much the entire subject of OOP), leaving little time to focus on much more important basic skills such as breaking a problem into smaller pieces and attacking a problem in an organized manner. Or even simple stuff, like the difference between a value and a variable. They also lamented the loss of a REPL, which is an invaluable tool for enabling (and encouraging) students to experiment and get a better understanding of how a programming language actually works. For my own part, I wonder if the current cultural unfashionability of OOP isn't somehow a result of the vogue for switching CS programs over to Java around the turn of the century. I find myself thinking that what a lot of newcomers to FP seem to think of as problems inherent to object-oriented programming are really just problems inherent to not having worked your way through SICP during your formative years.
- yodsanklai 13y agoSame here. There are two camps in my "alma mater". Those that think that students should learn programming with a simple and "clean" language, and those that think students should focus on widely used languages. They too abandoned Scheme which means that student don't learn any functional language. I think it's a shame considering that functional paradigms are getting more and more commonplace. (However, I much prefer OCaml to Scheme).
- pdpi 13y agoI can kind of see the point of going for "widely used languages", but if you don't want to use scheme or haskell, then at least go for c, c++, python, or javascript. A Java Hello World requires a ton of OOP boilerplate, and you're stuck either explaining OOP as the very first you do (which is stupid), or asking your students to either ignore the boilerplate or recite it as a magical mantra.
- Vaskivo 13y agoMy old university has a big partnership with MIT, and the first programming course is, I believe, similar to MIT's. I learned programming with Scheme, in that course, in 2004. I used, without noticing, many techniques I would later have relearn due to a "prolongued exposure to imperative programming". In my semester I used closures, functions as first class objects and lots of recursion. The following three semesters I forgot all that, for I had to use C, C++ and Java. When, in the fourth semester, I had my AI course in Lisp, I used "let"s and loops for everything. In the middle of the semester, I remembered recursion, and how it made everything better (in Lisp). Later, by myself, I relearned closures, functions as first-class-objects and other stuff. Having Scheme as an introductory language is good because it put students that came from a IT-technical high-school education equal to general high-school education students (that have never seen programming before). With the "real world" so drowned in imperative programming languages, there are few courses that can justify using a functional programming language. The things I know about FP, I know because I thought myself. I'm not saying FP is better than imperative programming, is just that both should be (well) taught. (As some other paradigms too, I believe). Some years ago my old uni, like MIT, changed from Scheme to Python. Python is my favourite programming language. But I'm still not happy with the decision.
- stiff 13y agoTo me there seems to be something wrong with using as the first language something that depends on a very, very complicated runtime and execution model to run on the hardware we currently are using. This way people end up viewing programming languages as some God-given black box and not just something another computer program written by another person provides for you. I think CS students should instead start by learning basics of computer architecture at a high level and programming on a level close to the computer architecture that so far has turned out to be practical, the Von Neumann machine. This way they can understand the whole field better, if you never face the challenges of organizing computations in a computer without many existing layers of abstractions designed by other people, you will never understand the development of the field and how the disciplines of algorithms, operating systems, computer architecture, etc came to be the way they are, too many things are taken for granted by people who have only seen very high level languages. People should know what the stack is, how function calls works, what is an assembler, what linked lists, binary trees, hash maps, ... are and why those had to be invented etc. I think something at the level of Go or C is best for that. Then I think a good moment comes for a course like SICP where people can learn how to take those pieces and build abstraction layers out of them.
- 616c 13y agoYour idea about going from architecture to programming in the other way of traditional curricula, in my opinion, has a lot of merit. Other seem to agree. An Israeli professor, Noam Nisan, created a course specifically for this purpose, now branded even more popularly as Nand2Tetris course and book.[0] Why did he teach something obvious like this? From the site: "Why Bother? Because many CS students don't understand how computers work; because fewer and fewer students take compilation courses; because many computer architecture courses are too detailed and too dry; because nothing beats the thrill of creating something from almost nothing; because Nand2Tetris engages students in implementing some of the coolest algorithms, data structures and techniques in applied computer science, and because the typical student feedback in Nand2Tetris courses is 'the best course I ever took'." My first exposure to this was at a hackerspace in my area, where far more experienced programmers than I were wrestling with this "hardware and low-level OS layers were a black box" that ever more complex systems and programming environments have created. I remember being the first time in a while, as an IT guy who plays with open source a lot, I got real enthusiastic even though it was rough for me (I never had a chance to finish). I encourage everyone to look into, because it was designed by Nisan specifically to address the deficiencies you had mentioned, and I watched a lot of skilled hackers fall in love with computers again because of it. [0] http://www.nand2tetris.org/ http://www.nand2tetris.org/
- christiansmith 13y agoAs much as I enjoy Dijkstra's wit in general (and I agree with the argument for learning functional languages early), I imagine taking a shot at "Texas's solid conservatism" didn't help his case all that much. For "enlightened" individuals, most left thinking and academic people are really no better at mitigating tribalism, prejudice, and ignorance of other points of view than the far fringes of the right. Perhaps it would have been more effective to appeal to the self interest of the council.
- abcd_f 13y agoDoes anyone know if anything came out of this letter?
- steveklabnik 13y agoRead the third sentence of the article.
- danielweber 13y agoOne of my favorite things about heaving to learn Scheme in my intro CS course was that it put most students on an even footing with regards to already (not) knowing the language. It's awesome to see Dijkstra alluding to that, "it drives home the message there is more to programming than they thought." I'm having a ball learning Clojure now, and it would be much much harder if I'd never used Scheme. (I've done some functional programming in C++ and Ruby, but I wouldn't have done that if I hadn't done it in Scheme earlier.)
- PaulHoule 13y agoUgh, is this a guy who learned his CS from reading Proggit? There's no way you can say Haskell is "orders of magnitude better than Java"; maybe it's better, but it's not that much better.
- ilbe 13y agoI do most of my programming in Java and I'm convinced I want to learn functional programming, just to broaden my thinking. What are some considerations regarding starting with SICP book/Scheme vs. Scala vs. Closure vs. Haskell?
- szatkus 13y agoPersonally I prefer Haskell because it's pure. Here's some good book: http://learnyouahaskell.com/ http://learnyouahaskell.com/ Scala is just Java+FP, so I use it as a replacement for Java development.
- lmm 13y agoYou don't want to have to learn how to use a dynamic language effectively at the same time as learning how to do functional programming, so unless you already know python/ruby/similar I'd say you want a strongly-typed language, i.e. Scala or Haskell (or OCaml, which might actually be the best middle ground if you're willing to try it). Haskell would very much be jumping in at the deep end; it's elegant, pure, and forces a very different way of thinking. OCaml is a bit less purist, still quite elegant, and doesn't perform as well as the other two if that's a consideration. Scala is inelegant, but has seamless integration with Java and similar syntax; if you want to start incrementally it's the best choice, but you may find you're slower to adopt a functional style, because you can write "java-in-scala" and it'll work.
- rbanffy 13y agoThe worst thing I have observed is colleges choosing Java (and C#) "because that's what the market demand". When I was in college (1986, engineering, not compsci) students started with 8-bit BASIC and FORTRAN (I mostly skipped classes on BASIC because I had learned to program on my Apple II). One year later, they switched from BASIC to Pascal. Later on, one of the teachers decided to teach APL. It was a wonderful experience because it was a different take on my previous paradigms. I am not sure what is the best way to teach someone how to program. When I was a kid, you turned your computer on and immediately got to a REPL (one Dijkstra would strongly disapprove, but still a programming environment). IMHO any programming language that demands an IDE or a build system more complex than make (even if hidden behind a shiny GUI) should not be used as an introduction. Paraphrasing Dijkstra, it could damage the young minds beyond repair. If my Apple II booted into Eclipse, I'd have gone into cinematography.
- annasaru 13y agoIf my Apple II booted into Eclipse, I'd have gone into cinematography. That's an awesome punchline.
- ambiate 13y agoMy lineup was: Intro1/2: C++. Systems: Assembly. Data Structures: C++. Unix Systems: C/perl. Algorithms: C++. Software Engineering 1/2: Java. Networking: Java. Architecture: C/Assembly. OS: C. SEng1/2 was introduction to Java/design patterns. That's it. It was the largest waste of time. Then, the holy grail, networking! That professor really threw us into the dark sides of APIs and tortured us. Very little direction and ridiculous projects. That's where I 'learned' Java. Three years later, I cannot remember Java. I do not recall how to handle the Arrays or anything of that nature. I can still rehearse C++ code off the top of my head! There was no functional programming at my uni in _any_ course.
- ctdonath 13y agoFor serious students of the subject, kicking off with an unusual language can be helpful. As another noted: if the student hasn't even started programming prior to college, s/he is likely not of a succeeding mindset as the bulk of other students already grasp programming. Starting college, I'd already learned assembler, BASIC, and Pascal - all what Dijkstra was warning against over-ingraining; proceeding to C would have been sensible but entrenching. Fortunately Syracuse University then was starting students on something very strange: APL. That was a mind-opener I needed at the time, and recommend such non-procedural/OOP language very early on for serious students.
- ben336 13y ago"if the student hasn't even started programming prior to college, s/he is likely not of a succeeding mindset" Clearly it couldn't have anything to do with a lack of access to resources, or simply developing an interest in programming later in life than you. Starting later may make them less likely to succeed, but saying that it is probably because they don't have a "succeeding mindset" is quite a privileged sounding generalization.
- ctdonath 13y agoSorry if the "mindset" comment seems offensive. New students unfamiliar with the topic are up against others who have been programming for years already, who (sometimes regardless of opportunity) managed to get programming books from the library/web, found an affordable computer to work on, and despite any/all hinderances made it happen - to wit, a succeeding mindset. It was a casual comment in a casual conversation. Apologies if it rubbed you the wrong way; please focus on the well-meant point.
- undoware 13y agoI agree with Dijkstra that Haskell should be taught in undergraduate courses. That's where we boil away most of the really bad, theory-ahead-of-practice CS ideas that academe cultivates. And I say this as a lover of both Haskell and universities. It's not until you've spent several 4am nights getting darcs and hackage to work that you realize no team can succeed without the sort of people who like reality and boring details as much as beautiful ideas. Haskell's culture is anathema to them. (And no, I'm not one of them. I just want my app to compile and my deps to be found.)
- mcguire 13y agoI'm a wee bit confused by this. I graduated from UTCS in 1990 (the first time) and was a graduate student and employee of the CS department from about 1992 until 2004-ish. At no time were the introductory classes in Haskell, to my knowledge. According to the wayback machine[1], the introductory courses (CS307 at the time) in 2001 were in Scheme, while subsequent courses were in C++. I recall the introductory classes experimented with Miranda briefly. On the other hand, the typed letter[2] is from the EWD archives. Weird. [1] https://web.archive.org/web/20010429024151/http://www.cs.utexas.edu/users/UTCS/undergradoffice/courseinfo/ https://web.archive.org/web/20010429024151/http://www.cs.ute... [2] http://www.cs.utexas.edu/users/EWD/OtherDocs/To%20the%20Budget%20Council%20concerning%20Haskell.pdf http://www.cs.utexas.edu/users/EWD/OtherDocs/To%20the%20Budg...
- Mikeb85 13y agoMy personal opinion - the best languages for learning are script-able, dynamically typed languages like Ruby or Python. You can build very basic programs in a procedural or functional style, and then get introduced very softly into the world of OO. Haskell is great in some ways, terrible in others. Like the fact that you can't apply a normal function to a monad, and monads are hidden with do <- syntax, so you need to use monadic functions, and then there's type classes and shit... In Haskell it seems the complexity goes up exponentially and building anything beyond trivial is a huge hassle - no wonder 'design' patterns like FRP seem to be all the rage (while the entire computing landscape is being built on languages like C++ and Java). Lisp/Scheme are conceptually very simple and easy to learn, but the syntax is hard to follow, and some of the keywords make no sense to someone who's never done any programming. I personally think Ruby -> Java/C++ would be a great progression, with maybe some SML/OCaml on the side somewhere along the way. I spent way too much time dabbling in various 'trendy' languages like Clojure, Haskell, various Lisps and other FPLs, Ruby and JS/Node, etc... Now I'm at the point where I just want to build things, so I'm using a very practical, OOP, statically-typed, compiled language that many people have already shipped many practical apps with.... Probably not going back to 'trendy' languages.
- rollo 13y agoYou can't apply normal functions to monads? Since when? Or what is a 'normal' function?
- Mikeb85 13y agoSee all the functions which are funM. mapM, replicateM, etc... For a newbie having to use a different function to apply to a monad vs. a pure function is confusing and not necessary.
- rollo 13y agoI'm just getting confused by the terminology. Those are pure functions too. And you have different functions because they're doing something completely different, operating on computational structures that are different from primitive values the 'normal' functions as you called them operate on. It's like saying C++/Java etc. are confusing because you can only print certain values, but you can't print the print statement.
- CmonDev 13y agoIt's much better to pick something multi-typed and multi-paradigm like C# and be able to show the difference between static and dynamic, imperative and functional, AOP etc.
- jokoon 13y agoYet I can't find any book on FP in practice...
- chrisdone 13y agohttp://www.cs.nott.ac.uk/~gmh/book.html http://www.cs.nott.ac.uk/~gmh/book.html http://shop.oreilly.com/product/9780596514983.do http://shop.oreilly.com/product/9780596514983.do http://shop.oreilly.com/product/0636920024743.do http://shop.oreilly.com/product/0636920024743.do
- joyeuse6701 13y agoAh, I encountered this coming up when various friends were enrolling in computer science courses at Universities. Curriculum either followed an 'engineering' format, a more EE to CS bottom-up methodology, or they followed a top-down thought process. The reasoning for bottom-up is that there are fundamental aspects of the bottom up approach that truly teach the fundamentals that are necessary to become a great computer scientist/engineer/developer that I don't think any other method provides. But the top-down approach is appealing for one reason it seems: It's friendly. I would not be surprised if the retention rate for top-down was greater than the bottom-up. Using something like Python, Java, or whatever other conventional blackbox language is easy, comfortable, and immediately demonstrates to a student the power of programming. The practicality of what they learn is evident. Ideally, interest in this would continue down the line. 'This is really cool, but how does Python actually work?'. Unfortunately, it seems that most people, when presented with a working blackbox, don't care to see how it actually ticks. It takes a certain special someone to open up a watch, disassemble and reassemble it. So who knows how well the top-down carries over into learning the fundamentals. The bottom-up has the drawback of intimidating the meek. I certainly was one. I would have benefited from a top-down approach, as I am one of the types who like to see how something ’ticks’. So therein lies a trade off, would you sacrifice the known quality of your curriculum for better retention? Having someone learn something, is better than nothing, but that’s up to people like Prof. Dijkstra to decide. EDIT: spelling/coherency
- hesdeadjim 13y agoI went to the University of Texas right before they made this change and I will say that my Programming Language course using Haskell was one of the toughest classes I took there. I was barely a novice at an imperative language, and all of a sudden I had the comfortable struts of local mutable state ripped out from under me. Having to solve most problems via recursion was incredibly challenging at that stage and I'd be lying if I said I left that class feeling like I understood Haskell. That course did have the desired effect that Dijkstra was hoping for though. I never programmed functionally in my coursework after that, but it stuck with me and the feeling that "there is something different out there" in the programming language world has forced me to never be satisfied with one language or one approach to solving a problem in my professional life since then.
- dxbydt 13y agoI can't help but notice that the vast majority of commenters are missing the fundamental reason for all this handwringing. The reason isn't language schism (that too, but I'd attach a much smaller weight to it) so much as the schism between corporatism & academia. Corporate America wants languages that are dumb, easy for corporate drones to assimilate, hard to mess up with, verbose ( verbosity is misinterpreted as documentation in the enterprise) and Java fits the bill from the get-go. Now, that doesn't mean you can't do non-dumb things in Java - at Sun Microsystems, we worked on all sorts of very cool R&D-type shit like JavaOS(http://en.wikipedia.org/wiki/JavaOS http://en.wikipedia.org/wiki/JavaOS), Hotjava ( http://en.wikipedia.org/wiki/HotJava http://en.wikipedia.org/wiki/HotJava), JavaSpaces (http://en.wikipedia.org/wiki/JavaSpaces#JavaSpaces http://en.wikipedia.org/wiki/JavaSpaces#JavaSpaces ), JavaCC( http://en.wikipedia.org/wiki/JavaCC http://en.wikipedia.org/wiki/JavaCC ), Jini (http://en.wikipedia.org/wiki/Jini http://en.wikipedia.org/wiki/Jini ), ...a very long list of R&D stuff. Sun Research was fucking elite, & staff engineers were considered outright geniuses. None of that cool R&D shit got any traction. So what got traction ? Whatever yucky shit corporate America wanted - JavaBeans( http://en.wikipedia.org/wiki/Java_Beans http://en.wikipedia.org/wiki/Java_Beans ), EJB (http://en.wikipedia.org/wiki/EJB http://en.wikipedia.org/wiki/EJB ), Swing (http://en.wikipedia.org/wiki/Swing_(Java) http://en.wikipedia.org/wiki/Swing_(Java) ), various sorts of form-builders, table widgets, reporting shit, IDEs, classfile obfuscators,... So Java became that. Rather than go down the R&D route, the pipeline became more corporate America oriented. Haskell has always had very deep roots in academia - the focus on enabling the corporate American drone with Haskell is minimal, close to zero. So what do you expect ? The focus will be on debating types & building theorem provers, not on "how to show big bank's fourth quarter report in 3 colors with 7 columns and subtotals in single widget while data-binding seamlessly occurs in middle tier using enterprise beans built from beanfactoryfactory" - this sort of shit that is commonplace in the Java EE world I inhabited post Sun, would be considered positively gauche in Haskell.
- tel 13y agoTotally! Djikstra was very aware of this influence and pokes only somewhat subtly at it here. Djikstra believed very strongly in inventing the next group of well-armed intelligent computer scientists—scientists tackling the hardest problems humans have yet discovered by his view. His goals are vastly maligned with what corporate America wants and the choice of language is a tool in the war between those interests.
- habosa 13y agoI love Haskell and Java. From a high level they are my favorite languages for their respective paradigms, so I think most programmers should at least try to write a simple program in both. That said, I think people are overreacting to Java as a CS 100-level language because of enterprise experiences. I have written enterprise Java and I hate it, but I still love Java. Java EE is all beans and POJOs and XML and Swing and cruft and I want to burn it in a fire. But that's not Java, those are libraries. Java is an excellent language to introduce someone to programming, because there is very little magic. Everything is explicit, due to the static typing and imperative nature. The computer (or JVM in this case) doesn't do anything that you don't tell it to do. That's easy for someone to grasp. Additionally, Java makes it very easy to write readable, organized, and extensible programs even if they are verbose. Using classes, objects, methods, types, and all of that OOP stuff makes it easy to write modular programs where each piece of code does exactly one thing. In functional programming the intricacies of passing state and higher-level functions lead to a lot more spaghetti code for someone who has never programmed before. Do I think that we should only teach Java? No, of course not. Do I think that it's still a great first language? Absolutely. If I had control of a curriculum, I'd teach Java for half a semester and then Haskell for half of the semester. I think it's important to not introduce "more productive" dynamic languages like Ruby or Python until students have had to deal with concepts like types so that they can appreciate what Python and other dynamic languages are leaving out. At Penn, where I go to school, the intro to CS class teaches OCaml in the first half and Java in the second. Unfortunately I think that so many people are struggling with writing code as a concept that they're too frustrated to appreciate the beauty of OCaml at first. Teaching it after something a little easier would make the advantages clearer.
- discreteevent 13y agoWe did half C/C++ and half Mathematica in parallel. For the project you needed to build a prototype in Mathematica and then implement it fully in C++ using a cross platform gui toolkit (Glockenspiel - this was quite some time ago). It seemed to work - for a functional language Mathematica was also fairly practical.
- dllthomas 13y agoIt's just my experience, but the people I know for whom Java was a genuinely first language seem to have a harder time than anyone else grokking pointers.
- ExpiredLink 13y agoHow many nano-Dijkstras has this letter?
- mathattack 13y agoThe first programming language depends a lot on what the purpose is. EWD's purpose is to train mathematicians specializing in computation. For these types of people, Haskell is fine. "Commercial" languages are better for people who want to learn the basics of programming to apply in a job later.
- hardwaresofton 13y agoI'll just leave this here... http://channel9.msdn.com/Series/C9-Lectures-Erik-Meijer-Functional-Programming-Fundamentals http://channel9.msdn.com/Series/C9-Lectures-Erik-Meijer-Func... (One of the greatest introductions and walkthroughs of Haskell I have ever watched, taught by Erik Meijer) I have actually watched every lecture (even the parts with stuff I "knew") and thoroughly enjoyed it. If an entire course was taught like those lectures were, I think you could teach someone a pretty darn good grasp of haskell pretty quickly (I am of course ignoring the part where you learn really basic fundamentals like bits/bytes, data types, references/pointers, etc)
- rmanocha 13y agoI was a freshman at UT in 2002 in their CS program. I wish they had heeded Djikstra's advice. Java with BlueJ was what we were taught from day 1. To the departments credit, we did end up taking a couple of courses in Haskell (the best one I remember was the course of compilers - we had to write a C lexer in Haskell). It was one of the more fun classes I took (thanks, in a great part, to the professor teaching us).
- bakul 13y agoWhy not teach assembly language programming so that the student can really understand how a computer works, and teach Scheme so that they can really understand the power of abstraction, recursion, functional programming etc. A later course can be to write a Scheme compiler generating the same asm lang.
- NigelTufnel 13y agoI think judging programming languages by their features is the same as judging people by their talent and not by their deeds. Take Java for example. Most people (Dijkstra included) hate it. But look how much Java has accomplished. It's not a coincidence that Hadoop is written in Java. It's not a coincidence that Java is the primary language on Android. To quote a great man: "Java works. Java captures the essence of the evolutionary spirit" Same thing applies to PHP, Javascript, and whatever everyone hates. Couple of years ago I thought that Java was the Devil's invention and the most awful programming language ever. Then I started using Java with Hadoop. And for the first week Java was the most awful programming language ever. Two/three weeks in I was absolutely okay with Java. It worked. And for me that's the only thing that counts.