Re: What does "C++ doesn't support modules" mean?

From: Alf P. Steinbach (alfps_at_start.no)
Date: 04/15/04


Date: Thu, 15 Apr 2004 12:28:24 GMT


* "Steven T. Hatton" <susudata@setidava.kushan.aa> schriebt:
> I've seen people here write that C++ doesn't support modules. What does
> that mean? 'Module' is a very nebulous term in my book. It probably means
> something quite different to me than what it does to people making that
> comment about C++. Can someone explain what they mean when they say C++
> doesn't support modules?

Probably modules as in Modula "module", Ada "package", Pascal "unit",
Java "package", Perl "package", and so on, where the language provides
some form of module import which includes linking information and
preferably also type-checking while suppressing implementation details,
and preferably also some support for module initialization & cleanup.

In C++ logical modules must, as many other things, be implemented by
convention only (using textual includes & separate compilation).

And module initialization & cleanup is not possible to ensure in the
most general case; also that must rely on convention & documentation.
To wit, the standard library's named iostreams must rely on a mechanism
that is unavailable to the C++ programmer. The main problem in solving
this unfortunate situation is to still provide backward compatibility.

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


Relevant Pages

  • Re: how to arrange classes in .py files?
    ... I don't think there is a single convention that anyone can ...   import mymodule ... since Python's module structure was ... myapp/ # this is a package, ...
    (comp.lang.python)
  • Re: Strikethrough text
    ... Ulem and it's \sout are really for paragraph text, ... might want the cancel package or the methods Werner mentions to strike ... There is a blackboard convention in which a speaker will ... I certainly hope the OP isn't trying to obtain the strike-through ...
    (comp.text.tex)
  • Re: Files application architecture
    ... so I'm tempted to use the same convention: 1 file per class and 1 folders per package. ... You don't have to write so much boilerplate code as in Java, so classes tend to be smaller in size; you may even find classes with an empty body. ... I've found PEP8 that gives a lot of good hints on coding convention, ...
    (comp.lang.python)
  • Re: choosing a package name
    ... >>> The convention for choosing a package name is to use your registered ... > Just make sure your ISP (or whoever it is providing you with your e-mail ... >> Register a domain name. ...
    (comp.lang.java.programmer)
  • Re: xp sluggish
    ... stuart wohl wrote: ... it is a part of the package that is mentioned on the ... Cleanup is essential, running contig and sdelete, cleaning ...
    (microsoft.public.windowsxp.basics)