From: Xah Lee
Subject: What are OOP's Jargons and Complexities
Date: 
Message-ID: <1175180497.362830.285710@y80g2000hsf.googlegroups.com>
What are OOP's Jargons and Complexities

Xah Lee, 20050128

Classes, Methods, Objects

In computer languages, often a function definition looks like this:

subroutine f (x1, x2, ...) {
  variables ...
  do this or that
}

In advanced languages such as LISP family, it is not uncommon to
define functions inside a function. For example:

subroutine f (x1, x2, ...) {
  variables...
  subroutine f1 (x1...) {...}
  subroutine f2 (x1...) {...}
}

Often these f1 f2 inner functions are used inside f, and are not
relevant outside of f. Such power of the language gradually developed
into a style of programing. For example:

subroutine a_surface () {
  coordinatesList = ...;
  subroutine translate (distance) {...}
  subroutine rotate (angle) {..}
}

Such a style is that the a_surface is no longer viewed as a function.
But instead, a boxed set of functions, centered around a piece of
datum. And, all functions for manipulating this piece of datum are all
embodied in this function. For example:

subroutine a_surface (arg) {
  coordinatesList = ...
  subroutine translate (distance) {set coordinatesList to translated
version}
  subroutine rotate (angle) {set coordinatesList to rotated version}
  subroutine return () {return coordinatesList}

  if (no arg) {do nothing}
    else { apply arg to coordinatesList }
}

In this way, one uses a_surface as a piece of datum that are bundled
with its own set of functions:

mySurface = a_surface           // assign subroutine to a variable
mySurface(rotate(angle))        // now the surface datum has been
rotated
mySurface(translate(distance))  // now its translated
newSurface = mySurface(return())

So now, a_surface is no longer viewed as a subroutine, but a boxed set
of things centered around a piece of datum. All functions that work on
the datum are included in the boxed set. This paradigm possible in
functional languages has refined so much so that it spread to other
groups and became known as Object Oriented Programing, and complete
languages with new syntax catered to such scheme emerged.

In such languages, instead of writing them like this:

mySurface = a_surface;
mySurface(rotate(angle));

the syntax is changed to like this, for example:

mySurface = new a_surface();
mySurface.rotate(angle);

In such languages, the super subroutine a_surface is no longer called
a function or subroutine. It is now called a “Class”. And now the
variable holding the function "mySurface" is now called a “Object”.
Subroutines inside the function a_surface are no longer called inner-
subroutines. They are called “Methods”. The act of assigning a super-
subroutine to a variable is called instantiation.

This style of programing and language has become so fanatical that in
such dedicated languages like Java, everything in the language are
Classes. One can no longer just define a variable or subroutine.
Instead, one defines these super-subroutines (classes) that has inner-
subroutines (methods). Every line of code are now inside such super-
subroutine. And one assigns subroutines to variables inside other
subroutines to create objects. And one calls inner-subroutines
(methods) thru these “object” variables to manipulate the data defined
in the super-subroutine. In this fashion, even basic primitives like
numbers, strings, and lists are no longer atomic entities. They are
now subroutines with inner-subroutines.

For example, in Java, a string is a class String. And inside the class
String, there are Methods to manipulate strings, such as finding the
number of chars, or extracting parts of the string. This can get very
complicated. For example, in Java, there are actually two Classes of
strings: One is String, and the other is StringBuffer. Which one to
use depends on whether you intend to change the datum.

So, a simple code like this in normal languages:

a = "a string";
b = "another one";
c = join(a,b);
print c;

or in lisp style

(set a "a string")
(set b "another one")
(set c (join a b))
(print c)

becomes in Java:

public class test {
  public static void main(String[] args) {
    String a = new String("a string");
    String b = new String("another one");
    StringBuffer c = new StringBuffer(40);
    c.append(a); c.append(b);
    System.out.println(c.toString());
    }
}

Here, the “new String” creates a String object. The “new
StringBuffer(40)” creates the changeable string object StringBuffer,
with room for 40 chars. “append” is a method of StringBuffer. It is
used to join two Strings.

Notice the syntax “c.append(a)”, which we can view it as calling a
inner-subroutine “append”, on a super-subroutine that has been
assigned to c, where, the inner-subroutine modifies the inner datum by
appending the value of a to it.

And in the above Java example, StringBuffer class has another method
“toString()” used to convert this into a String Class, necessary
because System.out.println's parameter requires a String type, not
StringBuffer.

For a example of the complexity of classes and methods, see the Java
documentation for the StringBuffer class at
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/StringBuffer.html
(local copy)

In the same way, numbers in Java have become a formalization of many
classes: Double, Float, Integer, Long... and each has a collection of
“methods” to operate or convert from one to the other.

Instead of

aNumber = 3;
print aNumber^2;

In Java the programer needs to master the ins and outs of the several
number classes, and decide which one to use. (and if a program later
needs to change from one type of number to another, it is often
cumbersome.)

This Object Oriented Programing style and dedicated languages (such as
C++, Java) have become a fad like wild fire among the programing mass
of ignoramuses in the industry. Partly because of the data-centric new
perspective, partly because the novelty and mysticism of new syntax
and jargonization.

It is especially hyped by the opportunist Sun Microsystems with the
inception of Java, internet, and web applications booms around 1995.
At those times, OOP (and Java) were thought to revolutionize the
industry and solve all software engineering problems, in particular by
certain “reuse of components” concept that was thought to come with
OOP. (we will cover the “reuse” issue in the inheritance section
later.)

As part of this new syntax and purity, where everything in a program
is of Classes and Objects and Methods, many complex issues and concept
have arisen in OOP from both the OOP language machinery as well as a
engineering practice.

We now know that the jargon Class is originally and effectively just a
boxed set of data and subroutines, all defined inside a subroutine.
And the jargon Object is just a variable that has been set to this
super-subroutine. And the inner-subroutines are what's called Methods.

-----------
The above is a excerpt from the article
“What are OOP's Jargons and Complexities”.
The full article is available at
http://xahlee.org/Periodic_dosage_dir/t2/oop.html

  Xah
  ···@xahlee.org
∑ http://xahlee.org/

From: James Stroud
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <euhir1$ksq$1@daisy.noc.ucla.edu>
This idiot is a troll. This idiot is a troll. ThThis idiot is a troll. 
This idiot is a troll. is idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll. This 
idiot is a troll. This idiot is a troll. This idiot is a troll.
From: Mirco Wahab
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <euhm8b$7r8$1@mlucom4.urz.uni-halle.de>
James Stroud wrote:

there's a serious bug waiting here

> This idiot is a troll. This idiot is a troll. ThThis idiot is a troll. 
> This idiot is a troll. is idiot is a troll. This idiot is a troll. This 

Remember, rockets went back to earth on such things (in pieces) ...

> idiot is a troll. This idiot is a troll. This idiot is a troll. This 

better use Xah's "functional paradigm" combined
with his most hated religion instead:


     print "This idiot is a troll. " x 42



Regards & f'up c.l.java.p

Mirco
From: Jon Harrop
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <460c30b1$0$8750$ed2619ec@ptn-nntp-reader02.plus.net>
Xah Lee wrote:
> As part of this new syntax and purity, where everything in a program
> is of Classes and Objects and Methods, many complex issues and concept
> have arisen in OOP from both the OOP language machinery as well as a
> engineering practice.

I think the fact that many design patterns from OOP are redundant in the
presence of functional programming is very interesting. I'd like to see
more written about this, not least because it would serve as an excellent
introduction to functional programming for the majority of programmers who
are versed only in object orientation (primarily C++, Java and C#
programmers).

There is an old paper on the GOF's OOP design patterns implemented in OCaml
but it was not written by OCaml-savvy programmers and contained many errors
and omissions. Perhaps the Lisp community have generated something better?

Also, pattern matching is fundamental to many modern functional programming
languages. Here, pattern matching is often the only way to manipulate
concrete data structures and often results in code that is both faster and
more concise than any object-oriented equivalent. I recently gave the
example of a small symbolic simplifier written in OCaml/F# that is
difficult and tedious to translate into many other languages efficiently
(including C++, Java, C# and even Lisp).

-- 
Dr Jon D Harrop, Flying Frog Consultancy
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet
From: Uri Guttman
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <x7odmbbtdl.fsf@mail.sysarch.com>
please DO NOT EVER followup xah's posts into comp.lang.perl.misc. he is
not wanted there and is considered a troll. he hates perl so why he
crossposts there is a question. if you want to followup, post only in
your own group. keep him and his useless threads out of c.l.p.misc.

uri

-- 
Uri Guttman  ------  ···@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org
From: Lew
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <OqmdnRDEgr8cppHbnZ2dnUVZ_u_inZ2d@comcast.com>
Uri Guttman wrote:
> please DO NOT EVER followup xah's posts into comp.lang.perl.misc. he is
> not wanted there and is considered a troll. he hates perl so why he
> crossposts there is a question. if you want to followup, post only in
> your own group. keep him and his useless threads out of c.l.p.misc.

We've heard similar reports about Xah Lee on other newsgroups as well.

-- Lew
From: Mike Schilling
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <Fo2Ph.12350$Um6.9109@newssvr12.news.prodigy.net>
Xah Lee wrote:

> So, a simple code like this in normal languages:
>
> a = "a string";
> b = "another one";
> c = join(a,b);
> print c;
>
> or in lisp style
>
> (set a "a string")
> (set b "another one")
> (set c (join a b))
> (print c)
>
> becomes in Java:
>
> public class test {
>   public static void main(String[] args) {
>     String a = new String("a string");
>     String b = new String("another one");
>     StringBuffer c = new StringBuffer(40);
>     c.append(a); c.append(b);
>     System.out.println(c.toString());
>     }
> }
>

Only when written by someone almost entirely ignorant of Java. 
From: Timofei Shatrov
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <460cc83a.2652073@news.readfreenews.net>
On Fri, 30 Mar 2007 06:48:05 GMT, "Mike Schilling" <···············@hotmail.com>
tried to confuse everyone with this message:

>Xah Lee wrote:
>
>> So, a simple code like this in normal languages:

>> becomes in Java:
>>
>>
>
>Only when written by someone almost entirely ignorant of Java. 
>

Which is the state most people want to be in...

-- 
|Don't believe this - you're not worthless              ,gr---------.ru
|It's us against millions and we can't take them all... |  ue     il   |
|But we can take them on!                               |     @ma      |
|                       (A Wilhelm Scream - The Rip)    |______________|
From: Lew
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <kKCdnbCHbYqwlpDbnZ2dnUVZ_oDinZ2d@comcast.com>
Timofei Shatrov wrote:
> On Fri, 30 Mar 2007 06:48:05 GMT, "Mike Schilling" <···············@hotmail.com>
> tried to confuse everyone with this message:
> 
>> Xah Lee wrote:
>>
>>> So, a simple code like this in normal languages:
> 
>>> becomes in Java:
>>>
>>>
>> Only when written by someone almost entirely ignorant of Java. 
>>
> 
> Which is the state most people want to be in...

As a particular case of the general proposition that most people want to be 
ignorant of computer programming.

-- Lew
From: Mike Schilling
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <mEbPh.10505$JZ3.8847@newssvr13.news.prodigy.net>
Timofei Shatrov wrote:
> On Fri, 30 Mar 2007 06:48:05 GMT, "Mike Schilling"
> <···············@hotmail.com> tried to confuse everyone with this
> message:
>
>> Xah Lee wrote:
>>
>>> So, a simple code like this in normal languages:
>
>>> becomes in Java:
>>>
>>>
>>
>> Only when written by someone almost entirely ignorant of Java.
>>
>
> Which is the state most people want to be in...

Most of them have the brains not to display their ignorance so widely. 
From: Arved Sandstrom
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <QcmPh.29531$x9.22267@edtnps89>
"Timofei Shatrov" <····@mail.ru> wrote in message 
·····················@news.readfreenews.net...
> On Fri, 30 Mar 2007 06:48:05 GMT, "Mike Schilling" 
> <···············@hotmail.com>
> tried to confuse everyone with this message:
>
>>Xah Lee wrote:
>>
>>> So, a simple code like this in normal languages:
>
>>> becomes in Java:
>>
>>Only when written by someone almost entirely ignorant of Java.
>>
>
> Which is the state most people want to be in...

Which based on what I've seen, is the state that most Java programmers are 
in. They'd have no idea why Mike said what he did.

AHS 
From: Lew
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <RPadne6QN55UGZPbnZ2dnUVZ_hKdnZ2d@comcast.com>
Arved Sandstrom wrote:
> "Timofei Shatrov" <····@mail.ru> wrote in message 
> ·····················@news.readfreenews.net...
>> On Fri, 30 Mar 2007 06:48:05 GMT, "Mike Schilling" 
>> <···············@hotmail.com>
>> tried to confuse everyone with this message:
>>
>>> Xah Lee wrote:
>>>
>>>> So, a simple code like this in normal languages:
>>>> becomes in Java:
>>> Only when written by someone almost entirely ignorant of Java.
>>>
>> Which is the state most people want to be in...
> 
> Which based on what I've seen, is the state that most Java programmers are 
> in. They'd have no idea why Mike said what he did.

what EVerrr!

-- Lew
From: bugbear
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <460cca34$0$8723$ed2619ec@ptn-nntp-reader02.plus.net>
Xah Lee wrote:

> So, a simple code like this in normal languages:
> 
> a = "a string";
> b = "another one";
> c = join(a,b);
> print c;
> 
> or in lisp style
> 
> (set a "a string")
> (set b "another one")
> (set c (join a b))
> (print c)
> 
> becomes in Java:
> 
> public class test {
>   public static void main(String[] args) {
>     String a = new String("a string");
>     String b = new String("another one");
>     StringBuffer c = new StringBuffer(40);
>     c.append(a); c.append(b);
>     System.out.println(c.toString());
>     }
> }

Er. How about

public class test {
   public static void main(String[] args) {
     String a = "a string";
     String b = "another one";
     StringBuffer c = a + b;
     System.out.println(c);
     }
}

Alternatively I could recode your Lisp example
as badly as you coded your Java.

   BugBear
From: Lew
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <kKCdnbOHbYrklpDbnZ2dnUVZ_oDinZ2d@comcast.com>
Xah Lee wrote:
>> public class test {
>>   public static void main(String[] args) {
>>     String a = new String("a string");
>>     String b = new String("another one");
>>     StringBuffer c = new StringBuffer(40);
>>     c.append(a); c.append(b);
>>     System.out.println(c.toString());
>>     }
>> }
> 
> Er. How about
> 
> public class test {
>   public static void main(String[] args) {
>     String a = "a string";
>     String b = "another one";
>     StringBuffer c = a + b;
>     System.out.println(c);
>     }
> }

bugbear wrote:
> Alternatively I could recode your Lisp example
> as badly as you coded your Java.

 From what I've seen and heard of Xah Lee, you'd probably lose the bad-coding 
competition to him. He's a professional.

-- Lew
From: Mike Schilling
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <SFbPh.10507$JZ3.490@newssvr13.news.prodigy.net>
bugbear wrote:
> Er. How about
>
> public class test {
>   public static void main(String[] args) {
>     String a = "a string";
>     String b = "another one";
>     StringBuffer c = a + b;

String c (etc.), that is.

>     System.out.println(c);
>     }
> }
From: Arved Sandstrom
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <DgmPh.29532$x9.17555@edtnps89>
"Mike Schilling" <···············@hotmail.com> wrote in message 
························@newssvr13.news.prodigy.net...
> bugbear wrote:
>> Er. How about
>>
>> public class test {
>>   public static void main(String[] args) {
>>     String a = "a string";
>>     String b = "another one";
>>     StringBuffer c = a + b;
>
> String c (etc.), that is.

My answer, Mike. Since there was never any need for variables "a" and "b" to 
be separate, I'd just be blatting out

System.out.println("a stringanother one");

as the solution to this particular problem. It's just a confuscated Hello 
World.

AHS 
From: Michele Dondi
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <oqks03h3h5tldjodga4and8ua3hej6a1uq@4ax.com>
On Fri, 30 Mar 2007 09:28:36 +0100, bugbear
<·······@trim_papermule.co.uk_trim> wrote:

>Er. How about
>
>public class test {
>   public static void main(String[] args) {
>     String a = "a string";
>     String b = "another one";
>     StringBuffer c = a + b;
>     System.out.println(c);
>     }
>}

Even better: pick one entry of your choice from

http://images.google.com/images?q=%22don%27t+feed+the+troll%22


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
From: Lew
Subject: Re: What are OOP's Jargons and Complexities
Date: 
Message-ID: <RPadnemQN54rGJPbnZ2dnUVZ_hKdnZ2d@comcast.com>
Michele Dondi wrote:
> Even better: pick one entry of your choice from
> 
> http://images.google.com/images?q=%22don%27t+feed+the+troll%22

I pick <http://img371.imageshack.us/img371/8263/noah7ok6rh.jpg/>

-- Lew