473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Is C# really better than VB 2005

Hi

Can someone please enlighten me. I hear different things. Some
suggest that the difference between the languages in terms of
capability and versitility has really narrowed down to a point where it
does not make any difference which language you use. Some suggest that
C# is still far superior language.

Thanks in advance.

Newish

Sep 30 '06 #1
21 1864
VB

"Newish" <ah*******@gmail.com???
news:11*********************@e3g2000cwe.googlegrou ps.com ???...
Can someone please enlighten me. I hear different things. Some
suggest that the difference between the languages in terms of
capability and versitility has really narrowed down to a point where
it
does not make any difference which language you use. Some suggest
that
C# is still far superior language.
well, C# is faster than VB.Net at least.

Sep 30 '06 #2
>
well, C# is faster than VB.Net at least.
Is there a new version of C#?

In the VB.language newsgroup there is lately a message given where a product
written with VB.Net outclasses completely an unmanaged written C++ program.

What was written with VB.Net could have done with C# of course as well and
the latter would have given the same performance.

Cor
Sep 30 '06 #3
VB wrote:
"Newish" <ah*******@gmail.com???
news:11*********************@e3g2000cwe.googlegrou ps.com ???...
>Can someone please enlighten me. I hear different things. Some
suggest that the difference between the languages in terms of
capability and versitility has really narrowed down to a point where
it
>does not make any difference which language you use. Some suggest
that
>C# is still far superior language.

well, C# is faster than VB.Net at least.
Do they generate that much different byte code? What kinds of
optimizations can be made by the C# compiler that couldn't be made by
the VB compiler?
Sep 30 '06 #4
So Newish, how pragmatic are you? How intelligent? Are you going to be a web
developer? As you may know or will have to learn there are two "platforms"
required for web development: the server and the client.

As it turns out for web development, code that runs in the client requires
code written using JavaScript. The "client" is usually a browser but could
be any application running on the desktop that uses a control to parse and
render webpage content. If you've heard of AJAX yet and how it is changing
webdevelopment? AJAX is A(synchronous) JA(vascript) X(ml). All AJAX code is
written using JavaScript. Arguably, AJAX happens to be the most important
trend in web development at the moment.

Secondly, all of the "Gadgets" and "Widgets" that run on the desktop that
Google, Yahoo and Microsoft are putting out are all built using JavaScript.
Coding with any of the "mashups" requires the use of JavaScript. Its
everywhere.

What's the point you may be wondering? Well JavaScript, C#.NET and Java all
come from C and all have exactly the same syntax. The grammar is nearly
identical too so when you learn one language you actually learn three
(actually more languages in fact because so many languages use the legacy
syntax and grammar of the C language). Coding Flash and applications from
vendors other than Microsoft all require a mastery of the C syntax and
grammar. Flash ActionScript for example is actually a JavaScript clone with
a different name.

Unfortunately, most VB.NET supporters are dishonest and never bother to
explain these facts so you never have a balanced view. I honestly have never
read any comments from any VB.NET developer who replied to any of the
thousands of RFIs asking the "which language" question who has ever had
anything honest to say by providing a balanced view of this topic. Not one.
Ever.

I was a VB script and VB.NET adoptee until I had an epiphany and now use C#
on the server and of course JavaScript on the client. I hope I have helped
you to have an epiphany too. All of the serious development as well as all
of the fun stuff that is happening on the web requires knowing the legacy C
syntax and grammar. So learning C# to use on the server and JavaScript on
the client is the pragmatic and smart way to become a masterful web
developer. Ainna?
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP 43°2'17"N 88°2'37"W : 43°2'17"N 88°2'37"W

"Newish" <ah*******@gmail.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
Hi

Can someone please enlighten me. I hear different things. Some
suggest that the difference between the languages in terms of
capability and versitility has really narrowed down to a point where it
does not make any difference which language you use. Some suggest that
C# is still far superior language.

Thanks in advance.

Newish

Sep 30 '06 #5

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:Ou**************@TK2MSFTNGP02.phx.gbl...
>
Is there a new version of C#?

In the VB.language newsgroup there is lately a message given where a
product written with VB.Net outclasses completely an unmanaged written C++
program.

What was written with VB.Net could have done with C# of course as well and
the latter would have given the same performance.

Cor
Please cite the message and any links to test results, etc. it includes.
This, I have to see.
Sorry, but I couldn't find it in the VB group.
Sep 30 '06 #6
Peter,

I have sent it to you by email.

Cor

"pvdg42" <pv****@newsgroups.nospamschreef in bericht
news:%2****************@TK2MSFTNGP04.phx.gbl...
>
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:Ou**************@TK2MSFTNGP02.phx.gbl...
>>
Is there a new version of C#?

In the VB.language newsgroup there is lately a message given where a
product written with VB.Net outclasses completely an unmanaged written
C++ program.

What was written with VB.Net could have done with C# of course as well
and the latter would have given the same performance.

Cor
Please cite the message and any links to test results, etc. it includes.
This, I have to see.
Sorry, but I couldn't find it in the VB group.

Sep 30 '06 #7
VB <Mi**@yahoo.comwrote:
Can someone please enlighten me. I hear different things. Some
suggest that the difference between the languages in terms of
capability and versitility has really narrowed down to a point where
it
does not make any difference which language you use. Some suggest
that
C# is still far superior language.

well, C# is faster than VB.Net at least.
At doing what? Unless you've got unsafe code involved, I can't think of
many things off-hand that you can't do exactly the same way in VB.NET,
resulting in virtual identical IL.

In a few rare edge cases, the VB.NET compiler creates
methods/properties which aren't inlined whereas the C# equivalent is -
but that would very rarely be significant.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Sep 30 '06 #8

For me it comes down to ecomomy of expression.

VB is and has always been more wordy.

c# is terse.

Newish wrote:
Hi

Can someone please enlighten me. I hear different things. Some
suggest that the difference between the languages in terms of
capability and versitility has really narrowed down to a point where it
does not make any difference which language you use. Some suggest that
C# is still far superior language.

Thanks in advance.

Newish

--
Texeme Construct
Sep 30 '06 #9
VB

"Jon Skeet [C# MVP]" <sk***@pobox.com???
news:MP************************@msnews.microsoft.c om ???...
VB <Mi**@yahoo.comwrote:
well, C# is faster than VB.Net at least.

At doing what? Unless you've got unsafe code involved, I can't think
of
many things off-hand that you can't do exactly the same way in VB.NET,
resulting in virtual identical IL.
Try following code and Compare the results. Remember compare "remarked"
code also.
I would said C# is not a "superior" but "faster" language.
Sorry for ugly C# code, I'm not skillful in C#. (^^;)

<VB>
Public Class Form1
Dim watch As New System.Diagnostics.Stopwatch

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim val(7) As Long, t As Long
watch.Start()
For i As Long = 1 To 10000
For j As Long = 0 To 255
val(0) = (j And 1) + 48
val(1) = (j And 2) / 2 + 48
val(2) = (j And 4) / 4 + 48
val(3) = (j And 8) / 8 + 48
val(4) = (j And 16) / 16 + 48
val(5) = (j And 32) / 32 + 48
val(6) = (j And 64) / 64 + 48
val(7) = (j And 128) / 128 + 48

'val(0) = (j And 1) + 48
'val(1) = ((j And 2) >1) + 48
'val(2) = ((j And 4) >2) + 48
'val(3) = ((j And 8) >3) + 48
'val(4) = ((j And 16) >4) + 48
'val(5) = ((j And 32) >5) + 48
'val(6) = ((j And 64) >6) + 48
'val(7) = ((j And 128) >7) + 48
Next
Next
watch.Stop()
t = watch.ElapsedMilliseconds
Text1.Text = t
watch.Reset()
End Sub
End Class

<C#>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace crt
{
public partial class Form1 : Form
{
private Stopwatch Watch;
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{

long t;
long[] bit = new long[8];

Watch = new Stopwatch();
Watch.Start();
for (long i = 1; i <= 10000; i++)
{
for (long j = 0; j <= 255; j++)
{
bit[0]= (j & 1) + 48;
bit[1] = (j & 2) / 2 + 48;
bit[2] = (j & 4) / 4 + 48;
bit[3] = (j & 8) / 8 + 48;
bit[4] = (j & 16) / 16 + 48;
bit[5] = (j & 32) / 32 + 48;
bit[6] = (j & 64) / 64 + 48;
bit[7] = (j & 128) / 128 + 48;

/*bit[0]= (j & 1) + 48;
bit[1] = ((j & 2) >>1) + 48;
bit[2] = ((j & 4) >>2) + 48;
bit[3] = ((j & 8) >>3) + 48;
bit[4] = ((j & 16) >>4) + 48;
bit[5] = ((j & 32) >>5) + 48;
bit[6] = ((j & 64) >>6) + 48;
bit[7] = ((j & 128) >7) + 48;*/

}
}
Watch.Stop();
t = Watch.ElapsedMilliseconds;
text1.Text = t.ToString();
Watch.Reset();
}
}
}

Oct 1 '06 #10
VB wrote:
"Jon Skeet [C# MVP]" <sk***@pobox.com???
news:MP************************@msnews.microsoft.c om ???...
>VB <Mi**@yahoo.comwrote:
>>well, C# is faster than VB.Net at least.
At doing what? Unless you've got unsafe code involved, I can't think
of
>many things off-hand that you can't do exactly the same way in VB.NET,
resulting in virtual identical IL.

Try following code and Compare the results. Remember compare "remarked"
code also.
I would said C# is not a "superior" but "faster" language.
Sorry for ugly C# code, I'm not skillful in C#. (^^;)

[snipped long code snippets]
At first there was a difference, but I made two changes to fix it so
that both snippets ran the same speed:

1) C# by default doesn't check for integer overflows and VB does. I
changed VB to not check and that sped it up.

2) The division you were doing in VB was dividing using a double and
then casting it back to a long. If you turn on Option Strict you'll see
a compiler error. I changed the division operator from / to \ (which is
the integral division operation in VB). IIRC C# uses integral division
when both operations are integral.

After those changes, both versions ran exactly the same speed (averaged
over several runs).
Adam Ruth
Oct 1 '06 #11
John,
VB is and has always been more wordy.
Even this is not true,

Private ds as New DataSet
against
private DataSet ds = new DataSet();

Cor

"John Bailo" <ja*****@texeme.comschreef in bericht
news:pO******************************@speakeasy.ne t...
>
For me it comes down to ecomomy of expression.

VB is and has always been more wordy.

c# is terse.

Newish wrote:
>Hi

Can someone please enlighten me. I hear different things. Some
suggest that the difference between the languages in terms of
capability and versitility has really narrowed down to a point where it
does not make any difference which language you use. Some suggest that
C# is still far superior language.

Thanks in advance.

Newish


--
Texeme Construct

Oct 1 '06 #12
VB

"Adam Ruth" <aw*@community.nospam???
news:%2****************@TK2MSFTNGP02.phx.gbl ???...
1) C# by default doesn't check for integer overflows and VB does. I
changed VB to not check and that sped it up.
Very interestring!
Can you teach me how to turn off this "check" function.
2) The division you were doing in VB was dividing using a double and
then casting it back to a long. If you turn on Option Strict you'll
see
a compiler error. I changed the division operator from / to \ (which
is
the integral division operation in VB). IIRC C# uses integral
division
when both operations are integral.

After those changes, both versions ran exactly the same speed
(averaged
over several runs).
Hmmmm, I'm now considering changing VB6 to VB.NET or C#.
To my knowledge, C++ is more efficient than VB6.
However C++ is obscure, VB is more suitable for amateur like me.
I did a little expirement above.
The result really hesitated me in choosing which one.
But now you fix the bug.
Looks like I find the answer. (^^)

Oct 2 '06 #13
VB wrote:
"Adam Ruth" <aw*@community.nospam???
news:%2****************@TK2MSFTNGP02.phx.gbl ???...
>1) C# by default doesn't check for integer overflows and VB does. I
changed VB to not check and that sped it up.

Very interestring!
Can you teach me how to turn off this "check" function.
Sure thing. In the project's properties, go to the compiler tab and
click on the Advanced Options button. There you will see a check box.
It's the same in C#, but the wording is a little different.
>
>2) The division you were doing in VB was dividing using a double and
then casting it back to a long. If you turn on Option Strict you'll
see
>a compiler error. I changed the division operator from / to \ (which
is
>the integral division operation in VB). IIRC C# uses integral
division
>when both operations are integral.

After those changes, both versions ran exactly the same speed
(averaged
>over several runs).

Hmmmm, I'm now considering changing VB6 to VB.NET or C#.
To my knowledge, C++ is more efficient than VB6.
However C++ is obscure, VB is more suitable for amateur like me.
I did a little expirement above.
The result really hesitated me in choosing which one.
But now you fix the bug.
Looks like I find the answer. (^^)
Well good luck. I used to do a lot of VB6, then I went to the Unix
world where I did C++ and Perl (yuck) and Python. I came back and found
the VB.Net language to be very different, but very much better. I think
that while the language is more complex, it's also still very easy to
handle.

Have fun whatever language you're using.

Adam Ruth
Oct 2 '06 #14
"John Bailo" <ja*****@texeme.comwrote in message
news:pO******************************@speakeasy.ne t...
>
For me it comes down to ecomomy of expression.
VB is and has always been more wordy.
c# is terse.
Well it is also true that VB.NET is more descriptive and self documenting.
Not to mention, with Visual Studio's great intellisense support you rarely
have to type an entire keyword anyway. I've used both VB.NET and C#
extensively, and I really don't think C# saves me any sigificant number of
keystrokes.

I love both languages. They both have their pros and cons. When am able to
make the choice though, I usually pick VB.NET over C# because its simply a
friendlier development experience overall.

--
I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net


Oct 2 '06 #15
Steve C. Orr [MVP, MCSD] wrote:
"John Bailo" <ja*****@texeme.comwrote in message
news:pO******************************@speakeasy.ne t...
>For me it comes down to ecomomy of expression.
VB is and has always been more wordy.
c# is terse.

Well it is also true that VB.NET is more descriptive and self documenting.
Not to mention, with Visual Studio's great intellisense support you rarely
have to type an entire keyword anyway. I've used both VB.NET and C#
extensively, and I really don't think C# saves me any sigificant number of
keystrokes.

I love both languages. They both have their pros and cons. When am able to
make the choice though, I usually pick VB.NET over C# because its simply a
friendlier development experience overall.
I tend to agree with that last statement. Visual Studio gives you much
more feedback while coding in VB than C#. I like knowing immediately
all of my compile errors without having to do a build. It seems that VS
2005 is better than VS 2003 in this regard with C#, but it's still not
as nice as with VB.

But the difference between the two is still the difference between 5
pennies and a nickel.

Adam Ruth
Oct 2 '06 #16
Thanks everyone for your responses.

Can someone clarify one point for me please.

More than once it was mentioned that C# is faster than VB.Net. Does
this refer to runtime performance or to coding, i.e. interms of
keystrokes.

Newish

Steve C. Orr [MVP, MCSD] wrote:
"John Bailo" <ja*****@texeme.comwrote in message
news:pO******************************@speakeasy.ne t...

For me it comes down to ecomomy of expression.
VB is and has always been more wordy.
c# is terse.

Well it is also true that VB.NET is more descriptive and self documenting.
Not to mention, with Visual Studio's great intellisense support you rarely
have to type an entire keyword anyway. I've used both VB.NET and C#
extensively, and I really don't think C# saves me any sigificant number of
keystrokes.

I love both languages. They both have their pros and cons. When am able to
make the choice though, I usually pick VB.NET over C# because its simply a
friendlier development experience overall.

--
I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net
Oct 2 '06 #17
It doesn't make much difference thought there are minor differences based on
their historical background.

--
Patrice

"Newish" <ah*******@gmail.coma écrit dans le message de news:
11*********************@e3g2000cwe.googlegroups.co m...
Hi

Can someone please enlighten me. I hear different things. Some
suggest that the difference between the languages in terms of
capability and versitility has really narrowed down to a point where it
does not make any difference which language you use. Some suggest that
C# is still far superior language.

Thanks in advance.

Newish

Oct 2 '06 #18

"Newish" <ah*******@gmail.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
Hi

Can someone please enlighten me. I hear different things. Some
suggest that the difference between the languages in terms of
capability and versitility has really narrowed down to a point where it
does not make any difference which language you use. Some suggest that
C# is still far superior language.
Considering they both use the same compiler and framework, that's questionable.

The one fact that can't be dismissed is that only C# is published as an ECMA
standard which is allowing it wider adoption in the non-MS community.
Oct 2 '06 #19
IMO, there never was a significant difference between the two -- and this
non-difference still is extant. C# allows you to write unsafe code (not
bad, just unsafe in terminology). VB does not.

As to speed differences, these are trivial, and it is possble to cherry-pick
and find some that performs better than the alternate using either.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Oct 2 '06 #20
I really don't think its faster at all.

--
I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net
"Newish" <ah*******@gmail.comwrote in message
news:11********************@m73g2000cwd.googlegrou ps.com...
Thanks everyone for your responses.

Can someone clarify one point for me please.

More than once it was mentioned that C# is faster than VB.Net. Does
this refer to runtime performance or to coding, i.e. interms of
keystrokes.

Newish

Steve C. Orr [MVP, MCSD] wrote:
>"John Bailo" <ja*****@texeme.comwrote in message
news:pO******************************@speakeasy.n et...
>
For me it comes down to ecomomy of expression.
VB is and has always been more wordy.
c# is terse.

Well it is also true that VB.NET is more descriptive and self
documenting.
Not to mention, with Visual Studio's great intellisense support you
rarely
have to type an entire keyword anyway. I've used both VB.NET and C#
extensively, and I really don't think C# saves me any sigificant number
of
keystrokes.

I love both languages. They both have their pros and cons. When am able
to
make the choice though, I usually pick VB.NET over C# because its simply
a
friendlier development experience overall.

--
I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net

Oct 2 '06 #21

Dick Grier wrote:
IMO, there never was a significant difference between the two -- and this
non-difference still is extant. C# allows you to write unsafe code (not
bad, just unsafe in terminology). VB does not.

As to speed differences, these are trivial, and it is possble to cherry-pick
and find some that performs better than the alternate using either.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Well said. Anyone who tries to make a mountain out of the molehill of
difference between C# and VB.Net is being a silly zealot. Unless
you're doing some very close-to-the-metal stuff (in which case you
should be working in C++) C# and VB.Net are basically the same language
with slightly different syntaxes. There are a few gotchas that come
from some of the differences between default behaviours of the
languages (C#'s shorcircuiting vs. VB.Net's non-shortcircuiting
operators, for example) but generally they're the same thing. Really,
any programmer worth his salt who knows one language would be able to
pick up the other in two hours. This isn't like learning SQL, or LISP,
or any other language that runs on a completely different paradigm from
the C-family. VB.Net is C# with words instead of characters, and a few
minor gotcha-style differences.

To a newb, I'd suggest C# because of the better support, and
familiarity in comparison to most other languages you'll run into...
Plus, MS tends to give C# slightly-better support - VB.Net is usually a
few small language features behind (eg. XML DocStrings). But if you
already know VB, Pascal, VBA, or other "wordy" languages and enjoy them
- just use VB.Net.

Oct 3 '06 #22

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Mel | last post by:
i see a lot of stuff going back and forth, tables are easy to use and do exactly what the name says it does ROWS/COLUMNS what is a GOOD reason to use DIVs instead ? thanks Mel
2
by: Peter Bencsik | last post by:
Hi, does anybody has experience with static source code checker for C? I am thinking of choosing splint as my favorite tool, is this a good choice? regards, pb
3
by: Newish | last post by:
Hi Can someone please enlighten me. I hear different things. Some suggest that the difference between the languages in terms of capability and versitility has really narrowed down to a point...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...

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.