问题描述:

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!

网友答案:

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.

网友答案:

I found this comparison very helpful:

http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/

This can be in addition to the actual tutorials mentioned already, not instead.

网友答案:

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

网友答案:

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.

网友答案:

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.

相关阅读:
Top