Alex Rivera | Logout

Differences between UNIX and Windows development

Asked 2009-04-25T16:35:46.463
11

I've been programming in C and C++ in Linux for around 3 years, and recently have been interested in developing commercial software for businesses. Let's say I've found a niche where I think I could be successful, but that they only use Windows. I have no experience whatsoever with the Windows API, however. I have a few questions:

Should I learn .NET?

Do I need to learn C# in order to use .NET, or can I stick with C++?

What is the sentiment about compiling using GCC under Cygwin with the --no-cygwin option? I'm interested in portability, and I'm worried that if I start writing for VC++, I might get bound to Windows.

Where is a good place to do my essential reading?

What else can you tell me about transitioning from Linux to Windows programming?

Edit
Report

3 Answers

13

I faced exactly the same questions and I am so happy I tried .NET. I hope this info can help you:

Should I learn .NET?

I would highly recomment it.

Do I need to learn C# in order to use .NET, or can I stick with C++?

You can stick with C++ but I am sure you will love to learn C#, please try it. You will be able to mix them too. The main challenge with .NET is to learn all the libraries that are out there to help you out (so you do not need to reinvent the wheel). Use msdn often and try to get a map of the fundamental classes and assemblies.

It is a fun experience if you come from C++ you should not have major problems.

Where is a good place to do my essential reading?

I would start with something light, check the free Visual Studio tools, software and examples here, go to the MSDN documentation and compile some of the examples in MSDN (how to access files,...). As you can see you will find C# and C++ examples side by side.

Then of course books like C# via CLR will eventually need to be read.

Portability

Be sure you run your code in Mono and multiple platforms.

Future investment

Investing on learning the .NET framework will pay back. Today is costly to learn all the new tools out there, with .NET you know you can evolve. New features and languages appear but the fundamental classes remain so your time/effort investment is more under control.

answered 2009-04-25T17:00:46.090
5

Should I learn .Net?

Depends on whether or not you feel this would be advantageous to the niche your are looking at. For instance, if your niche is a desktop application it's probably a good idea to get started because, IMHO, it's so much easier to develop a WinForms,WPF GUI than a C++ version,

Do I need to learn C# in order to use .Net, or can I stick with C++?

C# is not a requirement and using C++/CLI allows you to take advantage of .Net while still using C++. However, I tend ot only use C++/CLI for components which are heavily focused on interop between managed and native code. It is particularly good at that kind of development. If you switch to more mainstream applications I think you'll find that C# or VB.Net will suite you better. Most of the online samples are geared towards these languages. In particular a good portion of the tooling is heavily geared to these languages (WinForms and WPF designers to start).

Worried about writing non-portable code and being tied to VC++

I'm sure this opinion will be slightly unpopular. But you've already mentioned that the niche you're looing at is Windows specific. What is the point of writing portable code if you will only ever run it on Windows? This is not a Windows bias coming out, I would make the exact same argument if the platforms were reversed.

I'm not saying portable code is a bad thing. It is in fact a very good thing. But if there is no potential for using the portability why not take advantage of the platform instead?

answered 2009-04-25T16:43:38.160
0

no. dont learn .NET - learn C#.. its like the anything goes playground. once you get the hang of it.. you will be able to finish projects in 1/10th the time..

but with C#/.NET you learn bad habits. i am now back in C++. i had C++ 12years, then C# 5 years, now C++ 6 months.

although it does take around 6 times longer to complete projects... (6 months vs 1 month) , i feel that the C++ code has an artistic feel.. while the C# code is generic. like BestBuy.

i am totally anti C++/CLI or whatever its called. if you need to get down to the CLR level.. run, dont walk back to C++.. or you'll end up spending all your time working around some arbitrary C# design "feature" like event synchronization..

my next destination may be .NET Powershell to manage my C++ server applications.

I did Unix to Windows move around 10 years ago.. i tried going back to FreeBSD or Linux... I used to love vi.. but VS is by far the best IDE by far. just get vs2010 pro + reshaper and read these 2 books. the first one is core C# but its .NET 2.0 , which is good.. because its easiest to start writing C++ style code anyways. the next book will last you years.

http://www.amazon.com/2-0-Practical-Guide-Programmers-Guides/dp/0121674517

http://www.amazon.com/gp/reader/0735627045/ref=sib_dp_pt#reader-link

hope this helps.

also. no reason NOT to write portal c++ code in the year 2012. cmake + VS2010 + boost + crossroads-io

answered 2012-10-04T19:47:08.410

Your Answer