Slashdot Mirror


Python Bumps Off Java As Top Learning Language

itwbennett writes: Python has surpassed Java as the top language used to introduce U.S. students to programming and computer science, according to a recent survey posted by the Association for Computing Machinery (ACM). Eight of the top 10 computer science departments now use Python to teach coding, as well as 27 of the top 39 schools, indicating that it is the most popular language for teaching introductory computer science courses, according to Philip Guo, a computer science researcher who compiled the survey for ACM."

40 of 415 comments (clear)

  1. Re:another language shoved down your throat by szmccauley · · Score: 5, Funny

    could have been worse, it could have been javascript

  2. Which raises the critical question: by MAXOMENOS · · Score: 5, Interesting

    2.x or 3.x?

    1. Re:Which raises the critical question: by tippe · · Score: 5, Funny

      Who cares? Isn't the critical question always what editor they should program with? Everyone knows that real programmers use vim. Long live vim!

      Here: something to distract you while I go duck under a desk

    2. Re:Which raises the critical question: by ShadowRangerRIT · · Score: 5, Informative

      I really hope 3.x, if only for the fact that your code tends to work with non-English text by default, because str supports the whole Unicode range, so it works with non-English input by default. Compare to 2.x where you have to make a conscious effort to work with Unicode. Particularly important for third party libraries, where they aren't producing a final application, and often don't think about Unicode at all even for text based APIs. Heck, the Python built-in csv module in 2.7 doesn't work properly with Unicode; you have to load or convert as UTF-8 bytes, parse, then decode to the 2.7 unicode type. It's a mess.

      For teaching purposes 3.x is even better, since you have a proper distinction between binary data and text, rather than the mushy 2.x situation where str is sometimes binary data and sometimes handicapped text, while unicode is always text, and sometimes interoperates with str, while at other times it explodes. Teaching languages should be consistent, and 3.x is simply more consistent than 2.x (largely because of cleanup decisions like this).

      --
      $_ = "wftedskaebjgdpjgidbsmnjgcdwatb"; tr/a-z/oh, turtleneck Phrase Jar!/; print
    3. Re:Which raises the critical question: by Roger+W+Moore · · Score: 5, Funny

      Wow - I never knew you could tell a real programmer by their choice of bathroom cleaner.

    4. Re:Which raises the critical question: by number6x · · Score: 3, Funny

      vim! You are a reformed apostate!

      How dare you split from the true path of vi? You might as well join be working for the forces of E.

  3. The Future's So Bright by Art3x · · Score: 4, Funny

    I can't wait for this generation to saturate the industry. Fewer bugs, better features, from less nonsense to code programs with. They might even be better as people, with clearer heads. Python might even help you think more clearly.

    1. Re:The Future's So Bright by X0563511 · · Score: 4, Insightful

      That's not how it works. Bad programmers are bad programmers - it doesn't matter what language they touch.

      --
      For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
    2. Re:The Future's So Bright by hondo77 · · Score: 5, Interesting

      But good developers make less mistakes in a language where there's less freedom...

      Some of us like having the training wheels off our bikes.

      --
      I live ze unknown. I love ze unknown. I am ze unknown.
  4. "Top Learning Language" ...OR... by tlambert · · Score: 4, Interesting

    "Top Learning Language" ...OR... "Top Teaching Language"?

    Do we have some great metrics as to how well people taught in Python actually *learn*? You know, for things like memory allocation, pointers, and so on?

    1. Re:"Top Learning Language" ...OR... by pieisgood · · Score: 5, Insightful

      I think they're going for teaching conditionals, loops, classes, functions and structure. You don't need to teach them about memory allocation, pointers and memory alignment in an introductory class. You can save that for an asm and C course. Or better yet, a memory class (which I've not seen).

      --
      Eat sleep die
    2. Re:"Top Learning Language" ...OR... by Anonymous Coward · · Score: 4, Funny

      Funny you should mention a memory class. I'm the Computer Science department head at my university.

      I was going to introduce a memory class last semester, but I forgot.

  5. Python for learning? Good choice. by Anonymous Coward · · Score: 3, Insightful

    Python is an awesome language for learning - I'd vote for any language that allows interactive code debugging and experimentation. I see Python used everywhere these days so it's even useful as industry experience.

    I'm a C++ programmer by trade but there's no way I'd wish that language on a student. It's a hellish nightmare clusterfuck language that doesn't know what problem it's trying to solve anymore. Java is loosely based on C++ so it inherits a lot of the problems. I only wish Python would allow stricter interface constructs...

    1. Re:Python for learning? Good choice. by vux984 · · Score: 4, Insightful

      I'm a C++ programmer by trade but there's no way I'd wish that language on a student

      Agreed. Its not a learning language.

      I only wish Python would allow stricter interface constructs...

      I only wish python didn't have semantic whitespace. That's it. Otherwise i like it just fine.

      I want the compiler/IDE/whatever to pretty-print and reformat my code to reflect program semantics, not have me spend my time formatting it to DEFINE program semantics.

      A programming language that can have its code be destroyed by copy-paste / email / web-forum formatting mangling is simply idiotic.

    2. Re:Python for learning? Good choice. by dbc · · Score: 3, Insightful

      I only wish python didn't have semantic whitespace. That's it. Otherwise i like it just fine.

      I'll disagree on that. We use white space to communicate our programs' block structure to other humans. Why should we use a different syntax to tell the compiler the same information? Computers should conform to the needs of humans. Full. Stop. Python eliminates that source of bugs and redundancy by having the compiler's view of the significance of what space match a human's view of significance of white space. Please join us in the 21st century. I'm old enough that I did undergrand homeworks with punch cards, and just missed being taught intro to programming using FORTRAN. One thing I've learned over the years is to recognize progress when I see it.

    3. Re:Python for learning? Good choice. by Darinbob · · Score: 3, Insightful

      We taught C++ to a lot of students, and a lot of them learned it very well and were able to move on to other languages easily enough. Although I think a problem is that today's students aren't as nerdy as they used to be, they don't want to learn about computers and programming and everything related, from assembler and transistors up to lisp and databases, but instead just want to get their 9 to 5 job in whatever field seems to pay the most for the least effort.

  6. Makes sense by pieisgood · · Score: 3, Interesting

    It makes sense. IMHO python removes a lot of the hardware considerations that other languages have. This allows for a focus on the CS material, rather than the engineering material. An advantage over java is that it also supports functional programming. That means that you can teach introductory CS principles in multiple programming styles without having to switch languages. Top it all off with forced indentation (not my favorite thing), which makes beginner code easier to read for instructors and I can see why they did this. Now, later they'll get into asm and C/C++ and memory alignment and paging and all that stuff, but starting out it's nice.

    --
    Eat sleep die
  7. Re:another language shoved down your throat by infogulch · · Score: 5, Insightful

    If you didn't want to learn programming languages, why are you taking computer science courses?

    If you're being force-fed anyways, I think python would be much easier to stomach than java for introductory courses. And it would be much easier to grade (if grading consisted of more than "did it output correctly") since introductory students aren't exactly known for their exceptional code organization and formatting skills.

  8. Java or Python by benjfowler · · Score: 4, Interesting

    Lots of people hate the whitespace block-delimiting, but I think Python is *way* better than Java for beginning programming classes.

    I've seen the transition my alma mater made, between Modula-2 and Java. Modula-2 is trivial to pick up for anybody who cut their teeth on Turbo Pascal or Delphi, and "hello world" is quite easy to explain to anybody otherwise unfamiliar with programming. Try repeating that trick with Java's equivalent, and you'll understand why first-year dropout rates skyrocketed upon the switch. Anyway, Python has some nice goodies in the language which lends itself nicely to teaching both OO, and functional styles in the one language.

    I've even seen this in non-IT specialties; at Imperial College here in London, the newbies learn Python (stands to reason, because it's the weapon of choice for many scientists, especially physicists). King's College, OTOH force their first-years to take a unit of Fortran, which actually manages to be about fifty times worse than any other language I've attempted to use.

    The steepness of the learning curve is critical AFAICT -- you don't want to spoon-feed kids, but you don't want to crush them in their first two weeks at college either.

    1. Re:Java or Python by Anonymous Coward · · Score: 3, Insightful

      OP is right. Caring about whitespace is one of the fatal flaws of a programming language.
      Make shares the same flaws, but at least it does something useful.

    2. Re:Java or Python by St.Creed · · Score: 5, Interesting

      Why o why do people drop Pascal? It's still one of the best languages to learn how to program: it's typesafe, compilers plenty, and you can easily create custom types (records). With pointers to records you can make lists, trees etc. - all the constructs basic to the trade.

      --
      Therefore, by the (faulty) logic you're using, you're just a cow with a keyboard - osu-neko (2604)
    3. Re:Java or Python by Anonymous Coward · · Score: 4, Insightful

      Humans care about whitespaces. That's why there are spaces between words, lines, paragraphs and so on. It is easier to spot a lack of indentation or a line break than, let's say, a missing ; at the end of a line (or an extra one, like for(int i = 0; i n; ++i); { do something }").

      This kinds of things make it easier for beginners, and they should not be a problem to experienced programmers, either.

  9. Re:another language shoved down your throat by ShanghaiBill · · Score: 5, Insightful

    now I guess python will be forced fed to people who don't want it

    That seems like a silly objection. It is not practical for a teacher to let each kid choose their own language, nor are the kids knowledgeable enough to choose. I don't see any big organizations pushing Python the way that Sun was hyping Java back in the late 1990s.

    At my kids' school, they start teaching programming in 4th grade, using Scratch, and move to Python in 6th grade. It seems to work well.

  10. Re:another language shoved down your throat by BForrester · · Score: 4, Insightful

    java was only "the most popular" because it was force fed to people who didn't want it.

    I don't think you understand how schools and their curriculae work. Nobody is holding a gun to the collective and independently-operated heads of CS departments to demand which language they use for beginner courses.

    Java was historically chosen because it was a safe option; used widely in industry, decent documentation and tools, it supports good programming practices, and it provides reasonably powerful options while being relatively beginner friendly. Java largely replaced C and C++, which are not beginner friendly.

  11. Re:another language shoved down your throat by kthreadd · · Score: 4, Informative

    Computing science is not about programming, but programming is often used as a tool in computing science and they therefore (rightfully) have you take programming courses before going into the more theoretical material.

  12. Pascal by Dan+East · · Score: 3, Interesting

    Wait!!! What happened to Pascal?!?!? On a more serious note, Pascal was the premier teaching language back in the day, but it really wasn't used much in the real world. It was a stepping stone for learning C, which is where the real power was at and what "real" applications were developed in. I believe there is less disconnect today between the popular learning languages and what is actually utilized in the real world.

    --
    Better known as 318230.
    1. Re:Pascal by shutdown+-p+now · · Score: 3, Insightful

      Pascal had fucked up string handling, though some dialects partially rectified that.

      Also, back in the golden age of DOS (late 80s to early 90s), [Borland] Pascal was in fact the language in which many "real" applications were developed, as well; even games. Delphi was also pretty popular on Windows in late 90s to early 00s.

  13. Re:pointers by shutdown+-p+now · · Score: 4, Informative

    It doesn't have pointers, but it does have references - which are basically pointers without arithmetic. In fact, in Python, everything in a reference (even primitive types like int are reference types). This is sufficient to explain the core notion of indirection, and data structures built on that notion, like linked lists or binary trees.

  14. Great, an entire generation that won't... by Anonymous Coward · · Score: 3, Insightful

    be capable of comprehending blocks. Their kind simply doesn't fucking get begin and end even in pseudo code. I've had to fire three Python devs that simply couldn't figure-out how to use {} in JavaScript. It's not that hard, but I think that horrible language spoils them into thinking that whitespace is magical. Of course colleges want to graduate people that can't keep jobs so they get more customers for their masters programs so they love Python. Making sure you graduate people that are unable to find and/or keep jobs is the number one job now of college professors.

    1. Re:Great, an entire generation that won't... by supton · · Score: 4, Interesting

      You attribute the mistakes of idiots to their language of choice? What does that say about your ability to judge the merits of technical people you work with?

  15. Good idea by Animats · · Score: 5, Insightful

    Python isn't a bad first language. It has all the important advanced concepts - objects, dictionaries, closures, and threads. The syntax is reasonable. Some people are bothered by the forced indentation, but for new programmers, it will seem natural.

    Most of the problems with Python are performance related. They come from obscure features of the language, such as the ability to do "getattr" and "setattr" on almost anything, including objects running in another thread. So everything has to be a dictionary. (This is sometimes called the Guido von Rossum Memorial Boat Anchor.) PyPy is struggling hard to overcome that, with some success. (The optimization approach is "oh, no, program did Obscure Awful Thing which could invalidate running code" - abandon compiled JIT code, shift to backup interpreter, flush JIT code cache, execute Obscure Awful Thing, wait for control to leave area of Obscure Awful Thing while in backup interpreter, rerun JIT compiler, resume running compiled code.)

  16. Re:another language shoved down your throat by Anonymous Coward · · Score: 5, Insightful

    C is very beginner friendly in my opinion. It was my first non-BASIC language. Learning C you learn how those bits and bytes work and how shit gets done. The paradigm is old but not obsolete.

    But yes, Python is a great choice. My only gripe is the use of indentation instead of curly brackets to mark blocks.

  17. Comment removed by account_deleted · · Score: 3, Insightful

    Comment removed based on user account deletion

  18. What happened to Scheme? by damn_registrars · · Score: 3, Interesting

    The overwhelming majority of CSci graduates that I have known started undergrad by learning Scheme. IIRC that language was actually built for the purpose of teaching the fundamentals of programming. Why was it replaced (beyond the fact that hardly anyone in the real world uses it)?

    --
    Damn_registrars has no butt-hole. Damn_registrars has no use for a butt-hole.
  19. I was introduced to Python first by goltzc · · Score: 4, Interesting

    Back in 2001 I was attending Minnesota State University Mankato. The CS program there did all of the introductory programming courses in Python. A year or two prior to my enrollment all the intro classes were taught in Java. The profs found that students would get hung up on java syntax when their goal was to teach them basic programming concepts so they switched to Python. Courses in Python only lasted for a couple semesters. After that the rest of the curriculum was primarily taught in Java. I think that Python accomplished the CS department's goal quite well.

    --
    Our bugs are smarter than your test scripts.
  20. Re:another language shoved down your throat by ggpauly · · Score: 3, Informative

    You are far from alone in misunderstanding Javascript.

    --
    Verbum caro factum est
  21. Re:another language shoved down your throat by Anonymous Coward · · Score: 4, Insightful

    Yeah, because the concepts of C# cannot be aplied to any other language like Java or Python.

  22. Re:another language shoved down your throat by Ateocinico · · Score: 4, Insightful

    And for that reason python is good for a first course, as it forces the students to indent. I am tired of lazy students that don't indent, and then complain why their code doesn't seem to follow the intended flow. It is hard to teach good habits and practices. And any help, specially from the programming languages, is welcome.

  23. Re:another language shoved down your throat by MightyMartian · · Score: 4, Insightful

    That's rubbish. Most of the major platforms have had Java ported to them. Including various obscure systems is ludicrous. If I want a program that I'm almost guaranteed will run without recompile on Linux, Windows, BSD and even many mainframes, then Java remains the best solution. I'm not saying, from a programming perspective, that it's all that great, but from a platform neutral perspective for most of the systems that a programmer will encounter, it remains the best.

    Have fun running an x86-64 Linux binary natively on a Windows 8 machine. I can. however, write a Java program that I can almost guarantee will in fact run on x64 Linux or Windows.

    --
    The world's burning. Moped Jesus spotted on I50. Details at 11.
  24. Re:another language shoved down your throat by Xtifr · · Score: 4, Insightful

    Have you ever been fooled by incorrect indentation that didn't compile the way it looked?

    Nope. My editor takes care of indentation for me, in every common language except Python, and when I have to deal with a batch of code written by someone else, I run it through indent(1) first. So, in fact, it's just the opposite: when the indentation doesn't match what I expect, I know there's an actual problem in the code!

    With Python, on the other hand, I'm actually more likely to have an error in the indenting, because there's no easy way to see how many blocks I'm terminating when I outdent by an arbitrary amount. Which is a real PITA when you're refactoring.

    Of course, things may be different if you're using crappy tools. But professionals shouldn't be using crappy tools.

    Brackets, begin..end, and semicolons are crutches for compiler writers not programmers.

    No, they're tools to make my job easier. Whatever the historical reason for them may be, they benefit the programmer! They make me more productive.

    Now, I'll grant that Python is a remarkably good language despite its horrible flaw of relying on indentation. And many of its good features also make me more productive. But that doesn't mean that relying on the indentation isn't a horrible flaw.