Can a low-level programmer learn OOP?

S

Sebastian Bassi

place. At the end of it you'll have a good idea how OOP works, and how
Python works. Learning OOp this way is easy and painless, and what you
...

But this tutorial states "I assume you know how object-oriented
programming works"
 
B

bonnie

=== 8< ===





Oh you young'uns, not versed in The Ancient Lore, but filled with
self-serving propaganda from Xerox PARC,Alan Kay, and Smalltalk
adherents everywhere!

As a few more enlightened have noted in more than one thread here, the
Mother of All OOP was Simula (then known as SIMULA 67). AllAlan Kay
did was define "OOPL", but then didn't notice (apparently--though this
may have been a "convenient oversight") that Simula satisfied all the
criteria so was actually the first OOPL--and at least 10 years earlier
than Smalltalk!

So Kay actually invented NONE of the concepts that make a PL an OOPL.
He only stated the concepts concisely and named the result OOP, and
invented yet another implementation of the concepts-- based on a
LISP-like functional syntax instead of an Algol-60 procedural syntax,
and using message-passing for communication amongst objects (and
assumed a GUI-based IDE) (and introduced some new terminology,
especially use of the term "method" to distinguish class and instance
procedures and functions, which Simula hadn't done) .

As Randy Gest notes onhttp://www.smalltalk.org/alankay.html, "The
major ideas in Smalltalk are generally credited toAlan Kaywith many
roots in Simula, LISP and SketchPad." Too many seem to assume that
some of these other "features" of Smalltalk are part of the definition
of an OOP, and so are misled into believing the claim that it was the
first OOPL. Or they claim that certain deficiencies in Simula's object
model--as compared to Smalltalk's--somehow disqualifies it as a "true
OOPL", even though it satisfies all the criteria as stated by Kay in
his definition. Seehttp://en.wikipedia.org/wiki/Simulaand related
pages, and "The History of Programming Languages I (HOPL I)", for
more details.

Under a claim of Academic Impunity (or was that "Immunity"), here's
another historical tid-bit. In a previous empolyment we once had a
faculty applicant from CalTech who knew we were using Simula as our
introductory and core language in our CS program, so he visited Xerox
PARC before coming for his inteview. His estimate ofAlan Kayand
Smalltalk at that time (early 80s) was that "They wanted to implement
Simula but didn't understand it--so they invented Smalltalk and now
don't understand _it_!"

wwwayne

=== 8< ===

A couple of notes on this post.

Alan Kay has always publicly credited Simula as the direct inspiration
for Smalltalk, and if you know the man and his work, this implication
of taking credit for the first OOP language is not true, it is a
credit assigned to him by others, and one which he usually rights when
confronted with it.

You may be confused with the fact that "object oriented
programming"was a term which I believe was first used by Alan and his
group at PARC, so perhaps the coining of the term is what is being
referenced by others.

Perhaps I'm mistaken, but the tone of your post conveys an animosity
that did not exist between the original Smalltalk and Simula
inventors; Nygard and Kay were good friends, and admired each others'
work very much.


Bonnie MacBird
 
W

Wayne Brehaut

=== 8< ===
A couple of notes on this post.

Alan Kay has always publicly credited Simula as the direct inspiration
for Smalltalk, and if you know the man and his work, this implication
of taking credit for the first OOP language is not true, it is a
credit assigned to him by others, and one which he usually rights when
confronted with it.

I know this, and was perhaps a little too flippant in my all-inclusive
statement "self-serving propaganda from Xerox PARC,Alan Kay, and
Smalltalk adherents everywhere!", for which I apologize. But it was
made with humorous intent, as I had hoped the opening "Oh you
young'uns, not versed in The Ancient Lore, but filled with
self-serving propaganda..." would imply.

A more accurate and unhumorous statement of my opinion is that it is
Smalltalk adherents who know virtually nothing of the history of
OOP--and even some who do--who did and still do make such claims,
both personally and in the published literature of OOP.

And my statement about a prospective faculty member's opinion was just
that: a historical anecdote, and the expression of an early 80s
opinion by a professional CS professor and researcher in formal
semantics (which may have been part of his distrust of the Smalltalk
team's "understanding" of Smalltalk) . The opinion he expressed was
his and not my own, and I was just recording (what I thought might
be) an amusing anecdote in a context in which I thought it
appropriate: discussion of what OOP is, and after Bruno made the
claim: "OO is about machines - at least as conceveid by Alan Key, who
invented the term and most of the concept." I don't think my
recording it here should be construed as my opinion of either
Smalltalk or its creators (at that time or now).

As often happens in many arenas, the creator of an idea can lose
control to the flock, and many publications can get accepted if
referrees themselves don't know the facts or take care to check them
before recommending publication--which probably explains why so many
publications (especially in conference proceedings) on OOP in the 80s
and 90s completely omitted any mention of Simula: so much so that I
once intended writing a paper on "Ignorance of Simula Considered
Harmful."

On the other hand, anytyhing you may have inferred about my distaste
for those who doesn't bother to learn anything of the history of a
subject, then make false or misleading claims, and don't bother to
correct themselves when questioned, is true.
You may be confused with the fact that "object oriented
programming"was a term which I believe was first used by Alan and his
group at PARC, so perhaps the coining of the term is what is being
referenced by others.

No, I have been at more than one CS (or related area) conference where
a Smalltalk aficionado has stated unequivocally that Kay invented OOP
and that Smalltalk was the first OOPL. The last I recall for sure was
WebNet 2000, where a (quite young) presenter on Squeak made that
statement, and was not at all certain what Simula was when I asked
whether it might actually have been the first more than 10 years
before Smalltalk 80. So his claim, and that of many others,
explicitly or implicitly, is that not only the term, but most (or all)
of the concept, and (often) the first implementation of OOP was by Kay
and his Xerox PARC team in Smalltalk 80.
Perhaps I'm mistaken, but the tone of your post conveys an animosity
that did not exist between the original Smalltalk and Simula
inventors; Nygard and Kay were good friends, and admired each others'
work very much.

Yes, you are very much mistaken (as I note above), and appear not to
have understood the intended humorous tone of my posting.

wwwayne
 
P

Paddy

Hi:
Christopher
Problem:

1. How to most easily learn to write simple PC GUI programs that will
send data to remote embedded devices via serial comms, and perhaps
incorporate some basic (x,y) type graphics display and manipulation
(simple drawing program). Data may result from user GUI input, or from
parsing a text config file. Solution need not be efficient in machine
resource utilization. Emphasis is on quickness with which programmer
can learn and implement solution.

Have you also tried looking for a cross-platform GUI program that has
a
scripting interface that you might adapt? If found then the extra
scripting needs may be reduced.

- Paddy.
 
B

Bruno Desthuilliers

Wayne Brehaut a écrit :
One problem is that it's often not clear what lists of properties are
his definition of OOP vs. what are the intended properties of
Smalltalk--his intended impelmentation of OOP. Many of the lists begin
with the basic requirements that "everything is an object" and
"objects communicate by message passing", but the most common
"generally agreed upon" definition abstracts just four requirements
from these (changing) lists--attempting to separate implementation
details from what is essential to the underlying framework. As I note
below, these were:

1. modularity (class-based? object-based?)
2. inheritance (sub-classing)
3. encapsulation (information hiding)

I don't see information hiding and encapsulation as being the very same
thing. But anyway...
4. polymorphism ((sub-) class-specific response to a message, or
processing of a method)

subclassing - and even classes - are not necessary for polymorphism. I
guess you have a good enough knowledge of Python and/or some
prototype-based OOPL to know why !-)
Other details in Kay's lists are considered implementation details,
and important advances or alternatives to pevious methods, but not
required for a language to _be_ OO. It is reputed, though, that in
2003 Kay said
(http://c2.com/cgi/wiki?AlanKaysDefinitionOfObjectOriented) "OOP to
me means only messaging, local retention and protection and hiding of
state-process, and extreme LateBinding of all things."

So I understand your accepting one of Kay's lists as being a
definition of OOP instead of "just" a description of Smalltalk, or of
accepting this fairly recent "definition" as being the true one

Is there any "true one" ?-)
(as
opposed to the previous lists of usually 6 properties). "It's hard to
hit a moving target!"
Indeed.



Understood--sort of--but there is sufficient accurate information
about Simula available on the web now that it's no longer necessary to
use quotes from Kay about OOP and Smalltalk just because they're more
accessible, as used to be the case. What would be so OT about
referring to Simulain one sentence instead of or in addition to
Smalltalk?

What I mean is that I felt my answer to be already OT enough so I sniped
large parts of it. FWIW, I could have sniped the reference to Alan Kay
and kept the one to Simula, but then it would have require more rewrite
work.
But I digress--my only real objection to your post was your opinion
and claim that Kay "invented the term and most of the concept":

I agree that the term "most" is perhaps a bit too strong. For my
defense, please keep in mind that I'm not a native english speaker, so I
often have hard time expressing myself with the exact nuance I'd use in
french.

(snip)
As has been noted before, it's often the fact that a cause becomes a
religion:

Good Lord, save us from becoming religious !-)

Ok, I admit that I have my own understanding of OO (as anyone else, I
guess), which is quite closer to Smalltalk's model than to any other
OOPL (even Python). It probabaly has to do with the extremely
generalized and systematic application of two key concepts - objects and
messages - in such a way that it becomes a coherent whole - while most
mainstream OOPLs feel to me more like ad-hoc collection of arbitrary
rules and features. So yes, I'm probably guilty of being a bit too
impassioned here, and you're right to correct me. But have mercy and
take time to read a bit more of the offending post, I'm pretty confident
you won't find me guilty of mis-placed "religiosity".

(snip)
in contrast, all I've done so far is complain about
those who don't accept the correct (i.e., my) definition or use of
terms.

Lol ! I'm afraid this is something we're all guilty of one day or another...
 
B

Bruno Desthuilliers

Wayne Brehaut a écrit :
Newbie ;-)

(I started with Royal McBee LGP 30 machine language (hex input) in
1958, and their ACT IV assembler later! Then FORTRAN IV in 1965. By
1967 I too was using (Burroughs) Algol-60, and 10 years later upgraded
to (DEC-10) Simula-67.)


My my my... Would you believe that my coworkers do consider me like an
old sage because I started programming in 1990 with HyperTalk on Mac
Classic !-)

I suddenly feel 20 again ! Woo !-)
 
B

Bruno Desthuilliers

Wayne Brehaut a écrit :
Not quite--according to him:

object-based + classes => class-based
class-based + class inheritance => object-oriented

I.e., "object-oriented = objects + classes + inheritance".

What about prototype-based languages then ?-)
 
A

Aahz

If you just want to enter some values and set some flags and then hit
"go", you could always program the GUI in HTML and have a cgi script
process the result. This has a lot of benefits that are frequently
overlooked but tend to be less fun than using a bona-fide toolkit like
WX or QT.

This is excellent advice worth emphasizing -- but then, I make my living
working on a web app. ;-)
 
B

Bruno Desthuilliers

Wayne Brehaut a écrit :
=== 8< ===


Oh you young'uns, not versed in The Ancient Lore, but filled with
self-serving propaganda from Xerox PARC, Alan Kay, and Smalltalk
adherents everywhere!

Not feeling concerned.

(snip pro-simula/anti-Xerox propaganda).
 
B

Bruno Desthuilliers

Wayne Brehaut a écrit :
(snip)
> after Bruno made the
claim: "OO is about machines - at least as conceveid by Alan Key, who
invented the term and most of the concept."

Please reread more carefully the above. I do give credit to Smalltalk's
author for the *term* "OOP", and *most* (not *all*) of the concepts (I
strongly disagree with your opinion that message-passing is not a core
concept of OO).

FWIW, I first mentionned Simula too (about the state-machine and
simulation aspect), then sniped this mention because I thought it was
getting a bit too much OT - we're not on comp.object here.
 
H

hide1713

You are lucky.Our project is a cross-platform cluster computer
managment system
this system can run on both windows and Linux
http://pluster.gf.cs.hit.edu.cn/
I tell you how we solve this problems
1. How to most easily learn to write simple PC GUI programs that will
send data to remote embedded devices via serial comms, and perhaps
incorporate some basic (x,y) type graphics display and manipulation
(simple drawing program). Data may result from user GUI input, or from
parsing a text config file. Solution need not be efficient in machine
resource utilization. Emphasis is on quickness with which programmer
can learn and implement solution.

We use tk for GUI and we have a interpreter reads VB form file ".frm"
in and
display it with tk.You just need to draw forms in VB and save it in
frm formate
load it in your python file
LoadForm("aa.frm")
after that you can use button,menu and so on in python

We use XMLRPC to conmunicate with remote node.XMLRPC is very cool for
you can
invoke a function in remote side in the same way you invoke a local
method.
for example
we have an remote object foo
foo.bar() #invoke bar() in remote side
but XMLRPC is work on network.I'm not sure it can work in serial
2. Must be cross-platform: Linux + Windows. This factor can have a big
impact on whether it is necessary to learn a new language, or stick with
C. If my platform was only Linux I could just learn GTK and be done
with it. I wouldn't be here in that case.

and most important is XMLRPC is cross-platform.you can use a linux for
server and windows for client
 
W

Wayne Brehaut

Wayne Brehaut a écrit :
(snip)

Please reread more carefully the above. I do give credit to Smalltalk's
author for the *term* "OOP", and *most* (not *all*) of the concepts (I
strongly disagree with your opinion that message-passing is not a core
concept of OO).

One problem is that it's often not clear what lists of properties are
his definition of OOP vs. what are the intended properties of
Smalltalk--his intended impelmentation of OOP. Many of the lists begin
with the basic requirements that "everything is an object" and
"objects communicate by message passing", but the most common
"generally agreed upon" definition abstracts just four requirements
from these (changing) lists--attempting to separate implementation
details from what is essential to the underlying framework. As I note
below, these were:

1. modularity (class-based? object-based?)
2. inheritance (sub-classing)
3. encapsulation (information hiding)
4. polymorphism ((sub-) class-specific response to a message, or
processing of a method)

Other details in Kay's lists are considered implementation details,
and important advances or alternatives to pevious methods, but not
required for a language to _be_ OO. It is reputed, though, that in
2003 Kay said
(http://c2.com/cgi/wiki?AlanKaysDefinitionOfObjectOriented) "OOP to
me means only messaging, local retention and protection and hiding of
state-process, and extreme LateBinding of all things."

So I understand your accepting one of Kay's lists as being a
definition of OOP instead of "just" a description of Smalltalk, or of
accepting this fairly recent "definition" as being the true one (as
opposed to the previous lists of usually 6 properties). "It's hard to
hit a moving target!"
FWIW, I first mentionned Simula too (about the state-machine and
simulation aspect), then sniped this mention because I thought it was
getting a bit too much OT - we're not on comp.object here.

Understood--sort of--but there is sufficient accurate information
about Simula available on the web now that it's no longer necessary to
use quotes from Kay about OOP and Smalltalk just because they're more
accessible, as used to be the case. What would be so OT about
referring to Simulain one sentence instead of or in addition to
Smalltalk?

But I digress--my only real objection to your post was your opinion
and claim that Kay "invented the term and most of the concept": I've
never seen anyone claim that anyone else invented the term, but for
the claim that he invented "most of the concept" we need only refer to
Nygaard's claim in "How Object-Oriented Programming Started" at
http://heim.ifi.uio.no/~kristen/FORSKNINGSDOK_MAPPE/F_OO_start.html
that "Simula 67 introduced most of the key concepts of object-oriented
programming: both objects and classes, subclasses (usually referred to
as inheritance) and virtual procedures, combined with safe referencing
and mechanisms for bringing into a program collections of program
structures described under a common class heading (prefixed blocks)."

Combine this with the fact--as stated above by Bonnie MacBird (Alan
Kay's significant other)--that "Alan Kay has always publicly credited
Simula as the direct inspiration for Smalltalk, and... this
implication of taking credit for the first OOP language is not true,
it is a credit assigned to him by others, and one which he usually
rights when confronted with it." If he acknowledges this perhaps
others should too?

As has been noted before, it's often the fact that a cause becomes a
religion: true believers tend to take it over from the originator, and
this religiosity tends to blind them from the facts. Opinions and
rumours become facts, stories are invented, definitions are changed or
twisted, and another religion is born! Even those who don't belong to
the religion cpme to believe the oft-repreated stories, and then help
spread and perpetuate them. (Continuing in my original humorous vein I
was tempted to use terms like "religious zealots", "false gospel",
"propaganda", etc., but thought better of it in case I was again
misunderstood.)

Again, I disagree only with this one claim. You make significant
contributions to the group and to ellucidating Python and OOP to the
great unwashed: in contrast, all I've done so far is complain about
those who don't accept the correct (i.e., my) definition or use of
terms.

wwwayne
 
W

Wayne Brehaut

Wayne Brehaut a écrit :

Not feeling concerned.

(snip pro-simula/anti-Xerox propaganda).

Or, more accurately, pro:

1. Nygaard & Dahl as the inventors of most of the concept of OOP
2. Simula as the first OOP
3. Kay as the originator of the term OOP
4. Kay, Xerox PARC, and Smalltalk as making significant useful
advances in implementation of OOP and "popularizing" it

and anti:

1. attributing credit for any accomplishment to someone who doesn't
himself claim it and even denies it

wwwayne o/o
 
C

Chris Carlen

Hendrik said:
This is the way to go. - Trust me on this.
When you describe your history, it is almost an exact parallel to mine.
In my case, I have been doing real low level stuff (mostly 8031 assembler)
since 1982 or so. And then I found python in a GSM module (Telit), and
I was intrigued.
I really appreciate your comments on OO - it parallels a lot of what I feel
as there is a lot of apparent BS that does not seem to "do anything" at first
sight.
However- for the GUI stuff, there is an easily understood relationship between
the objects and what you see on the screen - so its a great way of getting
into OO - as far as people like you and me will go with it, which is not very
far, as we tend to think in machine instructions...
And for what its worth - you can programme assembler-like python, and it also
works.

The best thing to do is just to spend a few days playing with say Tkinter.
I use a reference from the web written by John W Shipman at New Mexico
Tech - it is succinct and clear, and deserves more widespread publicity.

Google for it - I have lost the link, although I still have the pdf file.
[edit]

Thanks for the tip. The next poster provides the link, which I've got
bookmarked now.

The more I play with Python, the more I like it. Perhaps I will
understand OOP quicker than I thought. What I've learned so far about
names binding to objects instead of values stored in memory cells, etc.
has been interesting and fascinating.



--
Good day!

________________________________________
Christopher R. Carlen
Principal Laser&Electronics Technologist
Sandia National Laboratories CA USA
(e-mail address removed)
NOTE, delete texts: "RemoveThis" and
"BOGUS" from email address to reply.
 
S

Steve Holden

Chris said:
Hendrik said:
This is the way to go. - Trust me on this.
When you describe your history, it is almost an exact parallel to mine.
In my case, I have been doing real low level stuff (mostly 8031 assembler)
since 1982 or so. And then I found python in a GSM module (Telit), and
I was intrigued.
I really appreciate your comments on OO - it parallels a lot of what I feel
as there is a lot of apparent BS that does not seem to "do anything" at first
sight.
However- for the GUI stuff, there is an easily understood relationship between
the objects and what you see on the screen - so its a great way of getting
into OO - as far as people like you and me will go with it, which is not very
far, as we tend to think in machine instructions...
And for what its worth - you can programme assembler-like python, and it also
works.

The best thing to do is just to spend a few days playing with say Tkinter.
I use a reference from the web written by John W Shipman at New Mexico
Tech - it is succinct and clear, and deserves more widespread publicity.

Google for it - I have lost the link, although I still have the pdf file.
[edit]

Thanks for the tip. The next poster provides the link, which I've got
bookmarked now.

The more I play with Python, the more I like it. Perhaps I will
understand OOP quicker than I thought. What I've learned so far about
names binding to objects instead of values stored in memory cells, etc.
has been interesting and fascinating.
I'm happy you are proceeding with so little trouble. Without wishing to
confuse you, however, I should point out that this aspect of Python has
very little to do with its object-orientation. There was a language
called Icon, for example, 20 years ago, that used similar semantics but
wasn't at all object-oriented.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------
 
H

Hendrik van Rooyen

Bruno Desthuilliers said:
My my my... Would you believe that my coworkers do consider me like an
old sage because I started programming in 1990 with HyperTalk on Mac
Classic !-)

I suddenly feel 20 again ! Woo !-)

*hands him a straw boater and a cane*

ok youngster - lets see you strut your stuff...

; - )
 
W

Wolfgang Strobl

Steve Holden said:
I'm happy you are proceeding with so little trouble. Without wishing to
confuse you, however, I should point out that this aspect of Python has
very little to do with its object-orientation. There was a language
called Icon, for example, 20 years ago, that used similar semantics but
wasn't at all object-oriented.

Actually, there was a language called SNOBOL, 40 years ago, that used
similar semantics, developed by Griswold et al. Its object model was
remarkably similar to that of Python without classes. And it even had
dictionaries (called "tables") :).

For an explaination of the concept "variable" in SNOBOL see
<http://www.cacs.louisiana.edu/~mgr/404/burks/language/snobol/catspaw/tutorial/ch1.htm#1.3>

SNOBOLs powerfull patterns still shine, compared to Pythons clumsy
regular expressions. I've used the language a lot in the past, first on
the mainframe (SPITBOL on System/360), later on the PC (Catspaws SNOBOL4
&SPITBOL). When I switched to Python, it wasn't because of the
expressiveness of the language, but of the rich library ("batteries
included") and the IMO elegant syntax, i.e. blocks by identation.

<http://en.wikipedia.org/wiki/SNOBOL>
<http://en.wikipedia.org/wiki/Ralph_E._Griswold>

Icon came later. Griswold developed Icon as a successor to SNOBOL,
constructing it around the concept of generators and co-expressions. I
didn't like it.
 
A

Aahz

SNOBOLs powerfull patterns still shine, compared to Pythons clumsy
regular expressions.

Keep in mind that Python regular expressions are modeled on the
grep/sed/awk/Perl model so as to be familiar to any sysadmin -- but
there's a reason why Python makes it a *library* unlike Perl. So adding
SNOBOL patterns to another library would be a wonderful gift to the
Python community...
 
E

Eddie Corns

Keep in mind that Python regular expressions are modeled on the
grep/sed/awk/Perl model so as to be familiar to any sysadmin -- but
there's a reason why Python makes it a *library* unlike Perl. So adding
SNOBOL patterns to another library would be a wonderful gift to the
Python community...

I don't believe you can get the benefit of SNOBOL matching without direct
language support. There's only so much a library can do. However a valiant
and interesting effort:

http://www.wilmott.ca/python/patternmatching.html

Eddie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,120
Latest member
ShelaWalli
Top