|
-
Jun 10th, 2005, 03:08 AM
#1
Thread Starter
Lively Member
advantages of C# over vb.net ??
im facing many interviews. but most of the companies asking C# only.
why? for what reason they prefer c# as codebehind?
We can acheive the same thing from vb.net also no. is there any advantage in C# than VB.net?
-
Jun 10th, 2005, 03:46 AM
#2
Re: advantages of C# over vb.net ??
# XML documentation generated from source code comments. (This is coming in VB.NET with Whidbey (the code name for the next version of Visual Studio and .NET), and there are tools which will do it with existing VB.NET code already.)
# Operator overloading - again, coming to VB.NET in Whidbey.
# Language support for unsigned types (you can use them from VB.NET, but they aren't in the language itself). Again, support for these is coming to VB.NET in Whidbey.
# The using statement, which makes unmanaged resource disposal simple.
# Explicit interface implementation, where an interface which is already implemented in a base class can be reimplemented separately in a derived class. Arguably this makes the class harder to understand, in the same way that member hiding normally does.
# Unsafe code. This allows pointer arithmetic etc, and can improve performance in some situations. However, it is not to be used lightly, as a lot of the normal safety of C# is lost (as the name implies). Note that unsafe code is still managed code, i.e. it is compiled to IL, JITted, and run within the CLR.
From: http://blogs.msdn.com/csharpfaq/arch.../11/87816.aspx
-
Jun 10th, 2005, 03:47 AM
#3
Re: advantages of C# over vb.net ??
A lot of this changes with 2.0, though.
-
Jun 10th, 2005, 03:55 AM
#4
Re: advantages of C# over vb.net ??
I think one of the main things is the unmanged code.
We currently have a data access library that's written in VB.NET
This works fine, but since SQLConnections are unmanged then they don't get cleaned up straight away when destroyed.
This has led to some huge problems with our web apps on our servers, which have a user base of over 30,000. We kept running out of room in the connection pool simply because VB.NET doesn't toast the unmanged resource.
So, this means that VB.NET is not good enough to write large enterprise level apps...this does sound stange, but it's true, and MS admit this is a "feature"! *sigh*
VS 2 will allow VB.NET to deal with unmanged code, but for the time being we have had to rewrite the data access class in c#, which has the Using command.
Woka
-
Jun 10th, 2005, 04:09 AM
#5
Re: advantages of C# over vb.net ??
 Originally Posted by Wokawidget
I think one of the main things is the unmanged code.
We currently have a data access library that's written in VB.NET
This works fine, but since SQLConnections are unmanged then they don't get cleaned up straight away when destroyed.
This has led to some huge problems with our web apps on our servers, which have a user base of over 30,000. We kept running out of room in the connection pool simply because VB.NET doesn't toast the unmanged resource.
So, this means that VB.NET is not good enough to write large enterprise level apps...this does sound stange, but it's true, and MS admit this is a "feature"! *sigh*
VS 2 will allow VB.NET to deal with unmanged code, but for the time being we have had to rewrite the data access class in c#, which has the Using command.
Woka
Are you sure about this? I did not know this nor was I aware of SQLConnections in VB.NET being unmanaged. Got any links I can read on?
-
Jun 10th, 2005, 04:37 AM
#6
Re: advantages of C# over vb.net ??
http://msdn.microsoft.com/library/de...poseTopic1.asp
SQLConnection are unmanaged...but the above article tells you how to destroy them. Cool, so this should work. But it doesn't 
Create a test SQL Server DB with a limited number of connection pools.
Now write a quick app that opens connection and then toasts them, using the code MS says should work.
Oh dear...it seems that MS are wrong...suddenly you get errors when creating the connection object.
The dispose method apparently just flags this connection to be toasted by the garbage collection, but if you have enough memory on your server this may not ever happen.
Woof
-
Jun 10th, 2005, 05:02 AM
#7
Re: advantages of C# over vb.net ??
Ah, some resources used by SQLConnection are unmanaged. *sigh of relief*
-
Jun 10th, 2005, 05:08 AM
#8
Re: advantages of C# over vb.net ??
Yea...but have you tested it? Try it 
Woka
-
Jun 10th, 2005, 05:15 AM
#9
Re: advantages of C# over vb.net ??
-
Jun 10th, 2005, 05:17 AM
#10
Re: advantages of C# over vb.net ??
http://www.devnewsgroups.net/group/m...opic11449.aspx
From this is seems people think that only the connection string gets toasted when you call the Dispose method 
Let me know how your testing goes.
Woka
-
Jun 10th, 2005, 06:26 AM
#11
I wonder how many charact
Re: advantages of C# over vb.net ??
 Originally Posted by mahivr
im facing many interviews. but most of the companies asking C# only.
why? for what reason they prefer c# as codebehind?
We can acheive the same thing from vb.net also no. is there any advantage in C# than VB.net?
VB traditionally is more of a business-use language whereas C and its derivatives (yes I know C# is just a name that happens to contain a 'C') are seen as computer science languages.
So depending on the companies you are interviewing with - most software engineering companies use C# - whereas if you were applying for jobs at some random corporate business - you would find they were looking for VB programmers.
C# is also close in syntatical sugar to JAVA and C++, which is what most software engineering companies were using for a long time before .Net became a must-have.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|