473,503 Members | 1,685 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3235
>> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2663
by: Raymond H. | last post by:
Hello, I create a vb4 project which can also naviger on Internet via the WebBrowser control which I put on my form. My question is: if this program is installed on a station having already...
17
6102
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
3
4804
by: Edward | last post by:
ASP.NET / VB.NET SQL Server 7.0 Our client has insisted that we change our established practice of building SQL in-line and move it all to SPROCs. Not a problem for 80% of the app. However,...
133
13130
by: Jane Withnolastname | last post by:
I have a web page that uses an unordered list (<UL>) and the LH (list header) tag. I know LH is a valid tag because it is clearly defined by the W3C here:...
29
3235
by: guru.slt | last post by:
"the c++ standard library, tutorial and reference" book, it says: ++i is faster than i++. the latter involves a temporary object because it must return the old value/object of i. for this reason,...
17
2522
by: lawrence | last post by:
How is it possible that the question "How do I detect which browser the user has" is missing from this FAQ: http://www.faqts.com/knowledge_base/index.phtml/fid/125 and is only here on this...
65
12507
by: Skybuck Flying | last post by:
Hi, I needed a method to determine if a point was on a line segment in 2D. So I googled for some help and so far I have evaluated two methods. The first method was only a formula, the second...
17
3941
by: clintonG | last post by:
I'm using an .aspx tool I found at but as nice as the interface is I think I need to consider using others. Some can generate C# I understand. Your preferences please... <%= Clinton Gallagher ...
4
9668
by: mflll | last post by:
I am looking into the different techniques of handling arrays of edit boxes in Java Script. The first program below works fine. However, are there better ways of doing this, where the person...
2
2209
by: rn5a | last post by:
A Form has a select list which is populated from a MS-Access database table. The DB table from where the select list is populated has 2 columns - CountryID & CountryName. When the Form is posted,...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.