Chris Hills said:
<
[email protected]> writes
Then use C++ builder. I would.
If I'm writing a Win32 program, then most of the time that's /precisely/
what I do. But I'm not always writing Win32 programs. In fact, hardly ever.
but how many apps need to do this?
Few *applications*, it's true - if you are using that in the sense of "big
program", so to speak. Mostly, application writers know their target
platform. Even then, if it's a good application, one day it'll have to be
ported. If it is written with portability planned-in, that task will be
easier.
And then there are libraries. I'd far rather use /one/ library, regardless
of which platform I'm using, than have to learn a separate library for each
platform. So if libraries can be written portably, obviously that benefits
platform-specific software development on /all/ platforms, which is good,
right?
Most seem to be WIn2K and XP these
days or ME, 2K & XP, they don't even cover win9* anymore let alone any
of the other OS you mention. Most of the SW I have is PC or PC.
Sorry, I thought this was comp.lang.c - I didn't realise it was
comp.lang.softwarethatChrisbuys
I have four different OSs running right here, only one of which is in the
Win2K/XP category. I doubt very much whether I'm the only one who runs
several OSs, either. If I want my computers to be able to do <foo>, I think
it makes sense to write *one* program to do <foo>, rather than write a
WinXPFoo, a LinuxFoo, and so on.
Well, that's precisely why the code posted by clc regs is portable - we
don't know, don't ask, and don't care what platform the OP is using. Such
minor details are left for other newsgroups to deal with.
And the same goes for exegetic programs (of which I write far too many). How
would the Unix world have reacted if K&R had begun their book on C by
writing an 80-line "Hello world" with a WinMain entry point?
Fair enough but I bet it won't run on an 8051?
Depends. Is it a hosted environment? If so, probably the code would work
just fine.
There is portability and there is portability....
Agreed.
I can write code that is completely portable
....and that's what we do here in comp.lang.c ...
but most of the stuff I write is not
....and that's what we do in other newsgroups.
because it is for embedded micros where portable code is
large and slower. If you have code that is large and slower it can
cost a fortune if it needs a slightly larger memory.... adds 1 USD to a
unit..... 50,000 units a year.
50,000 bucks is nothing compared to the money you save by being able to port
your half-million-line browser/mailclient to a new platform in four
person-weeks rather than a year or so, over and over again as more STB
suppliers become interested in your product. One of my former clients made
precisely this investment, and for precisely this reason, and it paid off
in hard cash savings.
As I keep saying though code which is not machine specific should be
portable and behave in the same way on similar machines...
Precisely so. And code that /is/ machine-specific can be isolated into
self-contained modules.