473,396 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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?
--
STH
Hatton's Law: "There is only One inviolable Law"
KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
Mozilla: http://www.mozilla.org
Jul 22 '05 #1
5 2809
"Steven T. Hatton" <su******@setidava.kushan.aa> wrote in message
news:Ad********************@speakeasy.net...
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?
--
STH
Hatton's Law: "There is only One inviolable Law"
KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
Mozilla: http://www.mozilla.org

C++ supports the modular programming paradigm, which is namespaces.


Ioannis Vranos

Jul 22 '05 #2
* "Steven T. Hatton" <su******@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?
Jul 22 '05 #3
Alf P. Steinbach wrote:
[...]
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.


I don't mean to be dense, but how would adding support for
modules compromise backward compatibility? Couldn't such a
mechanism coexist with the current model?
Jul 22 '05 #4
* Derek <no**@cheese.com> schriebt:
Alf P. Steinbach wrote:
[...]
> 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.


I don't mean to be dense, but how would adding support for
modules compromise backward compatibility? Couldn't such a
mechanism coexist with the current model?


Perhaps I am the dense one... ;-)

Thanks.

I just harked up something I learned somewhere, and am unable to support the
statement (although it's always a problem that when something new is
introduced, unanticipated interaction with existing features manifests
itself). I should have qualified that statement with a "seems to be".

Consider e.g. the hypothetical code

#include <old_header>
using package acme::xml;

or

using package acme::xml;
#include <old_header>

What could the problems really be?

On reflection I don't know. E.g. it seems we can disregard C compatibility
issues, and also preprocessor symbol interaction. So I just put the question
forward here; what I think I do know is that this has been debated over and
over several times, but with no clear module alternative emerging, even after
ten or twenty years or so (whatever), which seems to indicate that there are
problems -- but for the life of me I'm unable to not see obvious solutions.

--
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?
Jul 22 '05 #5

Last I heard (before the C and C++ Kona meetings last year) was that
Pete Becker was proposing adding built in facilities to C++ to support
shared/dynamic libraries.

I don't think Becker's proposal mentioned startup/shutdown code for
dynamic libraries at all. It may have just mentioned global objects and
said they're good enough.

I don't think there were any real concerns about backward compatability
being a problem either - except maybe whether objects have shared
linkage by default (unix) or not (windows).

In fact, I don't remember much in the proposal that was concrete yet -
it may have just been an early draft.

As an aside, nobody mentioned object files as kind of module-like.
Personally, I think they come closer than namespaces to being modules.

mark

Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Derek Wickersham | last post by:
Easy newbie question. I've searched all the PHP documentation I can find, but can't find an answer. What does the "@" mean, in this context: @mysql_select_db( "scripts");
9
by: Xiangliang Meng | last post by:
Hi, all. I see a very strange fragment code today. Uint32 enum { a = 100; b = 200; }; NOTE: Uint32 is defined to be 'unsigned' in other source files.
9
by: Marek Kurowski | last post by:
Yo! What mean when program is ALPHA or BETA version? I suppose it is not release version of program, but I don't know what it exactly mean. What it mean in your opinion? Marek Kurowski
11
by: L. Chen | last post by:
The standard says that a char* or void* pointer has the least strict alignment. But I do not know what is a strict alignment. What does that mean?
4
by: Luke Wu | last post by:
I am just wondering what the following terms usually mean: 1) "Standard C" 2) "K&R C" 3) "ANSI C" I am pretty sure "ANSI C" usually refers to the C89 standard, but what
1
by: Nice | last post by:
Are they the same thing?
9
by: plusk1008 | last post by:
I have finals next week and I am stuck on one question on my review sheet for excel. So once again I beg: Please, please, please, please, please, please, please, please, please, please someone help...
4
by: chandanlinster | last post by:
hello everybody, as i was going through the "printf" man page, i came across this statement. printf("%*d", width, num); what does "*" mean?
4
by: lander | last post by:
I've read the page life cycle thing in msdn, still, i'm getting a bit confused of thinking how all the things are going under the hood... I know that when page loading, that the controls'...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.