469,270 Members | 1,037 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Which to use VB.NET or C#?

Hi all,

I'm planning on developing an ASP.NET web site. I know both VB.NET and C#
but am unsure on which would be more useful to develop an ASP.NET site with?
Also I maybe looking to become a web developer in the future so it would help
if I use the langauge that most companies use to develop their ASP.NET site?

Many thanks,
Jon.
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200510/1
Nov 19 '05
53 2973
>> C# always wants the () when calling subroutines, even tells you they are
missing, but is too lazy to add them for you. But VB does it for you.
I think we're getting into trifles here, but the advantage of not putting
them in for you is if you've overloaded the method, you could well be
introducing a bug by assuming you want the one with no arguments.


This is not a trifle as far as I'm concerned. One of my pet peeves about
VB.net is Optional parameters. Now, you and I both know that such things do
not exist, but you can create them in VB.Net. Then, when you want to write
an overload, you can get into serious trouble, because of the Optional
parameters in the method you're trying to overload..

I have had on occasion to completely rewrite VB.Net methods with optional
parameters to overloaded methods in order to be able to add overloads to
them. And that's a waste of my time.
Case sensitive is a waste, promotes bugs, and has no real value. I like
watching VB redo my case to match my declares, confirms my memory.


I agree. I'd like to see an option (defaulting to off) in VS that treats
case fixing in C# the way it does in VB, but there are some advantages to
case sensitivity, specifically the construct

class foo
{
int myAge;
public int MyAge { get { return myAge; } set { myAge = value; } }
}


This is a problem, but making C# non-case-sensitive isn't the solution, for
reasons too many to enumerate (you can probably imagine at least some of
them). If you've had a look at VS.Net 2005, you can see Microsoft's
solution, which is to make the IDE auto-correct your capitalization for you
when it can discern that there is not a similar token with different case. I
think this is a good compromise. At least I can live with it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"Jesse Liberty" <jl******@libertyassociates.com> wrote in message
news:PO********************@speakeasy.net...I can answer some of your (rhetorical?) questions from personal experience,
though I'm worried this is turning into a religious rahter than a technical
debate.
Most .NET books I have only have one language in them. Wish they did have
both. Seems they like having 2 different books Why? Will some by both?
Just
more publishing hassles it seems to me...


Some readers really liked that we did two books in both VB and C#, many
others complained that it bloated the book, and we've moved away from
doing so.
Anyway I deal in real-world projects mostly.


Not me, I deal in virtual world projects <smile>. I spend 90% of my time
in real world projects and have just not run into your experience, but
that is why they make chocolate and vanilla.
Seems C# always wants you to press the CTRL and SPACE where VB just knows
when to help, most help due to the VB syntax I think.


Sorry, don't know what you mean? Ctrl-space?
The Auto complete is better: look at places where you use enumerations.
VB pops them up for you. C# even makes you type the true/false when VB
does not..


Not my experience; Intellisense in C# does know about enumerations (though
you must use the enumeration name and then it pops up the possible values,
and that is how it should work) and when a Boolean is possible, it offers
a menu of true/false.
C# always wants the () when calling subroutines, even tells you they are
missing, but is too lazy to add them for you. But VB does it for you.


I think we're getting into trifles here, but the advantage of not putting
them in for you is if you've overloaded the method, you could well be
introducing a bug by assuming you want the one with no arguments.

Case sensitive is a waste, promotes bugs, and has no real value. I like
watching VB redo my case to match my declares, confirms my memory.


I agree. I'd like to see an option (defaulting to off) in VS that treats
case fixing in C# the way it does in VB, but there are some advantages to
case sensitivity, specifically the construct

class foo
{
int myAge;
public int MyAge { get { return myAge; } set { myAge = value; } }
}

And note that properties are much better in C#, they look to the client
like fields, to the developer like methods which is just how it should be.
(My aren't we squabbling over trivialities).
Auto complete and formatting in VB is nice, I even hear C# developers say
this. In fact you can get VS Addins to improve this in C#.


In fact, both are in VS 2005 for C#

Some folks like braces (easier to type) some folks like the more verbose
VB style. My point is that there is no objective reason to prefer one over
the other; it is a personal, aesthetic decision.

-j
--
Jesse Liberty
Author of .NET books for O'Reilly Media
Microsoft MVP (.NET)


Nov 19 '05 #51

I know, but a ten-year-old habit is hard to break! :-)

--
Brendan Reynolds

"Jesse Liberty" <jl******@libertyassociates.com> wrote in message
news:a8********************@speakeasy.net...
Ah, I can solve that for you; I believe + works in both!
Sub Main()
Dim word1 As String = "Hello "
Dim word2 As String = "World"
Dim word3 As String = word1 + word2
Console.WriteLine(word3)
End Sub
--
Jesse Liberty
Author of .NET books for O'Reilly Media
Microsoft MVP (.NET)

"Brendan Reynolds" <br******@discussions.microsoft.com> wrote in message
news:uo**************@tk2msftngp13.phx.gbl...
It's the concatenation operator that keeps tripping me up - I'm
constantly trying to write "a string" & " of text" in C#! :-(


Nov 19 '05 #52


"Jesse Liberty" wrote:
I can answer some of your (rhetorical?) questions from personal experience,
though I'm worried this is turning into a religious rahter than a technical
debate.
Most .NET books I have only have one language in them. Wish they did have
both. Seems they like having 2 different books Why? Will some by both?
Just
more publishing hassles it seems to me...
Some readers really liked that we did two books in both VB and C#, many
others complained that it bloated the book, and we've moved away from doing
so.
Anyway I deal in real-world projects mostly.


Not me, I deal in virtual world projects <smile>. I spend 90% of my time in
real world projects and have just not run into your experience, but that is
why they make chocolate and vanilla.
Seems C# always wants you to press the CTRL and SPACE where VB just knows
when to help, most help due to the VB syntax I think.


Sorry, don't know what you mean? Ctrl-space?
The Auto complete is better: look at places where you use enumerations. VB
pops them up for you. C# even makes you type the true/false when VB does
not..


Not my experience; Intellisense in C# does know about enumerations (though
you must use the enumeration name and then it pops up the possible values,


In VB I don't need to type the enum name.
and that is how it should work) and when a Boolean is possible, it offers a
menu of true/false.
C# always wants the () when calling subroutines, even tells you they are
missing, but is too lazy to add them for you. But VB does it for you.
I think we're getting into trifles here, but the advantage of not putting
them in for you is if you've overloaded the method, you could well be
introducing a bug by assuming you want the one with no arguments.

Good point here.

Case sensitive is a waste, promotes bugs, and has no real value. I like
watching VB redo my case to match my declares, confirms my memory.
I agree. I'd like to see an option (defaulting to off) in VS that treats
case fixing in C# the way it does in VB, but there are some advantages to
case sensitivity, specifically the construct

class foo
{
int myAge;
public int MyAge { get { return myAge; } set { myAge = value; } }
}


I hate this style myself .


And note that properties are much better in C#, they look to the client like
fields, to the developer like methods which is just how it should be. (My
aren't we squabbling over trivialities).
Also not context help does not tell you if a property is read only or write
only, infact you will not see the error untill you compile.

Auto complete and formatting in VB is nice, I even hear C# developers say
this. In fact you can get VS Addins to improve this in C#.
In fact, both are in VS 2005 for C#

Some folks like braces (easier to type) some folks like the more verbose VB
style. My point is that there is no objective reason to prefer one over the
other; it is a personal, aesthetic decision.


No, End if tell you its completion of an if block. Next tells you its a
completion of a for loop. } does not specify.

I do agree that It look pretty...

-j
--
Jesse Liberty
Author of .NET books for O'Reilly Media
Microsoft MVP (.NET)


Seems you skipped over a few, is that beacause you agree?

Anyway I enjoyed the debate...

Thanks,

Schneider

Nov 19 '05 #53
I agree with you...besides VI is not a "simple" text editor....notepad is
simple.
I used to use papel and pencil for pseudo-code and algorithms... but I think
it's stupid not using the IDE to take care of the silly details.
"JIMCO Software" <co*******@jimcosoftware.com> wrote in message
news:Oq**************@TK2MSFTNGP12.phx.gbl...
WJ wrote:
it ! I know many MS/Programmers today will flunk simple because they
donot need to think, IDE does the most work for them! It trains you
to be a very good thinker without an IDE. I have no problem with


I've heard this argument before and I just don't buy it. An IDE does not
write code for you. It does not think for you. IntelliSense,
color-coding, auto-formatting, a nice debugger... these are all
productivity tools, not substitutes for thought.

In fact, your argument strikes me as being a bit ironic! :)

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

Nov 19 '05 #54

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

133 posts views Thread by Jane Withnolastname | last post: by
29 posts views Thread by guru.slt | last post: by
17 posts views Thread by clintonG | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.