Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / December 2005

Tip: Looking for answers? Try searching our database.

C# and VB.Net?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mantorok - 13 Dec 2005 13:14 GMT
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
Nicholas Paldino [.NET/C# MVP] - 13 Dec 2005 13:22 GMT
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.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> Hi all
>
[quoted text clipped - 11 lines]
>
> Thanks
Mantorok - 13 Dec 2005 13:36 GMT
> Mantorok,
>
[quoted text clipped - 4 lines]
>    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.
Ignacio Machin ( .NET/ C# MVP ) - 13 Dec 2005 14:40 GMT
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
Mantorok - 13 Dec 2005 14:54 GMT
> Hi,
>
[quoted text clipped - 7 lines]
>  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 _.
Michael S - 13 Dec 2005 15:03 GMT
>> Hi,
>>
[quoted text clipped - 17 lines]
> 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
Ignacio Machin ( .NET/ C# MVP ) - 13 Dec 2005 15:10 GMT
Hi,

>> Hi,
>>
[quoted text clipped - 10 lines]
> 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,

Signature

Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Ignacio Machin ( .NET/ C# MVP ) - 13 Dec 2005 13:57 GMT
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# :)

Signature

Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

> Hi all
>
[quoted text clipped - 11 lines]
>
> Thanks
Michael S - 13 Dec 2005 14:17 GMT
> Hi all
>
[quoted text clipped - 11 lines]
>
> 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
Mantorok - 13 Dec 2005 14:30 GMT
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.

>> Hi all
>>
[quoted text clipped - 59 lines]
> Hope this helped
> - Michael S
Michael S - 13 Dec 2005 14:35 GMT
No problem, I'll send the invoice. =)

> 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.
[quoted text clipped - 62 lines]
>> Hope this helped
>> - Michael S
Mantorok - 13 Dec 2005 14:38 GMT
LOL

> No problem, I'll send the invoice. =)
>
[quoted text clipped - 65 lines]
>>> Hope this helped
>>> - Michael S
Harry Simpson - 13 Dec 2005 14:45 GMT
A truly unbiased opinion from someone that can't even get the English
language subject verb agreement thing down.

> 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.
[quoted text clipped - 62 lines]
>> Hope this helped
>> - Michael S
Michael S - 13 Dec 2005 14:58 GMT
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

>A truly unbiased opinion from someone that can't even get the English
>language subject verb agreement thing down.
[quoted text clipped - 66 lines]
>>> Hope this helped
>>> - Michael S
Mythran - 13 Dec 2005 16:35 GMT
>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
M. Genuini - 13 Dec 2005 17:03 GMT
>10 INPUT "WHAT IS YOUR NAME "; X$
>20 PRINT "HELLO "; X$

30 INPUT "CONTINUE ? <Y/N>"; Y$
40 IF Y$ = "Y" THEN GOTO 1O
50 PRINT "BYE BYE"

^_________^
Michael S - 13 Dec 2005 18:05 GMT
> >10 INPUT "WHAT IS YOUR NAME "; X$
>>20 PRINT "HELLO "; X$
[quoted text clipped - 4 lines]
>
> ^_________^

LOL!

Yeah, I kinda expanded my code into exactly that, and got help by the
'teacher'.

He was so very cool. He was this lost nird-hippie-wannabe-left-overs who,
never really got over the political 70ies, and got hooked on computers to
escape from the horribly happy clueless elite 80ies.

Poor dude. And a great man. Sitting on his free time, learning a 8 year old
kid what a boolean is. And types.. X is variant, X$ is text and X# is
number. I guess most coders teach their kids this at even earlier ages
nowadays, but in 1982 this was pretty rare. Where would you even find a
computer in a poor suburb to Stockholm, Sweden in 1982? Bet my mom thought
he was molesting me or something *s*.

While growing up I saw him sometimes, like across the street or in a mall or
in the subway. We would just nod to eachother, but I never spoke to him.
Probably becuase while I learned to code, he became a drunk...

But I would like to meet him again. Guess I have a lot to thank him for...

Anyways, here is the cutie:

http://en.wikipedia.org/wiki/Luxor_ABC80

- Michael S
Jon Skeet [C# MVP] - 13 Dec 2005 17:15 GMT
<snip>

> 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.

I don't understand why passing a huge array to a method would be a bad
thing either though. Arrays are reference types - you're not passing a
load of data. What kind of problem are you thinking of?

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Michael S - 13 Dec 2005 18:15 GMT
> <snip>
>
[quoted text clipped - 11 lines]
> thing either though. Arrays are reference types - you're not passing a
> load of data. What kind of problem are you thinking of?

My Bad!

I ment huge structs, in loops.

I re-wrote that part a couple of times and wanted to mention value/reference
and also boxing/unboxing. It was not any good, so I erased stuff to get rid
of complex examples, and I guess array just got there and I went along
continuing writing...

Thanks Jon, for making sure people get that passing arrays is not bad.

- Michael S
Jason Newell - 13 Dec 2005 19:50 GMT
LOL @ "Visual Basic Sucks So Hard
It Bends Light".

I'll have to remember that one.

Jason

>>Hi all
>>
[quoted text clipped - 58 lines]
> Hope this helped
> - Michael S
Michael S - 13 Dec 2005 20:44 GMT
> LOL @ "Visual Basic Sucks So Hard
> It Bends Light".
>
> I'll have to remember that one.
>
> Jason

Then I'm sure you'll love this:

http://www.ddj.com/documents/s=1503/ddj0001vs/jan00.htm

Anyways, at work I sit behind a huge whiteboard.

The rule is that anything written may be removed at anytime.

It's for brainstorming and may be used or abused in any way possible (except
humping it, I guess) as long as you clean the board when done (It's
perfectly white, so we really embrace that what you write, you clean up)!

Except for the upper right corner. That is my box. I sport the one above,
but also this:

- Linux Is Only Free If Your Time Is Worthless.

While this is getting less and less true, as Linux is getting 'freindlier',
we are still a small (but an important gang) surrounded by an army of
Java-devs. Now I'm talking about full fledged Java army using open source
whenever they can, and they sure don't care much for Microsoft.

But I defend my island, and some of them (the smart ones, I think) really do
wanna be in our projects...

Actually, things are changing I think. People get bored with J2EE after a
while with having Maving say no to a method +45 lines, fix that, and then
wait his/her turn for merging several kilometer long config-files with 'the
team'.

They go:  - What? Tjeesus? What did you just do with that DataSet just now?
Drag and drop two tables, it understands the relation, you build a SQL query
by clicking, then call fill twice and call for typed childnodes. That's
pretty cool!

They can be pretty amazed at a Page_Load in ASP.NET line going:

string sessionId = Request["sessionId"] ?? "";

But when I talk about .NET 3 and LINQ they kinda get lost somewhere. Note
how Java1 and Delphi1 are both from 1995. Delphi managed to get from 1 to 7,
with major language-improvements, before going .NET. Poor Java is still back
at 1995 and the 1.5 version (my bad, it's the 5.0 version) still just fake
generics.

How will they keep up?

Happy Coding, I know I do!
- Michael S
Jon Skeet [C# MVP] - 14 Dec 2005 12:50 GMT
<snip>

> But when I talk about .NET 3 and LINQ they kinda get lost somewhere. Note
> how Java1 and Delphi1 are both from 1995. Delphi managed to get from 1 to 7,
> with major language-improvements, before going .NET. Poor Java is still back
> at 1995 and the 1.5 version (my bad, it's the 5.0 version) still just fake
> generics.

Better than no generics. You might also want to look into Java's enums
before thinking that C# is better in all respects... when using C# I
long for rich, OO enums like Java has.

(I also long for an IDE which matches Eclipse, but that's another
matter...)

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

philippedoucette@hotmail.com - 13 Dec 2005 15:03 GMT
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.
Michael S - 13 Dec 2005 15:17 GMT
>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
[quoted text clipped - 6 lines]
> 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
Mantorok - 13 Dec 2005 15:48 GMT
>>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
[quoted text clipped - 12 lines]
> 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.
Michael S - 13 Dec 2005 17:29 GMT
>>>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
[quoted text clipped - 15 lines]
> 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.

I'll give you some more 'ammo' for your meeting:

1. Strict Option Off
You are allowed to turn explicit casting off. This was done to make porting
of VB6 code easier. Also why they gave the language AndAlso and OrElse. The
whole syntax is created for easy-porting-purposes. The problem is that
porting Object-Based code into Object-Oriented code is a dumb idea from the
start. Who would 'port' JavaScript into C++? You don't port stuff like that.
You re-write the code and only port (re-use) the idea and feature, not the
design.

C# was not designed for porting, but to be a clever language. I think it is.

2. No-mans land.
At my work we mostly do Java, C#, C++ and Delphi (which is not really a
no-mans land, as most Delphites knows C++ ).

I say mostly - as sometimes our customers wants and insists on VB.NET. And,
like the dirty whores we are, we are happy to supply such a perverted
service. We hide behind the old - The Customer Is Always Right, as not to
offend whores. =)

However, for projects written in C#, we can always call on a Java or C++
developer to help us out if we are out of girl-power. While having a Javait
in your code, not coding a property Count, but insists on writing a
getCount() method, things are not that bad. Atleast the code is dandy and
written in a good pace. And while it may take her some time before she
fathoms that why she can't seem to find a StringBuffer anywhere, not even in
System.Text, is that it is called StringBuilder in .NET. She might grunt a
bit and may need some help, but she gets the job done.

If the same girl was to venture into a VB.NET project she would be doomed.
How would she know that she can't use And but must use AndAlso to get her
if-statements to work. How would you tell her that there are no braces and
that 'for' meets 'next', 'if' meets a 'end if', while 'while' meets a
'wend'.

Actually, I've seen this happen. But it was a guy and not a girl. And he got
so mad he almost screamed at me in frustration - Get me out of this NOW, or
I'll RESIGN!

3. Visual Basic Sucks So Hard It Bends Light.
This is my E=mc^2 argument. I think VB.NET is a gravity-well. Not really a
black-hole as time doesn't really stop, but it slows down a bit, and as time
== money, it earns you less money. While I don't care so much about money, I
rather see it as doing more work for less result.

While a VBers (or Delphites, like myself) may always claim, - 'I write so
fast in my favourite language, you won't know the difference'; both basic
and pascal are verbose languages and you could go faster. Once you talk
Algol-style languages like C#, C++ and Java fluently, you are quite fast in
doing JavaScript for a browser also.

4. Cognition
Our brains are wired to grasp the world in the following order; type,
identity and value.
For the science of this, please use google. I've written several posts on
this here, so you could always google groups for my long (and quite funny)
example.

Anyways, here is a short example;

int i = 5; //type first, identity second and value last.

Dim i as Long 'Dim is useless, identity comes before type. What is it's
value?
i = 5 'Value is not in context with type or identity.

While few studies have been done and nothing proven (how do you prove this?)
our brains tend to work harder when we code basic and pascal, and spend less
energy when doing the algol-style coding our brains like. Wirth did it wrong
when he designed pascal, while Ritchie just happened to get it right. I
don't think any of them even gave it a thought.

Well, there you have another four reasons for staying away from VB.NET.

Happy Coding
- Michael S


Doug H - 13 Dec 2005 21:14 GMT
> 4. Cognition
> Our brains are wired to grasp the world in the following order; type,
[quoted text clipped - 16 lines]
> when he designed pascal, while Ritchie just happened to get it right. I
> don't think any of them even gave it a thought.

Uh, dude, you don't know what the hell you are talking about here.  You
don't have a clue about cognition and reading.
That is seriously the worst understanding of cognition and misreading
of cognitive research I have ever seen.

There is research in _computer science education_ (not "cognition")
finding that verbose english-like programming languages aren't
necessarily easier for beginners, but they aren't worse either.  Just
like there is actual research showing that "==" vs. "=" is a common
source of errors with beginners, as well as case-sensitivity.
VB.NET is clearly designed to lower the learning curve and be easier
for beginners to pick up.  It isn't perfect, but it is much better
designed than C# for beginners at least.
Michael S - 13 Dec 2005 22:06 GMT
> Uh, dude, you don't know what the hell you are talking about here.  You
> don't have a clue about cognition and reading.
> That is seriously the worst understanding of cognition and misreading
> of cognitive research I have ever seen.

If you say so, dude!

> There is research in _computer science education_ (not "cognition")
> finding that verbose english-like programming languages aren't
[quoted text clipped - 4 lines]
> for beginners to pick up.  It isn't perfect, but it is much better
> designed than C# for beginners at least.

Oh, but I'm not talking about newbies..
If you are new to things, you think everything is weird and you need help.

I'm talking about people going to work for 8-10 hours a day and try to fix
someone elses code.
You might take a look at what R did with B before they did UML with I....

What Wirth thought when he designed pascal...

dude, please tell me if I am wrong! But don't dismiss me for being a fool. I
am not!

- Michael S
Ignacio Machin ( .NET/ C# MVP ) - 13 Dec 2005 20:18 GMT
Hi,

>> 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.

Does anybody knows what  DLinq in VB.NET looks like?
The syntax  in C# is abstract, so who knows what the VB guys will invent to
express it :)

Signature

Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Michael S - 13 Dec 2005 21:38 GMT
> Hi,
>
[quoted text clipped - 8 lines]
> The syntax  in C# is abstract, so who knows what the VB guys will invent
> to express it :)

Very much the same.

All I know is that VB.NET will have the 'select' come before the 'from'
part, just to look more like SQL.
The C# team thought that this would kill the purpose of intellisense. How
can you select from what? where? grouped by? having? ordered how?

Again C# team shows their knack for reality:  - SQL is weird, let's do
better, while intact, and give good support to Visual Studio!

The VB.NET team goes: This is not what they are used to. We think our gang
of coders can't learn new things. Let's drop intellisense on the select and
at least they may feel at home. Most of our coders are near braindead
anyways, and use arrows- and page-up/down for one line of code; - They won't
mind...

C# ---->

<----- VB

- Michael S
Ignacio Machin ( .NET/ C# MVP ) - 14 Dec 2005 13:34 GMT
Hi,

> The VB.NET team goes: This is not what they are used to. We think our gang
> of coders can't learn new things. Let's drop intellisense on the select
> and at least they may feel at home. Most of our coders are near braindead
> anyways, and use arrows- and page-up/down for one line of code; - They
> won't mind...

LOL

Or maybe select is not long enough and go for something like DoSelect :)

Signature

Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Michael S - 14 Dec 2005 14:49 GMT
That won't compile! You mean

AndAlso DoSelect OrElse

=)

- Michael S

> Hi,
>
[quoted text clipped - 7 lines]
>
> Or maybe select is not long enough and go for something like DoSelect :)
iWeb - 13 Dec 2005 16:21 GMT
Hi,
New here so be kind... :)

I found this link sometime back when asked by fellow (VB Experienced)
developers the same question.

"Differences Between Visual Basic .NET and Visual C# .NET"
http://support.microsoft.com/default.aspx?scid=kb;en-us;308470

I've worked in VB6 since 1999 but since being involved in c# projects for
the past 3 years, my first preference is c#.

Signature

iWeb
... for lack of a better nickname.

> Hi all
>
[quoted text clipped - 11 lines]
>
> Thanks
Michael S - 13 Dec 2005 18:43 GMT
> New here so be kind... :)

We will be. You are most Welcome.
We only hurt veteran posters we know.... and Flamewarriors... and Trolls. =)

> "Differences Between Visual Basic .NET and Visual C# .NET"
> http://support.microsoft.com/default.aspx?scid=kb;en-us;308470

But with NET 2.0 this article is almost obsolete. And with 3.0 there will be
hardly none.

> I've worked in VB6 since 1999 but since being involved in c# projects for
> the past 3 years, my first preference is c#.

And so you get in here, posting a link updated in june on a legacy topic,
and then tell us you might have lost your brain since 1999, and then brags
about you getting your rationale back?

Great post!

- Michael S

ps.
Now Nicholas will spank me again for being an a-hole.

pps.
iWeb: I'm not really a bastard. Just trying to be funny. Welcome!
Michael S - 13 Dec 2005 20:02 GMT
> But with NET 2.0 this article is almost obsolete. And with 3.0 there will
> be hardly none.

As you know specs by heart, wouldn't this be something you should write
about on your website.. Just an idea...

- Michael S
Jon Skeet [C# MVP] - 14 Dec 2005 12:43 GMT
> > But with NET 2.0 this article is almost obsolete. And with 3.0 there will
> > be hardly none.
>
> As you know specs by heart, wouldn't this be something you should write
> about on your website.. Just an idea...

Possibly. However, I disagree with your assertion (if I understand it
correctly) that C# 3.0 will be the same as VB 9.0. Having converged
somewhat, the languages are likely to *diverge* significantly in the
next release or two.

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Alvin Bruney - ASP.NET MVP - 14 Dec 2005 19:27 GMT
I like how OP called and Jon came running. MS must be paying some good money
for that type of support!

Signature

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------

> > > But with NET 2.0 this article is almost obsolete. And with 3.0 there will
> > > be hardly none.
[quoted text clipped - 6 lines]
> somewhat, the languages are likely to *diverge* significantly in the
> next release or two.
Jon Skeet [C# MVP] - 14 Dec 2005 22:59 GMT
> I like how OP called and Jon came running. MS must be paying some good money
> for that type of support!

Nah - I just have rules so that I see any threads which mention my name
:)

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Peter Bromberg [C# MVP] - 13 Dec 2005 17:32 GMT
Mantorok,
VB.NET is really a first-class member of the .Net family, although I do not
use it myself if I can possibly avoid doing so. I just don't like it anymore
now that I have C#.

The main issue I have with VB.NET is that it brings with it a lot of the
"culture" of the previous Classic VB mentality - and with that, the
sloppiness and potential runtime errors that can come with not setting Option
Strict and Option Explicit to "On" and extensive use of the
Microsoft.VisualBasic namespace - when the .NET Framework BCL proper already
has everything you need. In addition, you might want to mention to your boss
that unfortunately, the Microsoft.VisualBasic assembly is not marked
CLS-Compliant and this can cause problems down the road. I understand,
however, that this has been fixed in .NET 2.0.
--Peter

Signature

Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

> Hi all
>
[quoted text clipped - 11 lines]
>
> Thanks
Michael S - 13 Dec 2005 19:25 GMT
> Mantorok,
> IIn addition, you might want to mention to your boss
> that unfortunately, the Microsoft.VisualBasic assembly is not marked
> CLS-Compliant and this can cause problems down the road. I understand,
> however, that this has been fixed in .NET 2.0.
> --Peter

Nice Peter.

This is an important thing. More 'ammo' to Mantorok.

While C# is not CLS-compliant at all, for example being case-sensitive, C#
kinda inspire you to write good clean managed code.

VB.NET devs typically reference the Microsoft.VisualBasic namespace, which
(usually) involves COM and makes the code go out of specs by ISO and ECMA.

A C# dev may not conform to CLS; He might go high on crack, and name methods
with the same name, SoHigh(), soHigh(), SOHIGH(); but I think this never
happens.

C# devs tend to know that you shouldn't expose a public overloaded operator
in a public framework, as C++.NET devs knows they shouldn't sport
multi-inherited class as public.

CLS is not a problem!

I really don't think this CLS-thingy is a problem at all; as coders who know
their code will be used by someone else, typically takes more care in making
it good.

In the meantime, VBers are including stuff from the Microsoft namespace just
to get some VB6 feel into their coding, and by so, will never run on Mono.
While this is seldom a requirement and also seldom a problem, I still get
scared. Not for them doing it, but for not even care..

A reference to Microsoft.VisualBasic is for me a sign (proof) that the devs
are missing VB6 and would rather do that...

Put them on maintainance where they could do some serious (and important)
work, and not on development....

Just my thought.

- Michael S
Mattias Sjögren - 13 Dec 2005 19:55 GMT
>While C# is not CLS-compliant at all

CLS compliance is not a property of a language, but of the code you
write. You can write CLS compliant and non-compliant code in both C#
and VB.NET.

>VB.NET devs typically reference the Microsoft.VisualBasic namespace, which
>(usually) involves COM

Involves COM in what way?

>and makes the code go out of specs by ISO and ECMA.

Are you saying that you shouldn't use any libraries that haven't been
standardized?

>A reference to Microsoft.VisualBasic is for me a sign (proof) that the devs
>are missing VB6 and would rather do that...

The Microsoft.VisualBasic assembly is implicitly referenced by the
compiler (because it implements functionality required by the
language) so you don't have a choice.

Mattias

Signature

Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Michael S - 13 Dec 2005 21:11 GMT
>>While C# is not CLS-compliant at all
>
[quoted text clipped - 6 lines]
>
> Involves COM in what way?

I don't know. Do you?

>>and makes the code go out of specs by ISO and ECMA.
>
> Are you saying that you shouldn't use any libraries that haven't been
> standardized?

Not at all. I just want to have a stab at VB whenever I can.
You must have seen that I'm not really worried of this.

>>A reference to Microsoft.VisualBasic is for me a sign (proof) that the
>>devs
[quoted text clipped - 3 lines]
> compiler (because it implements functionality required by the
> language) so you don't have a choice.

I didn't know that.

But a funny thing is that I've seen a vb.net-coder, forced to do C#,
reference that namespace the first thing he did. But he's not the brightest
human in the world either, and makes for a poor example.

I think most people in this thread are very good at what they do, regardless
of language. What I'm trying to say is that *most* C# developers are more
interested in 'How It Actually Works', while *most* VB.NETers don't as much.

To turn the question on it's knees:

If you was forced to hire (and keep) 10 coders for a looong .NET-project
(management told you so), and you have 20 candidates fluent in VB.NET and
another 20 fluent in C#. But you are only allowed to intreview 12 of them.
Who would you call?

> Mattias

Did I make my point?
- Michael S
Peter Bromberg [C# MVP] - 13 Dec 2005 20:20 GMT
As Mattias mentioned, CLS-Compliance is not a "language feature", but a
feature of the code you write.

Some of the things the compiler checks:

Class and member names cannot differ only by case. For example, you can't
have one property named Counter and another named counter. This is important
for cross-language compatibility since VB .NET isn't case sensitive.

Overloaded class methods cannot differ only by out or ref parameter
designations.

Publicly exposed members cannot start with an underscore ( _ ).

Operators can't be overloaded

Unsigned types can't be part of the public interface of a class

My point was that unfortunately, although you can apply the CLSCompliant
attribute in VB .NET, the VB .NET compiler doesn't check for CLS compliance
(at least not in .NET 1.1).

However, I am not sure you must have a reference to the
Microsoft.VisualBasic asembly to write code in VB.NET, so long as you do not
use VB.NET language constructs that require it.

Peter

Signature

Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

> > Mantorok,
> > IIn addition, you might want to mention to your boss
[quoted text clipped - 41 lines]
>
> - Michael S
Jon Skeet [C# MVP] - 14 Dec 2005 12:48 GMT
> As Mattias mentioned, CLS-Compliance is not a "language feature", but a
> feature of the code you write.
[quoted text clipped - 4 lines]
> have one property named Counter and another named counter. This is important
> for cross-language compatibility since VB .NET isn't case sensitive.

Not quite: *public* class and member names cannot differ only by case.

For instance:

using System;

[assembly:CLSCompliant(true)]

public class Test
{
   public static void Main()
   {
   }
   
   static void main()
   {
   }
}

compiles fine. Make main() public and you'll get a compiler warning.

<snip>

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Peter Bromberg [C# MVP] - 13 Dec 2005 21:42 GMT
I misspoke.

Even if you remove the references / imports from the .vbproj file, a look at
your test class in Reflector will reveal that, indeed, a dependency on the
Microsoft.VisualBasic assembly has been magically re-created by the compiler,
whether you want it or not. So, its actually worse that I originally stated
from a CLS-Compliancy point of view. Mattias was correct.
Peter

Signature

Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

> > Mantorok,
> > IIn addition, you might want to mention to your boss
[quoted text clipped - 41 lines]
>
> - Michael S

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.