[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: c code vs c++ code
Gianfranco Berardi wrote:
> Steve Baker wrote:
>
>>> I'm wondering if there is some benefit to using the C code rather than
>>> the C++ code. Is it possibly better for porting to other systems? Or
>>> is it simply programmer preference?
>>
>>
>>
>> Programmer preference - I'm sure.
>
>
> Actually I believe that currently it is easier to port C code simply
> because of projects like Wine. I remember that only C code is much
> easier to make cross platform using Wine or some offshoot of it, but at
> the same time, if you program it correctly, it should be perfectly fine.
> I mean, if I had my program deal directly with the bits, there might be
> an issue, but I made a higher level struct/class, then so long as the
> implementation was ported, then the higher level code was portable.
>
> So I have to agree in the end, it is programmer preference to a degree,
> but also in the current state of things, the Wine project has made C
> code more easily portable.
>
> Feel free to disagree. I am only going on what I remember reading
> somewhere, so I could be wrong. Arguments are meant to gain knowledge.
Eh? I don't understand.
C (or C++ for that matter) is portable between Linux and Windows (and
most other OS's for that matter) without resorting to WINE.
My 76,000 line PLIB library ports just fine between half a dozen
different OS's.
Portability issues mainly come up with incompatible system calls
(eg Windoze has 'Sleep()' and Linux has 'sleep()')...there are very
few language-related issues in porting code these days.
WINE is for binary compatibility - and once your program is compiled,
it doesn't matter what language it started off as - it's machine code
now.
---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1@airmail.net> WorkEmail: <sjbaker@link.com>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sf.net http://tuxaqfh.sf.net
http://tuxkart.sf.net http://prettypoly.sf.net