Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux/C++ programmer to C#/Windows programmer

I have been coding exclusively for a while now on Linux with C++. In my current job, it's a Windows shop with C# as main language. I've retrained myself to use Visual Studio instead of emacs ( main reason is the integrated debugger in VC, emacs mode in VC helps ), setup Cygwin ( since I cannot live without a shell ) and pickup the ropes of managed language. What tools, books, website ( besides MSDN ) or pitfalls do you think I should check to make myself a more efficient Windows/C# coder?

like image 990
heisen Avatar asked Sep 25 '08 05:09

heisen


People also ask

Is Linux good for C programming?

Finally, C is easy to get started with, especially if you're running Linux. You can already run C code because Linux systems include the GNU C library ( glibc ). To write and build it, all you need to do is install a compiler, open a text editor, and start coding.

What is Linux C?

Along with the C programming language comes Linux, an essential operating system used by most computer scientists and developers. Linux powers almost all supercomputers and most of the servers worldwide as well as all android devices and most internet of things devices.


1 Answers

The first things to consider when switching from C++ to C# the fact that mostly share some of the surface syntax, but the difference of programming paradigms gets bigger and bigger as you dig in more into .Net.

Get to know the C# core programming paradigms before starting to program else you might fall in the trap of writing C++ programs in C#, which isn't the best idea by long stretch. The most important things to get accustomed to are:

  • Automatic memory management and garbage collection including the dispose pattern. Learn the basics and pitfalls.
  • What are classes, interfaces, structs and primitives in .Net, and how they behave compared to C++.
  • Events, delegates, properties, lambda expressions all of which are somewhat new concepts when coming from C++.
  • .Net generics and differences between templates.
  • strings, arrays, custom attributes, reflection, exceptions and threading basics in .Net, all of these are heavily used everywhere in .Net, and you must learn their intricacies to use them effectively.
  • GUI programming in Winforms and ASP.Net (and maybe after there WPF), components, controtrols, databinding. The .Net GUI model.

First start with a generic .Net book that introduces you to all of these concepts. I recommend a book over reading tutorials and articles first of all so you can have a big complete picture of .Net at the end. Articles on the internet might not achieve this. Best generic .Net book I've read:

Professional C#, 3rd edition. by Simon Robinson, Christian Nagel, Karli Watson, Jay Glynn, Morgan Skinner, Bill Evjen

Professional C#, 3rd edition, ISBN: 978-0-7645-5759-0

And second, since you're from a C++ background, and you are used to working close to the metal and thinking in way that is close to how hardware works (raw memory management (pointers, mem allocations, etc) I can only recommend one book that will really demystify what .Net is and what it does :

CLR Via C# by Jeffrey Richter

CLR via C#, Second Edition ISBN 9780735621633

I can't stress enough how good this book is for every .Net developer, especially when coming from C++ and at the same time being one of the best .Net books I've read. The book is a pure pleasure to read and covers topics from :

  • .Net execution model (from MSIL to native code)
  • Memory management (how the .net runtime and garbage collector manages memory, heap layout, memory generations, finalization, large object heap)
  • Designing types
  • Assembly loading, reflection, application domains
  • and many more ...

This is my best advice I could give to anyone on their way to become an expert C# developer in the shortest time possible.

like image 168
Pop Catalin Avatar answered Oct 13 '22 13:10

Pop Catalin