I've perused the FAQ, found some mention of paradigm, but didn't really find
an answer to my question.
What is meant by "C++ is a 4 paradigm language?" What are the 4 paradigms
of C++ and what makes them paradigms? Is C++/CLI the 5th paradigm of C++?
why/why not?
thanks,
crichmon 26 3190
crichmon wrote: I've perused the FAQ, found some mention of paradigm, but didn't really
find an answer to my question.
What is meant by "C++ is a 4 paradigm language?" What are the 4 paradigms of C++ and what makes them paradigms? Is C++/CLI the 5th paradigm of C++? why/why not?
- procedural. Programs control flow directly
- OO. Programs control flow indirectly, thru virtual methods
- generic. Like OO but bound at compile time
- declarative.
The last one is like SQL. You arrange elements in the shape of the result
you want, pull the rip cord, and the elements drive an engine to produce the
result.
I have no idea how that should work in C++ or if it's what they meant.
I have never learned a reason to distinguish these paradigms. Just write.
--
Phlip http://industrialxp.org/community/bi...UserInterfaces
crichmon wrote: I've perused the FAQ, found some mention of paradigm, but didn't really find an answer to my question.
What is meant by "C++ is a 4 paradigm language?" What are the 4 paradigms of C++ and what makes them paradigms? Is C++/CLI the 5th paradigm of C++? why/why not?
Yes C++ is a multiparadigm language and currently supports 4 paradigms.
The procedural paradigm (functions etc), the modular paradigm
(namespaces), the object oriented paradigm and the generic programming
paradigm (templates). Each paradigm is supported well with optimal space
and time efficiencies.
Regarding C++/CLI, I have not seen anyone else call it as the 5th
paradigm except me. Perhaps you have seen it in my pages where I write
"We can dare to say that C++/CLI is the fifth paradigm of C++". However
I do not if this has much scientific basis, and I am going to remove
that line if I get many complaints about it. :-)
Regards,
Ioannis Vranos http://www23.brinkster.com/noicys
* Ioannis Vranos: crichmon wrote:
I've perused the FAQ, found some mention of paradigm, but didn't really find an answer to my question.
What is meant by "C++ is a 4 paradigm language?" What are the 4 paradigms of C++ and what makes them paradigms? Is C++/CLI the 5th paradigm of C++? why/why not?
Yes C++ is a multiparadigm language and currently supports 4 paradigms. The procedural paradigm (functions etc), the modular paradigm (namespaces), the object oriented paradigm and the generic programming paradigm (templates). Each paradigm is supported well with optimal space and time efficiencies.
I didn't know that.
But certainly it's not something everyone agrees on.
For example, I absolutely do not agree that C++ "supports" modular
programming, since there _is_ no module concept in C++. However,
C++ allows you to fake some of it by strictly following some set of
conventions (header file guards etc.). That's in the same spirit
as assembler language supports object-orientation (even old TASM).
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Alf P. Steinbach wrote: Yes C++ is a multiparadigm language and currently supports 4 paradigms. The procedural paradigm (functions etc), the modular paradigm (namespaces ), the object oriented paradigm and the generic programming paradigm (templates). Each paradigm is supported well with optimal space and time efficiencies.
I didn't know that.
But certainly it's not something everyone agrees on.
For example, I absolutely do not agree that C++ "supports" modular programming, since there _is_ no module concept in C++. However, C++ allows you to fake some of it by strictly following some set of conventions (header file guards etc.). That's in the same spirit as assembler language supports object-orientation (even old TASM).
I have seen what I said above in TC++PL3 . In chapter 2 BS explains the
paradigms supported and you can find the modular paradigm on page 26 (2.4).
Regards,
Ioannis Vranos http://www23.brinkster.com/noicys
* Ioannis Vranos: Alf P. Steinbach wrote:
Yes C++ is a multiparadigm language and currently supports 4 paradigms. The procedural paradigm (functions etc), the modular paradigm (namespaces ), the object oriented paradigm and the generic programming paradigm (templates). Each paradigm is supported well with optimal space and time efficiencies.
I didn't know that.
But certainly it's not something everyone agrees on.
For example, I absolutely do not agree that C++ "supports" modular programming, since there _is_ no module concept in C++. However, C++ allows you to fake some of it by strictly following some set of conventions (header file guards etc.). That's in the same spirit as assembler language supports object-orientation (even old TASM).
I have seen what I said above in TC++PL3 . In chapter 2 BS explains the paradigms supported and you can find the modular paradigm on page 26 (2.4).
Well I doubt that Bjarne says C++ supports modular programming in a
sense different from OO (e.g. like Modula or Pascal or Ada), but if he
really does then I for one disagree! ;-)
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Alf P. Steinbach wrote: Well I doubt that Bjarne says C++ supports modular programming in a sense different from OO (e.g. like Modula or Pascal or Ada), but if he really does then I for one disagree! ;-)
Have you read the paragraph I provided you? In case you do not have this
book here is how it starts:
[It is placed after the procedural paradigm explanation and the topics
are placed in historical ordering].
"2.4 Modular Programming
Over the years, the emphasis in the design of programs has shifted from
the design of procedures and toward the organization of data. Among
other things, this reflects an increase in program size.
A set of related procedures with the data they manipulate is often
called a module. The programming paradigm becomes:
Decide which modules you want;
partition the program so that data is hidden within modules."
Then it has some more.
Regards,
Ioannis Vranos http://www23.brinkster.com/noicys
* Ioannis Vranos: Alf P. Steinbach wrote:
Well I doubt that Bjarne says C++ supports modular programming in a sense different from OO (e.g. like Modula or Pascal or Ada), but if he really does then I for one disagree! ;-) Have you read the paragraph I provided you?
Nope, cause you didn't provide it... :-)
In case you do not have this book
I don't. I have the first edition, though.
here is how it starts:
[It is placed after the procedural paradigm explanation and the topics are placed in historical ordering].
"2.4 Modular Programming
Over the years, the emphasis in the design of programs has shifted from the design of procedures and toward the organization of data. Among other things, this reflects an increase in program size.
A set of related procedures with the data they manipulate is often called a module. The programming paradigm becomes:
Decide which modules you want; partition the program so that data is hidden within modules."
Hum, well, that could refer to just about anything, including OO, and
it doesn't say that C++ supports _whatever_ it is, so as usual I think
Bjarne has not overstated the case, but here is being misinterpreted.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Alf P. Steinbach wrote: Have you read the paragraph I provided you?
Nope, cause you didn't provide it... :-)
I was talking about this: "In chapter 2 BS explains the paradigms
supported and you can find the modular paradigm on page 26 (2.4)." "2.4 Modular Programming
Over the years, the emphasis in the design of programs has shifted from the design of procedures and toward the organization of data. Among other things, this reflects an increase in program size.
A set of related procedures with the data they manipulate is often called a module. The programming paradigm becomes:
Decide which modules you want; partition the program so that data is hidden within modules."
Hum, well, that could refer to just about anything, including OO, and it doesn't say that C++ supports _whatever_ it is, so as usual I think Bjarne has not overstated the case, but here is being misinterpreted.
OO paradigm is mentioned later and in this paragraph namespaces are
mentioned for implementing the paradigm:
"
[...]
C++ provides a mechanism for grouping related data, functions, etc.,
into separate namespaces. For example, the user interface of a Stack
module could be declared and used like this:
namespace Stack{ // interface
void push(char) ;
char pop() ;
}
void f()
{
Stack: :push(´c´) ;
if (Stack: :pop() != ´c´) error("impossib le") ;
}
The Stack:: qualification indicates that the push() and pop() are those
from the Stack namespace. Other uses of those names will not interfere
or cause confusion.
The definition of the Stack could be provided in a separately-compiled
part of the program:
namespace Stack{ // implementation
const int max_size = 200;
char v[max_ size] ;
int top = 0;
void push(char c) { /* check for overflow and push c */ }
char pop() { /* check for underflow and pop */ }
}
The key point about this Stack module is that the user code is insulated
from the data representation of Stack by the code implementing
Stack::push() and Stack::pop(). The user doesn’t need to know that the
Stack is implemented using an array, and the implementation can be
changed without affecting user code.
[...]
"
Anyway it is an excellent book and I think every C++ programmer should
buy and *read* it.
Regards,
Ioannis Vranos http://www23.brinkster.com/noicys
* Ioannis Vranos: Anyway it is an excellent book and I think every C++ programmer should buy and *read* it.
Yes, I agree.
In fact it's even stronger: if you like the book then you're probably
a good C++ programmer or C++ programmer material, and if not, then
likely not. ;-)
And yes, as shown (I snipped that example) it's possible to implement
Modula/Pascal/Ada-like modules in C++, by use of conventions. Some
features are not possible to implement though. For example, transparent
module initialization requires language _support_. And in a language
with module support you get automatic checking of module dependencies
and such, which must be faked via brittle include guards in C++. Etc.
Cheers,
- Alf
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: John Benson |
last post by:
Hi, I see a lot of posts asking about "the best Python book." In my
experience, there is no such thing, but there are a lot of good books that
will help you along in different ways, and at different times.
First of all, I'd like to clarify my position on learning: I subscribe to
the adobe hacienda school of autodidactic technology, to wit:
"If you throw enough adobe at the side of the hacienda, some of it will
stick"
|
by: MPOOL'03 Organizers |
last post by:
We apologize if you receive this CfP multiple times * Please distribute !
--------------------------------------------------------------------------
CALL FOR PAPERS
Workshop on
MULTIPARADIGM PROGRAMMING WITH OO LANGUAGES (MPOOL'03)
at the
Conference on
|
by: MPOOL'03 Organizers |
last post by:
We apologize if you receive this CfP multiple times * Please distribute !
--------------------------------------------------------------------------
CALL FOR PAPERS
Workshop on
MULTIPARADIGM PROGRAMMING WITH OO LANGUAGES (MPOOL'03)
at the
Conference on
|
by: Jörg Striegnitz |
last post by:
We apologize if you have received this CfP multiple times.
--------------------------------------------------------------------
SECOND CALL FOR CONTRIBUTIONS AND PARTICIPATION
Workshop on
MULTIPARADIGM PROGRAMMING WITH OO LANGUAGES (MPOOL 2004)
(June 14 or 15, TBD)
at the
EUROPEAN CONFERENCE ON OBJECT-ORIENTED PROGRAMMING (ECOOP 2004)
|
by: Roger Smythe |
last post by:
A means for the progressive decomposition a problem space into increasingly simpler component parts
such that these component parts represent higher levels of conceptual abstraction, and are
completely independent of each other except for their well-defined interfaces.
This was an attempt to explain the gist of OOP to programmers accustomed to the
structured programming paradigm. I tried to explain OOP in terms of ideals that can
be...
| |
by: Corey C. Carter |
last post by:
I am new to programming. Over the years I have "tried" many langauges such
as basic, pascal(yea yea, I know, out of date), python and C. I was under
the impression that one must lean C before moving on to C++. Is that true,
or can I just begin with C++?
|
by: Jo Blow |
last post by:
Hi All,
I have a client that has written a specification for a Database system
comprising of 9 seperate MS Access Applications distributed throughout a
group of Hospitals. I have proposed that a single central web based
application would be more economically viable, scalable, secure,
maintainable etc. However I need to write a document to reflect this. Its
not that hard but with time constraints I was wondering if anyone knows of
online...
|
by: jacob navia |
last post by:
A recent article on CNN described the problem that phone makers
are facing.
(http://www.cnn.com/2006/TECH/biztech/05/29/cellphone.usability.ap/index.html)
Most people are rejecting the new "supercharged"
cell phones because they just do not want to learn the
incredible complex menus and stuff that you need to use them.
The new phones are just too complicated to use.
|
by: dmjpro |
last post by:
I have a confusion to understand the two basic terms .... programming paradigms and programming technology.
I need the technical differences.
plz help.
kind regards.
dmjpro.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |