Re: Windows forms application without Managed Code?
- From: Daniel James <wastebasket@xxxxxxxxxxxxxxxx>
- Date: Sat, 03 Mar 2007 10:34:52 GMT
In article news:<6figu2lhlsutsqgttje7btb03hrne83l47@xxxxxxx>, Joseph M.
Newcomer wrote:
If you want real portability, use Java.
I don't believe you wrote that, Joe. Java is not a silver bullet (whatever
Sun Microsystems would have you believe).
For that matter, Sun will probably release future incompatible
versions of Java, as they have in the past.
Oh, yes. Absolutely. As I said: Java is *NOT* a silver bullet.
So the motivation for "porting" must be established. Any "portable
library" gets you into the same fix as the Borland products: what
happens if it is discontinued?
I don't see either wxWidgets or Qt disappearing any time soon ... but even
if, say, Trolltech went out of business there would still be plenty of
people using (and maintaining) the Open Source version of Qt, and in
absence of any other options one could even maintain it oneself.
... what happens if it is discontinued?(this is why we have an app
stuck in Win16). The library we used ran on the Mac, on Unix, on
Win16, even on MS-DOS, but the company went out of business.
So the portability no longer mattered, and even though the library
was portable, the GUI was not.
That's sad (which library was it, by the way?).
I find that apps tend to fall into two categories: substantial
applications with relatively lightweight GUI front ends and complex GUI
applications with only a small amount of back-end (non-GUI) logic. With
apps of the second kind there really isn't much one can do if the GUI
toolkit vanishes, but with apps of the first kind the back-end code can be
reused with a new GUI written relatively quickly in the tools of the day.
... this all comes back to what I was saying about separating the display
of data from its representation and manipulation. If you make that
separation cleanly enough in your code it should be simple to drop in a
new GUI (maybe even in Java!) and carry on.
I know a couple people who have tried to use "portable" libraries, and
found that the controls are not extensible. Want to add a feature to
a control in MFC? Subclass the control, add some feature.
It's certainly true that it's hard to be portable and extensible at the
same time. The inner workings of a control (which the control's user
doesn't normally get to see) may (have to be) be different on different
platforms and so the subclassing may have to be done again on every
platform that the app supports. It's not (generally) impossible, but it
can certainly be extra work.
But, how often does one need to subclass a control? I think I've done that
maybe half a dozen times in 25 years of programming for my living.
The notion that you can write portable code is one of the many myths
we like to believe. It just ain't so. We can write code that is
sort-of-portable, subject to some set of constraints, and at a cost
in dollars, time, and learning curve.
That's a good point but, I think, overstated. There is a cost in learning
but once you learn to write code portably the cost in time and money in
negligible. No code can ever be completely portable, of course, but it is
worth the small effort to make one's code as portable as it can be -- if
only in the interests of future-proofing. It's like designing for reuse:
the vast majority of code is never reused but it doesn't cost much to
write in such a way that one's code can be reused when an opportunity
arises, and the savings can be considerable.
Cheers,
Daniel.
.
- Follow-Ups:
- Re: Windows forms application without Managed Code?
- From: Joseph M . Newcomer
- Re: Windows forms application without Managed Code?
- References:
- Re: Windows forms application without Managed Code?
- From: Daniel James
- Re: Windows forms application without Managed Code?
- From: Eric Hill
- Re: Windows forms application without Managed Code?
- From: Daniel James
- Re: Windows forms application without Managed Code?
- From: Joseph M . Newcomer
- Re: Windows forms application without Managed Code?
- Prev by Date: RE: Why we must use class factory to create some objects in COM?
- Next by Date: Re: Windows forms application without Managed Code?
- Previous by thread: Re: Windows forms application without Managed Code?
- Next by thread: Re: Windows forms application without Managed Code?
- Index(es):
Relevant Pages
|