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?
Printable View
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?
From: http://blogs.msdn.com/csharpfaq/arch.../11/87816.aspxQuote:
# 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.
A lot of this changes with 2.0, though.
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?Quote:
Originally Posted by Wokawidget
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
Ah, some resources used by SQLConnection are unmanaged. *sigh of relief*
Yea...but have you tested it? Try it ;)
Woka
Testing in progress..
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
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.Quote:
Originally Posted by mahivr
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.