home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- From: nikki@trmphrst.demon.co.uk (Nikki Locke)
- Path: sparky!uunet!pipex!demon!trmphrst.demon.co.uk!nikki
- Subject: Re: Give me safe C++
- Reply-To: nikki@trmphrst.demon.co.uk
- Distribution: world
- X-Mailer: cppnews $Revision: 1.30 $
- Organization: Trumphurst Ltd.
- Lines: 39
- Date: Tue, 15 Dec 1992 16:33:35 +0000
- Message-ID: <724462415snx@trmphrst.demon.co.uk>
- Sender: usenet@demon.co.uk
-
- In article <1992Dec12.145403.26483@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
- > What makes virtual functions so useful is the fact that they
- > are so tightly restricted .. for example, unlike a genuine
- > function pointer they cannot be modified after object creation,
- > nor specialised on a per object basis.
- >
- > So when language designers propose restrictions, one must
- > carefully weigh up the pros and cons: most restrictions also
- > grant freedom. In the case of virtual functions, if your
- > program compiles and links they are sure to be properly initialised,
- > freeing you from checking this manually.
-
- This is a very good point. It is where something like Modula scores - you
- have very tight restrictions over what you can do, unless you specifically
- state you want to relax the restrictions for a particular module.
-
- One of the drawbacks of C++ is that it is not always (often ?) clear
- whether a particular line of code is doing something completely pure, or
- is a nasty hack. My particular pet hate is the use of the same source code
- construct for casts and conversions, but there are many other examples.
-
- I rather like the idea of a restricted subset of C++ which disallows
- everything dubious, provided, of course, you can use the full power of the
- language occasionally (maybe in separate modules, or inside some #pragma
- section). That way I get protected from my own mistakes, but I can still
- work round any shortcomings in the language, the machine architecture or
- the design.
-
- This would also extend the appeal of C++ to a wider audience - I have seen
- many accounting (and similar) software writers reject C++ out of hand,
- because they aren't happy with using a language where a single typing
- mistake can re-write the operating system ! They are currently waiting
- for Object Oriented Cobol :-)
-
- How about a -safe-c++-only switch to the compiler :-)
-
- --
- Nikki Locke,Trumphurst Ltd.(PC and Unix consultancy) nikki@trmphrst.demon.co.uk
- trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
-