tags:

views:

156

answers:

4

Hi There.

I work for a research department in a big company and we use .Net platform to build our prototypes (That means the product team always reproduce our work if the prototype is 'useful'.).

We also hire interns for our projects. Some of the interns are mainly doing research, thus code less. But anyway, interns need to do some coding in C#, or F# if they can. Most of them don't have any C# experience before. They are senior undergrads or grads, and usually know some Java and C++. But they usually have not received any formal training in industry-quality programming.

The hard problem is to teach them C#/.Net fast as they should focus on their research problems during a 3 or 6 months internship. Also they really need to know some good C# practice, otherwise the codebase during their internship is not reuseable after the internship.

My way of learning C# is different from others (I learned F# first and then read CLR via C# and Effective Java from cover to cover. ) So I'd like to consult experienced C# users to suggest a short-term (say, 2 or 3 days) C# tutorial. Thanks a lot!

+4  A: 

Either ask them to buy, or buy for them, the following two books:

Essential C# 4.0 and C# 4.0 in a Nutshell

If you really care about their style, as you say you do, also get them:

Effective C# 2nd ed.

Given this set and assuming they already know how to program in general (e.g., Java/C++), they can get productive in a matter of weeks. You can use the Effective C# guidelines to help promote manageable code, at least at a low level.

Michael Goldshteyn
+2  A: 

Chapter 1 - Introduction from the language specification:
http://msdn.microsoft.com/en-us/library/ms228593.aspx

The reader should already know how to program in some OOP language beforehand. As a Delphi programmer it helped me learn C# very quickly.

CodeInChaos
+2  A: 

I would look at the tutorials at the Microsoft site: C# Tutorials

Steve Ellinger
A: 

Provide them with a range of simple sample programs.

A simple console application, with some example of data input, output, string.format, string.isnullorempty, getappconfig, type conversions, a simple sql connection and query using datatables, one using datareader, reflection,

Another few with XML and/or JSON serialization, system.text.encoding, system.text.regularexpressions, directorywachter, system.drawing, system.drawing.imaging, etc.

Other examples with iTestSharp, sharpziplib, excelpackageplus, nhibernate, BouncyCastle (OpenPGP), etc.

One example program each for Console, WinForms, Windows Service, Web Service authorization. WinForms containing dropdowns, checkboxes, textfields (+multiline), rich text controls, dataview, databind, treeview.

An example application using webReferences, e.g. ReportingService WebService. One HTTP module (IP blocking for example). One example application using SOAP extension (for encryption for example).

Then an ASP.NET page with DropDowns, CheckBoxes, TreeViews and PostBacks. Also one using ASP.NET MVC and AJAX instead of WebFroms.

Sample application of JQuery, JQuery uploadify.

Or even better, let one of those students write a collection of simple sample programs for all these. For further student's reference. Tell them to use Google to find out the details, and stackoverflow if they have a question.

Other topics: Events, function pointers (Delegates) Interfaces, CodeDom compiler, LINQ, nullable types, properties, registry, filesystem, iterators, http get/post requests, unsafe code and pointers.

Quandary
IMO examples can only be a supplement but not replace a real explanation.
CodeInChaos
@CodeInChaos: They should not require an explanation for loops and if then else statements, etc. IMHO, the only problem that really requries explanation is thread-safety and unsafe code with pointers. Besides, you cannot expect someone to learn a programming language as complex as C# in 3 days, the very notion of this is perfunctory and impossible. It requires a week alone to properly write an encrypted web service, and another week to write an installer which PROPERLY sets permissons and generates a user and adds said user to a certain group.
Quandary
@CodeInChaos: The only way to get them to write proper programs this fast is to provide them with sceletons, where they only need to add functionality, and needn't worry about the concept, e.g. encryption in a web-service, or that they don't need to write the class to add a user or add this user to a group (localization of groupnames!). But where you will definitely run into problems is that they won't know what's allowed in SQL and what they should avoid for performance reasons... If you ask my opinion, then I tell you that it's a very bad idea to employ programmers short-term. It won't work.
Quandary