Programming language failings [was Re: strangest systems I've sent email from]
Josh Dersch
derschjo at gmail.com
Fri Apr 29 22:10:13 CDT 2016
On 4/29/16 6:02 PM, Ian S. King wrote:
> I would actually argue that C++, Java and C# are not object-oriented
> languages. They are languages with syntax that supports object-oriented
> programming - note that the original C++ was a preprocessor for a C
> compiler.
I'll disagree with this on behalf of C# and Java. (C++ I agree with;
the OO portions of C++ are very weak. Then there are the
metaprogramming facilities which make me wish maybe Strostrup had played
with Lisp a bit more...)
C# and Java provide real objects, and real reflective capabilities.
They're built on top of a stack-oriented virtual machine runtime (and
JIT compilation) that was explicitly designed to support objects as
first-class entities. With reflection, one can find out at runtime what
methods and fields an object exposes, iterate over them, invoke methods,
and use that metadata programmatically for all manner of useful things.
Further, C# and Java's objects provide real encapsulation and real
run-time safety -- private data is really private, you can't poke at
random memory (*). They're not as pure of an OO language as Smalltalk
is and they're not nearly as flexible, but few languages are :).
- Josh
(*) well, you can in C# (unsure about Java) but you have to explicitly
state that you're doing something unsafe when you do it. It's handy to
have available but is rarely needed.
More information about the cctalk
mailing list