Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If I wanted to learn C#, not knowing any other compiled languages (but knowing PHP), where would I start? Another gotcha: I'm on OSX, and would prefer to learn C# from the standpoint of CLI first, then GUI components.


I think one of the best places to start with C#, if you have prior programming experience, is Jeffrey Richter's book "CLR via C#". I think it's a great book because it teaches you the specifics of the CLR as you are learning the language. You'll come away from it with a much deeper understanding of the C#/CLR system than you'd get from starting with a regular tutorial; C# is a lot like Java in that learning the language is only half the battle, you also need to understand the virtual machine.


Use mono [1]! Then write your first console application [2]. Or read [3] to learn about the language. And then maybe check out some trending github projects [4]!

[1] http://www.mono-project.com/

[2] https://msdn.microsoft.com/en-us/library/k1sx6ed2.aspx

[3] http://learnxinyminutes.com/docs/csharp/

[4] https://github.com/trending?l=csharp


I do all my development on my Macbook, inside a Parallels Desktop virtual machine running one of several builds of Windows (XP, 7, 8, 10).

You have two problems to tackle, as I see it: 1) building and environment 2) learning the language

1. Download Sun VirtualBox (free). Set up a virtual machine with your favorite build of windows (windows 10 preview is free) @http://windows.microsoft.com/en-us/windows/preview-iso

Install Visual Studio Community edition. You could learn C# from the command line, but this gives you a great IDE and debugger: https://www.visualstudio.com/products/visual-studio-communit... In the early days of learning c#, you'll value that debugger.

2. Language. Learning the language in isolation isn't very useful -- it's the dotnet libraries which give the real power of course. Everyone will have their own favourites for texts, but the one I used for myself and my teams over the years is "Learning c#" by Jesse Liberty. The first version, c#1.0. (IMO, the later books which were co-authored were not up to the standards of the first one; they tend to muddle and wander. Most of what you learn will apply, and once you feel like you've got your sea legs, you can grab a tutorial for an up-to-date version (c#6) and learn about the changes.) http://www.amazon.com/Programming-Building-Applications-Jess...

Best of luck to you!


I would highly recommend this book: http://www.amazon.com/5-0-Nutshell-The-Definitive-Reference/... . The authors really know their C#. I have the pocket edition of this book and have looked at the full version, and it looks like a much more in-depth version that would be useful for someone just starting out.

I have no experience with C# on a mac, but I know it is possible. See: http://www.mono-project.com/docs/about-mono/supported-platfo.... You'd probably have pretty good support for anything on the CLI, but might run in to issues if/when you make the jum pto GUIs. Good luck!


I wrote a similar answer on stack overflow a while ago. I would recommend Parallels to run windows and Visual Studio if you can. The community edition is free and is basically the pro version of it.

The main reason why you want to use VS is because if you just want to learn the language most of the resources out there assume you're coming from Visual Studio/Windows. There's enough crap to worry about without trying to figure out issues with your IDE/compiler/etc.


You have a couple options:

1) Code up some simple C# code in a text editor (sublime) and then compile it using the mono c# compiler.

2) Run Windows on Parallels and download visual studio community edition.

Folks are working on a CLR that will run on Darwin and the core framework as well as an alternative to Mono. This won't be released until later this year though, and tooling is still TBD.


Sublime? Parralells?

Why not just Monodevelop[1] instead? It's an open-source .NET IDE. Although not on par with Visual Studio, I doubt anyone would expect that anytime soon.

For a beginner it will probably be very relieving having Intellisense and code-completion, not to mention it will encourage exploration of the APIs in a much more playful manner than trying to read MSDN docs.

If you're going to start getting into C#, don't start with your hands tied behind your back. Get the full package!

[1] http://www.monodevelop.com/


I recommend this book: http://www.amazon.com/-/dp/0321877586

It focuses on the language, not any specific implementation. The examples all use the command-line compiler, not Visual Studio. So you would be able to use the Mono Development Kit.


Start with Mono. The .NET platform is a beast to "just sit down and learn". I've been doing .NET since 2002.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: