Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between UNIX and Windows development

Tags:

c++

c#

.net

windows

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?

like image 931
Richard Avatar asked Apr 25 '09 16:04

Richard


3 Answers

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.

like image 51
MMind Avatar answered Oct 27 '22 01:10

MMind


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?

like image 29
JaredPar Avatar answered Oct 27 '22 01:10

JaredPar


The answer depends on the type of program you would like to implement.

If you would like to implement some system utility then the answer is pretty much the same as on *nx world: you will have to programm in C for best results and to know Win API very well.

For other things, C# is probably the way to go today. Its the best language, IMO, from the existing dotNet languages.

Learning Windows API is definitelly good thing to do, but I suggest using some of the scripting languages for that for faster experimenting (Lua with Alien library, Python , AutoIt etc..). The good thing about it is that you probably know some of them, coming from *nx community.

Since you are worried about portability I suggest you using C# with special care about OS specific things like path separator, file name case sensitivity etc.. you can find some nice articles about it on MonoDeveloper site. Java is also good way to go - I am not an expert but from what I know its trading some language sophistication and speed and native feel (looking from C# perspective) for better portability.

Latest MonoDevelop makes you even load Visual Studio projects, although I never personaly did that.

like image 31
majkinetor Avatar answered Oct 26 '22 23:10

majkinetor