“Shannon Fang” xrfang@hotmail.com wrote in message
news:20021130202456.EFB2.XRFANG@hotmail.com…
Hi all in this discussion,
My comments on the document of Ruby is actually an abreaction of my
unsatisfaction toward C++.
Please follow the D project at news.digitalmars.com, it has many of the
things we would like in C and C++ instead of what we have. D is not just
another D language, Walter behind D wrote the legendary Zortech compiler. I
expect a lot from D, but currently it is in an early stage of development.
I learned C++ in 1993, I thought I can programming using the language. But
I was wrong. During these
years,
I learned it a few years earlier. I used to follow the evolving standard
closely and did eargerly dive into the cool templates that first got
introduced in Borland C++.
C++ is changing rapidly, and become more and more incomprehensible.
I eventually gave up on understanding C++ - I feel I have a fairly good C++
knowledge, but I can’t be bothered with the latest development in
templates - no matter what you do it is either not implemented, implemented
partially, implemented incorrectly and certainly not portable between
compiler vendors or even between compiler versions in either direction. Then
add stupid scope incompatibilities such as for(int x;—) where is the scope
of x?.
A recall a FidoNet argument on constructor behavior back in the mid 90’ties.
Turns out calling a constructor inside a constructor results in a) a new
temporary object, b) recursion, depending on your compiler (VC vs. Borland).
It’s just inherently difficult to make a precise definition of C++,
apparently much like HTML.
will depend on it’s internal mechanism, not on some piculiar “syntax
sugar”.
For example, C++ introduced the use of template, which seems very
interesting and efficient, but it required me to learn the new syntax of
how to use template. As a contract, Ruby’s polymophism achieved the same
effect, and more elligently. So Ruby is better on this comparison.
But Ruby isn’t an easy language - I thought so initially - there are many
complex aspects, most adds to the power of the language, while other
behavior happened in the course of development (which is why we always
invent new languages).
I hate piculiar symbols to express some obvious meanings. for example:
in C++ ~ means destructor. While in delphi, there’s a keyword
“destructor”, which is much clearer. A lot of my example are anti-C++…
Doesn’t really matter. What matters is features such as using class name as
constructor versus using the self keyword as constructor. Which code is the
easier to maintain, or to manage with macros if you want to make it ugly?
This is one thing fixed in D. Whether you use ~self or destructor amounts to
the same thing. I agree destructor is nicer, but things can also be too
verbose, and as I said, this aspect hardly matters.
And in ruby, attr_reader :name, and def name… end, while in Delphi, it
is “property name”. Again delphi is easier to comprehend, and hence
harder to forget.
Yes, I also find it putting tolls on my limited onboard RAM capacity (it’s R
as in Random) - which is why I hooked up with computers in the first place.
However, attr_ has a wider scope than just properties - if only I could
figure out exactly how it works.
Mikkel