C# and VB.Net?

M

Mantorok

Hi all

We are an organisation that use C# currently and we have some members who
are not yet trained in .Net or C#, some staff have requested they use VB
instead (probably due to their background).

Given that we are already using C# I think adding VB into the mix is a bad
idea - not with regards to the language itself but the fact that the VB.Net
coders won't learn C# and possibly vice-versa.

Apart from the business reasons not to introduce a 2nd .Net language, are
there any sites with un-biased views as to why both languages are in
effect - equal?

Thanks
 
N

Nicholas Paldino [.NET/C# MVP]

Mantorok,

You really don't need a site to tell you why they are practically equal.
Basically, all of your functionality is going to come from the framework
itself, and nothing that the language provides.

With the exception of unsafe code, there is little, if anything, that C#
offers over VB.NET.

I believe this will change with VB.NET 9.0, however. For your purposes,
though, it doesn't matter, because your people are coming from VB6, and
aren't going to be familiar with the new language features anyway.

Hope this helps.
 
M

Mantorok

Nicholas Paldino said:
Mantorok,

You really don't need a site to tell you why they are practically
equal. Basically, all of your functionality is going to come from the
framework itself, and nothing that the language provides.

With the exception of unsafe code, there is little, if anything, that
C# offers over VB.NET.

Yes - it is preference at the end of the day, our boss wants us to provide
specifics about each languag - which is wrong, it doesn't take a genius to
realise that introducing another language into the mix is going to cause
problems amongst staff.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,


They are effectively equals as practically all they use are from the
framework, that is common, the only thing that change is the syntax and just
a few other things that normally you can live without.

Having two teams that knows nothing about the other's programming language
is a bad thing though.

IMO, it's lot easier going from C# to VB.NET , I checked this first hand as
I was given a VB.net app to maintain and support like 6 months ago, it was
programmed by a consultant and I'm been updating it since then.

The other way, program C# from VB should not be as trivial though.


Have them learn C# :)
 
M

Michael S

Mantorok said:
Hi all

We are an organisation that use C# currently and we have some members who
are not yet trained in .Net or C#, some staff have requested they use VB
instead (probably due to their background).

Given that we are already using C# I think adding VB into the mix is a bad
idea - not with regards to the language itself but the fact that the
VB.Net coders won't learn C# and possibly vice-versa.

Apart from the business reasons not to introduce a 2nd .Net language, are
there any sites with un-biased views as to why both languages are in
effect - equal?

Thanks

Hi Mantrorok.

As part of my work I train VB6 developers becomming .NET developers. Both
in-house, but we also sell this service to our customers. Hence, I have
trained VBers in both VB.NET and C#, and I have noticed some important
issues with the two languages.

VB6 devs learning C# - pretty soon learns to forget everything they know
about what they used to do, and adopt OO-principles. C# is new and they
think in new directions.

However, the VBers that moves to VB.NET typically have a lot slower
learning-curve. As the syntax is so like the old basic, they tend to think
of VB.NET as just another complex Visual Basic alas more complex.

And the latter group typically don't adopt OO-principles. They still view a
class as some module you just put code and som Dims in, they keep on
concatinating strings, declaring their arrays, and don't get why an
ArrayList or a StringBuilder could ever be useful. The think in terms of
variables and don't get the 'reference on stack, object on heap' model and
can't undestand why passing a huge array to a method would be the bad thing.

Just this monday I visited a customer to do some simple maintainance for
them, and their VB.NET devs still prefix their types like they was variants:
strName, lngAge, objSqlConnection. It is so bleeding obvious why they
choosed VB.NET, not becuase they like it, but becuase they liked what they
had. They want to continue coding in same old way as they are used to. I
think most of them are also frustrated with .NET and just think it's complex
and bothersome.

Another thing about VB.NET and OO is the weird syntax, C# maps pretty well
to common concepts in the OO world, while VB.NET is harder to teach:

If I want to make this method abstract do I mark it as abstract?

C# - - Yes.

VB.NET - No Sir! You write mustinherit.

While I hate VB in any form and truly think that Visual Basic Sucks So Hard
It Bends Light -
I tried to give you some real exemples of my experience with teaching .NET
to VBers.

Hope this helped
- Michael S
 
M

Mantorok

Thanks very much Micael - I think you've hit the nail well and truly on the
head - this is an excellent example to take to my meeting.
 
M

Michael S

No problem, I'll send the invoice. =)

Mantorok said:
Thanks very much Micael - I think you've hit the nail well and truly on
the head - this is an excellent example to take to my meeting.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Yes - it is preference at the end of the day, our boss wants us to provide
specifics about each languag - which is wrong, it doesn't take a genius to
realise that introducing another language into the mix is going to cause
problems amongst staff.


Well, in VB you can have a more relaxed type assignment. which is bad IMO .
string s = theDataTable("Column") is acceptable , no need to convert it
to string

Also something that I find incredible that in the 21th century is not
deprecated is the need to place a "_" if you want to write an instruction in
more than one line
 
H

Harry Simpson

A truly unbiased opinion from someone that can't even get the English
language subject verb agreement thing down.
 
M

Mantorok

Ignacio Machin ( .NET/ C# MVP ) said:
Hi,




Well, in VB you can have a more relaxed type assignment. which is bad IMO
.
string s = theDataTable("Column") is acceptable , no need to convert it
to string

So what happens at runtime if theDataTable("Column") is integer? It bombs
presumably?
Also something that I find incredible that in the 21th century is not
deprecated is the need to place a "_" if you want to write an instruction
in more than one line

Yep, we had that in FoxPro and I hated it....except it was ; rather than _.
 
M

Michael S

I would have done much better in Swedish. English is not my first language.
Now go away Troll. There is no food here! Or do you have an opinion youself?

- Michael S
 
P

philippedoucette

I have developed in every version of Microsoft BASIC from the original
ROM chip that shipped with the IBM PC, under every version of DOS and
Windows. Every single one. I finally made the jump to C# and I must
tell you I am so happy. It is true that the OO syntax of C# is true to
the principals of OO so that it will change the way you think when you
program. When I was trying to do OO in VB, I carried with me all my
experience as dead weight and did not do real OO programming. Your
programmers will be better programmers in the long run if they learn
C#. Your code will be more maintainable and you will have a better
product.
 
M

Michael S

Mantorok said:
So what happens at runtime if theDataTable("Column") is integer? It bombs
presumably?


Yep, we had that in FoxPro and I hated it....except it was ; rather than
_.

Those where the days... =)

However, true basic must be in ALL CAPS and use line-numbers. I miss my
C-64.
My first program was on a ABC-80 (In Swedish as I was 8 years old and we are
not taught English until 10):

10 INPUT "WHAT IS YOUR NAME "; X$
20 PRINT "HELLO "; X$

- Michael S
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,


Mantorok said:
So what happens at runtime if theDataTable("Column") is integer? It bombs
presumably?

I Nop, it gets converted in a string, now the opposite (assigning a string
to a integer) throw an exception


cheers,
 
M

Michael S

I have developed in every version of Microsoft BASIC from the original
ROM chip that shipped with the IBM PC, under every version of DOS and
Windows. Every single one. I finally made the jump to C# and I must
tell you I am so happy. It is true that the OO syntax of C# is true to
the principals of OO so that it will change the way you think when you
program. When I was trying to do OO in VB, I carried with me all my
experience as dead weight and did not do real OO programming. Your
programmers will be better programmers in the long run if they learn
C#. Your code will be more maintainable and you will have a better
product.

I so totally agree with you.

I remember when I learned how VB.NET handles their weird AND/OR handling by
introducing AndAlso/OrElse. Didn't know if to cry or laugh. What a stupid
thing to do.

I think we should have the OrElse keyword in C#. But only as an empty
keyword to threaten the compiler:

myList.Add(myString) OrElse;

Or maybe it could be used to eat exceptions. Hey, that would be quite handy
sometimes. Better email Anders Hejlsberg as to explain my new
language-feature! =)

- Michael S
 
M

Mantorok

Michael S said:
I so totally agree with you.

I remember when I learned how VB.NET handles their weird AND/OR handling
by introducing AndAlso/OrElse. Didn't know if to cry or laugh. What a
stupid thing to do.

My good lord that's awful, the amount of patchwork being applied to the
already confusing language is just going to make it ten times worse.
 
M

Mythran

Michael S said:
I would have done much better in Swedish. English is not my first language.
Now go away Troll. There is no food here! Or do you have an opinion
youself?

- Michael S


Don't listen to that other guy. English is my only spoken language
(although, I should say BAD english is my only spoken language), and you did
as good or better than I could do :) The other guy just wants to make it
look like he's perfect and in doing so, he made himself look like a
jack-#$!...

:)

Mythran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top