What are the differences between C#.net and Visual Basic.net? - c#

I have a small experience in VB.net and I would like to learn C#.net
What are the differences between VB.net and C#.net?
Is there any difference in performance between these two?
Apart from the syntactical differences, are there any major changes that I have to keep in mind?

The Language Features section of the Wikipedia article offers a good overview. Performance is essentially equivalent in almost every aspect, from what I understand.

Performance is equivalent if you write equivalent code, but VB.NET has constructs that are in there for "backward compatibility" which should NEVER be used. C# doesn't have some of these things. I'm thinking specifically of:
Functions which are in the Microsoft.VisualBasic namespace which are members of other standard .NET classes like Trim(). The .NET classes are often faster.
Redim and Redim Preserve. Never to be used in .NET, but there they are in VB.
On Error ... instead of exceptions. Yuck!
Late binding (sometimes derisively called "Option Slow"). Not a good idea in a non-dynamic .NET language from a performance perspective.
VB is also missing things like automatic properties which makes it pretty undesirable for me. Not a performance issue, but worth keeping in mind.

I think you will find the answers to your question in this articles:
http://en.wikipedia.org/wiki/Comparison_of_C_sharp_and_Visual_Basic_.NET
and
Link
edit: Noldorin was faster :x

The first thing to know about learning C# is that it is not pronounced "C#.net", it is just C#. Microsoft tacked on ".NET" to VB, because there was a previous version of VB that didn't work on the .NET Framework. C# was created specifically with the .NET Framework in mind, so the ".net" is implied and unnecessary. Also as a side note putting "C#.NET" on your resume really tips off a knowledgeable manager to your skill level, or lack there of, regarding C#.
Also this Wikipedia article is really good for showing the pros and cons as well as the differences between C# and VB.NET at a high level.

Follow following links which give detailed differences
http://www.harding.edu/fmccown/vbnet_csharp_comparison.html
http://www.codeproject.com/KB/dotnet/vbnet_c__difference.aspx
http://support.microsoft.com/kb/308470
In spite of differences as mentioned at http://support.microsoft.com/kb/308470 both C# and VB.Net are first class citizens of .Net world
Although there are differences between
Visual Basic .NET and Visual C# .NET,
both are first-class programming
languages that are based on the
Microsoft .NET Framework, and they are
equally powerful. Visual Basic .NET is
a true object-oriented programming
language that includes new and
improved features such as inheritance,
polymorphism, interfaces, and
overloading. Both Visual Basic .NET
and Visual C# .NET use the common
language runtime. There are almost no
performance issues between Visual
Basic .NET and Visual C# .NET. Visual
C# .NET may have a few more "power"
features such as handling unmanaged
code, and Visual Basic .NET may be
skewed a little toward ease of use by
providing features such as late
binding. However, the differences
between Visual Basic .NET and Visual
C# .NET are very small compared to
what they were in earlier versions.

No matter which language you select based on your personal preference
and past experience, both languages are powerful developer tools and
first-class programming languages that share the common language
runtime in the .NET Framework.
Says by Microsoft
https://web.archive.org/web/20061027230435/http://support.microsoft.com/kb/308470

Related

How Similar are Java, C#, and Python? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
I know it is a kind of broad question but any answer are appreciated.
All:
Require some form of runtime on your system (JVM/.net/Python runtime)
All can probably be compiled to executables without the runtime (this is iffy and situational, none of them are designed to work this way)
Are good languages
All have specific areas where they are much more appropriate than the other two
Java:
Tries very hard to be Cross Platform--generally succeeds
Little access to platform features that are not in the SDK
Slowest of the three to change and does not contain features common to the other two such as closures
Very backwards compatible (partly because of the previous point)
FAST (about 2x slower than C, quite a few x faster than python)
Probably has the most library support of the three
Strong multi-platform server systems already deployed using J2EE
Scales down to embedded (I've worked on 2 different embedded java projects--coming soon to a cable box near you)
Static
C#
Quicker to add new features
Windows only--Mono is cross platform but does not have the library support.
Started very similar to Java but has many more language features now.
Much better access to windows APIs
Not sure about speed--I think it's similar to Java.
Very good library support
The only one of the three that you have to pay for (it's free for "entry level")
Static
Python
Language is cross platform. Not sure about non-language platform access (such as drag-and-drop)--anyone know?
Probably an easier language to learn
The only one of the three that does not use c-like syntax
Slowest of the three, but still pretty darn fast compared to other dynamic languages.
Dynamic
This link is also interesting
Python is a dynamic language where Java and C# are really not. It is totally different than the other two. There are ways to accomplishing things in Python that do not translate well to the others and vice versa.
Java and C# look the same, but they have differences between the two under the sheets. Being an expert in one, does not make you an expert in the other by any stretch of the imagination. The syntax is similar and libraries are too, so it would be easier to get up to speed in one or the other, but there are subtleties that can trip you up.
C# and Java have almost identical syntax and very similar libraries. There are differences that you have to be aware of (Type Erasure in Java, for example).
Python is a completely different animal. It is a dynamic language (where the other two aren't). Python winds up being closer in style to something like Ruby.
Java and C# are statically typed languages, while Python is a dynamically typed language. That's a huge difference.
The syntax of Java and C# is similar (but I would not call it "almost identical" as Justin Niessner says).
Java and c# are pretty similar in terms of syntax and are mostly strongly typed (C# is getting more dynamic with every version), Python is a dynamic language
Java and C# are very similar and are syntactically similar to C/C++. They also use braces to mark code blocks.
Python is completely different. Although imperative like Java and C#, Python uses indentation to define blocks of code.
Java and C# are also compiled languages, whereas Python is interpreted and dynamic.
Python, Ruby, and Groovy are somewhat similar languages.
C# and Java are easy to move between, although I don't know many people who are experts in both. C#'s syntax is based off of Java, so they read very, very similarly. They both run cross-platform; Java on the JVM, C# on .NET or Mono. They're both OOP, and widely used for web development. I'd use whichever the team was more familiar with.
Python's off to the side there. It's also used frequently as a scripting language. It can use classes and object orientation, but isn't forced to. It's not as well supported for web work. I'd use this for a different set of tasks than C#/Java.
C# and Java are the two languages you listed that are most similar. Python has a very different syntax, and uses a slightly different programming model. Both C# and Java are Object Oriented languages at their core, with increasing nods to Dynamic Typing. Python began as a Dynamically Typed scripting language and has been picking up more and more Object Oriented features over the years.
The C# class library (.NET Framework) is theoretically multi-platform, though it's heavily weighted towards the Windows platform, and any other OS compatibility is largely an afterthought. The .NET framework currently has two "official" frameworks for building windowed applications (Windows Forms, and WPF) and two "official" frameworks for building web applications (ASP.NET, and ASP.NET MVC). Windows Forms is similar to Java Swing, but the other four frameworks are very different from much of what is found in the Java or Python worlds. There are many language features in C# that are different or lacking in Java, such as Delegates.
The Java class library is pretty solidly multi-platform. It's officially supported desktop and web frameworks (Swing and J2EE) are generally regarded as slow, and difficult to use. However, there is a very lively open source community which has built several competing frameworks that are very powerful and versatile. Java as a language is very slow to introduce new language features, though it is runtime-compatible with several other languages that run on the Java platform (Groovy, Jython, Scala, etc..). Java is the language which has has the most run-time optimizations put into it, so an application written in Java is almost certainly going to be faster than an application written in C# or Python.
Python is an interpreted language (in general), and is pretty solidly multi-platform. Python has no "official" desktop or web frameworks, though desktop applications can be written using GTK or Qt support, both of which are multi-platform. Django has become a de-facto standard for Python web development, and is regarded as a very powerful and expressive framework. Python is at this point fully Object Oriented, and is notable for it's powerful tools for working with collections/arrays/lists. As an interpreted language, Python will be significantly slower than either C# or Java.
Python was made to be simpler, more readable, flexible and object oriented than what existed before - i.e. Java, Perl etc. It's actually closer to Java than it is to Ruby. Ruby is more like Smalltalk. Think of Python as Java without the stuff that mostly gets in your way, makes things awkward to do, slows you down or clutters the essence of your logic. So no semi-colons, curly braces for scoping. No static variable declaration or variables at all really they're identifiers that point to objects instead.
There's also a standard style guide for Python unlike other languages. Indentation is used to indicate scope and inconsistent indentation is a syntax error.
It also includes some often used things built into the language: lists, dictionaries, sets, generators etc.
Java is nice for those familiar with C / C++ syntax and are set in their ways, like that syntax and find it readable. Ruby and Python are for those that preferred Pascal or Smalltalk to C, like Lisp etc.
They are not similar at ALL. They all take widely different approaches to OOP, syntax, and static/dynamic typing.

Visual C++ vs Visual C# , which is the best to learn? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've done my C++ classes and practices after which I started learning Visual C++ using book Ivor Horton's Visual C++. The problem is that I am unable to understand the language of this book and badly trying to understand the codes. I want to learn Visual C++ for Windows application development and making my future in that (also because I already know C++).
Some of my friends told me to switch to C# since it has many library function to create GUI etc and told me it's hard to code Windows applications in Visual C++.
Now in these holidays I am going to join classes, can you help me which language I should stick to, and which one will be easy?
From very beginning I want to learn Visual C++ and sometimes I think it's hard when I don't understand concept in reference books etc.
Any help will be very appreciated, thanks a lot for taking your precious time.
Visual C++ and Visual C# are not languages nor GUI frameworks; they are Integrated Development Environments - IDEs. This means they are text editors tailored to the task of development.
Visual C++ lets you code in C++, Visual C# lets you code in C#. Also, both let you create GUIs in a point-and-click manner.
Sounds like what you really want to do is create GUIs. In that case, without having further information, I recommend you go for C#. It is a much cleaner language than C++, it has fewer ways to shoot yourself in the foot, and it provides access to the immensely useful .NET framework.
C# features that C++ doesn't have:
Fully automatic memory management
Lambda functions¹
Type inference¹
Reflection
Remoting
Automatic serialization
True entity types
Properties
Database integration via LINQ
Convenient functional-style programming via LINQ
No header files
No undefined behavior
Direct interoperability with many languages
Compile once, run everywhere
¹ these features have been added to C++ in the C++11 standard.
C++ features that C# doesn't have
Template metaprogramming
Typedefs
Zero-overhead principle
Means to enforce const-correctness
Mature compilers that produce extremely optimized code nowadays
Much wider platform support
can you help me which language i should stick to , and which one will be easy.
In general, if you're goal is to develop Windows Applications, you'll probably find many, many more simple examples to learn from in C# than in C++. There is a huge community around C# for Windows GUI development.
That being said, many of the concepts you'll need are the same in any language you learn. You can't really go wrong - at some point, you'll probably want to learn both langauges if you're going to program professionally (as well as others).
i think it's hard when i don't understand concept in ref books etc.
You should get a beginning programming book, not reference books, and go through it step-by-step. If your goal is just GUI development, I'd recommend a good, simple C# book, and just step through it form beginning to end, and do all of the examples. Learning from a "reference" book won't work - it's reference material, and not meant to teach concepts.
C++ vs. C# - a Checklist from a C++ Programmers Point of View
http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/
C# is the premeir .net language for developing applications on the .net framework.
Native C++ is more cross platform and low level. It's used for writing applications for windows, mac, linux, embedded systems, etc.
C++.net is C++ adapted to the .net platform, and is primarily used for writing performance critical parts of an application (the rest of which is written in C#, VB.net, or something else as they integrate virtually seamlessly).
Visual C++ is microsoft's windows compiler for C++ that can be used to write native and C++.net applications.
Writing .net applications solely in C++ in much harder than writing them in C# as you have to deal with more low level issues. If you want to write .net applications, I recommend using C# and C++.net if you need it.
with C++, you could be able to touch the 'low level' near 'assembly things' part of programming
c# is never meant to be created to beat c++, with c# you get the whole .net framework utilities, faster cleaner form generations, with the lack of 'low level' part
C# is largely intended for Business Applications so as Java. Visual C# is Microsoft's implementation of the C# programming language specification, included in the Microsoft Visual Studio suite of products.
C# is much slower than C++, since the code passes through CLR. VC++.net has the same drawback.
VC++ is very hard to learn, so as MFC and windows programming, even though you know C++. But is it a prestigious and efficient language.
It is easy to switch from VC++ to VC#. But the reverse is harder.
If you go for VC++, MFC and Windows programming, try this.
Maybe consider what you are likely to want to do in the future, as a professional or a hobbyist. Programming is a wide field, in which both languages have their place. If its too early for you to make that decision, C# is probably most likely to do you good in the future.
It's worth remembering that they are both only languages - and just as writing a good book is about more than correct spelling & grammar, writing good code is about more than the details of a particular languages syntax.
I would learn both.
Having said that, I would create GUI/Application projects using C#, and use VC++ for any COM or device communication.
I would check out Which platform should I use : native C++ or C# ?

What features should Java 7 onwards have to encourage switching from C#? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
C# has a good momentum at the moment. What are the features that you would need to have in order to switch (or return) to Java?
It would also be quite useful if people posted workarounds for these for the current Java versions, e.g. Nullables being wrapped around custom classes, to make this a much more interesting wiki.
As a .NET/C# developer here are the missing features that annoy me. This list in no particular order - just as thoughts come to mind:
The Java library is too small. For common things I have to choose between 5 competing open source products because the base library is lacking in so many ways.
This is an Object Oriented programming language right? Why in the heck do primitive types not inherit from "object"?
Pointers
Lambdas
Closures
Partial Classes and to a lesser extent partial Methods
Real support for Generics
Using statements and Dispose - this was a real WTF for me. You really have to explicitly close connections in try/catch blocks. Poor Java guys!
Yield return would be nice
Unsigned integers - again WTF? I have to use number types larger than I need for what purpose again?
In Java you can return from final blocks of try/catch. A co-worker confused the hell out of me for hours by introducing a bug this way. This behavior should be prohibited as in C#.
I rarely have to use Java and when I do, I have all sorts of WTF moments.
Edit: I Removed for-each comment based on the fact it is no longer a missing Java feature since 1.5.
In my experience, Java vs. .Net is more of a business decision than a technical one. Shops with MS experience trend towards .Net and shops with Java experience trend towards Java & OSS. I've seen little evidence of people switching based upon language features. On the other hand, I've seen shops heavily tilt towards one platform b/c of one or two key employees they wanted to hire being knowledgeable in that area.
in no particular order:
function pointers (delegates); the whole passing interfaces around thing is stupid
real generics; what's the point of having type safe generics if the compiler can't even hold the meta data through a unit's compilation?
ui speed; all the self-drawing ui libraries are very slow compared to native controls wrapped in "managed" libraries, not to mention that microsoft's self-drawn ui is hardware accelerated through direct3d
an yield return construct; c# is so user friendly in this it's crazy
operator overloading
linq; just cuz its so addicting
properties; more synctatic sugar you get addicted to
better interop with native code; c#'s p/invoke and native com support makes interop so easy compared to jni -.-
first class value types; this goes hand in hand with real generics, having generic lists that never box/unbox in c# is part of why c# is faster than java.
and i'd say this is the most important one:
a responsive, informative debugger; nothing can even come close to visual studio right now
Just going off the cuff, I think the biggest thing Java 7 needs that everyone is lamenting the lack of is closures.
I'm a C# programmer and about one year ago I had to participate in the development of an application in Java. What I missed the most was:
Visual Studio (Eclipse is nice, but
VS is VS, especially Team Edition)
Comparing strings with ==
Properties
Basic types as first-class objects
(e.g. not "int" type vs "Integer"
class)
Anonymous methods (a workaround can
be made by using anonymous classes
but it is not the same)
LINQ
And there was one single Java feature that I missed when I went back to C#: explicit exception declaration in method signatures.
DISCLAIMER: I am speaking about a somewhat old project, I don't know if some of these features are present in current versions of Java.
Less heinous XML parsing and manipulation tools. Doing anything with XML in Java sucks.
I'll also give one answer the other way around. C# needs an enumeration implementation like Java has. Java's enumerations rock!
Let me add anonymous overrides to this list also. Sorry to go off topic, but C# needs the ability to anonymously override methods. I have been switching back and forth between Java and C#, and I have to say for unit testing legacy code, there is nothing better than anonymous class overriding.
I would need function pointers of some sort. The ability to use delegates in C# is so useful. There are so many times in Java where I want to create a map of delegates or function pointers as the solution, but I can't. I know you can simulate a similar thing in Java, but having the abstraction as part of the language is a huge plus!
Momentum. I have done a lot of development on both platforms. I'm enjoying the .NET side more because of the way the C# language is evolving. Java's evolution seems to be more a reaction to C# than an actual vision. So I think the best thing for Java to do is ignore .NET and create something new of its own.
Another one I would like is some equivalent to LINQ. I noticed how much I actually depend on the ability to use LINQ when I tried to do a top coder competition and realized they only support .NET 2.0. Once you get used to using LINQ to solve problem and make it part of your regular programming vocabulary it is very difficult to not see problems in that light. It is akin to using generics and then not being able to use generic.
I think, choice between Java and C# is not a question of language features, but a question of platform and ecosystem choice.
So, I doubt that any new syntactic sugar in Java or C# can lead to a significant amount of switchers between the platforms.
After all, JVM world has Scala and many language-sensitive developers are using it in some way.
I think, you should consider swithcing this holywar from "Java vs C#" to "JVM vs CLR", because JVM is (in the last years — mostly) not only Java, but also Scala, Groovy, Clojure, JRuby, Jython, and dozen of JVM-languages.
Properties!
Anonymous objects are nice too
Continuations, like Scala (on top of the rest) would be good too, for agents development.
Support to run over CLR (and vice versa perhaps for JVM) without IKVM and other such layers.
Let's be clear that we need to distinguish between Java and the JVM. I actually switched from C# to Java, but I admit it was not because of Java's amazing language features! In my very humble opinion, C# is the better language, and CLR is the perhaps a more elegant VM. However, even with Mono, you're not writing applications that run everywhere!
I think the greatest argument for Java is the amazing community it has. This is where the cutting edge technology is being developed, not at Sun (now Oracle). The Java community has consistently been the leader in developing Enterprise technologies. For instance, how long did it take Microsoft to provide a DI Framework? Where's AOP in .NET? When I start a .NET project, my foundation is Spring.NET, a Java port. When I need ORM, it's NHibernate. Need a testing framework? NUnit. I realize there are other OSS projects for the .NET platform, but their numbers and support from Microsoft are laughable compared to the Java community.
on the other side, has .net got enterprise open projects like Terracotta (semi commerical), Infinispan, Compass ? no. ncache (commerical), lucene.net are far behind them. Especially Terracotta is unique, it can improve some of your app x100, it's simply perfect and free (partitioning is commerical). If we implement a high load app in both .net with anything and java with terracotta + hibernate + terracotta-hibernate-integration, java app will probably far more performant than .net one. Ther're some ports to .net like nhibernate, log4net, lucene.net, but all of them are trying to catch java versions. And entity framework is a disaster, they have to start with nhibernate as the base or get some lessons from them.
.net is only working on windows (mono is far from enterprise, there isn't any enterprises using it), how much money does myspace.com spent for their 4000 windows web server licences ? 1 million ?
You can't install a simple plugin to VS (and can't do some other things) if don't buy professional edition,
Some windows instance types in amazon web services are nearly x2 price of the linux ones.
if you look at ohloh.net open source java project counts (with language comparison tools), you'll see that java has x5 more volume than c#.
also Java has %20 share on worldwide while c# has %4.x (source:tiobe.com)
Look at the top web sites; only microsoft and myspace are using .net. google, amazon, ebay, linkedin, alibaba, twitter (switched to scala from rails)... many of them are using java and many others are using php, ruby (facebook, yahoo,..)
As a language Java is far behind c#, but Scala (runs on jvm) is as good as c# and it's performance is nearly same as java and also it can use all jdk and other java code as his library.
I'm not saying java is better, but I'm saying java is as valuable as .net, too.
A native 'decimal' type for Java replacing the BigDecimal class would be nice. But Java thread-safe collections are nice.
Perhaps the question is not so much what Java 7 needs to persuade developers to use it, but more a case of what makes developers want to move from Enterprise/server-side java language to a different C# desktop Windows-only oriented world?
For most developers, the language isn't difficult to pick up be it Java or C#. I develop in Java, but Linq didn't take long to understand and use.
I think the choice of Java or C# depends on what motivates you personally -perhaps money? in which case either language will do whether they have certain features or not.
Ste
They should start by fixing the Calendar/Date related classes, even that seems too much to ask.
A simple way to map values in your model to the UI (like bind in Java/FX)
I think it depends on bussiness decisions, not the languages themselves.
But I really really really love C# lambdas and curry :D :D
http://mikeomatic.net/?p=82
a map({codeblock}) which runs over anything iterable would be nice. And filter too. And being able to return multiple values easily from a method.
(a,b,c) = getThreeValues();
(would assign the individual variables a, b and c).
Actually I just think they should have Haskell as a supported scripting language on the JVM :D
linq, lambda, anonymous types
I don't see any point in "luring" anyone anywhere. They solve different problems and you should use whichever one suits you.
Java has less "Language" and less structures to trip up new people, it's platform independent and it doesn't change too fast allowing old code to stick around for a LONG time (Good for some large companies).
C# has tight desktop integration and a slew of nice features that make it more fun to program. It has .net integration. It has pointers, closures, etc which make it harder for n00bs (a valid language target, hence Basic) but more fun for experienced programmers--I haven't convinced myself that these features make you more productive, but in some situations they can make your code a lot nicer! Also if you need pointers, you need pointers.
I don't see a whole lot of overlap in target audiences. Why change a language to attract programmers when it's healthier for the entire industry to have two healthy languages each targeted at solving different problems attracting different developers?

What Are The Advantages/Disadvantages of Using Both VB.Net and C# In The Workplace?

At a colleague's workplace, a decision is trying to be made about whether to use both languages in the workplace or to standardize on one? There are some VB.Net developers and some C# developers.
What advantages or disadvantages would there be to using both or to using one?
Edit: To clarify this question, the question is not asking the advantages of one over the other, rather what are the advantages/disadvantage of standardizing on both languages versus standardizing on one.
For instance, one point could be that C#/VB.Net may have more third party tools available and hence it may make sense to standardize all developers on that language.
We should probably put on our Reality Glasses for this discussion. It's not just Syntactic Sugar going on here.
You will find that you can write code very quickly in Visual Basic.NET. That is largely due to some features that it has that C# does not yet provide: namely, the My namespace, which provides a plethora of functionality that C# developers have to frequently code by hand. (And that's a damned shame, if you ask me.)
I code in both languages every day. Coding event handlers for forms in Visual Basic is a snap, and it's VERY obvious what methods handle which events. It's not always as clear in C#. On the other hand, you can't always be as explicit in Visual Basic as you want to be, because Visual Basic does so much of the work for you. C# has the advantage of just getting the heck out of your way, and letting you get down to the nuts and bolts. Quite often, that's extremely liberating.
VB will let you invoke static/shared methods on an object instance. C# won't. You'll learn that the hard way when you try to port your code. C# will complain about unreachable code; VB doesn't care one way or the other.
But under the hood, when you get right down to it, it's all .NET. It all compiles down to MSIL. There will be minor differences. Visual Basic, for example, doesn't care about the case-sensitivity of names, where C# does. And the big gotcha there is that the CLR does as well. You'll realize that when you try to use reflection. Does that mean you shouldn't use VB? Nope. Just make sure you case things consistently -- especially your namespaces. (Namespace "My" and namespace "my" are two completely different namespaces to C# and the CLR, but they're the same to VB.)
Choose the language that makes you most productive, that reduces ramp-up time and maintenance costs. You may find that that means working with both languages. (We do!)
EDIT TO ADDRESS OP'S EDIT:
Refactoring tools are available for both languages.
Automated unit testing tools are equally applicable.
3rd party controls are going to be available for both languages because they're compiled down to MSIL.
Now, for IDE productivity tools, the one thing that C# has at this time that VB doesn't is StyleCop. That may change soon (and I hope it does), but I don't view it as a roadblock by any stretch of the imagination.
This is personal experience mixed with workplace lore:
VB.NET is capable of being little more nimble, compared to C#, because there isn't a standards committee (except for any that may exist at Microsoft).
Most of the Google-able code hackery out there is done in C#, and most of the best resource books provide code samples in C# only.
VB.NET is tainted with a history of VB being accessible to even the most incapable of developers. This is unfair, imho, because VB.NET is much more a "real" language. But the taint isn't going to be washed away any time soon, and "real" programmers still generally despise it.
As for real life - I code in my own time in C# and VB.NET at work. I believe that because so much of the code one writes for .NET is calls against the framework objects, the differences are actually quite small. If you can declare variables in both languages you're 80% to being portable. If you understand the framework, the syntax of the languages is a small obstacle.
EDIT to directly answer your question: We happily use both (though mainly VB.NET) and haven't ever had any problems. We use Visual Studio which allows us to pretty freely mix code files/assemblies. I would encourage you not to limit to a single language - I think some diversity is good for the brain.
My workplace had traditionally been a VB.Net shop, but a decision was made a couple years ago to switch to C#. This happened mostly because the VB developers had either left or moved into other positions and most of the new hires preferred C#. We still have a large legacy VB.Net code base, but all new development is being done in C#.
I don't think there's a strong technical reason to choose one language over the other, as they are pretty equivalent in functionality, but I do feel there are some valid reasons to choose one type of developer over the other. While I believe VB and C# are equal, there's is the unfortunate perception that C# developers are better than VB developers. While there is some justification for this, it's overblown. (It was more applicable in the C++/VB days.) That said, the perception exists. This does cause some talented developers to avoid and bash VB (though they usually do so from ignorance). I do think it's harder to hire developers into a VB shop than visa versa, because a C# developer will often balk at the idea of having to use VB, but VB developers usually aren't as opposed to using C#. There is one significant disadvantage to choosing C# over VB and that's that C# developers generally get paid more.
In my experience, the best developers welcome using both languages. The more languages you know, the better.
After tracking your question for a little bit and noting your edit, I have to wonder if you're fishing a little bit...
Either way, I think it's fairly obvious that at least the latest third-party tools favor C#. I, like the other responders, code VB for work and prefer C# for other development. I have definitely noticed that the documentation for many third-party addins/plugins and in some cases the products themselves favor C#. ReSharper, even though 4.5 has better VB support, is still vastly more comprehensive when using C#. And other frameworks, like Fluent NHibernate, don't support VB at all. So for tooling, especially when considering late-breaking stuff, I believe that C# wins. Not to mention the fact that C# got a few new features in 3.0 that won't be available until VB 10 makes a wide release.
I still agree whole-heartedly with the others; if you can do it in C#, you can do it in VB. It's all the same CLR, in the end.
I'd say given that there are "some VB.NET developers and some C# developers," there really is very little benefit to forcing everyone to use one language. Frankly even a VB.NET developer who's never looked at C# should be able to read C# code with no more than a brief introduction to the syntax, assuming he/she has a reasonable understanding of the .NET framework; and a C# developer should be able to do the same with VB.NET.
(I should also add: this is assuming everyone has access to a development environment in which the .NET languages can co-exist harmoniously -- e.g., VS2005, VS2008, etc., as opposed to one of the Express Editions, which as far as I know don't allow multi-language solutions.)
Don't fall for the "most examples / books are written for C#". Working out how to apply a C# example to VB.NET is trivial -- you'll have more trouble trying to understand what the moron who wrote the example / book is trying to do and what their hideous coding (un)convention is all about than you will mentally flipping C# syntax to VB syntax.
Also I'd say don't worry about whether you hire C# or VB.NET programmers: if they are any good at all then they won't have a problem with reading / writing both languages.
We use both here, and after a little resistance from some (we were using C++ before) have settled down fine. As I had predicted, the hardest thing for our team was (and probably still is) the conversion from MFC to .NET, not the language used to access the libraries.
FWIW our main split is VB.NET for UI code, and C# for backend / database / computation code.
C# and VB.net are the same with a different syntax. You can convert from C# to VB.net and back very easily.
VB.net does have a few extra advantages that C# does not, such as inline XML.
Most places have C# because its the more popular language.
I started out as a VB developer so naturally I migrated to VB.Net when I first worked with .Net. In fact my first .Net application was made in VB.Net too. But I tried out C# and found myself liking it better in a matter of weeks.
So I made some of that app in C# (some libraries) and it didn't hurt me. Now though I hate going back to the older VB.Net code and working on it. I really wish I could change it all to C# somehow.
That's not going to happen.
So what I am telling you here is, irrelevant of what language you choose (VB/C#) stick to it. Don't do mixed language development unless you have a compelling reason I can't think of yet :)
The advantage of standardizing on a single language is that basically everyone will have 1/2 as much to learn. I think it's better to spend the time learning more features of .NET, within a single language, rather than learning 1/2 the features in both.
As far as hiring goes, it does not really restrict you as a good VB or C# programmer should be able to switch to the other language without difficulty (or else they aren't really a good programmer :)

Is there a Functional Programming library for .NET?

For example, in Java there is Functional Java and Higher-Order Java. Both essentially give a small API for manipulating higher-order, curried functions, and perhaps a few new data types (tuples, immutable lists).
LanguageExt looks very promising for making functional style programming in C# easier.
https://github.com/louthy/language-ext
have you looked into F#?
Also a neat blog post would be here that talks about how to use the new generic / lambda expressions built into c# 3.0.
If you just add using System.Linq to the top of your source file there are a LOT of nice new functions added to working with collections such as folding / filtering / etc.
Assuming you can't use F# for whatever reason, and just want to use functional paradigms and idioms in your C# code to improve quality & reliability:
Functional style pattern matching for C#
Monad library for C#/.Net
There is also 'elevate' which has some functional things like option types (maybes) etc.
I think you want F#
Also, the more recent versions of C# have a lot of functional concepts included in the base langauge.
There may be such a library for C#, but you should probably consider just using F# http://research.microsoft.com/fsharp/fsharp.aspx and http://msdn.microsoft.com/en-us/fsharp/default.aspx.
Microsoft plans to make F# a first-class language in Visual Studio so there should be little risk in using one of the CTPs to build your initial stuff.
If you're looking for something that extends C# then no, but there is F# which is a .NET based functional language. From the "About F#" page:
F# is a typed functional programming language for the .NET Framework. It combines the succinctness, expressivity, and compositionality of typed functional programming with the runtime support, libraries, interoperability, tools and object model of .NET. F# stems from the ML family of languages and has a core language compatible with that of OCaml, though also draws from C# and Haskell. F# was designed from the ground up to be a first-class citizen on .NET, giving smooth interoperability with other .NET languages. For example, C# and F# can call each other directly. This means that F# has immediate access to all the .NET Framework APIs, including, for example, Windows Presentation Foundation and DirectX. Similarly, libraries developed in F# may be used from other .NET languages.
Since F# and OCaml share a similar core language, some OCaml libraries and applications can cross-compile either directly or with minor conditionally-compiled changes. This provides a path to cross-compile and/or port existing OCaml code to .NET, and also allows programmers to transfer skills between these languages. A major focus of the project has been to extend the reach of OCaml-like languages into arenas where they have not traditionally been used. Throughout the project the designers of F# are grateful for the support and encouragement of Xavier Leroy and others in the OCaml community.
Not a shrink-wrapped library per se, but Luca Bolognese of Microsoft has a series of blog posts where he builds a C# library for functional programming with types like tuples, records, type unions and so on:
Also Linq is basically a library for functional programming with syntactial support in C#.
Check out http://code.msdn.microsoft.com/FunctionalCSharp for some samples.
F#, there's a CTP release available from microsoft.
One more option to consider is FuncSharp. It's not so heavy as LanguageExt and it does cover the most important patterns/aspects.

Categories

Resources