The moose likes Teachers' Lounge and the fly likes Python as a first language Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Books and Education » Teachers' Lounge
Reply Bookmark "Python as a first language" Watch "Python as a first language" New topic
Author

Python as a first language

John M Morrison
Greenhorn

Joined: Jul 25, 2005
Posts: 16
We have been using Python as a first language at the North Carolina School of Science and Mathematics for five years. Anyone else out there doing that?
Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
The school I go to recently made Python the language used in the first programming course. Sadly, the next 4 courses use Java to explain the concepts. I think within 3-4 Python will replace Java in those courses.


"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 11740

You can start some wonderful academic fights over what language to use for teaching purposes - and, in fact whether or not to use a "practical" language or a contrived one.

For myself, I'm not entirely happy with the idea of Python as a teaching language for the same reason I don't hold with BASIC. A major reason is the very reason why both are so popular - they make it entirely too easy to get in and start hacking.

This is academia. "Git-R-Dun" shouldn't apply here. If you want to form good habits, it's usually considered better to learn the rules first and then learn how to break them. Bad habits are hard to get rid of.

Java is a strongly-typed language with early bindings. Python is not. It allows you to concentrate on the code, but not on the data. Not everyone thinks that the data deserves to be treated so lightly. Remember that classic work "Algorithms + Data Structures = Programs"?

Python is a useful skill to have, but it's intended to show results quickly without the need for detailed analysis and planning. In the business world and the Hacker world, that can be a good thing, but when the goal is to master a discipline, development speed isn't the main issue.


A lot the of modern-day software development platforms are designed to permit parcelling out work to those with the best aptitude for it. A lot of modern-day business is predicated on making one person do all the work, regardless of aptitude.
Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
That assumes on the idea that Python is a weak language. To compare it to BASIC is ludicrous, as is the idea that Python teaches bad programming habits. Python has been proven to be a solid language in real world apps. From the web to the desktop, to system scripts, python is being proven everyday.

It is also more orthogonal and elegant than Java. The fact that java is strongly typed isn't a teaching advantage at all. If an instructor wants he can restrict a single variable to a type throughout an assignment. Strongly typed languages are not inherently "better".

What data structure is not used in Python? I fail to see how your arguments match up with Python at all.

With your criteria C or better yet an assembly language should be the starting language as Java hides many of the important details that makes a good programmer. Even Java and Python programs benefit greatly by programmers who understand what is going on at the opcode level.

This is definitely not specific to Java but I see too many programmers that can't implement anything unless it is simple without relying on a library for it. So perhaps teaching assembly, then C, then OO concepts, then maybe a functional language concepts would produce more real programmers as opposed to API monkeys that come from academic programs that start out with Java or Python.

At this level students are learning the basics of how looping constructs and simple DS work and are given assignments to write their own programs implementing DS like linked lists, hash tables, and AVL trees. Writing these programs in Java(or C++ or C) can take a lot code, considerably more than Python. The ability to write a correct AVL tree faster is a huge benefit in academia since that means more time can be spent getting into the nitty gritty details and proper uses.

The elegance of Python vs the relative clunky-ness of Java is an advantage of students in departments that use Python first. In fact, I can see Java going away in these departments or at least being moved to an elective class like C++ often is.

In academia, students are taught concepts not languages. Using an elegant, easier to use language that stays out of the students way makes learning these concepts easier, not harder. For example teaching sorting and searching in Java requires stopping the class to cover the basics of interfaces and now generics which are fairly Java specific. Python is also great for teaching software design and implementation. It is not uncommon to see ~15 lines of Python code that would take 100+ in C++ or Java. Which is better in terms of concentrating of the concepts, avoiding, finding and fixing bugs?

In my opinion each class in core CS programs should use a different language, I have seen the effect of spending the first two years in mainly one language has on the ability of students to effectively learn other languages. Students who spend the better part of their first two years using java have a hard time moving into other languages because they think in java and not in programming basics. At least with a language like Python it is easier to move to other languages because it doesn't have quite so many language specific features that are core to using the language.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Have a look

The Perils of Java Schools
College Advice

Cheers.
 
 
subject: Python as a first language
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com