4 ms·
ANSI C is a near universally portable language, C# is not. His boss wants it written in C, and his boss is the customer. Of course, his boss is specifying globa
by chris_wot 14y ago
ANSI C is a near universally portable language, C# is not. His boss wants it written in C, and his boss is the customer. Of course, his boss is specifying global variable names, so said boss is a micromanager... A no-win situation here really...
- damian2000 14y agoC# isn't as portable as C but it isn't totally unportable either. Mono allows you to target iOS, Android and Linux for example.
- shadowmint 14y agoHardware interaction is the place where mono fails most often in my experience; portability for something that actually touches the underlying hardware (of any type) is probably not possible using c#.
- damian2000 14y agoAnd for that you can always call the native methods written in C, from C# - the support for doing this is excellent on both Linux and Windows. You can reference a function in a .DLL on windows and in a .so on linux.
- icefox 14y agoHave you ever heard a C# guy going around talking about how they ported their C# code to iOS/Android/Linux? Excluding projects started with that specifically in mind and built using Mono I have never heard of of a Windows C# project going the other way.
- damian2000 14y agoAgreed its rare but I wanted to reply here because I did just this thing myself last week. I had a ~6000 line TCP/IP sockets and serial port application (command line) written in C# on windows. I needed to port it to run on a Raspberry Pi (running Debian Wheezy). A rewrite in C was the initial plan/expectation. But got it working in Mono, with only a handful of changes to the serial port code.
- debacle 14y agoI write C# for mono and I've never had a portability issue.
- thebigshane 14y agoThe problem isn't that mono (or programs written using mono) have portability issues themselves. Requiring mono itself is the portability issue. Many people don't like running mono or .Net runtime or even the Java runtime and some businesses/clients don't want to support it. That is quite a portability issue.
- acuozzo 14y agoHow do (or would) you deal with architectures that Mono doesn't currently support?