2 ms·
IIRC I've found it extremely easy to support both macOS and Linux (as well as the *BSDs, and to a large extent Solaris and AIX), even when using non-POSIX, exte
by wahern 9y ago
IIRC I've found it extremely easy to support both macOS and Linux (as well as the *BSDs, and to a large extent Solaris and AIX), even when using non-POSIX, extension interfaces like epoll and kqueue.
However, I do mostly systems and network programming. When you get into GUI apps there's no avoiding the immense differences between some APIs. Learning how to identify and carefully separate program components that can be reasonably kept portable is something you learn with experience. And experience only comes with practice.
Also, I learned long ago that "porting" an application is typically a losing battle. If a program is not written with portability in mind from day 1, subsequent porting efforts will be so costly that you'll either abandon it altogether or conclude that portability is inherently costly and avoid it in the future.