Re: why is "self" used in OO-Python?



In article <Xns9AD9C189C42A3duncanbooth@xxxxxxxxx>,
Duncan Booth <duncan.booth@xxxxxxxxxxxxxxx> wrote:

Sadly a lot of Java programmers mistake the limitations of their language
for rules of OO programming, and worse this has spread from Java into other
languages where these restrictions no longer need apply.

You can generalize that to, "a lot of programmers assume that OO is defined
by whatever happens to be the first OO language they learn".

In fact, it generalizes even further to the Law of Primacy
(http://en.wikipedia.org/wiki/Principles_of_learning#Primacy). I recognize
this drivel from the crud the FAA publishes:

Primacy, the state of being first, often creates a strong, almost unshakable,
impression. Things learned first create a strong impression in the mind that
is difficult to erase. For the instructor, this means that what is taught
must be right the first time. For the student, it means that learning must be
right. ³Unteaching² wrong first impressions is harder than teaching them
right the first time. If, for example, a student learns a faulty technique,
the instructor will have a difficult task correcting bad habits and
³reteaching² correct ones.

but fundamentally, it's true. If the first programming language (or the
first OOPL) a person learns is Java, it should come as no surprise when
they think they way Java does things is the only way to do things. Having
seen no other ways yet, what else *could* they think?

I have no objection to teaching Java in a CS curriculum. Or even making it
the first language you teach. What I do object to is making it the ONLY
language you teach.

My next door neighbor's kid just finished a MSCS program. The curriculum
did a pretty good job of covering most of the important topics, but they
did it all in Java. Web development in Java, graphics programming in Java,
algorithms in Java, etc. He's well prepared to get a job as a Java
programmer (and, in fact, he did), but I don't think he's really trained to
be a computer scientist.

A good CS program should include a survey of different programming
languages. Today, I would certainly want to give students exposure to C++,
at least one of {Python,Ruby}, and a random sampling of some less main-line
languages like Erlang, Lisp, PHP, Groovy, Smalltalk, or PostScript.
Exactly which ones is not so important as getting to see a wide variety of
different approaches. Only after you've seen a bunch of different ways of
doing something can you start to appreciate the choices different language
designers made.

BTW, there's an interesting article in the July 2008 Computer Magazine: "In
Priase of Scripting: Real Programming Pragmatism". Ronald Loui argues
(amongst other things) that Python would make a good first language to
teach in a CS curriculum.
.



Relevant Pages

  • Re: Static vs Dynamic
    ... (Java has too much noise in its source code, ... lot to ask and is typical in a typed language supporting polymorphism. ... > developers can easily learn the Java programming language; ... > obivous bugs slip through and b) in many cases, ...
    (comp.lang.lisp)
  • Re: Public disclosure of discovered vulnerabilities
    ... I spoke of Java; ... > necessary when programming in Java. ... > it is every single programmer who wants to use the language securely. ... this is what we call the "mental model" problem in aerospace. ...
    (sci.crypt)
  • Re: 71% Say Finding New Energy Sources More Important than Conservation
    ... Most of the drive to define was for a test programming language, because each tester had it's own language and the engineer would have to re-write the program every time the testor changed. ... The only reason it was used was because people saw that it would have a longer life time than ADA. ... My group at Stanford switched to Java as their language of choice after giving up on C++ as too flawed to use. ...
    (soc.retirement)
  • Question on variable binding and assignment
    ... My Java for dummies book didn't tell me this stuff. ... Then for a dynamically typed language such as Perl, ... concept of "unbound variables" in a programming language in the first ...
    (comp.lang.lisp)
  • Re: why java is not pure object oriented?
    ... For learning I preffer language like Lisp based on ... program fast in latter, but, imho, it's very hard in former (like Java). ... CU> programming which is neither top-down nor bottom-up (though it's ...
    (comp.lang.java.programmer)

Quantcast