News for hackers. Stuff that matters.
Re:Brian's Rules for Writing Cross Platform 'C' Code (2008) by kosinus on Saturday June 14, 2014 @06:36AM (#7892508)
ObjC and C go extremely well together, more so than C++ and C. You just have to make sure platform specific stuff that is in ObjC and GUI stuff is separate, which he advocates for any way, if I understood correctly.
Re:Brian's Rules for Writing Cross Platform 'C' Code (2008) by mtdewcmu on Saturday June 14, 2014 @12:25PM (#7893063)
I think you are right about separating the ObjC. C++ and ObjC don't play so well together, either, so if your primary language was C++, I think you'd need a plan around how to deal with ObjC.
Re:Brian's Rules for Writing Cross Platform 'C' Code (2008) by tylerneylon on Saturday June 14, 2014 @04:08PM (#7893559)
gcc and clang can handle mixed Objective-C and C++ in a single source file (some call it Objective-C++). The only tricky part is linking since C++ and ObjC++ use a different symbol name convention than C/ObjC; but you can still link between them by using extern "C" declarations in the right places.
Re:Brian's Rules for Writing Cross Platform 'C' Code (2008) by pjmlp on Saturday June 14, 2014 @01:39PM (#7893203)
Ever heard of Objective-C++? It is also supported by Objective-C compilers.
Re:Brian's Rules for Writing Cross Platform 'C' Code (2008) by mtdewcmu on Saturday June 14, 2014 @11:44PM (#7894308)
The problem is that C++ and ObjectiveC have overlapping purposes. The issue isn't that it's impossible to use them together. The issue is that you will have to have a strategy for dealing with conflicts before they occur.
Re:Brian's Rules for Writing Cross Platform 'C' Code (2008) by pjmlp on Sunday June 15, 2014 @08:39AM (#7895097)
That is true. Actually such considerations should be part of any mixed language project, specially in the presence of portable code.