• Welcome to Valhalla Legends Archive.
 

Opinions on C#

Started by Tuberload, May 12, 2003, 03:18 PM

Previous topic - Next topic

Grok

Hi, may I suggest you do some reading on .NET, for it sounds like much of your bias comes from knowledge of Visual Basic.

VB.NET is an entirely new language that is coincidentally(or not) similar in grammatics and keywords to the old Visual Basic.  The paradigms are different.

banditxx99

#16
Hi.. if that was towards me, I'm very familiar with c#. Just not vb.net. So I took your suggestion and did a little reading.  I like to learn!

So, for anyone that cares...

vb.net is both weak and strong typed. It's weak by default. You can make it strong by using the directive:

Option Strict On

I tried a bit of code in vb.net (prior to turning that option on)


Dim w
Dim x
Dim y
Dim z


x = 1.2
y = 3
z = x+y
w = "test"
z = w & y


That compiles and runs fine.

in c#

Object w;
Object x;
Object y;
Object z;
x = 1.2;
y = 3;
w = "test";
z = x + y;

this doesn't compile. it fails at z = x + y.
error: Operator '+' cannot be applied to operands of type 'object' and 'object'

turning the option strict on in the vb.net will give many errors on that vb.net sample code.. including Operator '+' cannot, blah blah.

Heh..  I know all this is OT from the original post, but I did learn something, so thanks.

edit: added code tags