views:

803

answers:

12

I have recently been working with Python using Komodo Edit and other simpler editors but now I am doing a project which is to be done in C# using VS 08. I would appreciate any hints on how to get productive on that platform as quickly as possible.

A: 

Do small mini projects. Some of the top of my head.

1) Hello world
2) Console
3) GUI design
4) Toy project

They're going to bring you up faster to speed than reading a tutorial. Grab a beer and have fun.

Chad
One last thing, buy a copy of. visual assist you can thank me later.
Chad
A: 

Microsoft has a nice learning platform for this:

http://msdn.microsoft.com/en-us/vcsharp/aa336766.aspx

I recommend to take a look at the "How do I" video series.

VVS
A: 

I would consider this dependant on a few things. For example, do you use keyboard more than mouse? If so i would get learning VS shortcuts. Do you know C# at all? Read some books. I know this is vague, but its a somewhat vague question.

Practice, practice, practice, gain experience, become productive.

mattlant
+1  A: 

Get an excellent book and start reading. I have Pro C# 2008 and the .NET 3.5 Platform.

Since you have a project to work on that should help greatly as well.

+3  A: 

Pick a Python project you've completed in the past and manually convert it to C#. This is how I've learned every language I currently know (except for x86 assembly).

Consider using IronPython to help bridge the gap - you can reference .NET assemblies via IronPython, as well as create .NET assemblies to reference from C#.

Also, stay very far away from those Learn C# in 21 Days! books... They almost never live up to the hype, and are typically more harm than good.

Erik Forbes
+3  A: 

I would appreciate any hints on how to get productive on that platform as quickly as possible.

Practical experience my friend. Start using it as soon as possible to be productive as soon as possible.

Some obvious recommendations are:

  • create shortcut\macros\templates for frequent actions. Force yourself use shortcuts instead of clicking on menus
  • install ReSharper - in will give you 1000% productivity boost (if you have a couple of bucks to buy it)

And don't hesitate to look into manual from time to time :)

aku
He should stay away from using addons like ReSharper until he's gained some proficiency in the vanilla IDE - not all employers are keen on paying for that license (mine for example.....)
Erik Forbes
Erik, yeah, greedy employers are not really understand that investing 100$ on such tool can increase developer productivity tremendously
aku
+7  A: 

I would personally concentrate on learning the core parts of both C# and .NET first. For me, that would mean writing console apps (rather than Windows Forms) to experiment with the language and important aspects like IO. When you're happy with the foundations, move onto whichever "peripheral" technology (WinForms, WPF, ASP.NET, WCF etc) you need for your project.

In terms of books, I can recommend both C# 3.0 in a Nutshell and Accelerated C# 2008. The links are to my reviews of the books. Both cover language + core libraries. I wouldn't worry too much about LINQ to start with - get comfortable with the rest of the language, particularly delegates and generics, before you tackle LINQ. At that point, I'd thoroughly recommend playing with LINQ to Objects for quite a while before you start using LINQ to SQL or the Entity Framework. (On the other hand, if you need to use XML at all, I'd go straight to LINQ to XML - it's a whole XML API, not just a LINQ provider. It's much nicer than the normal DOM API.)

Jon Skeet
A: 

For every tool, system, language or whatever, the quickest way to get productive is (at least for me) to get to understand the background rather than starting from hello world followed by stumbling from one command to next one you think you need.

So buy a good book (e.g. Microsoft Press) or go to Microsoft MSDN and Technet and read as much as possible of the background stuff. Detailed stuff (at book or internet) can by referred later.

Additionally - to boost the productivity - join mailinglists, IRCs, usegroups, etc. to get knowledge about every day problems of others, using the same tool, system, language, whatever.

Then - after a week or two - start programming.

I know, thats not that what one want to do when starting with a new language. But for me, this apporach works best, the last years.

Marco
+1  A: 

I look at the move from Python to C# as a step down the evolutionary ladder. Expect a much more verbose experience (e.g. variable declarations and class properties).

Keep an eye on IronPython - it will help you to get the feel of .NET using a familiar language. The dynamic nature of Python makes checking .NET behavior a lot quicker then checking ideas in C#. You can use IronPython directly from Visual Studio with IronPython Studio .

gimel
True, I'm not that happy about the change but what can you do? Good point about IronPython. Thanks.
Mingus Rude
I don't see how you can make a statement like that. C# and Python are two separate tools. Each have their own uses and strengths.
Jeremy Cantrell
Jeremy Cantrell - I apologize for the subjective statement - it's a matter of personal taste. The statement was directed at the original poster (Mignus Rude) who is switching from one language to another.I did not mean to start a language war.
gimel
+10  A: 

As far as becoming proficient with C# I would highly recommend Programming C# and C# in Depth.

For Visual Studio, start poking around in the IDE a lot, play around, get familiar with it. Start with simple projects and explore all the different aspects. Learn how to optimize Visual Studio and get familiar with some of the great keyboard shortcuts / hidden features of the IDE.

Definitely do each of the following at least once:

Projects:

  • Create a simple console application (e.g. hello world)
  • Create a class library (managed .dll) and use it from another application you create
  • Create a simple windows application
  • Create a simple asp.net web app

Debugging:

  • Debug a command line app
  • Get familiar with: breakpoints, the locals and watch windows, step over, step into, step out of, continue, stop debugging
  • Create a command line app which uses a function in a class library. Store the dll and symbol file (.pdb) for the library but delete the source code, debug through app as it goes into the library
  • Debug into a webservice
  • Learn how to use ILDasm and ILAsm

Command Line:

  • Get familiar with the Visual Studio command line environment
  • Build using only the command line
  • Debug from the command line using devenv.exe /debugexe
  • Use ILDasm / ILAsm from the command line to disassemble a simple app into .IL, reassemble it into a differently named file, test to see that it still works

Testing:

  • Create unit tests (right click in a method, select the option to create a test)
  • Learn how to: run all unit tests, run all unit tests under the debugger, rerun failed unit tests, see details on test failures, run a subset of unit tests
  • Learn how to collect code coverage statistics for your tests

Source Control:

  • Learn how to interact with your source control system of choice while developing using VS

Refactoring et al:

  • Become familiar with all of the built-in refactorings (especially rename and extract method)
  • Use "Go To Definition"
  • Use "Find All References"
  • Use "Find In Files" (ctrl-shift-F)

IDE & Keyboard Shortcuts:

  • Learn how to use the designer well for web and winforms
  • Get very familiar with the Solution Explorer window
  • Experiment with different window layouts until you find one your comfortable with, keep experimenting later to see if that's still the best choice
  • Learn the ins and outs of intellisense, use it to your advantage as much as possible
  • Learn the keyboard shortcut for everything you do
Wedge
+1  A: 

Python to C# transition

You usually learn next language by comparing it's features to languages you already know. Since you're familiar with Python, read some Python/C# comparisons like "A Python Programmmer's Perspective on C#" and "Does C# 3.0 Beat Dynamic Languages at their Own Game?". The delta between C# 3.5 and Python is not that big.

Constantin
A: 

For mastering C# I can recommend C# 3.0 in a Nutshell and C# in Depth.

For getting up to speed with VS2008, I would take a look at Professional Visual Studio 2008 (disclosure: the authors provided me with a copy for review). For getting started with C#, Pro C# with .NET 3.0

For learning LINQ, there is no better way than downloading LINQPad (by the author of C# 3.0 in a Nutshell). It comes with examples and is a great tool for creating LINQ queries.

Mitch Wheat