Thread View: news.software.nntp
2 messages
2 total messages
Started by zooko
Mon, 01 Sep 1997 00:00
Re: How REALLY portable is C++?
Author: zooko
Date: Mon, 01 Sep 1997 00:00
Date: Mon, 01 Sep 1997 00:00
47 lines
2125 bytes
2125 bytes
Igor Chudov @ home <ichudov@algebra.com> wrote: >Hello, > >I am planning to write a library and a set of tools, based on that >library, for advanced processing of mail and news messages. I intend the >library to be portable across many platforms, including major Unix(tm) >systems, various versions of Widows, and possibly Macintosh computers. <snip> Hi, Igor. When faced with this self-same situation, I and my team went with a subset of C++. It is sufficiently portable using various commercial compilers or g++ -- whatever is working that day! Subset rules: 1. No multiple inheritance except for pure-virtual pure-abstract mix-in base classes (i.e. just like Java "Interfaces"). 2. No templates. Period. Sorry! 3. We're using exceptions. Hopefully this won't blow up on us!! Of course, there will be no exceptions from destructors. This is problematic... 4. We also have a large set of restrictions merely for readability/consistency/safety (no operator overloading especially conversion operators, no constructors with functionality, no static casts, no dynamic casts if we can help it, no friends, no global anythings, etc. etc. Regards, Zooko P.S. Check out the new "fast-evolving" version of gcc called "egc" or some such ugly-sounding word. :-)
Re: How REALLY portable is C++?
Author: Tim Ottinger
Date: Mon, 15 Sep 1997 00:00
Date: Mon, 15 Sep 1997 00:00
58 lines
3068 bytes
3068 bytes
> Subset rules: > > 1. No multiple inheritance except for pure-virtual > pure-abstract mix-in base classes (i.e. just like Java > "Interfaces"). Where is this not supported, or supported with language extensions? To my knowledge, this is supported everywhere.I've not met a compiler that won't allow it. And it's also not likely to be removed in the future. It's just too useful. > 2. No templates. Period. Sorry! I understand this, but I've seen templates supported one way or another everywhere. Take a lesson from Doug Schmidt's stuff a www.cs.wustl.edu/~schmidt. He uses templates and has had to work around more compilers than you'd care to. > 3. We're using exceptions. Hopefully this won't blow up on > us!! Of course, there will be no exceptions from destructors. > This is problematic... Actually, I've found more discrepency in exceptions than in the things you've avoided! > 4. We also have a large set of restrictions merely for > readability/consistency/safety (no operator overloading > especially conversion operators, no constructors with > functionality, no static casts, no dynamic casts if we can help > it, no friends, no global anythings, etc. etc. I also understand the problem with the new style casts (static_cast<>, dynamic_cast<>, etc) and portability. I would think this isn't bad advice with regards to portability.As a general rule unrelated to portability, I agree on conversion operators. A lot of this seems unnecessarily restrictive and unrelated to portability. You didn't mention the obvious porting concerns of character sets (wchar) or of integer sizing, or whether you should use long longs and thelike. It would have been nice to see those addressed. This discussion would not be complete without mentioning the use of 3rd party libraries and platform-specific libraries. You're probably best off to take a look at the C++ Available Libraries FAQ and see what's available. You should look at the work by RogueWave, ObjectSpace, and others for supporte platforms. If 3rd party stuff fits your needs, then you should buy v. build. You should also look into the ACE Wrappers library which wraps up a lot of platform-specific calls in a portable way. Tim
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads