C# or VB.NET?
am 10.01.2008 12:32:59 von m.ali.qureshi
Hi,
I am a beginner in .NET. I have been coding in plain asp before, using
VBScript, and now when i'm migrating to .NET, i obviously chosed VB.NET.
But.... when i see code samples on net, they are mostly in C#, i also saw a
post in this newsgroup where someone mentioned that it was a very "heated
topic back in 2002 about VB.NET vs C#".
So, my question is... what was the result of that topic?
What is best to go for, VB.NET or C#? and why?
Thanks and regards
Re: C# or VB.NET?
am 10.01.2008 12:52:54 von Kevin Spencer
Which language you choose depends on a number of factors. If you are a
professional and have career in mind, C# is going to give you better odds at
advancing your career. In addition, as you've noticed, it is much easier to
find examples and samples written in C#. On the other hand, if you are a
casual or part-time developer, and you have little or no experience with the
C or Java language families, and are familiar with VB or VBScript, and you
are not familiar with object-oriented programming, it might be easier for
you to ease into ASP.Net with VB.Net, and worry about learning or not
learning C# later on. The difference between the programming paradigm of ASP
classic and ASP.Net is quite a learning curve. However, it might be argued
that learning C# when you start learning ASP.Net will help you keep from
falling into the trap of thinking in ASP classic terms when doing ASP.Net.
Ultimately, it's entirely up to you, and, as Led Zeppelin once said, "there
are 2 paths you can go by, but in the long run, there's still time to change
the road you're on."
--
HTH,
Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
"M. Ali Qureshi" wrote in message
news:726AB418-B792-4C73-A8A0-360D6BBD7184@microsoft.com...
> Hi,
>
> I am a beginner in .NET. I have been coding in plain asp before, using
> VBScript, and now when i'm migrating to .NET, i obviously chosed VB.NET.
>
> But.... when i see code samples on net, they are mostly in C#, i also saw
> a post in this newsgroup where someone mentioned that it was a very
> "heated topic back in 2002 about VB.NET vs C#".
>
> So, my question is... what was the result of that topic?
> What is best to go for, VB.NET or C#? and why?
>
> Thanks and regards
Re: C# or VB.NET?
am 10.01.2008 12:57:08 von mark
"M. Ali Qureshi" wrote in message
news:726AB418-B792-4C73-A8A0-360D6BBD7184@microsoft.com...
> I am a beginner in .NET. I have been coding in plain ASP before, using
> VBScript, and now when I'm migrating to .NET, I obviously chose VB.NET.
Obviously??? You've clearly fallen into the trap that VB.NET is somehow an
upgrade of Visual Basic and that ASP.NET is somehow an upgrade of ASP
Classic. Apart from some peripheral syntactic similarities, nothing could be
further from the truth. The reason, of course, is the .NET Framework...
Since you're familiar with ASP Classic, you no doubt enjoy the comfort
factor of Dim This As That, If...Then...Else...End If etc... But, since
you're familiar with ASP Classic, you've almost certainly had some exposure
to JavaScript, so basic C# syntax will already be totally understandable to
you...
> But.... when i see code samples on net, they are mostly in C#, i also saw
> a post in this newsgroup where someone mentioned that it was a very
> "heated topic back in 2002 about VB.NET vs C#".
That was me...
> So, my question is... what was the result of that topic?
There was no result, because there is no right or wrong answer... Both
languages are (almost) identical in terms of functionality - the only main
advantage that C# had over VB.NET was support for unsafe code i.e. pointers.
The reason that both languages are (almost) identical is because they both
target the .NET Framework. At it most simplistic level, it really doesn't
matter at all what .NET language you use - they are all identical...
> What is best to go for, VB.NET or C#? and why?
Both, and then decide which you prefer.
It's my personal opinion that VB.NET is a totally unnecessary language, and
it exists purely for reasons of marketing. Back in early 2002, outside of
Microsoft and a tiny beta test community, there were no C# programmers at
all. But there were millions and millions of VB programmers, and Microsoft
weren't about to alienate them by releasing a new development suite with no
flavour of Basic...
Prior to .NET, I'd made my living almost exclusively with the various
dialects of Basic right back as far as QuickBasic and on through VB for DOS,
VB for Windows, VBScript, AccessBasic, WordBasic, VBA etc.
But, after about a day with C#, I knew that I never wanted to write another
line of Basic again! And, apart from one piece of work in 2004 that I simply
couldn't turn down, I never have...
However, that's just my opinion...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 13:21:34 von CMoya
I disagree with you. Although I like C#, it's only because of a sense of
cachet that it gives you that you probably feel the way you do (because of
the fuzzy feeling you get when you think it's somehow related to C++ in some
way-- when really it's not). Aside from C#'s pointer and rudimentary
unmanaged code ability (useless in most business solutions), VB does MORE
than C#. VB event wiring is better (withevents), intellisense + syntax
checking much much better (background compiling as you type), built in
functions that wrap a lot of code up (for example, Asc, Left, Mid etc...
that handle exceptions gracefully) in both the VisualBasic Library namespace
and the handy "My" namespace. Add to that VB2008's superior LINQ/XML
implementation and you have a clear superior.
Now, you're perfectly welcome to prefer the C# syntax. But in terms of
functionality VB is not "identical" to C#... it's better.
C. Moya
http://www.cmoya.com
"Mark Rae [MVP]" wrote in message
news:%23uLjs$3UIHA.5300@TK2MSFTNGP03.phx.gbl...
> "M. Ali Qureshi" wrote in message
> news:726AB418-B792-4C73-A8A0-360D6BBD7184@microsoft.com...
>
>> I am a beginner in .NET. I have been coding in plain ASP before, using
>> VBScript, and now when I'm migrating to .NET, I obviously chose VB.NET.
>
> Obviously??? You've clearly fallen into the trap that VB.NET is somehow an
> upgrade of Visual Basic and that ASP.NET is somehow an upgrade of ASP
> Classic. Apart from some peripheral syntactic similarities, nothing could
> be further from the truth. The reason, of course, is the .NET Framework...
>
> Since you're familiar with ASP Classic, you no doubt enjoy the comfort
> factor of Dim This As That, If...Then...Else...End If etc... But, since
> you're familiar with ASP Classic, you've almost certainly had some
> exposure to JavaScript, so basic C# syntax will already be totally
> understandable to you...
>
>> But.... when i see code samples on net, they are mostly in C#, i also saw
>> a post in this newsgroup where someone mentioned that it was a very
>> "heated topic back in 2002 about VB.NET vs C#".
>
> That was me...
>
>> So, my question is... what was the result of that topic?
>
> There was no result, because there is no right or wrong answer... Both
> languages are (almost) identical in terms of functionality - the only main
> advantage that C# had over VB.NET was support for unsafe code i.e.
> pointers. The reason that both languages are (almost) identical is because
> they both target the .NET Framework. At it most simplistic level, it
> really doesn't matter at all what .NET language you use - they are all
> identical...
>
>> What is best to go for, VB.NET or C#? and why?
>
> Both, and then decide which you prefer.
>
> It's my personal opinion that VB.NET is a totally unnecessary language,
> and it exists purely for reasons of marketing. Back in early 2002, outside
> of Microsoft and a tiny beta test community, there were no C# programmers
> at all. But there were millions and millions of VB programmers, and
> Microsoft weren't about to alienate them by releasing a new development
> suite with no flavour of Basic...
>
> Prior to .NET, I'd made my living almost exclusively with the various
> dialects of Basic right back as far as QuickBasic and on through VB for
> DOS, VB for Windows, VBScript, AccessBasic, WordBasic, VBA etc.
>
> But, after about a day with C#, I knew that I never wanted to write
> another line of Basic again! And, apart from one piece of work in 2004
> that I simply couldn't turn down, I never have...
>
> However, that's just my opinion...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 13:39:34 von mark
"CMoya" wrote in message
news:5BBFD0DB-D307-4890-80C2-B4C4F9821DC8@microsoft.com...
>I disagree with you. Although I like C#, it's only because of a sense of
>cachet that it gives you that you probably feel the way you do (because of
>the fuzzy feeling you get when you think it's somehow related to C++ in
>some way-- when really it's not).
Not true at all - I've never used C/C++ at all in my entire career...
> Aside from C#'s pointer and rudimentary unmanaged code ability
You mean unsafe code, not unmanaged code...
> VB event wiring is better (withevents),
WithEvents is totally unnecessary in C#, otherwise it would have it:
http://www.thescripts.com/forum/thread255585.html
> Asc
http://www.thescripts.com/forum/thread441566.html
> Left, Mid
http://www.thescripts.com/forum/thread246103.html
> Now, you're perfectly welcome to prefer the C# syntax. But in terms of
> functionality VB is not "identical" to C#... it's better.
We'll have to agree to disagree... :-)
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 13:42:11 von m.ali.qureshi
Just as i was about to be convinced to go with c#, CMoya's comments have
again put me back at 0-point :-)
Well, i am a part-time/casual developer. By profession i am a SysAdmin.
Developing is something i just like doing in my free time, and i create
small applications for internal use i our company, which are often
appreciated, since the developers are always working for customers.
The reason why i started with vb.net is because of the familiar syntax of
VBScript (Dim, if then else, for each etc etc...). I do have very good
knowlege og Javascript and a bit knowlege of J2EE as well. So, i dont really
think it will be much of trouble for me to switch to c#. Also because i'm
still a beginner with .NET.
But again, CMoya's comments sounds quite promising in favour of VB. Though
honestly, i didn't understand quite a few things he mentioned :-). But all
i'm looking for is "best" way to choose.
Thank you all for your helpful replies.
Regards.
"M. Ali Qureshi" wrote in message
news:726AB418-B792-4C73-A8A0-360D6BBD7184@microsoft.com...
> Hi,
>
> I am a beginner in .NET. I have been coding in plain asp before, using
> VBScript, and now when i'm migrating to .NET, i obviously chosed VB.NET.
>
> But.... when i see code samples on net, they are mostly in C#, i also saw
> a post in this newsgroup where someone mentioned that it was a very
> "heated topic back in 2002 about VB.NET vs C#".
>
> So, my question is... what was the result of that topic?
> What is best to go for, VB.NET or C#? and why?
>
> Thanks and regards
Re: C# or VB.NET?
am 10.01.2008 13:47:42 von m.ali.qureshi
Hi,
Just as i was about to be convinced to go with c#, CMoya's comments have
again put me back at 0-point :-)
Well, i am a part-time/casual developer. By profession i am a SysAdmin.
Developing is something i just like doing in my free time, and i create
small applications for internal use i our company, which are often
appreciated, since the full-time developers are always working for
customers.
The reason why i started with vb.net is because of the familiar syntax of
VBScript (Dim, if then else, for each etc etc...). I do have very good
knowlege og Javascript and a bit knowlege of J2EE as well. So, i dont really
think it will be much of trouble for me to switch to c#. Also because i'm
still a beginner with .NET.
But again, CMoya's comments sounds quite promising in favour of VB. Though
honestly, i didn't understand a few things he mentioned :-). But all i'm
looking for is "best" way to choose.
Thank you all for your helpful replies.
Regards.
"Mark Rae [MVP]" wrote in message
news:%23uLjs$3UIHA.5300@TK2MSFTNGP03.phx.gbl...
> "M. Ali Qureshi" wrote in message
> news:726AB418-B792-4C73-A8A0-360D6BBD7184@microsoft.com...
>
>> I am a beginner in .NET. I have been coding in plain ASP before, using
>> VBScript, and now when I'm migrating to .NET, I obviously chose VB.NET.
>
> Obviously??? You've clearly fallen into the trap that VB.NET is somehow an
> upgrade of Visual Basic and that ASP.NET is somehow an upgrade of ASP
> Classic. Apart from some peripheral syntactic similarities, nothing could
> be further from the truth. The reason, of course, is the .NET Framework...
>
> Since you're familiar with ASP Classic, you no doubt enjoy the comfort
> factor of Dim This As That, If...Then...Else...End If etc... But, since
> you're familiar with ASP Classic, you've almost certainly had some
> exposure to JavaScript, so basic C# syntax will already be totally
> understandable to you...
>
>> But.... when i see code samples on net, they are mostly in C#, i also saw
>> a post in this newsgroup where someone mentioned that it was a very
>> "heated topic back in 2002 about VB.NET vs C#".
>
> That was me...
>
>> So, my question is... what was the result of that topic?
>
> There was no result, because there is no right or wrong answer... Both
> languages are (almost) identical in terms of functionality - the only main
> advantage that C# had over VB.NET was support for unsafe code i.e.
> pointers. The reason that both languages are (almost) identical is because
> they both target the .NET Framework. At it most simplistic level, it
> really doesn't matter at all what .NET language you use - they are all
> identical...
>
>> What is best to go for, VB.NET or C#? and why?
>
> Both, and then decide which you prefer.
>
> It's my personal opinion that VB.NET is a totally unnecessary language,
> and it exists purely for reasons of marketing. Back in early 2002, outside
> of Microsoft and a tiny beta test community, there were no C# programmers
> at all. But there were millions and millions of VB programmers, and
> Microsoft weren't about to alienate them by releasing a new development
> suite with no flavour of Basic...
>
> Prior to .NET, I'd made my living almost exclusively with the various
> dialects of Basic right back as far as QuickBasic and on through VB for
> DOS, VB for Windows, VBScript, AccessBasic, WordBasic, VBA etc.
>
> But, after about a day with C#, I knew that I never wanted to write
> another line of Basic again! And, apart from one piece of work in 2004
> that I simply couldn't turn down, I never have...
>
> However, that's just my opinion...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 13:53:30 von mark
"M. Ali Qureshi" wrote in message
news:e$wS7Y4UIHA.5360@TK2MSFTNGP03.phx.gbl...
> But all I'm looking for is "best" way to choose.
Why do you actually have to choose at all...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 14:07:00 von m.ali.qureshi
> Why do you actually have to choose at all...?
Maybe that was wrong choice of words. "Best way to begin" maybe :-)
Well, i have alot to learn in .NET yet, and if i go to c#, then syntax will
be yet another thing to learn. Besides, most of the samples online are in
c#, and by converting them always to VB for me will give me some knolege of
c# as well.
But since you are an MVP in asp.net. What would you suggest a beginner with
my background. VB or C# to begin learning?
Regards.
"Mark Rae [MVP]" wrote in message
news:%23UAQMf4UIHA.4624@TK2MSFTNGP03.phx.gbl...
> "M. Ali Qureshi" wrote in message
> news:e$wS7Y4UIHA.5360@TK2MSFTNGP03.phx.gbl...
>
>> But all I'm looking for is "best" way to choose.
>
> Why do you actually have to choose at all...?
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 14:16:57 von mark
"M. Ali Qureshi" wrote in message
news:espbym4UIHA.5164@TK2MSFTNGP03.phx.gbl...
>> Why do you actually have to choose at all...?
> Maybe that was wrong choice of words. "Best way to begin" maybe :-)
Fair enough.
> But since you are an MVP in asp.net. What would you suggest a beginner
> with my background. VB or C# to begin learning?
I would suggest you begin with C#, for no other reason that it will force
you to think in an object-orientated .NET way and prevent you from carrying
over any of the VBScript baggage...
I've known quite a few new (to .NET) developers who have begun with VB.NET
and then switched to C# - I've never known the reverse...
And, if ever you find yourself thinking "How would I have done this in ASP
Classic?", then have a five-minute break and approach the problem again from
the beginning... :-)
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 14:24:38 von CMoya
You missed the point.... with your links. For example:
The replacement for VB's "str2 = Left(str, 5)" is not string.Substring(...).
It's
if (str != null)
{
if (str.Length >= 6) {
str2 = str.Substring(0, 5);
}
else {
str2 = str;
}
}
else {
str2 = string.Empty;
}
The C# way! ;) Sure you can encapsulate this (and everyone will do it
differently... and forget a conditional here or there... and u might see the
encapsulation in a bunch of places if many developers work on the same
project). But, this is just one of example of VB's "moreness" and robustness
compared to C#. :)
"Mark Rae [MVP]" wrote in message
news:%23v6EaX4UIHA.4752@TK2MSFTNGP05.phx.gbl...
> "CMoya" wrote in message
> news:5BBFD0DB-D307-4890-80C2-B4C4F9821DC8@microsoft.com...
>
>>I disagree with you. Although I like C#, it's only because of a sense of
>>cachet that it gives you that you probably feel the way you do (because of
>>the fuzzy feeling you get when you think it's somehow related to C++ in
>>some way-- when really it's not).
>
> Not true at all - I've never used C/C++ at all in my entire career...
>
>> Aside from C#'s pointer and rudimentary unmanaged code ability
>
> You mean unsafe code, not unmanaged code...
>
>> VB event wiring is better (withevents),
>
> WithEvents is totally unnecessary in C#, otherwise it would have it:
> http://www.thescripts.com/forum/thread255585.html
>
>> Asc
>
> http://www.thescripts.com/forum/thread441566.html
>
>> Left, Mid
>
> http://www.thescripts.com/forum/thread246103.html
>
>> Now, you're perfectly welcome to prefer the C# syntax. But in terms of
>> functionality VB is not "identical" to C#... it's better.
>
> We'll have to agree to disagree... :-)
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 14:35:04 von mark
"CMoya" wrote in message
news:8FC636CA-1984-4D0E-9F02-3C5A86ED6704@microsoft.com...
> But, this is just one of example of VB's "moreness" and robustness
> compared to C#. :)
OK.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 14:36:20 von CMoya
>> VB event wiring is better (withevents),
> WithEvents is totally unnecessary in C#, otherwise it would have it:
> http://www.thescripts.com/forum/thread255585.html
Also, I guess VB doesn't need WithEvents/Handles either since it supports
both the C# manual += adding of events (via AddHandler... remember to remove
it too at some point!) AND a cleaner "declarative" WithEvents / Handles way.
Private Sub Button1_Click(...) Handles Button1.Click
....
End Sub
or (to similate old school VB control arrays)
Private Sub Buttons_Click(...) Handles Button1.Click, Button2.Click,
Button3.Click
....
End Sub
No need to tear down the event handler either.
"Mark Rae [MVP]" wrote in message
news:%23v6EaX4UIHA.4752@TK2MSFTNGP05.phx.gbl...
> "CMoya" wrote in message
> news:5BBFD0DB-D307-4890-80C2-B4C4F9821DC8@microsoft.com...
>
>>I disagree with you. Although I like C#, it's only because of a sense of
>>cachet that it gives you that you probably feel the way you do (because of
>>the fuzzy feeling you get when you think it's somehow related to C++ in
>>some way-- when really it's not).
>
> Not true at all - I've never used C/C++ at all in my entire career...
>
>> Aside from C#'s pointer and rudimentary unmanaged code ability
>
> You mean unsafe code, not unmanaged code...
>
>> VB event wiring is better (withevents),
>
> WithEvents is totally unnecessary in C#, otherwise it would have it:
> http://www.thescripts.com/forum/thread255585.html
>
>> Asc
>
> http://www.thescripts.com/forum/thread441566.html
>
>> Left, Mid
>
> http://www.thescripts.com/forum/thread246103.html
>
>> Now, you're perfectly welcome to prefer the C# syntax. But in terms of
>> functionality VB is not "identical" to C#... it's better.
>
> We'll have to agree to disagree... :-)
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 14:50:50 von CMoya
> I would suggest you begin with C#, for no other reason that it will force
> you to think in an object-orientated .NET way and prevent you from
> carrying over any of the VBScript baggage...
How is VB any less object-oriented than C#? Inheritance? Check. Interfaces?
Check. Namespaces? Check.
And what exactly is VBScript baggage and how is it different than JScript
baggage?
I mean, I'm not trying to be argumentative.... but you don't really posit
any real reason why C# is better than VB.
"Mark Rae [MVP]" wrote in message
news:u24oSs4UIHA.4684@TK2MSFTNGP06.phx.gbl...
> "M. Ali Qureshi" wrote in message
> news:espbym4UIHA.5164@TK2MSFTNGP03.phx.gbl...
>
>>> Why do you actually have to choose at all...?
>> Maybe that was wrong choice of words. "Best way to begin" maybe :-)
>
> Fair enough.
>
>> But since you are an MVP in asp.net. What would you suggest a beginner
>> with my background. VB or C# to begin learning?
>
> I would suggest you begin with C#, for no other reason that it will force
> you to think in an object-orientated .NET way and prevent you from
> carrying over any of the VBScript baggage...
>
> I've known quite a few new (to .NET) developers who have begun with VB.NET
> and then switched to C# - I've never known the reverse...
>
> And, if ever you find yourself thinking "How would I have done this in ASP
> Classic?", then have a five-minute break and approach the problem again
> from the beginning... :-)
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 14:58:52 von sloan
My two sides of the coin are:
If you have a asp/vb6 background..then
Side 1 : You'll be more used to using the "dim x" syntax. You'll get "on
board" slightly quicker.
Side 2 : You'll be more likely to bring bad habits with you, most of which
resolve around non OO practices.
Creating a billiion concrete classes is not OO development.
And asp.net is NOT an upgrade or extension of asp. Accept that truth
early, and you'll get on board faster.
Here is an article to look at:
http://www.cmswire.com/cms/featured-articles/not-another-c-v ersus-vb-article-000591.php
Its your choice ultimately.
The last small tid-bit thing is.... google searches.
When you search for C# tidbit and syntax, you'll only have to filter through
1.1 vs 2.0 stuff for the most part (ok, maybe 3.0 and 3.5, but 3.0 and 3.5
are more extensions of 2.0). which isn't that hard.
When you do a syntax search for vb/vb.net, you'll have to wade through 10+
years of vb snipplets (non vb.net stuff) to find the vb.net stuff you're
looking for.
To put it another way, it is (IMHO) easier to find what you're looking for
when faced with an issue...googling C# syntax.
Heck, sometimes ...4-5 years ago when I did vb.net, the only way I could
find .Net specific stuff was to artificially translate my snipplet into
C#...to avoid that "google overload syndrome"........
Last advice:
If you're ever interested in anything like WCF....or similar (more 3.0 and
3.5 stuff), then most (not all but most) examples are in C#.
And you will save time...because you don't constantly have to artificially
translate the syntax every single time you find a great C# snipplet.
This was finally the thing that I said "Ok, c# it is", because I got tired
of translating samples into vb.net just for the sake of translating samples
into c#.
And after I used c# for 2 months......it was over. The language feels
"cleaner" to me. (Which I would say you can figure out why alot of people
feel this way from the article above "not another".
The article above isn't perfect, but I like the historical aspect of it.
Good luck with your decision.
"M. Ali Qureshi" wrote in message
news:726AB418-B792-4C73-A8A0-360D6BBD7184@microsoft.com...
> Hi,
>
> I am a beginner in .NET. I have been coding in plain asp before, using
> VBScript, and now when i'm migrating to .NET, i obviously chosed VB.NET.
>
> But.... when i see code samples on net, they are mostly in C#, i also saw
a
> post in this newsgroup where someone mentioned that it was a very "heated
> topic back in 2002 about VB.NET vs C#".
>
> So, my question is... what was the result of that topic?
> What is best to go for, VB.NET or C#? and why?
>
> Thanks and regards
>
Re: C# or VB.NET?
am 10.01.2008 14:59:01 von mark
"CMoya" wrote in message
news:C7619048-5E80-4ECD-AF5D-E39B5EDF1747@microsoft.com...
> I mean, I'm not trying to be argumentative....
OK.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 15:08:45 von CMoya
"sloan" wrote in message
news:eC6f144UIHA.2464@TK2MSFTNGP04.phx.gbl...
>
> My two sides of the coin are:
>
> If you have a asp/vb6 background..then
>
> Side 1 : You'll be more used to using the "dim x" syntax. You'll get "on
> board" slightly quicker.
>
>
> Side 2 : You'll be more likely to bring bad habits with you, most of
> which
> resolve around non OO practices.
> Creating a billiion concrete classes is not OO development.
> And asp.net is NOT an upgrade or extension of asp. Accept that truth
> early, and you'll get on board faster.
>
>
>
> Here is an article to look at:
> http://www.cmswire.com/cms/featured-articles/not-another-c-v ersus-vb-article-000591.php
>
> Its your choice ultimately.
>
> The last small tid-bit thing is.... google searches.
> When you search for C# tidbit and syntax, you'll only have to filter
> through
> 1.1 vs 2.0 stuff for the most part (ok, maybe 3.0 and 3.5, but 3.0 and 3.5
> are more extensions of 2.0). which isn't that hard.
> When you do a syntax search for vb/vb.net, you'll have to wade through 10+
> years of vb snipplets (non vb.net stuff) to find the vb.net stuff you're
> looking for.
> To put it another way, it is (IMHO) easier to find what you're looking for
> when faced with an issue...googling C# syntax.
> Heck, sometimes ...4-5 years ago when I did vb.net, the only way I could
> find .Net specific stuff was to artificially translate my snipplet into
> C#...to avoid that "google overload syndrome"........
Now this is certainly true. And I agree. It's a good point. Although
sometimes all that old VB classic knowledge base on the web comes in handy
too..... especially when you find that the .NET framework doesn't do
something you want and you need to use Win32 API's via p/invoke. Lots of old
good stuff there.... no C# examples. :)
>
> Last advice:
> If you're ever interested in anything like WCF....or similar (more 3.0 and
> 3.5 stuff), then most (not all but most) examples are in C#.
> And you will save time...because you don't constantly have to artificially
> translate the syntax every single time you find a great C# snipplet.
> This was finally the thing that I said "Ok, c# it is", because I got tired
> of translating samples into vb.net just for the sake of translating
> samples
> into c#.
>
> And after I used c# for 2 months......it was over. The language feels
> "cleaner" to me. (Which I would say you can figure out why alot of people
> feel this way from the article above "not another".
>
I agree here too. C# is definately aesthetically cleaner than VB. It's not
always easier to read, but it is sparse ... while VB is verbose. I hate
having to type CType or DirectCast instead of C's beautiful casting way. But
even here too when I'm reading discussions on this topic (I lurk a lot), C#
folks' ignorance rears its ugly head... when, for instance, they call VB's
casting "function calls" (they're not... the compiler treats them as inline
casts... just like C#..... we just have to type a little more to do it. :)
> The article above isn't perfect, but I like the historical aspect of it.
>
>
> Good luck with your decision.
>
>
>
>
>
>
> "M. Ali Qureshi" wrote in message
> news:726AB418-B792-4C73-A8A0-360D6BBD7184@microsoft.com...
>> Hi,
>>
>> I am a beginner in .NET. I have been coding in plain asp before, using
>> VBScript, and now when i'm migrating to .NET, i obviously chosed VB.NET.
>>
>> But.... when i see code samples on net, they are mostly in C#, i also saw
> a
>> post in this newsgroup where someone mentioned that it was a very "heated
>> topic back in 2002 about VB.NET vs C#".
>>
>> So, my question is... what was the result of that topic?
>> What is best to go for, VB.NET or C#? and why?
>>
>> Thanks and regards
>>
>
>
Re: C# or VB.NET?
am 10.01.2008 15:15:10 von m.ali.qureshi
> I mean, I'm not trying to be argumentative.... but you don't really posit
> any real reason why C# is better than VB.
Good point.
"CMoya" wrote in message
news:C7619048-5E80-4ECD-AF5D-E39B5EDF1747@microsoft.com...
>> I would suggest you begin with C#, for no other reason that it will force
>> you to think in an object-orientated .NET way and prevent you from
>> carrying over any of the VBScript baggage...
>
> How is VB any less object-oriented than C#? Inheritance? Check.
> Interfaces? Check. Namespaces? Check.
> And what exactly is VBScript baggage and how is it different than JScript
> baggage?
>
> I mean, I'm not trying to be argumentative.... but you don't really posit
> any real reason why C# is better than VB.
>
>
> "Mark Rae [MVP]" wrote in message
> news:u24oSs4UIHA.4684@TK2MSFTNGP06.phx.gbl...
>> "M. Ali Qureshi" wrote in message
>> news:espbym4UIHA.5164@TK2MSFTNGP03.phx.gbl...
>>
>>>> Why do you actually have to choose at all...?
>>> Maybe that was wrong choice of words. "Best way to begin" maybe :-)
>>
>> Fair enough.
>>
>>> But since you are an MVP in asp.net. What would you suggest a beginner
>>> with my background. VB or C# to begin learning?
>>
>> I would suggest you begin with C#, for no other reason that it will force
>> you to think in an object-orientated .NET way and prevent you from
>> carrying over any of the VBScript baggage...
>>
>> I've known quite a few new (to .NET) developers who have begun with
>> VB.NET and then switched to C# - I've never known the reverse...
>>
>> And, if ever you find yourself thinking "How would I have done this in
>> ASP Classic?", then have a five-minute break and approach the problem
>> again from the beginning... :-)
>>
>>
>> --
>> Mark Rae
>> ASP.NET MVP
>> http://www.markrae.net
>
Re: C# or VB.NET?
am 10.01.2008 15:25:54 von m.ali.qureshi
> I would suggest you begin with C#, for no other reason that it will force
> you to think in an object-orientated .NET way and prevent you from
> carrying over any of the VBScript baggage...
I think this point has alot of weight. I do still think about "how i would
have solved a perticular issue in classic ASP"
Why i even touched this "heated topic" here is because i just wanted to know
what is "best". During my learning also i've been trying to stick with
"best-practices". using n-tier application structure etc...
But i must say, VB.NET and C# is not a "choice" one can make. One way or
another, in the end i'll actualy be having my hands on both.
Thank you everyone for very helpful input. I've learnt alot from this
discussion.
"Mark Rae [MVP]" wrote in message
news:u24oSs4UIHA.4684@TK2MSFTNGP06.phx.gbl...
> "M. Ali Qureshi" wrote in message
> news:espbym4UIHA.5164@TK2MSFTNGP03.phx.gbl...
>
>>> Why do you actually have to choose at all...?
>> Maybe that was wrong choice of words. "Best way to begin" maybe :-)
>
> Fair enough.
>
>> But since you are an MVP in asp.net. What would you suggest a beginner
>> with my background. VB or C# to begin learning?
>
> I would suggest you begin with C#, for no other reason that it will force
> you to think in an object-orientated .NET way and prevent you from
> carrying over any of the VBScript baggage...
>
> I've known quite a few new (to .NET) developers who have begun with VB.NET
> and then switched to C# - I've never known the reverse...
>
> And, if ever you find yourself thinking "How would I have done this in ASP
> Classic?", then have a five-minute break and approach the problem again
> from the beginning... :-)
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 15:29:29 von ge0193387
> Side 2 : You'll be more likely to bring bad habits with you, most of which
> resolve around non OO practices.
This is probably the best argument against VB. Nothing was worse than
working with a bunch of programmers that went from VB6 to .NET with no
learning at all. Every single horrible thing they could do in VB6 (it
was bad then too) went directly over to .NET. When you force yourself
to learn a new language you can to wield it the correct way from the
beginning dumping those bad habits from the beginning rather than
"knowing" how you can do something and it be bad. This is even more
true with VB since they carried over the functions from older versions
into .NET (i.e. LTrim() Mid() cInt) whereas the .NET way is
different. The advantage to going to C# and having a VBScript
background is you should be able to read/write VB.NET fairly from
knowing C# and VBScript while it doesn't work as well the other way
(only VB with no C# learning).
Re: C# or VB.NET?
am 10.01.2008 15:51:45 von George Ter-Saakov
> I mean, I'm not trying to be argumentative.... but you don't really posit
> any real reason why C# is better than VB.
there is only 2 reasons (listed bellow) why (I think) C# is better than
VB.NET.
1. Less characters to type.
I would kill the person who came up with "Then", "End if", "Select Case".
Well, i am kidding, not kill of course, but make him write 1000 times IF ...
THEN ... ELSE :)
For me { }, "switch" are more easily to read and i understand code better.
The type casting is a killing compare C# (int)a; with CType(a, int)
I have a big "thank you" to developers of C# for coming up with "using" and
"lock" keywords.
And i can go on...... Implements/Inherits keywords in VB, "Dim B as
Integer" vs "int b", IList.Item vs [], .......
2. As it been for years C# compiler is less guessing/forgiven than VB.NET
compiler.
I was cought couple time when my code would produce result i did not expect
because VB.NET compiler "guessed" for me what i want to do. And guesses
incorrectly. I agree that my code was ambigious but C# would give me an
error at compile time as apposed to VB that would throw an error when my
customers using the program.
Biggest example: Option Explicit. It is a mad man invention. Thanks though
that it's "On" by default now. I used to use non-dictionary words every time
I saw it's Off in old VB programs...Still see people using it.... I guess
hardcode VB programmers that life did not tach anything :)
------------------------------------------------------------ -------
If you can put up with #1 and #2 then Vb.NET and C# languages pretty much
the same.
George.
Re: C# or VB.NET?
am 10.01.2008 16:02:09 von CMoya
"cfps.Christian" wrote in message
news:577cf46f-91ea-43db-a4d0-ab2a436fac3c@j78g2000hsd.google groups.com...
> beginning dumping those bad habits from the beginning rather than
> "knowing" how you can do something and it be bad. This is even more
> true with VB since they carried over the functions from older versions
> into .NET (i.e. LTrim() Mid() cInt) whereas the .NET way is
> different.
But, see, this is what I don't get. And I think C# folks put out a lot of
misinformation about this. Mid, Trim, etc. are suppossed to HELP. They have
no functional equivalents in .NET. No, Substring(...) isn't the same because
1) you need to make sure the string isn't a null reference first, and 2)
exceptions are thrown if you pass values larger than the string. So
everytime you'd like to do the equivalent of Left(...) you have to do:
if (str != null)
{
if (str.Length >= 6) {
str2 = str.Substring(0, 5);
}
else {
str2 = str;
}
}
else {
str2 = string.Empty;
}
How does that beat Left(str, 5)? Ah. You can write your own function, sure.
But, I can't count the number of different times I've seen this done 3
different ways by 3 different C# developers in the SAME project who didn't
realize another developer had already written it. That's BAD.
And what's this .NET way for CInt that mention? All CInt is shorthand for
CType(var, Integer)... which is a more robust inline compile operator (a
cast, not a function call) that mimics System.Convert(object,
IFormatProvider) (a function call). The VB way produces faster msil than the
equivalent.
--
-C. Moya
http://www.cmoya.com
"cfps.Christian" wrote in message
news:577cf46f-91ea-43db-a4d0-ab2a436fac3c@j78g2000hsd.google groups.com...
>> Side 2 : You'll be more likely to bring bad habits with you, most of
>> which
>> resolve around non OO practices.
>
> This is probably the best argument against VB. Nothing was worse than
> working with a bunch of programmers that went from VB6 to .NET with no
> learning at all. Every single horrible thing they could do in VB6 (it
> was bad then too) went directly over to .NET. When you force yourself
> to learn a new language you can to wield it the correct way from the
> beginning dumping those bad habits from the beginning rather than
> "knowing" how you can do something and it be bad. This is even more
> true with VB since they carried over the functions from older versions
> into .NET (i.e. LTrim() Mid() cInt) whereas the .NET way is
> different. The advantage to going to C# and having a VBScript
> background is you should be able to read/write VB.NET fairly from
> knowing C# and VBScript while it doesn't work as well the other way
> (only VB with no C# learning).
Re: C# or VB.NET?
am 10.01.2008 16:18:11 von CMoya
"George Ter-Saakov" wrote in message
news:%233n8Sh5UIHA.5132@TK2MSFTNGP02.phx.gbl...
>> I mean, I'm not trying to be argumentative.... but you don't really posit
>> any real reason why C# is better than VB.
>
> there is only 2 reasons (listed bellow) why (I think) C# is better than
> VB.NET.
>
> 1. Less characters to type.
> I would kill the person who came up with "Then", "End if", "Select Case".
> Well, i am kidding, not kill of course, but make him write 1000 times IF
> ... THEN ... ELSE :)
>
> For me { }, "switch" are more easily to read and i understand code better.
Ugh. But the "Break;" in every single case block drives me mad. It's so.....
1982. ;) The C switch statement is the equivalent of the VB goto in terms of
ugliness.
>
> The type casting is a killing compare C# (int)a; with CType(a, int)
Yeah, C#'s way is definately prettier. But VB's casting is still casting. C#
folks think they're function calls, but they're not. They compile to
straight MSIL code.
> I have a big "thank you" to developers of C# for coming up with "using"
> and "lock" keywords.
VB has the "Using" (automatical disposal) keyword too.
Plus, VB has the "With" keyword.... which is beautiful. C# doesn't.
And VB has the SyncLock keyword.
>
> And i can go on...... Implements/Inherits keywords in VB, "Dim B as
> Integer" vs "int b", IList.Item vs [], .......
>
Yes, VB is more verbose.
>
> 2. As it been for years C# compiler is less guessing/forgiven than VB.NET
> compiler.
> I was cought couple time when my code would produce result i did not
> expect because VB.NET compiler "guessed" for me what i want to do. And
> guesses incorrectly. I agree that my code was ambigious but C# would give
> me an error at compile time as apposed to VB that would throw an error
> when my customers using the program.
> Biggest example: Option Explicit. It is a mad man invention. Thanks though
> that it's "On" by default now. I used to use non-dictionary words every
> time I saw it's Off in old VB programs...Still see people using it.... I
> guess hardcode VB programmers that life did not tach anything :)
Everybody knows to turn on Explicit/Strict options.
And turning them off (on a class by class basis) can under *some*
circumstances be an asset... like when you need to create an MS Office
automation solution and you don't want to bind to one particular version,
but rather have it work with all versions of MS Office. No can do in C#
(AFAIK).
> ------------------------------------------------------------ -------
> If you can put up with #1 and #2 then Vb.NET and C# languages pretty much
> the same.
>
> George.
>
--
-C. Moya
http://www.cmoya.com
Re: C# or VB.NET?
am 10.01.2008 16:27:54 von David Wier
The thing is, having a background in VB, you will get a quicker start in
..Net, using VB.Net. I did and it worked well for me.
I know there are a lot of sites with C# samples, but I can think of one with
mainly VB.Net (hint)
Having said all that, I don't see why, once you get started, and somewhat
understand the basics, you don't also try C#.
It's not a One or the Other type of situation.
If you know both, you become more knowledgeable. Therefore, at that point,
if you want to stick with one or the other, you can make your own decision
based on what you've learned yourself.
David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
"M. Ali Qureshi" wrote in message
news:OZm$3S5UIHA.4280@TK2MSFTNGP06.phx.gbl...
>> I would suggest you begin with C#, for no other reason that it will force
>> you to think in an object-orientated .NET way and prevent you from
>> carrying over any of the VBScript baggage...
>
> I think this point has alot of weight. I do still think about "how i would
> have solved a perticular issue in classic ASP"
>
> Why i even touched this "heated topic" here is because i just wanted to
> know what is "best". During my learning also i've been trying to stick
> with "best-practices". using n-tier application structure etc...
>
> But i must say, VB.NET and C# is not a "choice" one can make. One way or
> another, in the end i'll actualy be having my hands on both.
>
> Thank you everyone for very helpful input. I've learnt alot from this
> discussion.
>
>
> "Mark Rae [MVP]" wrote in message
> news:u24oSs4UIHA.4684@TK2MSFTNGP06.phx.gbl...
>> "M. Ali Qureshi" wrote in message
>> news:espbym4UIHA.5164@TK2MSFTNGP03.phx.gbl...
>>
>>>> Why do you actually have to choose at all...?
>>> Maybe that was wrong choice of words. "Best way to begin" maybe :-)
>>
>> Fair enough.
>>
>>> But since you are an MVP in asp.net. What would you suggest a beginner
>>> with my background. VB or C# to begin learning?
>>
>> I would suggest you begin with C#, for no other reason that it will force
>> you to think in an object-orientated .NET way and prevent you from
>> carrying over any of the VBScript baggage...
>>
>> I've known quite a few new (to .NET) developers who have begun with
>> VB.NET and then switched to C# - I've never known the reverse...
>>
>> And, if ever you find yourself thinking "How would I have done this in
>> ASP Classic?", then have a five-minute break and approach the problem
>> again from the beginning... :-)
>>
>>
>> --
>> Mark Rae
>> ASP.NET MVP
>> http://www.markrae.net
>
Re: C# or VB.NET?
am 10.01.2008 16:58:12 von Aidy
> But, this is just one of example of VB's "moreness" and robustness
> compared to C#. :)
My understanding is that those functions are there for the VB->VB.NET
conversion utility, and also so that VB programmers can use vb.net without
having to change their coding syntax, style or methods.
Just cos you can doesn't mean you should.
Re: C# or VB.NET?
am 10.01.2008 17:01:18 von mark
"CMoya" wrote in message
news:1F345DC7-C057-4DA4-8E44-E0ECFFDF6918@microsoft.com...
> Plus, VB has the "With" keyword.... which is beautiful. C# doesn't.
Now there I fundamentally disagree with you! I think the With keyword is
positively horrible...
As you know, a 'with' statement would make C# more complex. As you will also
know, VB.NET had to add new language syntax to address the potential
ambiguity between a local variable (Text) and a property on the "with"
target (.Text), and other ways of solving this problem also introduce
language complexity.
A different approach is to push a scope and make the property hide the local
variable, but then there's no way to refer to the local without adding some
escape syntax.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 17:11:21 von mark
"Aidy" wrote in message
news:5aGdnX2qTvAI3RvanZ2dnUVZ8s6inZ2d@bt.com...
>> But, this is just one of example of VB's "moreness" and robustness
>> compared to C#. :)
>
> My understanding is that those functions are there for the VB->VB.NET
> conversion utility, and also so that VB programmers can use vb.net without
> having to change their coding syntax, style or methods.
>
> Just cos you can doesn't mean you should.
Absolutely!
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 17:15:57 von CMoya
That's wrong. The VisualBasic.dll library (where those functions reside) is
not the same as the VB Compatibility Library (that has truly deprecated
things like old VB.Classic control arrays). Stuff in the Visual Basic.dll
library are fully supported, and completely rewritten stuff.... along with
new stuff like the very handy "My" namespace, which resides in the same
library with Left/Right/Mid.
--
-C. Moya
http://www.cmoya.com
"Aidy" wrote in message
news:5aGdnX2qTvAI3RvanZ2dnUVZ8s6inZ2d@bt.com...
>> But, this is just one of example of VB's "moreness" and robustness
>> compared to C#. :)
>
> My understanding is that those functions are there for the VB->VB.NET
> conversion utility, and also so that VB programmers can use vb.net without
> having to change their coding syntax, style or methods.
>
> Just cos you can doesn't mean you should.
>
Re: C# or VB.NET?
am 10.01.2008 17:15:59 von George Ter-Saakov
"CMoya" wrote in message
news:1F345DC7-C057-4DA4-8E44-E0ECFFDF6918@microsoft.com...
> Ugh. But the "Break;" in every single case block drives me mad. It's
> so..... 1982. ;) The C switch statement is the equivalent of the VB goto
> in terms of ugliness.
Agree that C# has a lot of semicolumns. But the whole point is that on
average you have less to type with C# than .NET.
And for me it's easier to read C# program than .NET but that might be just
me.
> circumstances be an asset... like when you need to create an MS Office
> automation solution and you don't want to bind to one particular version,
> but rather have it work with all versions of MS Office. No can do in C#
> (AFAIK).
Reference the earliest version of MS Office your program would work with and
all newest versions will work as well.
------------------------------------------------
Late binding is possible in C#
http://support.microsoft.com/kb/302902
It might be not so intuitive as in VB, but for me it falls under "compiler
trying to guess what you want to do" category. Which I consider a really bad
thing. I would rather know how staff works/done and have some control over
it.
George.
Re: C# or VB.NET?
am 10.01.2008 17:32:24 von CMoya
"Mark Rae [MVP]" wrote in message
news:eXOZvN6UIHA.5516@TK2MSFTNGP02.phx.gbl...
> "Aidy" wrote in message
> news:5aGdnX2qTvAI3RvanZ2dnUVZ8s6inZ2d@bt.com...
>
>>> But, this is just one of example of VB's "moreness" and robustness
>>> compared to C#. :)
>>
>> My understanding is that those functions are there for the VB->VB.NET
>> conversion utility, and also so that VB programmers can use vb.net
>> without having to change their coding syntax, style or methods.
>>
>> Just cos you can doesn't mean you should.
>
> Absolutely!
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
"Just cos you can doesn't mean you should" implies there's something wrong
with the function (whose equivalent you'd find in many a C#'s developer's
"snippet's library"... all different... and all redundant... and often
buggy). If the wrapper was written for you (by the Microsoft VB.NET
Team).... it's fast (rewritten in .NET), it works well, and it has (ohhhh I
dunno over 25 years worth of track record), why not use it?
Again, as I noted in another thread... the Microsoft.VisualBasic .NET
namespace is not the same as the VisualBasic.Compatibility namespace.
--
-C. Moya
http://www.cmoya.com
Re: C# or VB.NET?
am 10.01.2008 17:37:46 von CMoya
What "new language syntax" are you refering to? With (statement) is just
shorthand. I'm not aware of any caveats with it... or ambiguity between what
appears in the block and what's scoped....
Please explain.
As for ambiguity between scoped variables... (Me, the equivalent of C#'s
"this" removes all ambiguity).
--
-C. Moya
http://www.cmoya.com
"Mark Rae [MVP]" wrote in message
news:eU7OII6UIHA.4476@TK2MSFTNGP06.phx.gbl...
> "CMoya" wrote in message
> news:1F345DC7-C057-4DA4-8E44-E0ECFFDF6918@microsoft.com...
>
>> Plus, VB has the "With" keyword.... which is beautiful. C# doesn't.
>
> Now there I fundamentally disagree with you! I think the With keyword is
> positively horrible...
>
> As you know, a 'with' statement would make C# more complex. As you will
> also know, VB.NET had to add new language syntax to address the potential
> ambiguity between a local variable (Text) and a property on the "with"
> target (.Text), and other ways of solving this problem also introduce
> language complexity.
>
> A different approach is to push a scope and make the property hide the
> local variable, but then there's no way to refer to the local without
> adding some escape syntax.
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 18:07:59 von mark
"CMoya" wrote in message
news:F0734C20-EC3D-4C73-8290-C670C4D2328B@microsoft.com...
> Please explain.
http://msdn2.microsoft.com/en-us/vcsharp/aa336816.aspx
Near the bottom...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 18:54:23 von CMoya
Ah. I see. You just copy and pasted.... verbatim. That doesn't explain what
the "new language syntax" means. Do you know what that post means and thus
why you don't like it? I sure don't.
--
-C. Moya
http://www.cmoya.com
"Mark Rae [MVP]" wrote in message
news:ufLaZt6UIHA.4448@TK2MSFTNGP03.phx.gbl...
> "CMoya" wrote in message
> news:F0734C20-EC3D-4C73-8290-C670C4D2328B@microsoft.com...
>
>> Please explain.
>
> http://msdn2.microsoft.com/en-us/vcsharp/aa336816.aspx
> Near the bottom...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 19:47:44 von mark
"CMoya" wrote in message
news:OJMgNJ7UIHA.4440@TK2MSFTNGP06.phx.gbl...
> "Mark Rae [MVP]" wrote in message
> news:ufLaZt6UIHA.4448@TK2MSFTNGP03.phx.gbl...
>> "CMoya" wrote in message
>> news:F0734C20-EC3D-4C73-8290-C670C4D2328B@microsoft.com...
>>
>>> Please explain.
>>
>> http://msdn2.microsoft.com/en-us/vcsharp/aa336816.aspx
>> Near the bottom...
>
> Ah. I see. You just copy and pasted.... verbatim.
Not quite... :-)
> That doesn't explain what the "new language syntax" means. Do you know
> what that post means and thus why you don't like it? I sure don't.
I don't like the 'with' syntax because I don't find it particularly readable
or intuitive - but that's just my opinion. On a different syntactical
subject, I like placing the opening curly bracket on a new line as opposed
to the end of the previous line - again, that's just a preference.
But back to the plot; the C# team felt that a 'with' statement would add
little, if anything, to improve the language so didn't include it,
especially since it's extremely easy to simulate it if you absolutely must,
e.g.
OpenFileDialog dlgOpen = new OpenFileDialog
{
AddExtension = true,
CheckFileExists = true,
CheckPathExists = true,
DefaultExt = ".bmp"
};
See here
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=236268 6&SiteID=1 for
more on this and, yes, that's where I lifted the above snippet from... :-)
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: C# or VB.NET?
am 10.01.2008 21:52:14 von sloan
//Quote
Everybody knows to turn on Explicit/Strict options.
//
NO THEY DON'T. I REPEAT..NO THEY DON'T.
I still get arguments why some developers don't want to use it that way.
Because its "easier".
One time I turned it on, and found 200+ issues with basically:
Dim X
situations. (Aka, no datatype).
And since Option Strict/Explicit sometimes related to your IDE setup under
"solutions and projects", I find this particuliarly deficient in a team
environment.
If Vb.Net had a
Option JustLikeCSharp On
then that would be acceptable. Just because I want the compiler to find the
most errors/situations it can.
//With Keyword//
I didn't like this keyword in VB6. And if anyone nested them, good gosh.
I much prefer it not being around in C#.
.........
//Using//
In VS2005 (2.0) it is there, but not in 1.1
Anyways.
I find Option Explicit/Strict being optional ... one of the reasons I
dislike development in a group situation.
The "with" keyword is ... opinion for the most part.
"CMoya" wrote in message
news:1F345DC7-C057-4DA4-8E44-E0ECFFDF6918@microsoft.com...
>
> "George Ter-Saakov" wrote in message
> news:%233n8Sh5UIHA.5132@TK2MSFTNGP02.phx.gbl...
>>> I mean, I'm not trying to be argumentative.... but you don't really
>>> posit any real reason why C# is better than VB.
>>
>> there is only 2 reasons (listed bellow) why (I think) C# is better than
>> VB.NET.
>>
>> 1. Less characters to type.
>> I would kill the person who came up with "Then", "End if", "Select Case".
>> Well, i am kidding, not kill of course, but make him write 1000 times IF
>> ... THEN ... ELSE :)
>>
>> For me { }, "switch" are more easily to read and i understand code
>> better.
>
> Ugh. But the "Break;" in every single case block drives me mad. It's
> so..... 1982. ;) The C switch statement is the equivalent of the VB goto
> in terms of ugliness.
>
>>
>> The type casting is a killing compare C# (int)a; with CType(a, int)
>
> Yeah, C#'s way is definately prettier. But VB's casting is still casting.
> C# folks think they're function calls, but they're not. They compile to
> straight MSIL code.
>
>> I have a big "thank you" to developers of C# for coming up with "using"
>> and "lock" keywords.
>
> VB has the "Using" (automatical disposal) keyword too.
>
> Plus, VB has the "With" keyword.... which is beautiful. C# doesn't.
>
> And VB has the SyncLock keyword.
>
>>
>> And i can go on...... Implements/Inherits keywords in VB, "Dim B as
>> Integer" vs "int b", IList.Item vs [], .......
>>
>
> Yes, VB is more verbose.
>
>>
>> 2. As it been for years C# compiler is less guessing/forgiven than VB.NET
>> compiler.
>> I was cought couple time when my code would produce result i did not
>> expect because VB.NET compiler "guessed" for me what i want to do. And
>> guesses incorrectly. I agree that my code was ambigious but C# would give
>> me an error at compile time as apposed to VB that would throw an error
>> when my customers using the program.
>> Biggest example: Option Explicit. It is a mad man invention. Thanks
>> though that it's "On" by default now. I used to use non-dictionary words
>> every time I saw it's Off in old VB programs...Still see people using
>> it.... I guess hardcode VB programmers that life did not tach anything :)
>
> Everybody knows to turn on Explicit/Strict options.
> And turning them off (on a class by class basis) can under *some*
> circumstances be an asset... like when you need to create an MS Office
> automation solution and you don't want to bind to one particular version,
> but rather have it work with all versions of MS Office. No can do in C#
> (AFAIK).
>
>
>> ------------------------------------------------------------ -------
>> If you can put up with #1 and #2 then Vb.NET and C# languages pretty much
>> the same.
>>
>> George.
>>
>
>
> --
> -C. Moya
> http://www.cmoya.com
>
Re: C# or VB.NET?
am 10.01.2008 23:07:02 von CMoya
Agreed. I hardly ever use "With" anymore either (since the performance
advantage in the old COM world doesn't exist in VB.NET). Still, in my ORM
entities and stuff, where I need to map huge sets of class properties to
dataset fields, it sometimes comes in handy... and makes for way more
readable code.
I also agree that Strict/Explicit should be turned on by default. As with so
many things in the development world, it comes down to good coding
guidelines that you and your team must agree to follow. I'm sure C# has its
share of "dont's" as well that must be agreed upon in a team's coding
standards at the outset. For instance, I insist that my developers use
"this" in a class when referring to Properties (and only Properties, btw).
It makes for very readable code and is also part of Microsoft's Coding
Guidelines. But, I hardly ever see C# (or VB guys for that matter) use it.
--
-C. Moya
http://www.cmoya.com
"sloan" wrote in message
news:u3S2Kq8UIHA.1132@TK2MSFTNGP06.phx.gbl...
>
> //Quote
> Everybody knows to turn on Explicit/Strict options.
> //
>
> NO THEY DON'T. I REPEAT..NO THEY DON'T.
> I still get arguments why some developers don't want to use it that way.
> Because its "easier".
> One time I turned it on, and found 200+ issues with basically:
> Dim X
> situations. (Aka, no datatype).
>
> And since Option Strict/Explicit sometimes related to your IDE setup under
> "solutions and projects", I find this particuliarly deficient in a team
> environment.
>
>
> If Vb.Net had a
>
> Option JustLikeCSharp On
>
> then that would be acceptable. Just because I want the compiler to find
> the most errors/situations it can.
>
>
>
>
> //With Keyword//
>
> I didn't like this keyword in VB6. And if anyone nested them, good gosh.
>
> I much prefer it not being around in C#.
>
> ........
>
>
> //Using//
>
> In VS2005 (2.0) it is there, but not in 1.1
>
>
>
> Anyways.
>
> I find Option Explicit/Strict being optional ... one of the reasons I
> dislike development in a group situation.
> The "with" keyword is ... opinion for the most part.
>
>
>
>
>
>
> "CMoya" wrote in message
> news:1F345DC7-C057-4DA4-8E44-E0ECFFDF6918@microsoft.com...
>>
>> "George Ter-Saakov" wrote in message
>> news:%233n8Sh5UIHA.5132@TK2MSFTNGP02.phx.gbl...
>>>> I mean, I'm not trying to be argumentative.... but you don't really
>>>> posit any real reason why C# is better than VB.
>>>
>>> there is only 2 reasons (listed bellow) why (I think) C# is better than
>>> VB.NET.
>>>
>>> 1. Less characters to type.
>>> I would kill the person who came up with "Then", "End if", "Select
>>> Case". Well, i am kidding, not kill of course, but make him write 1000
>>> times IF ... THEN ... ELSE :)
>>>
>>> For me { }, "switch" are more easily to read and i understand code
>>> better.
>>
>> Ugh. But the "Break;" in every single case block drives me mad. It's
>> so..... 1982. ;) The C switch statement is the equivalent of the VB goto
>> in terms of ugliness.
>>
>>>
>>> The type casting is a killing compare C# (int)a; with CType(a, int)
>>
>> Yeah, C#'s way is definately prettier. But VB's casting is still casting.
>> C# folks think they're function calls, but they're not. They compile to
>> straight MSIL code.
>>
>>> I have a big "thank you" to developers of C# for coming up with "using"
>>> and "lock" keywords.
>>
>> VB has the "Using" (automatical disposal) keyword too.
>>
>> Plus, VB has the "With" keyword.... which is beautiful. C# doesn't.
>>
>> And VB has the SyncLock keyword.
>>
>>>
>>> And i can go on...... Implements/Inherits keywords in VB, "Dim B as
>>> Integer" vs "int b", IList.Item vs [], .......
>>>
>>
>> Yes, VB is more verbose.
>>
>>>
>>> 2. As it been for years C# compiler is less guessing/forgiven than
>>> VB.NET compiler.
>>> I was cought couple time when my code would produce result i did not
>>> expect because VB.NET compiler "guessed" for me what i want to do. And
>>> guesses incorrectly. I agree that my code was ambigious but C# would
>>> give me an error at compile time as apposed to VB that would throw an
>>> error when my customers using the program.
>>> Biggest example: Option Explicit. It is a mad man invention. Thanks
>>> though that it's "On" by default now. I used to use non-dictionary words
>>> every time I saw it's Off in old VB programs...Still see people using
>>> it.... I guess hardcode VB programmers that life did not tach anything
>>> :)
>>
>> Everybody knows to turn on Explicit/Strict options.
>> And turning them off (on a class by class basis) can under *some*
>> circumstances be an asset... like when you need to create an MS Office
>> automation solution and you don't want to bind to one particular version,
>> but rather have it work with all versions of MS Office. No can do in C#
>> (AFAIK).
>>
>>
>>> ------------------------------------------------------------ -------
>>> If you can put up with #1 and #2 then Vb.NET and C# languages pretty
>>> much the same.
>>>
>>> George.
>>>
>>
>>
>> --
>> -C. Moya
>> http://www.cmoya.com
>>
>
>
Re: C# or VB.NET?
am 11.01.2008 02:30:26 von CMoya
"George Ter-Saakov" wrote in message
news:%23RRPYQ6UIHA.4532@TK2MSFTNGP02.phx.gbl...
>
> "CMoya" wrote in message
> news:1F345DC7-C057-4DA4-8E44-E0ECFFDF6918@microsoft.com...
>> Ugh. But the "Break;" in every single case block drives me mad. It's
>> so..... 1982. ;) The C switch statement is the equivalent of the VB goto
>> in terms of ugliness.
>
> Agree that C# has a lot of semicolumns. But the whole point is that on
> average you have less to type with C# than .NET.
> And for me it's easier to read C# program than .NET but that might be just
> me.
Perhaps in pure syntax alone (though the common switch statement alone
belies that assertion), I agree mostly. But you do have to code *more* to
achieve the same functionality in C#. There is no equivalent to the
intelligent CType for instance (other than littering your code with
conditionals to cover it's functionality). Event wiring and tearing down
(declaratively done in VB-- though it also supports manual) and all the
"utility" wrappers in the runtime and My namespace that save oodles of code
and time IMO. And, what's funny is that VB supports all the manual C# ways
as well (Direct casting, manual event wiring via AddHandler, etc,)... so you
lose nothing.
Here's my experience in 10 years coding and leading teams: I've seen lots of
(what I personally thought) really horrible VB code.... but that worked well
with 0 bugs. It just worked. And it worked well. On the other hand my
experience with C# is I've seen some really spartan, clean, pretty code
frought with bugs because the developer never thought (or was too lazy) to
add a conditional or two to handle things C# doesn't handle intrinsically.
>
>> circumstances be an asset... like when you need to create an MS Office
>> automation solution and you don't want to bind to one particular version,
>> but rather have it work with all versions of MS Office. No can do in C#
>> (AFAIK).
>
> Reference the earliest version of MS Office your program would work with
> and all newest versions will work as well.
By having the earliest version installed on your machine to bind to? Good
luck. I don't ever want to have to install Office 2000 just because I need
to write a solution that uses a couple of it's well established COM methods.
I guess you can steal the OLB files from an Office 2000 installation on
another machine and reference them (I've done it... it works well... but is
also prone to gotchas).
> ------------------------------------------------
> Late binding is possible in C#
> http://support.microsoft.com/kb/302902
> It might be not so intuitive as in VB, but for me it falls under "compiler
> trying to guess what you want to do" category. Which I consider a really
> bad thing. I would rather know how staff works/done and have some control
> over it.
Oh wow... that code... that is just... just... horrid. Using reflection like
that to access late bound COM objects. Not only is that not as "intuitive,"
it's downright "hack-ish" and frought with many opportunities for bugs IMO.
>
>
>
>
>
> George.
>
Re: C# or VB.NET?
am 11.01.2008 10:36:25 von Aidy
> "Just cos you can doesn't mean you should" implies there's something wrong
> with the function
What would you rather do? Call "string.Length" or call "len (string)" that
then calls "string.Length" internally? And I don't know how the len
function handles nulls cos I didn't write it and haven't seen the source.
However I know how myString.Length will react if myString is null and I
don't need trial and error or consulting docs to tell me.
Using those functions also makes it harder to understand c# examples. If
you at least use vb.net as intended then reading c# shouldn't be too much
problem, and switching to c# if you want to should be easier.
Re: C# or VB.NET?
am 11.01.2008 10:39:15 von Aidy
What I'm getting at is that to convert VB to vb.net every line like;
if len(myString) > 100 then
myString = mid(myString, 1, 50)
end if
would need to be changed to
if myString.Length > 100 then
myString = myString.Substring(1, 50)
etc
So by creating len, mid etc functions, the VB code still works with very
little change.
"CMoya" wrote in message
news:DE1E7416-23A9-49E0-BDE6-1C93A013CEFE@microsoft.com...
> That's wrong. The VisualBasic.dll library (where those functions reside)
> is not the same as the VB Compatibility Library (that has truly deprecated
> things like old VB.Classic control arrays). Stuff in the Visual Basic.dll
> library are fully supported, and completely rewritten stuff.... along with
> new stuff like the very handy "My" namespace, which resides in the same
> library with Left/Right/Mid.
>
> --
> -C. Moya
> http://www.cmoya.com
>
> "Aidy" wrote in message
> news:5aGdnX2qTvAI3RvanZ2dnUVZ8s6inZ2d@bt.com...
>>> But, this is just one of example of VB's "moreness" and robustness
>>> compared to C#. :)
>>
>> My understanding is that those functions are there for the VB->VB.NET
>> conversion utility, and also so that VB programmers can use vb.net
>> without having to change their coding syntax, style or methods.
>>
>> Just cos you can doesn't mean you should.
>>
>
>
Re: C# or VB.NET?
am 11.01.2008 10:47:19 von Aidy
> Perhaps in pure syntax alone (though the common switch statement alone
> belies that assertion), I agree mostly. But you do have to code *more* to
> achieve the same functionality in C#. There is no equivalent to the
> intelligent CType for instance (other than littering your code with
> conditionals to cover it's functionality).
It might help if you provide some examples, but writing strongly typed code
is usually seen as a good thing. It removes ambiguity and the possibility
for bugs. VB does give you more leeway but that doesn't make it good. For
example VB can do this, but is it good?
dim x as variant
x = 123
x = "Hello World"
Of course it's not good. If one object can be converted to another type
then it's usually possible in C# too, just with different syntax.
Re: C# or VB.NET?
am 11.01.2008 11:31:37 von CMoya
"Aidy" wrote in message
news:k-SdnelhBqAEpRranZ2dnUVZ8qugnZ2d@bt.com...
>> "Just cos you can doesn't mean you should" implies there's something
>> wrong with the function
>
> What would you rather do? Call "string.Length" or call "len (string)"
> that then calls "string.Length" internally? And I don't know how the len
> function handles nulls cos I didn't write it and haven't seen the source.
> However I know how myString.Length will react if myString is null and I
> don't need trial and error or consulting docs to tell me.
I'd rather call Len(str) than do the following in a bunch of places in code:
if (str != null) {
num = str.Length()
}
else {
// do something else. in this case assign: num = 0
}
//(Even worse if I want to duplicate Left/Mid/Right)
What's wrong with calling a reusable Len() "utility" function that does the
same thing as the conditionals above?
>
> Using those functions also makes it harder to understand c# examples. If
> you at least use vb.net as intended then reading c# shouldn't be too much
> problem, and switching to c# if you want to should be easier.
>
Is it any different than using utility functions written by other
developers in your team or written by developers employed before you joined
the team... or worse, copy and pasted from the web? Do all C# developers
work alone and bring their redundant encapsulated utility functions to a
project? What a nightmare (that I've personally seen.... at least back in
the day VB coders did this a lot with API vodoo calls-- but C# guys do it
for the most rudimentary things). These built-in utility (standard)
functions are designed to make your life easier and manage projects
easier.... the goal of all high-end computer languages. Except perhaps C#? I
dunno.
--
-C. Moya
http://www.cmoya.com
Re: C# or VB.NET?
am 11.01.2008 11:40:09 von CMoya
"Aidy" wrote in message
news:xeSdnYHT-5O6phranZ2dnUVZ8sijnZ2d@bt.com...
>> Perhaps in pure syntax alone (though the common switch statement alone
>> belies that assertion), I agree mostly. But you do have to code *more* to
>> achieve the same functionality in C#. There is no equivalent to the
>> intelligent CType for instance (other than littering your code with
>> conditionals to cover it's functionality).
>
> It might help if you provide some examples, but writing strongly typed
> code is usually seen as a good thing. It removes ambiguity and the
> possibility for bugs. VB does give you more leeway but that doesn't make
> it good. For example VB can do this, but is it good?
>
> dim x as variant
> x = 123
> x = "Hello World"
>
> Of course it's not good. If one object can be converted to another type
> then it's usually possible in C# too, just with different syntax.
>
VB.NET does not support the Variant data type. Perhaps you meant "Object"
type. Which, BTW, C# allows just fine too.
>
Re: C# or VB.NET?
am 11.01.2008 11:53:51 von Aidy
> I'd rather call Len(str) than do the following in a bunch of places in
> code:
So you'd rather your code was vague rather than explicit? What happens
when, in "version x", Microsoft change the way Len is written and you need
to handle your own nulls? If you find you do that code a lot, then write
your own Len function and use it.
> These built-in utility (standard) functions are designed to make your life
> easier and manage projects easier.... the goal of all high-end computer
> languages. Except perhaps C#? I dunno.
Fair point. My goal isn't to make things "easier" in terms of coding or
management. My goal is to write tight, explicit, strongly typed code that
is easy to extend, re-use and has a lower chance of introducing bugs. If I
need to put a little extra effort in to do that then so be it.
Re: C# or VB.NET?
am 11.01.2008 12:13:32 von mark
"Aidy" wrote in message
news:xeSdnYHT-5O6phranZ2dnUVZ8sijnZ2d@bt.com...
> dim x as variant
> x = 123
> x = "Hello World"
That's actually not valid VB.NET... In VS.NET 2008, if you type or paste the
above code IntelliSense will change Variant to Object. At that level,
there's no difference between the above and:
object x = new object();
x = 123;
x = "Hello World";
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: C# or VB.NET?
am 11.01.2008 12:14:45 von CMoya
--
-C. Moya
http://www.cmoya.com
"Aidy" wrote in message
news:1s6dnWKHbtNa1xranZ2dnUVZ8qaqnZ2d@bt.com...
>> I'd rather call Len(str) than do the following in a bunch of places in
>> code:
>
> So you'd rather your code was vague rather than explicit? What happens
> when, in "version x", Microsoft change the way Len is written and you need
> to handle your own nulls? If you find you do that code a lot, then write
> your own Len function and use it.
The Len utility function hasn't changed in over 25 years. It's intrinsic.
It's like expecting the ++ operator to change in C. I don't see C# guys
writing var = var + 1 wrapper functions to replace ++.
>
>> These built-in utility (standard) functions are designed to make your
>> life easier and manage projects easier.... the goal of all high-end
>> computer languages. Except perhaps C#? I dunno.
>
> Fair point. My goal isn't to make things "easier" in terms of coding or
> management. My goal is to write tight, explicit, strongly typed code that
> is easy to extend, re-use and has a lower chance of introducing bugs. If
> I need to put a little extra effort in to do that then so be it.
And as a manager, it's my job to make sure that my developers aren't wasting
time reinventing the wheel.... duplicating code, violating the basic tenets
of encapsulation, and neglecting to use tried and true functions. Whether
they're written by other developers in my team or put into the VB runtime by
the VB.NET team.
>
Re: C# or VB.NET?
am 11.01.2008 12:27:05 von Aidy
> And as a manager, it's my job to make sure that my developers aren't
> wasting time reinventing the wheel.... duplicating code, violating the
> basic tenets of encapsulation, and neglecting to use tried and true
> functions. Whether they're written by other developers in my team or put
> into the VB runtime by the VB.NET team.
Yes, but loosely typed and coupled code may speed up development but you
lose in the long-run on bug fixing and future updates.
Re: C# or VB.NET?
am 11.01.2008 12:28:40 von Aidy
> That's actually not valid VB.NET...
"For example VB can do this"
:)
I know, I was harking back to the history of VB where your typing can be as
loose as you want. It seems like MS are trying to carry that forward with
vb.net too.
Re: C# or VB.NET?
am 11.01.2008 12:29:22 von Aidy
See my reply to Mark. We're all coders, we really should read posts before
commenting and be more pedantic :)
"CMoya" wrote in message
news:8924F084-00EE-4B90-9BF8-B624326E2D09@microsoft.com...
> "Aidy" wrote in message
> news:xeSdnYHT-5O6phranZ2dnUVZ8sijnZ2d@bt.com...
>>> Perhaps in pure syntax alone (though the common switch statement alone
>>> belies that assertion), I agree mostly. But you do have to code *more*
>>> to achieve the same functionality in C#. There is no equivalent to the
>>> intelligent CType for instance (other than littering your code with
>>> conditionals to cover it's functionality).
>>
>> It might help if you provide some examples, but writing strongly typed
>> code is usually seen as a good thing. It removes ambiguity and the
>> possibility for bugs. VB does give you more leeway but that doesn't make
>> it good. For example VB can do this, but is it good?
>>
>> dim x as variant
>> x = 123
>> x = "Hello World"
>>
>> Of course it's not good. If one object can be converted to another type
>> then it's usually possible in C# too, just with different syntax.
>>
>
> VB.NET does not support the Variant data type. Perhaps you meant "Object"
> type. Which, BTW, C# allows just fine too.
>
>>
>
Re: C# or VB.NET?
am 11.01.2008 17:49:53 von CMoya
"Aidy" wrote in message
news:c7WdnT1SYdkOzxraRVnyvAA@bt.com...
>> And as a manager, it's my job to make sure that my developers aren't
>> wasting time reinventing the wheel.... duplicating code, violating the
>> basic tenets of encapsulation, and neglecting to use tried and true
>> functions. Whether they're written by other developers in my team or put
>> into the VB runtime by the VB.NET team.
>
> Yes, but loosely typed and coupled code may speed up development but you
> lose in the long-run on bug fixing and future updates.
Nobody is talking about loosely typed code.
Re: C# or VB.NET?
am 11.01.2008 17:58:48 von CMoya
"Aidy" wrote in message
news:f6qdnZ_sOvduzxraRVnyhwA@bt.com...
>> That's actually not valid VB.NET...
>
> "For example VB can do this"
>
> :)
>
> I know, I was harking back to the history of VB where your typing can be
> as loose as you want. It seems like MS are trying to carry that forward
> with vb.net too.
No, not really.
--
-C. Moya
http://www.cmoya.com
Re: C# or VB.NET?
am 09.04.2008 14:15:44 von Premium Plastics
I am employed to code in C# but in my own time and when I'm paid for jobs
outside of work, I use VB.
I have never come across any reason not to, and it much more fun to use,
Visual studio is much more friendly to VB
"CMoya" wrote in message
news:68683265-6B99-4C12-8E26-8FC818AC50AC@microsoft.com...
> "Aidy" wrote in message
> news:c7WdnT1SYdkOzxraRVnyvAA@bt.com...
>>> And as a manager, it's my job to make sure that my developers aren't
>>> wasting time reinventing the wheel.... duplicating code, violating the
>>> basic tenets of encapsulation, and neglecting to use tried and true
>>> functions. Whether they're written by other developers in my team or put
>>> into the VB runtime by the VB.NET team.
>>
>> Yes, but loosely typed and coupled code may speed up development but you
>> lose in the long-run on bug fixing and future updates.
>
> Nobody is talking about loosely typed code.
Re: C# or VB.NET?
am 09.04.2008 15:20:40 von Premium Plastics
"cfps.Christian" wrote in message
news:577cf46f-91ea-43db-a4d0-ab2a436fac3c@j78g2000hsd.google groups.com...
>> Side 2 : You'll be more likely to bring bad habits with you, most of
>> which
>> resolve around non OO practices.
what nonsence
very weak argumnet
>
> This is probably the best argument against VB.
they the argument is lost
>Nothing was worse than
> working with a bunch of programmers that went from VB6 to .NET with no
> learning at all. Every single horrible thing they could do in VB6 (it
> was bad then too) went directly over to .NET. When you force yourself
> to learn a new language you can to wield it the correct way from the
> beginning dumping those bad habits from the beginning rather than
> "knowing" how you can do something and it be bad. This is even more
> true with VB since they carried over the functions from older versions
> into .NET (i.e. LTrim() Mid() cInt) whereas the .NET way is
> different. The advantage to going to C# and having a VBScript
> background is you should be able to read/write VB.NET fairly from
> knowing C# and VBScript while it doesn't work as well the other way
> (only VB with no C# learning).
Re: C# or VB.NET?
am 09.04.2008 15:52:37 von mark
"ThatsIT.net.au" wrote in message
news:208B0BC8-3E75-4AA9-97AF-6FD7CCCF3ACB@microsoft.com...
> Visual studio is much more friendly to VB
In what way(s)...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: C# or VB.NET?
am 10.04.2008 02:15:15 von Premium Plastics
better intellisence better code completion better snippets, just to name a
few
"Mark Rae [MVP]" wrote in message
news:eEjt2jkmIHA.2504@TK2MSFTNGP05.phx.gbl...
> "ThatsIT.net.au" wrote in message
> news:208B0BC8-3E75-4AA9-97AF-6FD7CCCF3ACB@microsoft.com...
>
>> Visual studio is much more friendly to VB
>
> In what way(s)...?
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net