From 8006173910736335116
X-Google-Thread: f78e5,e8e0ab29e8861265
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 27 Jul 2005 12:30:31 -0500
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Delivered-To: std-c++@ucar.edu
X-TN-Interface: 209.99.127.20
X-Authentication-Warning: serv3.gc.dca.giganews.com: news set sender to poster@giganews.com using -f
From: "Steven T. Hatton" <hattons@globalsymmetry.com>
Subject: Re: If C++ had interfaces, what would they be?
References: <dfadnU0KIovHJkbfRVn-3Q@speakeasy.net> <1121963458.661748.118300@f14g2000cwb.googlegroups.com> <HIednX0HN9sLm33fRVn-qQ@speakeasy.net> <1122299887.515239.317170@g49g2000cwa.googlegroups.com> <oaidneYkiKMP93jfRVn-hQ@speakeasy.net> <1122336456.595882.282330@g49g2000cwa.googlegroups.com> <42E60A63.9050409@cs.york.ac.uk> <1122409313.507177.240760@g14g2000cwa.googlegroups.com>
User-Agent: KNode/0.9.1
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
Message-ID: <u8adnSopg7NDz3rfRVn-og@speakeasy.net>
X-Complaints-To: abuse@speakeasy.net
X-DMCA-Complaints-To: abuse@speakeasy.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.31
Newsgroups: comp.std.c++
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Date: Wed, 27 Jul 2005 12:26:54 CST
Lines: 85
NNTP-Posting-Host: 65.182.171.162
X-Trace: sv3-Z6byGfBafVpaQ3US0sDeRge8znoh76Z6SFWZbZRMcDATjIxr4QN8ApFONFgpDtUwSxJx9tgF5thv/Xi!36xXFRDPVPTRMiKd0QLlqnVPZ/e3jh5kUM/9U2OYNWgomCVyNXjeSOM7UatdOJm75wvAlx8WQPVW!r9ZyVHKYMAnbURbS8+HE
X-Complaints-To: abuse@speakeasy.net
X-DMCA-Complaints-To: abuse@speakeasy.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.32
Xref: g2news1.google.com comp.std.c++:1524

Bob Bell wrote:

> chris jefferson wrote:
[...]
>> Also, while it's easy to find the "base definition" of a template, I can
>> imagine it would be hard if not impossible for an IDE to show you the
>> "correct" template overload for a particular situation.
> 
> Just like it's hard but not impossible to show the correct function
> overload.

There are some limitations to what can be done with templates, that are not
encountered in more concrete code.  Try to get the IDE to find a list of
"pure abstractions" of some template related behavior or structure.  I see
templates moving toward a formalization of what I call meta-types. The same
kinds of problems that led to the creation of strong typing in the first
place, are now presenting themselves at the next higher level of
abstraction.

>> I'm not saying C++ shouldn't support these things, but it makes it very
>> hard to write anything in an IDE which doesn't have to use heuristics to
>> some degree.
> 
> The more information the IDE can get from the compiler, the less it has
> to rely on heuristics. When compiling a piece of text, the compiler can
> feed any information it wants back to the IDE, such as which template
> instantiation is actually used at a particular place in the code.
> 
> Whether any compiler/IDE actually goes that far is a different
> question. 

I'm not completely sure what you mean here, but KDevelop certainly uses the
object code, and/or, intermediate code to provide some of this code
completion and error detection.  Tools such a JBuilder are clearly doing
this same kind of thing with Java.  For example, certain error detection
features only work after part of the code is compiled, or fail to adapt
immediately to changes made in the the source.
 
> My point is that there is nothing about the language 
> definition that precludes this sort of interaction; tools can be
> written to address this needs. One may argue that tools of this sort
> are hard to create, and that's fair; they _are_ hard.

In many cases the things we want an IDE to do for us are things we would
otherwise do by hand.  I'm convinced that something that is difficult to
automate is usually difficult to accomplish in the first place. 

I know in my experience with C++, most of my time is spent dealing with
preprocessor, or linking related problems.  The amount of time I've spent
actually writing code is less than the time I've spent on problems related
to file name extensions, arcane and obscure preprocessor definition
conflicts, and simple preprocessor macro demangling.  You can say your IDE
will automate the location of #defines, but what happens when you are
examining an SVN repository with a web browser?  This is something that
came up just yesterday for me.  I was looking at code that had the
namespaces #defined.  Other than brute force searches, and lucky guessing,
there is no way to properly understand the code you're looking at.

The particular code base I'm talking about is one of the best organized C++
projects I've seen.  There are places where things are far worse.  Many of
the worst examples of deranged C++ project and program structure are really
badly written C programs with some C++ classes mixed in.  This is not to
say C projects cannot be well organized and coherent.  I'm currently
studying the libelf package.  For the most part, it seems quite well
organized, and doesn't go too far into the typical C macro madness.

The degree to which the Cpp is used to undermine the good order of C++ is
one of the primary motivations I have for exploring different possible
language directions.  Two things need to happen. 1) People need to become
aware that Cpp programming really does cause problems.  2) alternatives
need to be provided so that the bad practices can be replaced with better
ones.

-- 
STH
http://www.kdevelop.org
http://www.suse.com
http://www.mozilla.org

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



