I feel vindicated....

by "Srinivasan Ramakrishnan" <srinivar(at)md3.vsnl.net.in>

 Date:  Mon, 3 Jul 2000 01:42:31 +0530
 To:  <hwg-languages(at)hwg.org>
  todo: View Thread, Original
Hi,

You know that I have told you on atleast one occasion how I'd like a C/C++
that was reworked to include the features of a modern oops language,
something like Java but compilable as in C/C++ (none of this compiled &
interpreted crap). Sort of a retro C.

Well, surprise..... MS has released a sneak preview of its Visual Studio 7
language C# (pronounced C Sharp) which is built to look like C,C++ (and Java
though MS does not say so). It has no libraries, instead it relies on the
libraries of VB, VC and other languages.

It is completely OO, unlike C++ which sits on the wall. It allows both
automatic and manual memory management. However the killer feature is that
it is built for the internet from the ground up. It uses  ".NET" , a
proprietary runtime platform(is there any other kind ? :) ) for the
Internet.

I think this could be the NextGen language because it does not try to please
everybody. I have hated Java for that because it offers a lot, and yet it
pleases none since it is so slow, and the different JREs become a platform
nightmare themselves.

C# is unabashedly pro MS, it runs altleast for now only on MS technologies,
but that will change (I hope). Anyway it does a cool thing which I will tell
you about.

Inspite of Java's speed or rather the lack of it, I have liked it for a few
things like its API. I don't have to learn a new API every time I move to a
new platform. If you have had any exposure to MS languages for the past year
or wo you must have spotted this curious thing which MS is doing. I will use
an example here:

Have you heard of the FSO or the FileSystemObject ? Well, MS has implemented
this on its JScript 5, VBScript 5 & VB 6, as a common way of accessing the
file system. The idea is simple, once you master the FSO you can use it on
any MS language, neat huh?

This way over a period of time a common API will emerge and we will only
have to deal with the quirks of that implementation by MS on each platform.
Sounds like a practical solution since runtime interpreted systems are still
too slow for practical use. Once a common API emerges, we could refactor our
classes to use it, atleast the wise ones will, makes maintenance a lot
easier.

Oh and did I mention that C# has a string data type? Way overdue in my
opinion. It also has the JavaScript like NaN value for "Not a Number". The
other thing that has got me all excited is the exceptions part. C# does have
a try / catch syntax but strangely in the documentation that MS released the
exceptions chapter has been left empty! Likewise C# has support for
versioning but that chapter too is empty.

It also has a bool data type. And before I forget, it has XML documentation
facilities. (Way too cool!!, shows that MS hasn't been sleeping.) Variables
in C# are automatically initialized by the environment. (A double edged
sword no doubt.)

Here's the first paragraph of the MS documentation (yet to be published):

"C# is a simple, modern, object oriented, and type-safe programming language
derived from C and C++. C# (pronounced "C sharp") is firmly planted in the C
and C++ family tree of languages, and will immediately be familiar to C and
C++ programmers. C# aims to combine the high productivity of Visual Basic
and the raw power of C++."

I just had to get this news off to people who I know will be interested in
knowing this. In the end I hope it's a bit more than just syntactic sugar
and MS propaganda.

Anyway I feel partly vindicated. It's as though C in a new avtar has arrived
(I never liked C++ so I count that as C on steroids (literally, steroids
with all its harmful implications) !!). What I really wanted was a language
that had a fresh start, none of the legacy stuff. I wanted a language that
was just like Java in the sense that it was modern, object oriented and
embraced the internet. It should have a library / API that was common
accross platforms and was generally standardised.

C++ lost it on that count, it had too much of the past stuck with it. It
made an attempt at standardisation with the STL, but MS hijacked it midway
with its very own ATL. Anyway I've always had the feeling that the creators
of C++ were never sure of its object orientedness, while being a refreshing
change in an increasingly OO world, I wonder what the fate of STL will be
considering that C# supports only ATL.

Cynics will no doubt have a lot to say on C#. Infact here's one I can think
of "It should have been named C-- ".

MS seems eager to remedy the bad taste that C++ left with the ::, the C #
docs are quick to clarify that the :: is not an operator in C# and the -> is
used rarely if ever. While C# seems to be aware of threads, I have not seen
a clear explanation of its support in the docs.

I have still not read the language docs fully, so any technical assumptions
/ comments I may have made about C# are not entirely reliable.

BTW, if you were patient enough to read till here thanks, and to show my
appreciation I'll let you in on a secret, I lied about C# being compiled.
Yes it does compile and produce an EXE, but not all of it is native code,
since C# is type-safe and all objects in C# are COM objects, though MS
assures that if needed C# can include native code though it will have to be
marked as "unsafe"!!.

Is this another MS attempt at "embrace and extend" ? I don't think so, on
the other hand I'm not so sure, since I just saw C# code that accesses the
length of an array using the familiar( if you know Java or JS that is)
arrayName.length property.

Well we all know what MS does best, and C# is no exception. All the MS
technologies are so hopelessly tied into C# that you will be married to the
MS platform forever. Beginning from COM to SOAP, C# has got a hook here, and
a hook there, so if you are planning a non-MS bash, watch out.

BTW if you're wondering where more info on this can be got look no further:
msdn.microsoft.com/vstudio/nextgen/technology/csharpintro.asp
is your answer.

Tell me what you feel.

-Srini

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA