Sharepoint development in what language? - c#

I know this might sound a little silly. but I'm confused as to what language does sharepoint code behind uses? do they use vb or c#? or is it possible to use either? thanks in advance.

C#.
You CAN use any .net language that you want of course, but the vast vast majority of SharePoint books, documentation and Code Samples are in C#. The official Microsoft SharePoint SDK Samples is only in C#.
You really want to use C# if you have to develop for SharePoint, especially if you're just starting.

You can use any language supported by the .NET Framework, Visual Basic and C# included.

You'll never know for sure. It could be any language that can compile into a .Net assembly. I think the advice here is that it is most likely C# but it would be hard for someone to say definitely that every code behind in the product was written with C#.
In short, write with what you know and like. If you are just learning and don't have a preference, stick with C#.

Lets just say 9 out of 10 uses C# as the code behind although this is not proven. But that's the way how I rate it in terms of community, samples and all the persons I know. Haven't seen somebody to use VB as codebehind yet but I'm sure there is. It would actually depend on what language you are comfortable it has no actual requirments for the code behind for as long as it is in .Net :)

I have seen some vb.net codebehind, but honestly that was more to show that they could also write it in vb.net than out of a preference. I started in vb.net when .net just surfaced and I must admit that I changed to c# after 3 months and I never regretted that afterwards :)

Related

Going from C# to VB.NET - Resources?

Though I have worked with Visual Basic in the past (VB 4, 5, and 6), ever since the .NET framework was first released I have been working in C#. For an upcoming project I am being asked to work in VB.NET so I am trying to come up to speed with VB.NET. Can anyone recommend any resources (books, articles, etc ..) targeted towards C# developers who are looking to quickly become familiar with VB.NET?
EDIT: I feel I should emphasize, due to certain comments, that I am not trying to compare the various worth of each language (C# vs. VB.NET). Such a comparison wold be subjective in so many ways. Rather, I am saying I myself am not that versed in VB.NET and am looking for resources that would enable me to learn VB.NET considering my experience is with C#.
Never, ever forget this when you're doing boolean logic:
AndAlso instead of And
OrElse instead of Or
Just dive in. Seriously, that is the best way to learn. Functionally, they are mostly the same these days.
For me, the major differences are
lack of support for iterators (yield return) in VB.Net (coming in the next version)
XML literals in VB.Net are not available in C#. As a C# developer, many times I prefer VB when working with XML these days...
linq query syntax behaves differently in VB (richer at first sight in VB, but much more consistent in C#)
Other than that, it's mostly just syntax
Oh, and don't forget to put Option Strict and Option Infer on... If you need dynamic, you can 'sort of' get the same by turning off Option Strict (I recommend doing this at the file level).
Here is a link that compares the two languages: http://www.harding.edu/fmccown/vbnet_csharp_comparison.html
In truth with .Net 4.0 they are pretty much the same. The syntax is different (obviously), but their functionality is nearly identical. This is now by design, Microsoft plans on co-evolving them from now on, so new features will be added to both.
I work with both, if you know C# and know VB6 syntax, it'll be easy to pick up (I started with C# since I have more of a C++ background, but I also had some VB6 so it was very easy to start working on VB.Net as well).
There's a few things you'll have to look up every now and then but as Kevin says, they're more or less the same language. And anyway, the languages themselves aren't that big so aren't very difficult to learn, it's learning the .Net Framework that takes a lot of time, so you know what's already written and where to find it, and your knowledge of that transfers across.
go to msdn Visual Basic Developer Ceneter , you'll find tons of information there
http://msdn.microsoft.com/en-us/vbasic/default
here is a learning guide
http://searchwindevelopment.techtarget.com/tutorial/Choosing-VBNET-or-C-Learning-Guide
Google is good for checking syntax differences (search "C# keyword equivalent in vb.net"). MSDN is good about having code examples in both VB and C# too.
This online conversion tool can often be helpful too.
Besides the short circuit operators, one thing that can trip you up is not initializing your variables. It seems like you don't have to, but if you are in a loop you actually do have to.

ASP.NET - C# vs VB.NET - Indirect differences and things you might not initially consider

I'm not interested in starting another "who has the bigger member" VB vs C# debate (https://stackoverflow.com/questions/158229/what-are-the-pros-of-vb-net seems to cover that already) though I am interested in indirect differences which may influence developing in one vs the other. All my commercial .NET development was desktop apps in VB until the last 3 months where I had a web project and decided it was a good opportunity to force myself to learn C#. In the course of doing so I've noticed a few non-technical differences:
A lot more mature open source apps and thorough examples are available in C# than for VB.
Third party vendors of add-ins for things like refactoring and documentation tend to support C# better than VB (if at all), with VB support for similar features from comparable C# versions often lagging behind or absent.
ASP.NET jobs targeting C# seem to pay around 15-20% more on average than otherwise identical jobs in VB (at least in Australia, looking on seek.com.au and careerone.com.au for reference).
The jump to ASP.NET, MVC and C# presented a lot of speed humps at once but I think was well worth it. The decision I need to make now is whether to put more energy into pursuing C# for future .NET development or if I might as well stick to VB. Are there any other points of difference between the language (other than direct language feature comparisons already covered) that one should consider in this instance?
I find that VS does more automatic code completion for VB than C#.
It's very useful to know both languages and I personally have to get better acquainted with C# so that I'm comfortable applying for C# jobs which should triple my options.
At the Microsoft 2009 Mix Web
developer conference, all the
presentations that I attended
included code examples in C#, not VB.
In StackOverflow, notice how
questions tagged c# largely outnumber vb.net and
vb.
John Skeet wrote C# in Depth, not VB in Depth.
One thing that has been widely stated when I have participated in hiring (both as a hiring manager, as well as a candidate) is that C# and Java are close enough that converting a candidate from one to the other is fairly easy, and that this is not true for a VB.NET candidate to C#, or Java. This statement has even been extended to C++, saying training a C# or Java developer (to code in C++) is easier than a VB.NET developer.
Though I tend to disagree (I think it is more about how the person sees programming in general) I know that several large, reputable firms will accept candidates for C# or Java jobs that list C++, C# or Java experience. These same firms will in general not look at candidates who only list VB.NET, or list VB.NET as their primary language.
Specifically for web development, becoming proficient in C# made writing javascript (and doing complex things using jQuery) much easier because the syntax is so similar.
I agree with your points, particularly the first. I would add that it seems there are more C# developers out there than VB.NET. If you are looking to hire another developer, you may get more (quantity or quality) from the C# pool. And employers, perceiving that C# is more popular, will go in that direction, and there will be more demand for C# programmers (hence the higher salaries/rates you noticed)
I know that this is an old post but I'd like to add one other factor: all the new stuff gets done in C# first. This comes from my experiences with early WPF development. All the examples where in C# and we were working in VB.Net. It just took extra time to translate. Another example is lambdas, initially you could use expressions (single line) or statements (multi-line) in C# but only expressions in VB.Net.
When .Net was first rolled out, I think that there were a lot of VB6 folks who didn't really get .Net and that it was a whole different animal. I think that those people were partially responsible for the negative perceptions of VB.Net. But that was 10 years ago now and no longer a factor.

Learning C# as a VB.NET programmer

I am looking to switch to C#. I come from a C / C++ background but C# is a little different for me. I am switching mainly because of Silverlight and MVVM; all examples are in C#. Any information is in C# and I am confused when I read through it all.
What is a good place to start learning C# when starting with existing C / C++ knowledge?
Start writing code in C# ASAP. Only way to learn the language is to write it. You already understand VB.NET. You've got a huge lead on anyone new to .NET.
Take a smallish application you've written in VB.NET and methodically change it over to C#.
You'll learn the syntax, etc. quickly.
Write all of your future projects in C#. Just force yourself into the change and you'll do fine.
Read the best C# books. :)
The Wikipedia article "C Sharp (programming language)" is a decent introduction to C# as a language.
Shortly after learning VB.NET I decided I'd rather be coding C#. I learned it by reading a couple of books and working on a project. Slowly, I got my coworkers converted over to the language from VB.NET as well. The languages are very similar, some code conversion is just a matter of changing syntax.
However, if you've ever worked with a true VB'er you will see VB specific functions used in their code that'll make you scratch your head. There are string handling functions and casting functions for example that you will have to convert. Also, C# has no RaiseEvent. Events take a little more effort to understand in C# because you need to wrap your mind around delegates (C++ function pointers/callbacks). As others have said, if you are coming from C++ this shouldn't be too difficult.
Many people go on about needing to work on a project to understand a language, which I agree with. However, there are features of languages which you will never know about if you don't pick up a couple of books and read about them. I've been able to show my coworkers many useful techniques just by reading a couple of books.
Lastly, C# is a great language. I was very skeptical when I first started using .NET, but now I know that MS got the right talent together for that framework and language.
Good luck.
As you know C++ (as you wrote in the question) and VB.Net (as you mentioned in the title), C# won't be hard for you if do know them both well. If this is the case, just grab any source in C#, and read it.
By the way, the article from wikipedia is a very nice intro.
One thing that may work for you is to use a converter
Write your desired code in VB.
Paste small pieces of code you don't know how to write in C# into http://converter.telerik.com/ and convert.
Manually type the result into your C# project.
Gradually, reduce your reliance on converter as you become more familiar with language.
That is enough to get you started, however C# has language features that VB does not, or VB offers in a way that is so wordy that no one really uses it.
The more features you will come across as you look at code examples from around the web (like on stack overflow), and you need to either look up syntax or function manually, or convert from C# back to vb to understand what it is doing (use same converter). Or, just paste it in and see what it does.

Using IronPython to learn the .NET framework, is this bad?

Because I'm a Python fan, I'd like to learn the .NET framework using IronPython. Would I be missing out on something? Is this in some way not recommended?
EDIT:
I'm pretty knowledgeable of Java ( so learning/using a new language is not a problem for me ). If needed, will I be able to use everything I learned in IronPython ( excluding language featurs ) to write C# code?
No, sounds like a good way to learn to me. You get to stick with a language and syntax that you are familiar with, and learn about the huge range of classes available in the framework, and how the CLR supports your code.
Once you've got to grips with some of the framework and the CLR services you could always pick up C# in the future. By that point it will just be a minor syntax change from what you already know.
Bare in mind that if you are thinking with respect to a career, you won't find many iron python jobs, but like I say, this could be a good way to learn about the framework first, then build on that with C# in a month or twos time.
You can definitely do that to learn the class library, but I'm not sure if it's such a good idea when it comes to fundamental CLR concepts (e.g. delegates and events). You'll need to pay attention and distinguish what is strictly an IronPython feature, and what is CLR feature exposed in IronPython in a way that matches its dynamic semantics better.
If I wanted to just "learn the framework", I would do it in C# or VB for two main reasons:
Intellisense - the framework is huge, and being offered suggestions for function overloads is one of the ways to find new stuff. There's almost no good intellisense for the framework with IronPython at the moment (Michael Foord has done some work on building the appropriate info for Wing, but I haven't tried it myself).
Code samples - pretty much all the educational material that exists about the .NET framework is given with C# or VB. You'll be much more on your own with IronPython.
I find .NET a lot easier to learn with intellisense. If you can get IronPython to work in Visual Studio as a first-class language, go for it. If you try, please document it!
Hmmm: http://www.codeplex.com/IronPythonStudio

How do I convert VB5 project to a c# project

I have a VB5 (non .net) project that I would like to upgrade to a c# project. Has anyone have any suggestions on methods or free tools that are avalible to help me with this.
Thanks
Brad
You are better off with a straight rewrite.
What I would suggest is first convert the project to VB6. It'll be much easier to go forward from there. There are a number of tools to help you do this. There is VBMigration Partner and there is vbto. I've not tried either so YMMV.
If costs are a constraint you could try this: there is a wizard in Visual Studio that will attempt to upgrade VB6 to VB.NET. It's not 100% accurate and you WILL have to write code for things VB.NET does not support such as control arrays, etc. Once the code is in VB.NET you can use a tool like SharpDevelop to convert the VB.NET to C#. It'll be a bit tedious but i suppose all roads, no matter how convoluted, lead to Rome.
In case you were able to migrate it to VB6 you can use the code advisor to see how you can fix your project to be compatible to vb.net, then you can migrate to vb.net, in case it success, you can use this tool to convert it to c# or the Reflector.
I give it a chance of 1x10^(-100)% to work.
Good luck.
If you're about to convert VB5 to .NET (whether it's C# or even VB.NET) the fastest way is to restart from 0 your implementation so you can take full advantage of .NET Framework classes. I don't know if there are tools to do this conversion automatically.
It's rarely a good idea to do a strict conversion from one language to another, particularly when they are as different as VB5 and C#.
Theoretically, you could convert VB5 to VB6 and then VB6 to VB.NET and then VB.NET to C#, but that just sounds crazy to me as I type it.
C# is so much more powerful than VB5 that you wouldn't want to covert the code anyway. After all, it likely has a poor design due to VB's weak OO capabilities.
I'd instead recommend re-implementing the functionality you need in C# (or whatever other language you want to use).
I know there exist a conversion tools, not sure though if there are some for vb5.
However, i'd recommend performing a redesign of the project, taking advantage of the .net features unavaiable in vb5. Specially it would be good redesigning for a OO language.
Migrating VB5 to C# just to have .NET is never a good reason. I would prefer to have a good look at the assumptions and design decisions I made in the VB5 version, rethink them all, add new ideas, sketch the UI and improve it to look closer to a modern one.
Then it's a new project, I wouldn't even call it a rewrite, because so much would have changed.
I've migrated a small 1-tier VB6 application to C# and I will never do it again.
There are applications out there that do a rather good job migrating from VB6 to VB.Net.
//Magnus
I’ve done it in the past but don’t recommend it. Getting the project to work correctly after the ‘auto-migration’ was not worth the effort. I ended up rewriting the program and was better off because of it.
Having done this myself I talk about the issues involved here.
Basically as ocdecio you are looking at least a partial rewrite. You will likely need to refactor your forms to move as much code out of them as possible. You will also need to refactor any VB6 specific features to work behind a interface that you can reimplement in .NET. Notably the Graphics commands, and the Printer functions. Migration Tools are usually worthless for any serious project.

Categories