by Anonymous Coward writes:
on Friday November 30, 2001 @10:19PM (#2639761)
If you haven't looked at Ruby yet it's @ www.ruby-lang.org it's a beautifully done object oriented scripting language which IMHO is exactly what the computer industry needs. Other scripting languages have really hit a wall in development because of the objectless syntax, but ruby, is a piece of work.
Object orientation is the semantics. Semantics
is tied to syntax, but not to any particular syntax; there is no ``object oriented syntax''. Syntax allows you to group some expressions together to express some semantic relationship.
Languages hit the wall when they have a hard-wired syntax, with hard-wired semantics.
Ruby is no exception. It's a whole lot of syntactic sugar for a bunch of non-programmable semantics. It was obsolete before it was conceived. Moreover, the author has a very limited view of what object oriented programming is, and suffers from a fundamental confusion that OO is somehow syntactically determined. This if from one of his slides:
//OOP
fi = File::new("sample.dat", "r")
fi.binmode = true
line = fi.readline()
fi.close
// Non-OOP
fi = fopen("sample.dat", "r")
fbinmode(fi, true)
line = freadline(fi)
fclose(fi)
So, in other words, something is object oriented if it uses the notation object.method(arg), but not object oriented if it uses the notation method(object, arg). Is this guy for real?
It takes a certain level of experience to see through the facade of curly braces, vertical bars, squiggles, splats, hashes, cokebottles and whatnot. Such devices, despite looking impressively cryptic and terse, do not imply any special power; they are designed to dazzle and seduce the undergraduate mind.
The real power arises when the same expression, whether it uses lots of syntactic sugar or not, can mean absolutely anything that the programmer wants, not only what the language designer wants it to mean.
Your complaint about Ruby seem to apply to many other languages. I am curious to know what languages, in your opinion, do not have the weaknesses you describe. I would also be very interested to know why you believe these lanuages to be better.
I'm not trying to belittle your complaint, I'm genuinly interested in having a look at better programming languages.
The usual argument for "OO syntax" is that the non-OO syntax for what is in reality an object (the file fi) "pollutes the name space" (creates lots of names of things at the global level).
That is really just a lexical problem of symbol management. Global symbol clashes are avoided by the use of packages. Lexical scoping has little or nothing to do with object orientation. Using C to emulate object oriented programming suffers from that problem because C has no namespaces or packages; programmers resort to conventions like adding a common prefix to related identifiers.
The real power arises when the same expression, whether it uses lots of syntactic sugar or not, can mean absolutely anything that the programmer wants, not only what the language designer wants it to mean.
Gee, does the compilier or interpreter have any say in this, or would that also be too restricting?
Can you point to any language that meets your criteria?
mmmm (Score:2, Troll)
Hitting the wall with syntax. (Score:1)
is tied to syntax, but not to any particular syntax; there is no ``object oriented syntax''. Syntax allows you to group some expressions together to express some semantic relationship.
Languages hit the wall when they have a hard-wired syntax, with hard-wired semantics.
Ruby is no exception. It's a whole lot of syntactic sugar for a bunch of non-programmable semantics. It was obsolete before it was conceived. Moreover, the author has a very limited view of what object oriented programming is, and suffers from a fundamental confusion that OO is somehow syntactically determined. This if from one of his slides:
//OOP
fi = File::new("sample.dat", "r")
fi.binmode = true
line = fi.readline()
fi.close
// Non-OOP
fi = fopen("sample.dat", "r")
fbinmode(fi, true)
line = freadline(fi)
fclose(fi)
So, in other words, something is object oriented if it uses the notation object.method(arg), but not object oriented if it uses the notation method(object, arg). Is this guy for real?
It takes a certain level of experience to see through the facade of curly braces, vertical bars, squiggles, splats, hashes, cokebottles and whatnot. Such devices, despite looking impressively cryptic and terse, do not imply any special power; they are designed to dazzle and seduce the undergraduate mind.
The real power arises when the same expression, whether it uses lots of syntactic sugar or not, can mean absolutely anything that the programmer wants, not only what the language designer wants it to mean.
Re:Hitting the wall with syntax. (Score:1)
I'm not trying to belittle your complaint, I'm genuinly interested in having a look at better programming languages.
Re:Hitting the wall with syntax. (Score:2)
The usual argument for "OO syntax" is that the non-OO syntax for what is in reality an object (the file fi) "pollutes the name space" (creates lots of names of things at the global level).
That is really just a lexical problem of symbol management. Global symbol clashes are avoided by the use of packages. Lexical scoping has little or nothing to do with object orientation. Using C to emulate object oriented programming suffers from that problem because C has no namespaces or packages; programmers resort to conventions like adding a common prefix to related identifiers.
Re:Hitting the wall with syntax. (Score:2)
Gee, does the compilier or interpreter have any say in this, or would that also be too restricting?
Can you point to any language that meets your criteria?
Re:Hitting the wall with syntax. (Score:1)
Common Lisp.
Re:Hitting the wall with syntax. (Score:1)
(makes note to add 25th hour to day)
Re:mmmm (Score:4, Interesting)
Other scripting languages have really hit a wall in development because of the objectless syntax, but ruby, is a piece of work.
Yeah, I can see your point. The other languages have a totally [perldoc.com] objectless [python.org] syntax [phpbuilder.com]!
Too bad they have all hit [python.org] a [perl.org] wall [zend.com].