473,786 Members | 2,806 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Genericity is *not* templates

According to the C++ FAQ Lite:

http://www.parashift.com/

[34.11] What is "genericity "?

Yet another way to say, "class templates."

Not to be confused with "generality "
(which just means avoiding solutions which are overly specific),
"genericity " means class templates.

This is *not* correct.
Class templates are *not* generally generic.
Usually, class templates are only be used to generate template classes
for a restricted set of types.
Only class templates which are designed to generate template classes
for *all* types are truly generic.
The standard vector class template, for example, is generic but
the standard valarry class template is *not* generic
because it only makes sense for numeric types.

Jul 22 '05
22 2195

"E. Robert Tisdale" <E.************ **@jpl.nasa.gov > wrote in message
news:40******** ****@jpl.nasa.g ov...
According to the C++ FAQ Lite:

http://www.parashift.com/

[34.11] What is "genericity "?

Yet another way to say, "class templates."

Not to be confused with "generality "
(which just means avoiding solutions which are overly specific),
"genericity " means class templates.

This is *not* correct.
Class templates are *not* generally generic.
Usually, class templates are only be used to generate template classes
for a restricted set of types.
Only class templates which are designed to generate template classes
for *all* types are truly generic.
The standard vector class template, for example, is generic but
the standard valarry class template is *not* generic
because it only makes sense for numeric types.


It sounds to me like you're applying the description backwards. The
statement does not say the term "templates" implies "genericity " (or
"genericnes s"), but the other way around: that saying "genericity " implies
"templates" . So if some templates are not "generic", that's fine, but of
you want to apply a "generic" solution, then you're talking about using
tmeplates.

"Of course, that's just my opinion...I could be wrong."

-Howard


Jul 22 '05 #11
E. Robert Tisdale wrote:
Steven T. Hatton wrote: Pick the dictionary of your choice. I use
The American Heritage® Dictionary of the English Language:
Fourth Edition:
Yup! That's my dictionary of choice! http://www.bartleby.com/61/
www.dict.org is what I get from kdict on my Linux box.
generic

ADJECTIVE:1. Relating to or descriptive of an entire group or class;
general. See synonyms at general.

SYNONYMS:genera l, common, generic, universal These adjectives mean
belonging to, relating to, or affecting the whole: the general welfare;
a common enemy; generic likenesses; universal military conscription.


I hope I didn't come across as challenging your usage. That wasn't my
intent. I just received my copy of _C++ Templates: The Complete Guide_,
and the authors do take issue with the simplistic notion that 'programming
with tmplates'='gene ric programming'. They suggest the distinguishing
feature of generic programming is that "[t]emplates have to be designated
in a framework for the purpose of enabling a multitude of useful
combination." That statement seems to be rather open to interpretation.

Regardless of the semantics, the observation you presented is significant.
I'm not taking a side in the genericity debate. ;-)
--
p->m == (*p).m == p[0].m
http://www.kdevelop.org
http://www.suse.com
http://www.mozilla.org
Jul 22 '05 #12
E. Robert Tisdale wrote:
Steven T. Hatton wrote: Pick the dictionary of your choice. I use
The American Heritage® Dictionary of the English Language:
Fourth Edition:
Yup! That's my dictionary of choice! http://www.bartleby.com/61/
www.dict.org is what I get from kdict on my Linux box.
generic

ADJECTIVE:1. Relating to or descriptive of an entire group or class;
general. See synonyms at general.

SYNONYMS:genera l, common, generic, universal These adjectives mean
belonging to, relating to, or affecting the whole: the general welfare;
a common enemy; generic likenesses; universal military conscription.


I hope I didn't come across as challenging your usage. That wasn't my
intent. I just received my copy of _C++ Templates: The Complete Guide_,
and the authors do take issue with the simplistic notion that 'programming
with tmplates'='gene ric programming'. They suggest the distinguishing
feature of generic programming is that "[t]emplates have to be designated
in a framework for the purpose of enabling a multitude of useful
combination." That statement seems to be rather open to interpretation.

Regardless of the semantics, the observation you presented is significant.
I'm not taking a side in the genericity debate. ;-)
--
p->m == (*p).m == p[0].m
http://www.kdevelop.org
http://www.suse.com
http://www.mozilla.org
Jul 22 '05 #13
"E. Robert Tisdale" <E.************ **@jpl.nasa.gov > wrote
According to the C++ FAQ Lite:

http://www.parashift.com/

[34.11] What is "genericity "?

Yet another way to say, "class templates."

Not to be confused with "generality "
(which just means avoiding solutions which are
overly specific),
"genericity " means class templates.

This is *not* correct.
You have to read it in context. You're overanalyzing a FAQ, not a standard
document. There's no requirement for an item in a FAQ to be rigorously
accurate and complete. For anyone looking for a quick answer to "what is
genericity" in the context of C++, pointing them to templates isn't doing
them a disservice. Are there other ways to implement genericity? Plenty, but
discussing them would be terribly out of place in a FAQ.
Class templates are *not* generally generic.
NOTHING is generally generic. You can't put unrealistic expectations on
templates.
Usually, class templates are only be used to generate
template classes for a restricted set of types.
Any generic solution is limited to types for which the operations make
sense.
Only class templates which are designed to generate
template classes for *all* types are truly generic.
Absurd.
The standard vector class template, for example, is
generic
Wrong! Vectors can only be instantiated on certain types, namely, those that
implement value semantics. You can't have vectors of objects that can't be
copied or directly instantiated.
but the standard valarry class template is *not* generic
because it only makes sense for numeric types.


It's generic for that domain. It's unreasonable, unrealistic, and naive to
expect any solution to cross all possible problem domains. You need to
rethink your absolutist preconceptions.

Claudio Puviani
Jul 22 '05 #14
"E. Robert Tisdale" <E.************ **@jpl.nasa.gov > wrote
According to the C++ FAQ Lite:

http://www.parashift.com/

[34.11] What is "genericity "?

Yet another way to say, "class templates."

Not to be confused with "generality "
(which just means avoiding solutions which are
overly specific),
"genericity " means class templates.

This is *not* correct.
You have to read it in context. You're overanalyzing a FAQ, not a standard
document. There's no requirement for an item in a FAQ to be rigorously
accurate and complete. For anyone looking for a quick answer to "what is
genericity" in the context of C++, pointing them to templates isn't doing
them a disservice. Are there other ways to implement genericity? Plenty, but
discussing them would be terribly out of place in a FAQ.
Class templates are *not* generally generic.
NOTHING is generally generic. You can't put unrealistic expectations on
templates.
Usually, class templates are only be used to generate
template classes for a restricted set of types.
Any generic solution is limited to types for which the operations make
sense.
Only class templates which are designed to generate
template classes for *all* types are truly generic.
Absurd.
The standard vector class template, for example, is
generic
Wrong! Vectors can only be instantiated on certain types, namely, those that
implement value semantics. You can't have vectors of objects that can't be
copied or directly instantiated.
but the standard valarry class template is *not* generic
because it only makes sense for numeric types.


It's generic for that domain. It's unreasonable, unrealistic, and naive to
expect any solution to cross all possible problem domains. You need to
rethink your absolutist preconceptions.

Claudio Puviani
Jul 22 '05 #15
Leor Zolman wrote:
E. Robert Tisdale wrote:
According to the C++ FAQ Lite:

http://www.parashift.com/

[34.11] What is "genericity "?

Yet another way to say, "class templates."

Not to be confused with "generality "
(which just means avoiding solutions which are overly specific),
"genericity " means class templates.

This is *not* correct.
Class templates are *not* generally generic.
Usually, class templates are only be used to generate template classes
for a restricted set of types.
Only class templates which are designed to generate template classes
for *all* types are truly generic.
The standard vector class template, for example, is generic but
the standard valarry class template is *not* generic
because it only makes sense for numeric types.

I suppose the word "genericity " doesn't necessarily in and of itself have
to imply "templates. " But in the context of C++, it pretty much does, and
the C++ FAQ Lite isn't attempting to define terms as used outside that
context. In any case, C++ happens to be the only context /I've/ ever seen
it used in. While it isn't in the Merriam-Webster online dictionary as such
(note that under "generic", the MW shows "genericnes s", not "genericity "),
here's one technical site's definition of it:

The possibility for a language to provided (sic.) parameterized
modules or types. e.g. List(of:Integer ) or List(of:People) .

Okay, the grammatical error doesn't exactly inspire high levels of
confidence in the source, but this does sound right, and it certainly
describes the functionality of templates in C++.

If some templates just happen to be designed to work only for class-typed
template parameters, or even only for a very narrow selection of classes
(e.g., std::string), that hardly seems reason enough (at least to me) to
proclaim that those templates are no longer examples of "genericity ".


Genericity implies that the class template is *generic* or general.
Few class templates have that property.
The standard complex class templates, for example,
only work for floating-point types float, double and long double.

Although genericity implies class templates in C++,
the converse is seldom true.
Class templates do *not* imply genericity in C++.

Jul 22 '05 #16
Leor Zolman wrote:
E. Robert Tisdale wrote:
According to the C++ FAQ Lite:

http://www.parashift.com/

[34.11] What is "genericity "?

Yet another way to say, "class templates."

Not to be confused with "generality "
(which just means avoiding solutions which are overly specific),
"genericity " means class templates.

This is *not* correct.
Class templates are *not* generally generic.
Usually, class templates are only be used to generate template classes
for a restricted set of types.
Only class templates which are designed to generate template classes
for *all* types are truly generic.
The standard vector class template, for example, is generic but
the standard valarry class template is *not* generic
because it only makes sense for numeric types.

I suppose the word "genericity " doesn't necessarily in and of itself have
to imply "templates. " But in the context of C++, it pretty much does, and
the C++ FAQ Lite isn't attempting to define terms as used outside that
context. In any case, C++ happens to be the only context /I've/ ever seen
it used in. While it isn't in the Merriam-Webster online dictionary as such
(note that under "generic", the MW shows "genericnes s", not "genericity "),
here's one technical site's definition of it:

The possibility for a language to provided (sic.) parameterized
modules or types. e.g. List(of:Integer ) or List(of:People) .

Okay, the grammatical error doesn't exactly inspire high levels of
confidence in the source, but this does sound right, and it certainly
describes the functionality of templates in C++.

If some templates just happen to be designed to work only for class-typed
template parameters, or even only for a very narrow selection of classes
(e.g., std::string), that hardly seems reason enough (at least to me) to
proclaim that those templates are no longer examples of "genericity ".


Genericity implies that the class template is *generic* or general.
Few class templates have that property.
The standard complex class templates, for example,
only work for floating-point types float, double and long double.

Although genericity implies class templates in C++,
the converse is seldom true.
Class templates do *not* imply genericity in C++.

Jul 22 '05 #17
Howard wrote:
E. Robert Tisdale wrote:
According to the C++ FAQ Lite:

http://www.parashift.com/

[34.11] What is "genericity "?

Yet another way to say, "class templates."

Not to be confused with "generality "
(which just means avoiding solutions which are overly specific),
"genericity " means class templates.


The statement does not say [that]
the term "templates" implies "genericity " (or "genericnes s")
but the other way around:
that saying "genericity " implies "templates" .
So if some templates are not "generic", that's fine
but, if you want to apply a "generic" solution,
then you're talking about using templates.


Correct.

Jul 22 '05 #18
Howard wrote:
E. Robert Tisdale wrote:
According to the C++ FAQ Lite:

http://www.parashift.com/

[34.11] What is "genericity "?

Yet another way to say, "class templates."

Not to be confused with "generality "
(which just means avoiding solutions which are overly specific),
"genericity " means class templates.


The statement does not say [that]
the term "templates" implies "genericity " (or "genericnes s")
but the other way around:
that saying "genericity " implies "templates" .
So if some templates are not "generic", that's fine
but, if you want to apply a "generic" solution,
then you're talking about using templates.


Correct.

Jul 22 '05 #19
E. Robert Tisdale wrote:
E. Robert Tisdale wrote:
[snip]
The standard vector class template, for example, is generic but
the standard valarry class template is *not* generic
because it only makes sense for numeric types.

[snip]
ADJECTIVE:1. Relating to or descriptive of an entire group or class;
general. See synonyms at general.


[snip]

Who says the numeric types don't comprise an "entire group or class"?

From the Oxford Concise English Dictionary, 9th edition, "*generic*
[...] 2 /Biol./ Characteristic of or belonging to a genus." In this
other technical sense, then, genericity is quite a limited thing: it
doesn't refer to entire families, orders, classes, phyla or kingdoms.

--
Regards,
Buster.
Jul 22 '05 #20

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

Similar topics

22
1454
by: E. Robert Tisdale | last post by:
According to the C++ FAQ Lite: http://www.parashift.com/ What is "genericity"? Yet another way to say, "class templates." Not to be confused with "generality" (which just means avoiding solutions which are overly specific),
0
9650
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10164
jinu1996
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...
0
9962
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 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...
0
8992
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, 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...
1
7515
isladogs
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...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.