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."

28 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.

  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. 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.

  6. 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 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)
    2. 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.

  7. 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.

  8. 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.

  9. 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.

  10. 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.

  11. 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.

  12. 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.)

  13. 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.

  14. 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.
  15. 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?

  16. 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.

  17. 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.

  18. 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.
  19. 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.