Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practices for portable C# [closed]

Tags:

I am looking to write some C# code for linux/windows/mac/any other platform, and am looking for best practices for portable code.

Project mono has some great porting resources.

What are the best practices for portable C#?

like image 291
Oded Avatar asked Sep 03 '08 21:09

Oded


People also ask

Is it OK for portable AC to run all day?

Modern portable air conditioners are safe to run continuously, which means that you can keep it going all day long and even for multiple days in a row. There is nothing in the machinery itself that poses a problem.

What temp should I set my portable AC?

According to the Department of Energy1, 78° Fahrenheit is the sweet spot for air conditioners to balance energy savings and comfort when people are at home and need cooling.


2 Answers

I hate the term "Best practice" because it seems that some practices can be the best in any context, which is a risky thing, but I'll tell what I consider a "Good practice" for multi-platform code (and for most other type of development):

Use a continuous integration engine and build for all the target platforms all the time.

Sounds too complex? Well, if you really need to support multiple platforms, better to do it. No matter how careful you are with your code and library usage, if you test too late, you'll find yourself spending looong hours reworking big portions of the app.

like image 199
Martin Salias Avatar answered Oct 03 '22 03:10

Martin Salias


I've actually used winforms and it was fine. It was BUTT UGLY, but it worked.

Obviously, don't use P/Invoke, or any win32 stuff like the registry. Also be aware of any third party DLL's. For example, we use a third party SQLite dll which actually contains native code in it which we have to swap out if we want to run on OSX/linux.

like image 28
Orion Edwards Avatar answered Oct 03 '22 03:10

Orion Edwards