FYI: what's OOP's jargons and complexities?

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

FYI: what's OOP's jargons and complexities?

Petite Abeille
Reply | Threaded
Open this post in threaded view
|

Re: FYI: what's OOP's jargons and complexities?

Mike Pall-50
Hi,

PA wrote:
> http://article.gmane.org/gmane.comp.python.general/384636

Please, read this guy's homepage first before spreading his stuff to other
lists. Parental guidance strongly advised. Funny -- he hates killfiles. :-)
Actually he hates _lots_ of things, except four letter words.

Anyway, there are better articles out there on this topic. Google for
'OOP criticism' or 'OOP debunking'.

Bye,
     Mike

Reply | Threaded
Open this post in threaded view
|

Re: FYI: what's OOP's jargons and complexities?

Petite Abeille
On Jan 29, 2005, at 03:08, Mike Pall wrote:

Please, read this guy's homepage first before spreading his stuff to other
lists.

Sorry about that.

 Parental guidance strongly advised. Funny -- he hates killfiles. :-)
Actually he hates _lots_ of things, except four letter words.

I have to confess that I greatly enjoyed some of is, er, "position papers" 8^)

Anyway, there are better articles out there on this topic. Google for
'OOP criticism' or 'OOP debunking'.

It's not so much about OOP itself, but rather the timing of his post related to my own perverse desire to concoct an OOP system in Lua. I found it very ironic. Therefore my enjoyment.

Sorry for the noise.

Now... if someone could just point me to the right direction and clearly demonstrate how to put the mythical LuaSocket, LTN12 and coroutines sisters all together, I would be "mochu" delighted :))

Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/


Reply | Threaded
Open this post in threaded view
|

RE: FYI: what's OOP's jargons and complexities?

Thiago Bastos-3
> > Please, read this guy's homepage first before spreading his stuff to
> > other
> > lists.
>
> Sorry about that.

Actually, thanks for pointing this "gem" out!

> >  Parental guidance strongly advised. Funny -- he hates killfiles. :-)
> > Actually he hates _lots_ of things, except four letter words.
>
> I have to confess that I greatly enjoyed some of is, er, "position
> papers" 8^)

Me too! Not wanting to start a flame war here, but I must confess that I
sympathize with his political views too. :-)

> It's not so much about OOP itself, but rather the timing of his post
> related to my own perverse desire to concoct an OOP system in Lua. I
> found it very ironic. Therefore my enjoyment.

Careful with that perverse desire... I'm beginning to see a lot of
similarities between you and Xah. :-)

Just kidding!

-- Thiago



Reply | Threaded
Open this post in threaded view
|

RE: FYI: what's OOP's jargons and complexities?

skaller
On Sat, 2005-01-29 at 14:29, Thiago Bastos wrote:
> > > Please, read this guy's homepage first before spreading his stuff to
> > > other
> > > lists.
> >
> > Sorry about that.
> 
> Actually, thanks for pointing this "gem" out!

Lol .. I have no idea if his history is correct,
but his political viewpoint is spot on :)

Unfortunately, from my point of view the analysis
missed the most important point. Well to me anyhow.

OO was touted as a way to find the Holy Grail of
programming -- reuse. Reuse depends on polymorphism,
and polymorphism on abstraction.

The central idea of OO is encapulation, providing
a way to allow functions to abstract the details
of data representation away.

This idea, IMHO, is just fine. If only it worked.

The problem is it does not work. This isn't a waffle
statement about engineering but irrefutable
mathematical fact (search for 'covariance problem')

Roughly speaking you can't do any relations in OO,
and that's 90% of all business problems which it can't
handle. This includes any binary operator such as addition,
So its 99.999999% of all mathematical problems it can't handle :)

Classes work fine only if all the required
method arguments are invariant (eg device driver
writing char vs addition of Number to Number).

-- 
John Skaller, [hidden email]
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net




Reply | Threaded
Open this post in threaded view
|

Re: FYI: what's OOP's jargons and complexities?

Jay Carlson
In reply to this post by Mike Pall-50
On Jan 28, 2005, at 9:08 PM, Mike Pall wrote:

Hi,

PA wrote:
http://article.gmane.org/gmane.comp.python.general/384636

Please, read this guy's homepage first before spreading his stuff to other lists. Parental guidance strongly advised. Funny -- he hates killfiles. :-)
Actually he hates _lots_ of things, except four letter words.

In the business, we call this an ad hominem argument.

I'm having to dig deeper for machine names. The iMac was style-over-substance; this Mac mini is appeal-to-pity.

if you'd like to wade into the rhetoric, head over to http://www.oreillynet.com/pub/wlg/6291 , where people are fighting over bogus methodologies for benchmarks for XML processing in Python. Something is wrong when even lazykit is orders of magnitude faster than Uche's code, which is well-regarded in the Python world. No wonder people think XML is bloated and slow.

Jay


Reply | Threaded
Open this post in threaded view
|

Re: FYI: what's OOP's jargons and complexities?

Petite Abeille
In reply to this post by Thiago Bastos-3

On Jan 29, 2005, at 04:29, Thiago Bastos wrote:

Me too! Not wanting to start a flame war here, but I must confess that I
sympathize with his political views too. :-)

"The world according to the United States of America"

http://xahlee.org/Periodic_dosage_dir/_p/usa.jpg

Brasil will be quite conveniently known as "Coffee" from now on and the Argentinean pampa as "Jungle" 8^)

Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/


Reply | Threaded
Open this post in threaded view
|

Re: FYI: what's OOP's jargons and complexities?

Petite Abeille
In reply to this post by Jay Carlson

On Jan 29, 2005, at 06:49, Jay Carlson wrote:

No wonder people think XML is bloated and slow.

This comes rather as a shock to me:

http://www.eod.com/devil/archive/xml.html

Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/


Reply | Threaded
Open this post in threaded view
|

Re: FYI: what's OOP's jargons and complexities?

Adrian Sietsma
"putting angle brackets around everything is not a technology, by itself"
- someone on the web

Adrian


Reply | Threaded
Open this post in threaded view
|

Re: FYI: what's OOP's jargons and complexities?

duck
> "putting angle brackets around everything is not a technology, 
>by itself"

But, errrr, technologies like XML *put angle brackets round some 
things, and not others*. This makes an important difference!

(Not least that consultants and contractors who charge by the angle 
bracket get to litter there work with more of them than a simple "two 
angle brackets per object" model.)



Reply | Threaded
Open this post in threaded view
|

Lua+XML = forced love? (Re: FYI: what's OOP's jargons and complexities?)

Asko Kauppi-3

Instead of fighting the XML world, I think it'd be best for Lua to be recognized as an "integrates well with XML" product. I mean, reading in XML _seamlessly_ into Lua tables, and output, too.

I will be needing this shortly, since working with XML in C is .. tedious. Anyone care to promote their favorite XML binding, I'll be listening. :)

ps. it wouldn't hurt if this kind of functionality was even one of the standard libraries.
-ak


30.1.2005 kello 13:16, duck kirjoitti:

 "putting angle brackets around everything is not a technology,
by itself"

But, errrr, technologies like XML *put angle brackets round some
things, and not others*. This makes an important difference!

(Not least that consultants and contractors who charge by the angle
bracket get to litter there work with more of them than a simple "two
angle brackets per object" model.)




Reply | Threaded
Open this post in threaded view
|

Re: Lua+XML = forced love? (Re: FYI: what's OOP's jargons and complexities?)

Petite Abeille

On Jan 30, 2005, at 12:34, Asko Kauppi wrote:

You surely meant "Lua+XML = unnatural love?" 8^)

Instead of fighting the XML world, I think it'd be best for Lua to be recognized as an "integrates well with XML" product. I mean, reading in XML _seamlessly_ into Lua tables, and output, too.

"Resistance if futile, you will be assimilated"
-- The Borg

I will be needing this shortly, since working with XML in C is .. tedious. Anyone care to promote their favorite XML binding, I'll be listening. :)

Looks like there is a Expat binding:

http://luaforge.net/projects/luaexpat/

SAX if rather low level, but perhaps that would work for you?

Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/


Reply | Threaded
Open this post in threaded view
|

Re: Lua+XML = forced love? (Re: FYI: what's OOP's jargons and complexities?)

Asko Kauppi-3

What I mean by 'seamless' is really, truly, that. Like dofile( "mydata.xml" ) and getting a Lua table returned. Hmm.. anyone up for it?


30.1.2005 kello 13:47, PA kirjoitti:


On Jan 30, 2005, at 12:34, Asko Kauppi wrote:

You surely meant "Lua+XML = unnatural love?" 8^)

Instead of fighting the XML world, I think it'd be best for Lua to be recognized as an "integrates well with XML" product. I mean, reading in XML _seamlessly_ into Lua tables, and output, too.

"Resistance if futile, you will be assimilated"
-- The Borg

I will be needing this shortly, since working with XML in C is .. tedious. Anyone care to promote their favorite XML binding, I'll be listening. :)

Looks like there is a Expat binding:

http://luaforge.net/projects/luaexpat/

SAX if rather low level, but perhaps that would work for you?

Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/



Reply | Threaded
Open this post in threaded view
|

Re: Lua+XML = forced love? (Re: FYI: what's OOP's jargons and complexities?)

Erik Hougaard
Hey Guys,

Please search the archives, Roberto posted a xml parser written awhile back and Steve Dekorte also worte something.

/Erik

Asko Kauppi wrote:


What I mean by 'seamless' is really, truly, that. Like dofile( "mydata.xml" ) and getting a Lua table returned. Hmm.. anyone up for it?


30.1.2005 kello 13:47, PA kirjoitti:


On Jan 30, 2005, at 12:34, Asko Kauppi wrote:

You surely meant "Lua+XML = unnatural love?" 8^)

Instead of fighting the XML world, I think it'd be best for Lua to be recognized as an "integrates well with XML" product. I mean, reading in XML _seamlessly_ into Lua tables, and output, too.


"Resistance if futile, you will be assimilated"
-- The Borg

I will be needing this shortly, since working with XML in C is .. tedious. Anyone care to promote their favorite XML binding, I'll be listening. :)


Looks like there is a Expat binding:

http://luaforge.net/projects/luaexpat/

SAX if rather low level, but perhaps that would work for you?

Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/





Reply | Threaded
Open this post in threaded view
|

Re: Lua+XML = forced love? (Re: FYI: what's OOP's jargons and complexities?)

Erik Hougaard
And that would be "written IN LUA"

Erik Hougaard wrote:

Hey Guys,

Please search the archives, Roberto posted a xml parser written awhile back and Steve Dekorte also worte something.

/Erik

Asko Kauppi wrote:


What I mean by 'seamless' is really, truly, that. Like dofile( "mydata.xml" ) and getting a Lua table returned. Hmm.. anyone up for it?


30.1.2005 kello 13:47, PA kirjoitti:


On Jan 30, 2005, at 12:34, Asko Kauppi wrote:

You surely meant "Lua+XML = unnatural love?" 8^)

Instead of fighting the XML world, I think it'd be best for Lua to be recognized as an "integrates well with XML" product. I mean, reading in XML _seamlessly_ into Lua tables, and output, too.



"Resistance if futile, you will be assimilated"
-- The Borg

I will be needing this shortly, since working with XML in C is .. tedious. Anyone care to promote their favorite XML binding, I'll be listening. :)



Looks like there is a Expat binding:

http://luaforge.net/projects/luaexpat/

SAX if rather low level, but perhaps that would work for you?

Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/







Reply | Threaded
Open this post in threaded view
|

Re: Lua+XML = forced love? (Re: FYI: what's OOP's jargons and complexities?)

Javier Guerra Giraldez
In reply to this post by Asko Kauppi-3
On Sunday 30 January 2005 7:19 am, Asko Kauppi wrote:
> What I mean by 'seamless' is really, truly, that.  Like dofile(
> "mydata.xml" ) and getting a Lua table returned.  Hmm.. anyone up for
> it?

easy (with luaexpat):

require "compat-5.1"
require "lxp.lom"

xmltable = lxp.lom.parse (io.open ("xmlfile.xml","r"):lines ())

done!

-- 
Javier

Attachment: pgpDPuLAVIhir.pgp
Description: PGP signature

Reply | Threaded
Open this post in threaded view
|

Re: Lua+XML = forced love? (Re: FYI: what's OOP's jargons and complexities?)

Asko Kauppi-3

ok. Can I also modify the table, then save it back..? ;)


30.1.2005 kello 16:21, Javier Guerra kirjoitti:

 On Sunday 30 January 2005 7:19 am, Asko Kauppi wrote:
What I mean by 'seamless' is really, truly, that.  Like dofile(
"mydata.xml" ) and getting a Lua table returned.  Hmm.. anyone up for
it?

easy (with luaexpat):

require "compat-5.1"
require "lxp.lom"

xmltable = lxp.lom.parse (io.open ("xmlfile.xml","r"):lines ())

done!

--
Javier


Reply | Threaded
Open this post in threaded view
|

Re: Lua+XML = forced love? (Re: FYI: what's OOP's jargons and complexities?)

Javier Guerra Giraldez
On Sunday 30 January 2005 9:47 am, Asko Kauppi wrote:
> ok. Can I also modify the table, then save it back..? ;)

that's a bit longer, here's what i use for output:


local function attrstostr (a)
 local out = {}
 for i,attr in ipairs (a) do
  table.insert (out, string.format ('%s = "%s"', attr,  a[attr]))
 end
 return table.concat (out, " ")
end

function lomtoxml (x, of)
 of = of or print

 if type (x) == "string" then
  return of (x)
 end

 local attrs = ""
 -- does it have any attributes?
 if x.attr [1] then
  attrs = " " .. attrstostr (x.attr)
 end
 
 -- is there any content?
 if x[1] then
  of ("<" .. x.tag .. attrs .. ">")
  for i in ipairs (x) do
   lomtoxml (x[i], of)
  end
  of ("</".. x.tag .. ">")
 else
  of ("<" .. x.tag .. attrs .. "/>")
 end
end



-- 
Javier

Attachment: pgpb47R8_DNag.pgp
Description: PGP signature

Reply | Threaded
Open this post in threaded view
|

Re: Lua+XML

Adrian Sietsma
In reply to this post by Asko Kauppi-3
Asko Kauppi wrote:

What I mean by 'seamless' is really, truly, that. Like dofile( "mydata.xml" ) and getting a Lua table returned. Hmm.. anyone up for it?

i wrote one in my early lua days, which does about that.
from memory i think it also allowed xpath syntax.

if you want that as-is to see if it suits, i can mail it to you.

(from my earlier post)

<QUOTE>
this one is a sax-type callback parser, which can
1/ parse (but not interpret) embedded DTD's
2/ handle html-type naked and value-less attributes
3/ handle html-type overlapping tags (sort-of)

i ported this because it is block-based, maintaining state between calls, so you can parse an xml stream as a sequence of chunks.
approx 26 kb of source (not production quality, yet)
</QUOTE>

Adrian

Reply | Threaded
Open this post in threaded view
|

RES: what's OOP's jargons and complexities?

André de Leiradella
In reply to this post by Petite Abeille
> http://article.gmane.org/gmane.comp.python.general/384636

Quoting Xah:

	"This style of programing and language have 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 creates these meta-subroutine "Classes". Everything one do
are inside Classes. And one assign variables inside these Classes to
create "Objects". And one uses "Methods" to manipulate Objects. In this
fashion, even data types like numbers, strings, and lists are no longer
atomic data types. They are now Classes."

He clearly lacks a deeper knowledge of Java. Java has 8 basic types:
booleans, bytes, chars, shorts, ints, longs, floats and doubles. Those
types aren't instances of any class and the JVM has dedicated opcodes to
deal with them. The plus operator isn't a method from a "Number" class,
it's just an operator implemented with opcodes like iadd, ladd, dadd...
I wrote a VM for Java, so trust me on that.

The classes that wrap the basic types were written because many methods
of many Java classes take an Object as an argument, for instance the
Hashtable class and the type of it's keys and values. How does one use
the Hashtable with integer keys? Wrapping an int with an Integer
instance. I don't like it as every interaction with this Hashtable will
have lots of "new Integer(id)", but if Java used dynamic types, that
need would go away.

	"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 data."
	
String manipulation is even harder on other languages, I think everyone
on this list know how "strings" in C are manipulated.

	"becomes in pure OOP languages:

	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());
	}
	}"
	
In C it would be:

int main(int argc, char argv[]) {
	char a[] = "a string";
	char b[] = "another one";
	char *c;
	
	c = malloc(strlen(a) + strlen(b) + 1);
	strcpy(c, a);
	strcat(c, b);
	return 0;
}

I think Java, considering it being a strongly typed language, does it
better.

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

	Instead of

	aNumber = 3;
	print aNumber^3;

	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.)"
	
Wrong.

class Test {
	public static void main(String[] args) {
		double aNumber = 3;
		System.out.println(Math.pow(aNumber, 3));
	}
}

Changing the type of the number can be hard if the type is used across
an entire application (like changing Lua to use ints instead of
doubles).

	"because of psychological push for purity, in Java there are no
longer plain subroutines. Everything is a method of some class. Standard
functions like opening a file, square root a number, for loop thru a
list, if else branching statements, or simple arithmetic operations...
must now some how become a method of some class. In this way, the OOP
Hierarchy is born.
	
	Basic data types such as now the various classes of numbers, are
now grouped into a Number class hierarchy, each class having their own
set of methods. The characters, string or other data types, are lumped
into one hierarchy class of data types. Many types of lists (variously
known as arrays, vectors, lists, hashes...), are lumped into a one
hierarchy, with each node Classe having their own set methods as
appropriate. Math functions, are lumped into some math class hierarchy."
	
Whow, this guy knows nothing about Java. Again, basic types are just
basic types, their respective classes are just wrappers with specific
usages. And the Math class is just a bunch of methods grouped and anyone
can write Math.sin(o) or Math.sqrt(a). Doesn't Lua do the same?
Modularity is good.

What about if/else branches? There are many opcodes to compare/branch in
the JVM, and how could a method you call cause a jump to a different
place in the callee?

	"Now suppose the plus operation +, where does it go? Should it
become methods of the various classes under Number headings, or should
it be methods of the Math class set? Each language deals with these
issues differently. As a example, see this page for the hierarchy of
Java's
core language classes:
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/package-tree.html";

In neither of them. Operators are implemented as opcodes.

	"But now with the pure OOP style, there can no longer be just a
number or this_file path, because everything now must be a Object. So,
the "this_file", usually being just a string representing the path to a
file on the disk, is now some "file object". Initiated by something like

	this_file = new File("path to file");

	where this file class has a bunch of methods such as reading or
writing to it.

	see this page for the complexity of the IO tree
	
http://java.sun.com/j2se/1.4.2/docs/api/java/io/package-tree.html

	see this page for the documentation of the File class itself,
along with its 40 or so methods and other things.
http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html";
	
Compare it with the minimal approach of C. What happens is that Java is
bloated with classes to "help" programmers do their job. Do you want to
read from memory (a byte array) instead of a file? Use a
ByteArrayInputStream. Do you want to write objects to make them
persistent across runs? Use a DataOutputStream. You can even combine
things and write an object to memory...

	"Tomorrow i shall cover more manmade jargons and complexities
arising out of the OOP hype, in particular Java."
	
Then he should buy himself a good Java book and perhaps read the JVM
Specification...

There is just one point in which I agree with Xah: reusability. OOP
languages are as good with reusability as are their programmers. But
that's not a problem with OOP. Libraries are sets of functions and
procedures related to each other, tied together in some way. But how
many times you dreamed about a library having just one more function or
characteristic? It's hard to satisfy everyone. (humm... Lua is a library
that implements a embeded script language, I wish I could do OOP with it
;)

I think what makes OOP good is encapsulation (do you see or *want to*
see OpenGL's internals while using it's functions?), specialization
(which you can use to extend functionality to add something you miss
without having to have access to the class or module being extended, and
requires inheritance of course) and polymorphism (which let's you
combine classes to do things in a way that is very hard to do in non-OOP
languages, such as reading data from a socket, from a file, from a pipe
or from memory, where that data could be compressed or not, using the
same methods for all of them).

Sorry for this OT post, but Xah claims deserved an explanation before
everyone starts thinking that OOP is a bad thing per se.

And please don't get me wrong, just because I like Java it doesn't mean
I wish to see Lua with all those classes, I just want to *be able* to
build my own class tree to match my needs.

Regards,

Andre


12