[Ilugc] [TIP] perl tutorial XIII (some OO)

  • From: thescriptdevil@xxxxxxxxx (Ashok Gautham)
  • Date: Fri, 16 Dec 2011 11:54:22 +0530

On Fri, Dec 16, 2011 at 11:29:14AM +0530, Girish Venkatachalam wrote:

In fact Objective C used in apple products is supposed to be  C with OO.
[personalOpinion]
Objective C is a completely different language. While the goal was to
add OO to C, the syntax seems foreign to me. I find it strange that
you chose Objective C over C++ to demonstrate Object Orientation added
to C :P
[/personalOpinion]

But even without that, just plain ANSI C can do OO albeit in a crude
  way.
Yes. :D There is a complete (free) book about it.
http://www.cs.rit.edu/~ats/books/ooc.pdf
 
In higher level languages the only data structure people use by
default is a string.
Everything in higher level scripting languages is a string.

Isn't this Perl specific? Are you referring to the weakly typed nature
of some scripting languages? Lists, dictionaries and even tuples
and Sets are used very frequently in Python

Anyway now a hash table or a hash or a dictionary or an associative
array or a structure is nothing but a bunch of
 key value pairs.

A key can be just a name , in the case of C it is a variable name;

Uh? Where in C is a variable name a first-class type? Do you mean a
symbol-type in lisp-esque languages (and I suppose it is something
similar in Perl)?

You hide what is inside the object by a reference, since it is just
like a C pointer. It can hold any address.

Minus the dangerous pointer arithmetic?

The other aspect of an object is the lack of order. No sequencing.
This is also true of hash tables. No ordering.

In hash tables, this is true because the hashing function (ideally)
should distribute the keys uniformly. Is it true for any object?
 
Today we have seen a lot of theory.
Tomorrow we will see some real OO examples.

Great. Sorry if some of the issues I raised here betrayed my
ignorance. I am just trying to get things a little clearer. I am a
Perl noob but am comfortable in other scripting languages like Lua,
Ruby and Py.

---
Ashok Gautham

Other related posts: