6

After a few years writing good ol' straight, archaic, homely C/C++, I'm finally going to give in and learn .NET. I'm looking for the best way to become .NET-competent quickly.

I use VS2005 C/C++ Express and I see there's a CLR choice in the "new project" wizard. I think that must be a way into the world of managed code. Is that a reasonable entry to .NET?

Do I have to learn C# or some crazy stuff instead? Or maybe [shudder] CLR is just the first baby step into .NET?

gnat
  • 21,442
  • 29
  • 112
  • 288
Pete Wilson
  • 1,766
  • 11
  • 15
  • 7
    It sounds like you've already made up your mind that .Net sucks and the world is ending. Maybe you should try Python or Ruby. – Joel Etherton May 02 '11 at 13:57
  • 1
    @Joel Etherton - Absolutely not! I don't feel that way at all. The world ended *long* ago when the demand for Assembler dried up :-) – Pete Wilson May 02 '11 at 19:56
  • Set an objective and pick a flavor before you spend effort in the wrong direction. for flvors see: http://programmers.stackexchange.com/questions/131639/why-do-we-have-so-many-flavors-of-net-is-it-a-good-thing also see:http://programmers.stackexchange.com/questions/145917/process-for-learning-net-and-c – NoChance Apr 25 '12 at 09:11

3 Answers3

10

My comment above sounds snarky (and it is, frankly), but the intention behind it might be missed because of that same snark. Instead, I'll post an answer that more accurately states what I mean.

If you're not enthused about the language you're about to learn (and it doesn't sound like you are enthused about .Net at all) then my advice is: "Don't." You should be looking forward to this new learning with at least a sense of "I wonder if ..." rather than "You mean I have to ... what?".

Unless you have some employment commitment that requires it or a free boot camp coming up or something, you may want to skip it for now. Try a different language with an entirely different tool-set, syntax, direction. These other languages may give you a fresh perspective on the language you're not excited about and reinvigorate you to learn it. You may just come to like one of the more, or find more job opportunities with one.

Moral of the story: If you're not in love with the direction your learning is going, pick another direction out of the air and try it.

Joel Etherton
  • 11,674
  • 6
  • 45
  • 55
  • 2
    +1 For the 2nd paragraph! The benefits of learning Python on Ruby to (apart from them being great languages) is that they are both integrated on the .Net platform. So you could learn .Net and Python/Ruby at the same time. – Jetti May 02 '11 at 14:33
  • @Jetti, that's a great idea. I'll take it. Thanks. – Pete Wilson May 02 '11 at 20:10
6

That would be one way to do it, but I'd not recommend it. The syntax is similar, but the way you do things is sometimes different. Trying to figure it out without any help could get frustrating. Get a book like Pro C# (this is a link to the .NET 4.0 editition, I only have the .NET 3.5 edition but it was very good, and I would hope the quality has stayed the same in this newer edition) to work from. It's not a beginner's book but you sound like you can easily handle it. There're also probably many good tutorials online if you don't want to drop cash for a book, but I don't have any great links to recommend for getting started (only for very specific topics).

Also, I'd look into getting VS2010 Express Edition for C#, VS2005 is a bit outdated now. Only thing is, I don't know how well two different versions of VS EE will play on the same machine...

FrustratedWithFormsDesigner
  • 46,105
  • 7
  • 126
  • 176
  • 1
    +1: That whole series of .Net books by APress is very good. – Joel Etherton May 02 '11 at 14:03
  • Yes, I'm worried about the coexistence of two VSEE editions, too. Thanks for your helpful answer. – Pete Wilson May 02 '11 at 19:35
  • @Pete Wilson: Do you need VS2005 C++ EE or is upgrading to 2010 an option? I think that two installations of VS EE that are the same year-version but different "flavours" shouldn't have much trouble, but I haven't tried that myself in a long time. – FrustratedWithFormsDesigner May 02 '11 at 19:37
  • Yes, I could upgrade to VS2010 except that I have this huge nearly-done C++ project under 2005 that I'm terrified of breaking, so I'd just as soon not introduce another variable right now. That's the only reason I'm putting off an upgrade. – Pete Wilson May 02 '11 at 20:06
5

I would not recommend you first venture into .NET by way of C++/CLI. It's a language that gives you careful and fine-grained control over -- well, some stuff you don't understand yet. Start with C# instead, because it's simpler. C# Express is free and you will mostly know how to work it from your experience with C++ Express.

As for how to learn, there are some pretty good Getting Started links on the Start Page inside Visual Studio itself. Make an app that does something you already know how to do in C++, like opening and parsing a file, or gathering info from controls on a form and then saving it somewhere. Then you can start to try new things according to what you're trying to write.

Once you're comfortable with the CLR and with C#, you can come back to C++/CLI as a way to control interop to your old code, should you feel the need.

Kate Gregory
  • 17,465
  • 2
  • 50
  • 84