Click to See Complete Forum and Search --> : C# as compared to C++ and VB


Lord Vetinari
August 2nd, 2000, 07:02 AM
This will probably sound stupid as I'm new to C#, but from everything I've heard I get the impression that C# is slowly turning VC++ into VB, and the new improvements to VB in VS7 are turning it into VC++.

Personally I like the big differences between them. Adding the features to VB is making it into a serious language for making large applications, which it is not suited for. VC++ is much better for that kind of thing, but it is becoming closer to VB.

Am I getting a much too simplistic view of the languages, or are they all slowly becoming the same?

Rory Condon
Anarchic Chicken Software
http://www.anarchic-chicken.8m.com

Tom Archer
August 3rd, 2000, 05:19 AM
There is absolutely nothing in C# that makes it anything like VB. In fact, C# is more like a combination of C++, Java and SmallTalk. The only parallels that you can draw between C# and VB is that C#/.NET makes for a much easier and robust development environment.

>>>
Am I getting a much too simplistic view of the languages
<<<

Yes :)

Seriously, anytime someone tries to distill an entire language such as C# down to a simple one-liner like "It's just another VB" you have to worry about your source. Take a look at the docs and play with the language a bit. In very short order, you'll begin to see that the C# / .NET combination makes for an incredibly productive development environment.


Cheers,
Tom Archer - CodeGuru
Inside C# (late 2000)
Teach Yourself Visual InterDev in 24 Hours

Lord Vetinari
August 3rd, 2000, 04:40 PM
No, I don't mean it's like VB, I mean it is a successor to C++, and is closer to Visual Basic than C++. Look at the MSDN page for the language (http://msdn.microsoft.com/msdnmag/issues/0900/csharp/csharp.asp), it has many features similar to VB, they even admit it in places, but I don't like the way it automatically does things like (bad example but I'm in a hurry) initialising dynamically created objects and arrays to 0. It's taking power out of the hands of the developer. I would prefer it if the complier warned you if you use them without initialising, which it does anyway, but not take the decision for you. C++ allows you huge amounts of control, which is why all the major companies I've been part of/worked with have always use VC++. VB is too limited for anyone to use for most types of program, especially when they need to run fast. The MSDN site also admits C# will run more slowly than C++.

And the VB becoming more like C++ is shown by the announcements that in VS7 VB will have inheritence, polymorphism, etc. VB makes interpretor based, relativly slow, easy to crack programs. It is not suited to the big business programs which it is used for. I saw a book telling people how to use VB for e-commerce. VB contains a copy of the source code in the file. I have a decompiler which works on every version of VB made so far, it is definately NOT a solution for programs which could lose complanies large amounts of money if it is cracked, which many people would want to.

I'm definately not saying it is VB, but they many languages are being slowly run together. Think of Delphi and VC++, they are identical in their uses, the only difference is the language. Imagine if VB, VC# and Delphi as well as many others end up exactly the same, and programmers would only be able to develop in one. There would be no point, all the languages would have to be too simple for some programs and too complex for others, instead of being able to choose the language best suited to the application you might have to settle with a kludge in an unsuitable one.

Rory Condon
Anarchic Chicken Software
http://www.anarchic-chicken.8m.com

Tom Archer
August 3rd, 2000, 05:19 PM
>>>
No, I don't mean it's like VB, I mean it is a successor to C++, and is closer to Visual Basic than C++. Look at the MSDN page for the language
<<>>
they even admit it in places
<<<


Being a developer and an author I can tell you that just because someone writes for MSDN doesn't mean they have even met anyone on any of the .NET teams. Many times, this "white paper" work is farmed out to people that do this sort of writing on a consultant basis. Don't misunderstand me here: I don't even know Joshua so I can't speak about him specifically. I'm just saying that just because you see it in MSDN doesn't necessarily mean that it's the final word from Microsoft; especially when you're talking about subjective matter such as what language C# most resembles. Like any other subjective topic, it comes down to the personal interpretation and opinion of the author.


>>>
It's taking power out of the hands of the developer. I
would prefer it if the complier warned you if you use them without initialising, which it does anyway, but not take the decision for you. C++ allows you huge amounts of
control, which is why all the major companies I've been part of/worked with have always use VC++. VB is too limited for anyone to use for most types of program,
especially when they need to run fast.
<<>>
The MSDN site also admits C# will run more slowly than C++.
<<>>
And the VB becoming more like C++ is shown by the announcements that in VS7 VB will have inheritence, polymorphism, etc. VB makes interpretor based, relativly slow,
easy to crack programs. It is not suited to the big business programs which it is used for. I saw a book telling people how to use VB for e-commerce. VB contains a copy
of the source code in the file. I have a decompiler which works on every version of VB made so far, it is definately NOT a solution for programs which could lose
complanies large amounts of money if it is cracked, which many people would want to.
<<>>
I'm definitely not saying it is VB, but they many languages are being slowly run together. Think of Delphi and VC++, they are identical in their uses, the only difference is
the language. Imagine if VB, VC# and Delphi as well as many others end up exactly the same, and programmers would only be able to develop in one. There would be no
point, all the languages would have to be too simple for some programs and too complex for others, instead of being able to choose the language best suited to the
application you might have to settle with a kludge in an unsuitable one.
<<<

IMO, one of the things that Microsoft is doing with all this is simply moving the base functionality that most applications would need into the .NET framework and then giving you your choice of language to use. Realize that in this environment, that the language is not a language like we think of one. In other words, I can write 'C' without Windows because it has its own file I/O, screen I/O (with the standard output device), etc.

However, in the case of C#, we're not talking about a stand-alone language. In fact, you can't do anything substantial with C# because it relies on .NET for anything of significance. C# is simply a set of (C++/Java) syntax used to interface to .NET features. The advantages here are that you finally won't have the issue of "I can do one thing in this language but I can't do that in this other language." because all of the meaningful functionality is provided by the .NET framework. Therefore, you're free to choose whichever language suits your company's skill set and direction.



Cheers,
Tom Archer - CodeGuru
Inside C# (late 2000)
Teach Yourself Visual InterDev in 24 Hours

Lord Vetinari
August 4th, 2000, 06:45 PM
&gt;&gt;&gt;
However, in the case of C#, we're not talking about a stand-alone language. In fact, you can't do anything substantial with C# because it relies on .NET for anything of significance. C# is simply a set of (C++/Java) syntax used to interface to .NET features. The advantages here are that you finally won't have the issue of "I can do one thing in this language but I can't do that in this other language." because all of the meaningful functionality is provided by the .NET framework. Therefore, you're free to choose whichever language suits your company's skill set and direction
&lt;&lt;&lt;

I'd disagree with that. Having the .NET framework shared between languages means that all of the languages will be the same. Think of if MFC was shared between languages, to show a dialog it could be:// In VC++
CDialog aDialog;
aDialog.DoModal();

'In VB
Dim aDialog as Dialog
Dialog.DoModal()

etc.
It would be stupid to have many languages using exactly the same code in their own language. Why not make it simple and have one? That's why VB may be more or less suited to a task than VC++, they work completely differently.

Rory Condon
Anarchic Chicken Software
http://www.anarchic-chicken.8m.com

Tom Archer
August 4th, 2000, 10:48 PM
&gt;&gt;&gt;
Having the .NET framework shared between languages means that all of the languages will be the same.
&lt;&lt;&lt;
No it doesn't. The .NET CLR provides the same ***functionality*** across languages. In other words, C# and VB7 will have the same abilities in terms of what they can do with the operating system. I didn't say the code would look the same or that these .NET features would be accessed the same way from either language.

Therefore, these languages still maintain their current syntactical differences, but they can perform the same work.

&gt;&gt;&gt;
It would be stupid to have many languages using exactly the same code in their own language.
&lt;&lt;&lt;
Who said that they both look exactly the same? Have you used either language? I've been using C# for several months and it looks nothing like VB7 code except that they both have access to the same .NET functionality.

&gt;&gt;&gt;
That's why VB may be more or less suited to a task than VC++, they work completely differently.
&lt;&lt;&lt;
Really? At the PDC Microsoft illustrated creating an application with three different .NET capable (CLS-compliant) compilers (C#, VB7 and Cobol) . They then used the ILDASM (IL disassembler) to illustrate that each one of these compilers generated the exact same code!

You may not like it but the simple fact of the matter is that all languages will work the same in .NET (in terms of what they can do with the system and with each other) regardless of what the source code looks like.

Cheers,
Tom Archer - CodeGuru
Inside C# (late 2000)
Teach Yourself Visual InterDev in 24 Hours

Lord Vetinari
August 5th, 2000, 06:33 AM
&gt;&gt;&gt;
You may not like it but the simple fact of the matter is that all languages will work the same in .NET (in terms of what they can do with the system and with each other) regardless of what the source code looks like
&lt;&lt;&lt;

That's just what you said didn't happen. I'm saying that if the languages all use the same calls to the .NET framework the same functions will be used to do the same thing. That's why it's stupid. The same functions will allow you to do exactly the same things, so why not just have one language. Why make all the languages do exactly the same?

Rory Condon
Anarchic Chicken Software
http://www.anarchic-chicken.8m.com

Tom Archer
August 5th, 2000, 09:59 AM
&gt;&gt;&gt;
That's just what you said didn't happen.
&lt;&lt;&lt;
Not sure we're mis-communicating, but we're doing it consistently so I'll just leave this alone.

&gt;&gt;&gt;
I'm saying that if the languages all use the same calls to the .NET framework the same functions will be used to do the same thing. That's why it's stupid. The same functions will allow you to do exactly the same things, so why not just have one language. Why make all the languages do exactly the same?
&lt;&lt;&lt;

*** Companies have grown tired of having to hire highly priced consultants to every niche job they have. Having the base functionality being exposed in a generic way enables all programmers of any (.NET) language to access the same functionality the same way. I personally applaud that MS has finally gone this path.

*** You ask why not have a single language? That would mean MS choosing between VB and VC++. Why would they do that and risk losing one or the other camp?

*** Depending on which language they'd choose what would they tell all these corporations that invested billions of dollars in training and consulting only to see the entire language that they've built their corporate software tossed out?

Simple fact is that we're moving in the direction that the only significant difference between (.NET) languages will be their syntax. IOW, people will choose one language over another based on things like their current personnel and its skill set.



Cheers,
Tom Archer - CodeGuru
Inside C# (late 2000)
Teach Yourself Visual InterDev in 24 Hours

Lord Vetinari
August 6th, 2000, 07:23 AM
I agree it is impractical to choose just one, but why not preserve the differences between them? VB and VC++ are both suited perfectly to their jobs, so why use the .NET framework so they do things exactly the same?

Rory Condon
Anarchic Chicken Software
http://www.anarchic-chicken.8m.com

jedipoteat
August 7th, 2000, 07:32 AM
A couple of reasons out of many:
1) Because I want to use C# and my coworker wants to derive a class from my code and he only knows VB.
2) I see some code I would like my new class to derive functionality from but it is written in C++...I want to use C#.

Rory, your arguments are losing me here. The differences of languages are all preserved, they are just compiled into the same language before they get to the machine dependent code stage. Currently they are all compiled into machine code in the end so they are going to end up the same anyway...the only real differences between languages have always been syntax. Creating one runtime environment that all languages use instead of a different API (that all do more-or-less the same thing) for every different language makes perfect sense.

Tom Archer
August 7th, 2000, 10:03 AM
&gt;&gt;&gt;
...the only real differences between languages have always been syntax.
&lt;&lt;&lt;
Actually, this isn't 100% true and it seems to be the problem Rory has. Right now there are many things that I can do in VC++ that I can't do in VB. However, I'm glad that's going away and that the only differences are going to be langauge semantics (syntax).

&gt;&gt;&gt;
Creating one runtime environment that all languages use instead of a different API (that all do more-or-less the same thing) for every different language makes perfect sense
&lt;&lt;&lt;
Agreed!! I was starting to worry when *nobody* was jumping in to applaud this initiative by Microsoft. I bash these guys as much as anyone, but I also like to give them credit where it's due and .NET and C# (so far) are a welcome change in the programming space!

Cheers,
Tom Archer - CodeGuru
Inside C# (late 2000)
Teach Yourself Visual InterDev in 24 Hours

Lord Vetinari
August 8th, 2000, 12:28 PM
The language syntax is irrelavant. I think this is where we're at cross purposes. I'm talking about the frameworks they use, eg. MFC or .NET, not the syntax.

&gt;&gt;&gt;
Creating one runtime environment that all languages use instead of a different API (that all do more-or-less the same thing) for every different language makes perfect sense
&lt;&lt;&lt;
But it doesn't make sense! The advantage of VC++ is MFC, it's incredibly versatile and effective. The advantage of VB is the simple and easy way it can be used to deal with Windows, no huge number of function calls and overridden classes. Why make the simple one more complex and the versatile one more limited? VC# is not as flexible as VC++ but simpler, and VB7 will be more powerful but more complicated than VB6.

Rory Condon
Anarchic Chicken Software
http://www.anarchic-chicken.8m.com

Lord Vetinari
August 9th, 2000, 02:51 PM
BTW, I won't be repling to this again for about 2 weeks cause I'm going on holiday

see ya!

Rory Condon
Anarchic Chicken Software
http://www.anarchic-chicken.8m.com

Epitome
August 9th, 2000, 05:41 PM
While I agree that this is a tremendous step forward for developers in general, I also see some possible drawbacks. For instance, what prevents programs from eventually becoming sprinkled with mixed language code? With the ability to cross-inherit, I can foresee programs mixed with every language under the sun (that supports the .NET platform). Imagine being hired to modify a major software system that combines VB, C#, Pascal, and (here is the worst of them all ) COBOL!



Neil Axe
Cirith Concepts, Inc.

Tom Archer
August 9th, 2000, 05:53 PM
No problem :) Take care and have fun, Rory!

Cheers,
Tom Archer - CodeGuru
Inside C# (late 2000)
Teach Yourself Visual InterDev in 24 Hours

mappin
August 10th, 2000, 07:56 AM
Hmm? you never worked on a system like that before? In a lot of large corporates thats already a reality, except you have to use a different development environment for all of them! You've got it all to look forward to.
What you will find out is that after the first three or four languages another 2 or 3 makes no difference. By the time that happens you will already have an IL installed in your head. (WWIL) WetWare Intermediate Language. :)

Lord Vetinari
August 19th, 2000, 08:52 AM
OK, I'm back!

Rory Condon
Anarchic Chicken Software
http://www.anarchic-chicken.8m.com

Mike Maddux
August 24th, 2000, 11:04 AM
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;
...the only real differences between languages have always been syntax.
&lt;&lt;&lt;
Actually, this isn't 100% true and it seems to be the problem Rory has. Right now there are many things that I can do in VC++ that I can't do in VB. However, I'm glad that's going away and that the only differences are going to be langauge semantics (syntax).
&gt;&gt;&gt;&gt;&gt;

Is there really going to be no reason to choose C# over VB other than which one you happen to be most familiar with?

I'm not very familiar with VB (I have the same union restrictions that Tom has), but what experience I do have leads me to believe that one can express complex concepts in C++ more elegantly and with greater ease of modification than one can in VB. I would HOPE that this will still be the case with C#.

My hope for and excitement about C# is that this possibility of elegance and ease of modification has increased from what it was in C++ - partly because the "clunky" parts of C++ have been removed, and also C# has a more intimate connection with the "system."

I'm also excited as a C++ programmer, who loves the language but is irritated by many parts of it, to feel that with C# there is a future in the new world order for my kind. I was worried that C++ was going to go the way of assembly language programming.

Mike

Tom Archer
August 24th, 2000, 11:48 AM
In answer to your question, I'll tell you (paraphrase) what Jeffrey Richter (who is also on the CLR team) told me regarding C# and CLR: "Because most functionality is being moved into the CLR layer, C# and other .NET compliant compilers are basically becoming nothing more than syntax checkers."

His point is that you can't really do anything with these compilers by themselves any more (unlike C++ or VB6). They are simply a means to get to .NET classes with the main differences between them being their syntax.

Cheers,
Tom Archer - CodeGuru
Inside C# (late 2000)
Teach Yourself Visual InterDev in 24 Hours