Saturday, November 29, 2008

comp.lang.c++ - 25 new messages in 7 topics - digest

comp.lang.c++
http://groups.google.com/group/comp.lang.c++?hl=en

comp.lang.c++@googlegroups.com

Today's topics:

* Who gets higher salary a Java Programmer or a C++ Programmer? - 18 messages,
8 authors
http://groups.google.com/group/comp.lang.c++/t/4017272356b778c8?hl=en
* Types through a macro - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/bb3a4df299d49059?hl=en
* Dereferencing a list Structure - 2 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/8c5c4aff6ded0433?hl=en
* binary format of the number. - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/bf11dd6e68624537?hl=en
* Initialising a constant object - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/1d73105076e0e724?hl=en
* What is the difference between .cpp + .h vs .cxx and .hxx ? - 1 messages, 1
author
http://groups.google.com/group/comp.lang.c++/t/e664fec03455e417?hl=en
* Basic .H/.CPP Location Question - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/6056e1d45918a0f9?hl=en

==============================================================================
TOPIC: Who gets higher salary a Java Programmer or a C++ Programmer?
http://groups.google.com/group/comp.lang.c++/t/4017272356b778c8?hl=en
==============================================================================

== 1 of 18 ==
Date: Sat, Nov 29 2008 5:28 am
From: James Kanze


On Nov 29, 2:57 am, "Daniel T." <danie...@earthlink.net> wrote:
> Arne Vajhøj <a...@vajhoej.dk> wrote:
> > You argue that not fully automated means design.

> > That is obviously not true.

> No, I argue that C++/Java programmers do help design the
> application.

But doesn't this depend on the process. In most cases I've
seen, the software developers are responsible for many aspects
of low level design. But it's not a given; a process could have
a separate design team, which specified everything in detail, to
the point where the developers only had to "pisser les lignes";
there responsibility wouldn't be much more than that of a
bricklayer.

--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34


== 2 of 18 ==
Date: Sat, Nov 29 2008 5:33 am
From: James Kanze


On Nov 29, 1:34 am, Lew <l...@lewscanon.com> wrote:
> Tim Roberts wrote:
> > The fact that it is widely used does not mean that it is
> > CORRECTLY used. There are many states in which it is
> > illegal to call yourself an "engineer" of any kind unless
> > you have received an engineering license from the state,

> Which ones?

I don't know about the US, but in Europe, it is generally
illegal to appropriate a title that you don't have. In Germany,
for example, I cannot claim that I'm a Dipl. Ing., because I
don't have that title.

In most cases, the simple title "engineer", without further
qualifications, is not an academic title, so it doesn't depend
on a degree. Never the less, some qualification is expected.

> > and those license examinations often involve topics in which
> > a software engineer has no training.

> If you are speaking of the United States, one has the First
> Amendment right to call oneself whatever one likes.

Where does it say that in the first amendment? I can't find it.

> I can call myself President of the United States or God,
> should I so choose.  (Since no one agrees on what or if God
> is, that last one has no conceivable actionable consequences
> at law.)

I don't know about God, but you cannot enter into a contract as
the President of the United States; only one person has a legal
right to that title.

Closer to home, you cannot open an office as a doctor unless you
have legally recognized qualifications.

> What one calls one's profession or business may, of course, be
> a different matter.

What you call yourself in private circles probably won't cause
any problems, as long as no one decides to prosecute. If you
present yourself publicly as an M.D. however, you'd better have
the corresponding qualifications, or you'll have legal problems.

--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34


== 3 of 18 ==
Date: Sat, Nov 29 2008 5:37 am
From: Martin Gregorie


On Fri, 28 Nov 2008 14:47:12 -0500, LR wrote:

> Are doctors required to belong to a professional association?
>
Yes. If they are sufficiently bad they are struck off, i.e. kicked out of
the association, and can no longer practice medicine. Is is a criminal
offense to practice medicine of you're not a member of the medical
association. Think AMA in the USA and GMC in the UK. I don't know their
names elsewhere.

> May I ask what jurisdiction you're speaking of.
>
North America, UK, Europe, Australia and New Zealand for certain.
Probably a lot of others too.

> However, in almost every jurisdiction that I know of where it would
> matter, software engineers, actually anyone who calls themselves an
> engineer, like doctors, lawyers and hairdressers are required to have a
> license.
>
As Tom said, depends on local rules. If you're a member of a professional
association or (in the UK) Chartered then the association operates much
like the AMA or the GMC. In addition, national laws cover whether you can
practice without being a member of a professional association: medical
doctors, lawyers, architects and accountants can't. I'm uncertain how
that applies to engineers, but it doesn't apply to software engineers.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |


== 4 of 18 ==
Date: Sat, Nov 29 2008 7:34 am
From: Keith H Duggar


On Nov 29, 8:12 am, James Kanze <james.ka...@gmail.com> wrote:
> On Nov 29, 4:04 am, LR <lr...@superlink.net> wrote:
>
> > Kai-Uwe Bux wrote:
> > > LR wrote:
> > > a) There is some tension about where to put math.
> > I didn't think so, but this thread has clarified that for me.
> > > Some place it with the sciences, others don't.
> > I don't.
>
> So you're in a minority of one. All of the standard definitions
> consider it science.
>
> Obviously, if you redefine science, and redefine principles, you
> can come up with definitions such that software engineering does
> not use "scientific principles". But that's just playing word
> games, and doesn't help either understanding nor communication.

Semantic whining is often employed by those seeking to
reinforce their own prejudices as opposed to those seeking
to learn and communicate.

> > I tend to think of science as dealing with physical phenomena
> > and math dealing with, for lack of a better word, abstraction.
>
> What physical phenomena are involved in such sciences as
> economic science, or psychology, or sociology.

economics :
The various phenomena related to the acquisition, production,
distribution, and consumption of materials and services such
as scarcity, abundance, economy of scale, supply and demand,
learning curve, Laffer curve, market structures, inflation,
deflation, risk-reward, value theory, competition, etc.

psychology :
The various phenomena related to mental processes and behavior
such as memory, learning, perception, attention, sensitization,
de-sensitization, adaptation, dreams, emotion, empathy, gender
differences, attitude, personality, etc.

sociology :
The various phenomena related to human group behavior such as
crowd behavior, mob mentality, herding, racism, segregation,
social identity, culture, memes, globalization, deviance,
family, justice, class warfare, etc.

mathematics :
The various phenomena related to quantity, structure, pattern,
relations, space, and change such as measures of extent (area,
distance, volume), scaling relations, congruence, topology for
example the description and enumeration of knots and networks,
rates of change, colorability, conversation of number, etc.

The Four Color Theorem is an enjoyable and clear example of
mathematics describing a physical phenomenon.

KHD

== 5 of 18 ==
Date: Sat, Nov 29 2008 7:35 am
From: LR


Martin Gregorie wrote:
> On Fri, 28 Nov 2008 14:16:19 -0500, LR wrote:
>
>> Martin Gregorie wrote:
>>> On Wed, 26 Nov 2008 22:36:41 -0500, LR wrote:
>>>
>>>> Martin Gregorie wrote:
>>>>> On Wed, 26 Nov 2008 16:32:19 -0500, LR wrote:
>>>>>
>>>>>> But I think I made it plain that engineers don't consider the entire
>>>>>> physics of the bridge. They might not consider fluid interactions or
>>>>>> wind loading or some such. The parameters are likely to be driven
>>>>>> by budget, customer requirements or perhaps good practice.
>>>>>>
>>>>> That's quite wrong. The engineers who designed the Tay and the Tacoma
>>>>> Narrows bridges ignored wind and look where that got them.
>>>> I'm sorry, but what is quite wrong? I completely fail to understand
>>>> how your response contradicts anything I wrote above. Please explain,
>>>> because I utterly bewildered by your response.
>>>>
>>> This:
>>> "But I think I made it plain that engineers don't consider the entire
>>> physics of the bridge. They might not consider fluid interactions or
>>> wind loading or some such."
>>>
>>> I suggest you do some reading about those bridges.
>> I have read a bit about them. Sorry, but I really am quite confused now.
>> You said that they ignored wind loading and I agreed that they might
>> not consider fluid interactions or wind loading. Perhaps you object to
>> the redundancy?
>>
>> Could you please explain to me where we disagree?
>>
> You seemed to be saying that wind load calculations were purely an
> optional extra to be undertaken if there was any cash left in the design
> kitty.

I don't think that it's optional in the sense that it's good thing not
to consider wind load.


But it does depend on what work the customer contracts an engineer to
perform. Not every engineer working on a bridge might consider wind
load. But I'd agree that someone should. I suspect it doesn't always
happen though.

There are also issues of what might be expected to occur. EG, AFAIK,
there was work done on the WTC to determine the outcome of a jetliner
impacting the building, but no work was done to determine what the fuel
that jet might be carrying would do to the structural integrity of the
building.

I think a reasonable lesson from this might be that failure modes can be
important.

> I disagree. Including an engineering project's operating environment in
> the design calculations is mandatory: the engineer is culpable if a known
> hazard or constraint is overlooked. This applies equally to software and
> bridges.

I did mention good practice. Would you agree that this only implies
within the limit of known art?

LR


== 6 of 18 ==
Date: Sat, Nov 29 2008 7:59 am
From: Martin Gregorie


On Sat, 29 Nov 2008 10:35:53 -0500, LR wrote:

> Martin Gregorie wrote:
>> On Fri, 28 Nov 2008 14:16:19 -0500, LR wrote:
>>
>> I disagree. Including an engineering project's operating environment in
>> the design calculations is mandatory: the engineer is culpable if a
>> known hazard or constraint is overlooked. This applies equally to
>> software and bridges.
>
> I did mention good practice. Would you agree that this only implies
> within the limit of known art?
>
That's why I said *known* hazard.

You can't design for an unknown hazard but you should sure as hell have
your arse kicked for ignoring a relevant one.

BTW, Cheney should not have been rubbished for his "unknown unknowns":
just because you don't know about something doesn't mean it isn't there,
so a prudent course of action should make some allowance for that
possibility.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |


== 7 of 18 ==
Date: Sat, Nov 29 2008 8:15 am
From: AL


Arved Sandstrom wrote:
[...]
> My personal feeling about "software engineers" is that if it's a title we
> want to have, we should have equivalent standards to other engineers.
> Require courses like the ones I mentioned. Make sure - perhaps through the
> professional exams - that the aspirant really knows core CS. Have an
> engineer-in-training period (in NS it's 4 years) where you are mentored and
> observed, and your work experience is assessed.
>
> Is there value to this? I think there is. One of the reasons for having
> professional accreditation (the other big one being public safety) is the
> assurance of reasonable competency. Right now in software development you
> really don't know what you're getting.
>
> Do all software developers need to be engineers (Assuming such schemes were
> adopted)? Probably not. In fact I think few would be. A number of IT jobs
> could likely be done by technicians, although the technicians themselves
> would be accredited (perhaps two year programmes of study) and also have
> work experience before being certified. But probably most software
> development would continue to be done by individuals who have no
> accreditation. The main difference would be that safety-critical software
> would require professional software engineers and technicians, and also that
> any client could demand that as they saw fit.
>
> I personally don't much care. I just don't like seeing the title used unless
> you really are one. And it's not a title that you award to yourself, I'm
> afraid.


And that expresses my opinion as well.

Engineer is not a self-assigned title that can be scribbled on a "Hello
My Name Is" sticker and slapped on one's lapel. It must be backed up
with credentials that demonstrate the person has been through the
grinder to earn the recognition, responsibility and compensation.

== 8 of 18 ==
Date: Sat, Nov 29 2008 8:27 am
From: LR


James Kanze wrote:
> On Nov 29, 4:04 am, LR <lr...@superlink.net> wrote:
>> Kai-Uwe Bux wrote:
>>> LR wrote:
>>> a) There is some tension about where to put math.
>
>> I didn't think so, but this thread has clarified that for me.
>
>>> Some place it with the sciences, others don't.
>
>> I don't.
>
> So you're in a minority of one.

I think that might depend on what minority you're speaking of, if you
accept what Kai-Uwe Bux said about there being some tension about where
to put math, that implies that there is at least one other person
besides me who feels that way.

> All of the standard definitions consider it science.

Not the one's that I've read. Not the one's my teachers taught me.


> Obviously, if you redefine science, and redefine principles, you
> can come up with definitions such that software engineering does
> not use "scientific principles". But that's just playing word
> games, and doesn't help either understanding nor communication.

These are the things that I was taught and learned. But perhaps the
opposite is true? That people are changing the definitions of things to
suit what they perceive as being their self-interest? Do you think
that's possible?

>
>> I tend to think of science as dealing with physical phenomena
>> and math dealing with, for lack of a better word, abstraction.
>
> What physical phenomena are involved in such sciences as
> economic science, or psychology, or sociology.

Assuming that it is in fact a science, I think that in economics at
least there is the question of the allocation of scarce resources
(that's from memory, so I might have it wrong, I think that's what
Sowell said,) and these are physical entities. There's also the
question of the movement of goods and currency. Perhaps we could
restate those as fluids problems? In an article at a link I posted else
thread, George Soros used the phrase "financial engineering."

It's less clear to me, perhaps because I don't know enough about them
that psychology and sociology are sciences. But I suppose if they are
able to measure physical phenomena and make predictions about them, the
way physics can then they'd be sciences. Can they do these?

But I think that we do have to be careful about defining what a science
is. For example, political pollsters measure things and often use them
to make predictions. But I'm not sure how far I'd go in saying that
Political Science is a science. Maybe I'm wrong about that. Or if it's
not now, maybe one day it will be.

Also, AFAICR all of the sciences have some relation to an engineering
discipline, or at least off hand I can't think of one that doesn't.
What engineering disciplines are the three things you named related to?

LR


== 9 of 18 ==
Date: Sat, Nov 29 2008 8:41 am
From: "Daniel T."


James Kanze <james.kanze@gmail.com> wrote:
> On Nov 29, 2:57 am, "Daniel T." <danie...@earthlink.net> wrote:

> > I argue that C++/Java programmers do help design the application.
>
> But doesn't this depend on the process. In most cases I've seen,
> the software developers are responsible for many aspects of low
> level design. But it's not a given; a process could have a separate
> design team, which specified everything in detail, to the point
> where the developers only had to "pisser les lignes"; there
> responsibility wouldn't be much more than that of a bricklayer.

Many orginazations have attempted to relegate the programmer to "brick
layer" status. The effort has been so phenomenally unsuccessful that
there has been a backlash and now even attempts at reasonable high-level
design are often met with derision.


== 10 of 18 ==
Date: Sat, Nov 29 2008 8:44 am
From: LR


James Kanze wrote:
> On Nov 28, 7:44 pm, Tim Roberts <t...@probo.com> wrote:
>> "Daniel T." <danie...@earthlink.net> wrote:
>
>>>> Programs are carefully hand-crafted one line at a time...
>
>>> Aren't bridge blueprints carefully drawn one line at a time
>>> as well?
>
>> I would argue "no". For the most part, bridges are built up
>> from pre-defined and well-understood modules with limited
>> options and provable behavior.
>
> Aren't programs built up from pre-defined and well-understood
> motules with limited options and provable behavior. I mean, I
> don't reinvent std::vector each time I need it.

Evidently, there's an opinion that the arts can be more or less the same.
http://rogerebert.suntimes.com/apps/pbcs.dll/article?AID=/19900309/REVIEWS/3090304/1023

"Most movies are constructed out of bits and pieces of other movies,
like little engines built from cinematic Erector sets."


>
>> You might get an artist's rendering drawn one line at a time.
>
>> Even if we do grant your point, the analogy is not valid. I
>> don't drive over a bridge blueprint. The blueprint is the
>> design document. The bridge is engineered. With software,
>> that "hand-crafted" artistry is exactly what I am driving on.
>
> You don't use C++ code, either; C++ doesn't run on my machine.
> C++ is just the blueprint for the machine code (which in turn is
> really just a blueprint for the way some electrons are going to
> move).

Is there any reason in principle why C++ code can't run on a machine?

LR


== 11 of 18 ==
Date: Sat, Nov 29 2008 8:47 am
From: LR


Martin Gregorie wrote:
> On Fri, 28 Nov 2008 15:13:19 -0500, LR wrote:
>
>> I think that I'll stand by what I wrote, with the exception of the cause
>> of the Tay's failure. Since I am still not sure what you understood from
>> what I posted, please feel free to ask me to amplify or clarify and I
>> will be happy to make the attempt. Otherwise, I shall be glad to wallow
>> quite contentedly in my hole.
>>
> As I've just explained above, what I didn't like was that I read into
> your statement the idea that consideration of known hazards/constraints
> might be optional when designing something. IMO that's never optional
> regardless of what is being designed.

Then please allow me to ask what an engineer should do if a client wants
an analysis done on the resonant frequency of a bridge, but not any work
done on wind loading, or, well, I'm not sure what the technical terms
would be, let's call it static deck loading, or transient deck loading.
Or another fluids problem bridges encounter, water on their supports.
Can an engineer take that work?

LR


== 12 of 18 ==
Date: Sat, Nov 29 2008 8:54 am
From: LR


James Kanze wrote:
> On Nov 28, 9:43 pm, Kai-Uwe Bux <jkherci...@gmx.net> wrote:
>> LR wrote:

>>> However, I note that I've read some stuff recently that
>>> suggests that mathematicians have some doubts about the
>>> concept of proof.
>
>> Where did you read that?
>
> Probably the same place he read that math is not a science. If
> you're willing to redefine words as readily as he is, then you
> can prove or disprove anything.

I've already apologized for not saying in the first place that I can't
remember where I read it, and I repeat my apology here. I also posted a
link elsethread to a place where I may have read it, but the entire
article is not available at that link.

LR


== 13 of 18 ==
Date: Sat, Nov 29 2008 9:10 am
From: LR


Martin Gregorie wrote:
> On Fri, 28 Nov 2008 14:47:12 -0500, LR wrote:
>
>> Are doctors required to belong to a professional association?
>>
> Yes. If they are sufficiently bad they are struck off, i.e. kicked out of
> the association, and can no longer practice medicine. Is is a criminal
> offense to practice medicine of you're not a member of the medical
> association. Think AMA in the USA and GMC in the UK. I don't know their
> names elsewhere.

Are you sure about this in the US? From what I know, almost every
physician in the US is an AMA member, but I was unaware that it was a
requirement to be a member.

I snipped perhaps a little too much about what you wrote about national
laws requiring membership I'm not sure you meant to apply that to US.
I'm not all that familiar with how the AMA is organized, but I seem to
recall a few stories in the US about doctors who lose their license in
one state but not another and continue to practice in the state in which
they maintain a license. But I hasten to say that I don't have a link to
anything that will back me up on this.

LR


== 14 of 18 ==
Date: Sat, Nov 29 2008 10:31 am
From: Lew


James Kanze wrote:
>> What physical phenomena are involved in such sciences as
>> economic science, or psychology, or sociology.

Keith H Duggar wrote:
> economics :
> The various phenomena related to the acquisition, production,
> distribution, and consumption of materials and services such
> as scarcity, abundance, economy of scale, supply and demand,
> learning curve, Laffer curve, market structures, inflation,
> deflation, risk-reward, value theory, competition, etc.

All of which are social phenomena. Economics is a behavioral science, not a
physical one.

There is nothing physically inherent in ferrous ore that makes it an economic
resource. It's the valuation by humans that makes it an economic phenomenon.

Yes, economics does involve physical phenomena, but their significance in
economics is social.

> psychology :
> The various phenomena related to mental processes and behavior
> such as memory, learning, perception, attention, sensitization,
> de-sensitization, adaptation, dreams, emotion, empathy, gender
> differences, attitude, personality, etc.

It is not the physical attributes of those that make up psychology. The
physical phenomena make up the sciences of neurology and physiology.

> sociology :
> The various phenomena related to human group behavior such as
> crowd behavior, mob mentality, herding, racism, segregation,
> social identity, culture, memes, globalization, deviance,
> family, justice, class warfare, etc.

Again, not physical phenomena, as viewed through the filter of social science.

> mathematics :
> The various phenomena related to quantity, structure, pattern,
> relations, space, and change such as measures of extent (area,
> distance, volume), scaling relations, congruence, topology for
> example the description and enumeration of knots and networks,
> rates of change, colorability, conversation of number, etc.

Not physical.

> The Four Color Theorem is an enjoyable and clear example of
> mathematics describing a physical phenomenon.

When applied to physicial phenomena, but the theorem is studied apart from its
physical applicability.

This supports the point made by James and others that science is not solely
concerned with physical phenomena. I think he should have picked a better
term than "involved in", perhaps "focused on".

--
Lew


== 15 of 18 ==
Date: Sat, Nov 29 2008 10:39 am
From: Lew


Daniel T. wrote:
> James Kanze <james.kanze@gmail.com> wrote:
>> On Nov 29, 2:57�am, "Daniel T." <danie...@earthlink.net> wrote:
>
>>> I argue that C++/Java programmers do help design the application.
>> But doesn't this depend on the process. In most cases I've seen,
>> the software developers are responsible for many aspects of low
>> level design. But it's not a given; a process could have a separate
>> design team, which specified everything in detail, to the point
>> where the developers only had to "pisser les lignes"; there
>> responsibility wouldn't be much more than that of a bricklayer.
>
> Many orginazations have attempted to relegate the programmer to "brick
> layer" status. The effort has been so phenomenally unsuccessful that
> there has been a backlash and now even attempts at reasonable high-level
> design are often met with derision.

At no level of software development can one afford not to be an engineer. It
is not "pisser des lignes".

--
Lew


== 16 of 18 ==
Date: Sat, Nov 29 2008 10:45 am
From: Lew


Lew wrote:
>> If you are speaking of the United States, one has the First
>> Amendment right to call oneself whatever one likes.

James Kanze wrote:
> Where does it say that in the first amendment? I can't find it.

"Congress shall make no law ... abridging the freedom of speech ..."

It's not a very long amendment, and it's commonly referred to as "freedom of
speech". Rather hard to miss.

Lew wrote:
>> I can call myself President of the United States or God,
>> should I so choose. (Since no one agrees on what or if God
>> is, that last one has no conceivable actionable consequences
>> at law.)

James Kanze wrote:
> I don't know about God, but you cannot enter into a contract as
> the President of the United States; only one person has a legal
> right to that title.

Entering into a contract is a specific act that is not "calling oneself" a
title. The First Amendment doesn't cover that.

James Kanze wrote:
> Closer to home, you cannot open an office as a doctor unless you
> have legally recognized qualifications.

Again, that is action other than speech.

> What you call yourself in private circles probably won't cause
> any problems, as long as no one decides to prosecute.

It's not even actionable if they do.

> If you present yourself publicly as an M.D. however, you'd better have
> the corresponding qualifications, or you'll have legal problems.

Only if you engage in certain specific acts for which it's a requirement.
Simple self-description isn't one of them.

--
Lew


== 17 of 18 ==
Date: Sat, Nov 29 2008 10:48 am
From: Lew


LR wrote:
> Are you sure about this in the US? From what I know, almost every
> physician in the US is an AMA member, but I was unaware that it was a
> requirement to be a member.

In Maryland, at least, the requirement isn't to be an AMA member but to be
board-certified by the State Board of Medical Examiners. (They also certify
acupuncturists, making acupuncture a full-fledged medical profession in
Maryland.) Part of the certification requirement is to have an appropriate
academic degree.

--
Lew


== 18 of 18 ==
Date: Sat, Nov 29 2008 10:58 am
From: Tom Anderson


On Sat, 29 Nov 2008, Ian Collins wrote:

> Tom Anderson wrote:
>> On Sat, 29 Nov 2008, Ian Collins wrote:
>>
>>> LR wrote:
>>>
>>>> When an engineer designs a bridge, they may for example try to figure
>>>> out how the bridge will react to a given load. They may try this for
>>>> various loads. The load limit is determined by physics.
>>>>
>>>> What is the analogous thing for software?
>>>
>>> The Roman or medieval bridge builder who pre-dated the discovery of
>>> physics?
>>
>> Despite what the Civ2 tech tree may say, the building of bridges by
>> Romans and medievals was not done without the aid of physics. Indeed,
>> the mechanics needed to build bridges, siege engines, and other such
>> staples of the ancient world was well advanced in classical Greece. They
>> didn't have calculus, or quite such an integrated picture of physics,
>> but they had plenty of quantitative rules.
>
> Which is probably where software engineering is now.
>
>>> The Roman or medieval bridge builder was no less of an engineer than
>>> today's bridge builder. If anything he was more of an engineer because
>>> he didn't have machines to do his donkey work for him.
>>
>> The Greeks built tools to calculate cube roots, which were essential to
>> the design of those big spear-throwing siege engines - oxybeles, i seem
>> to remember they're called.
>>
>> Although the mathematics they used was empirical, rather than being
>> based on theory.
>
> Which is probably where software engineering is now.

I don't think so. I don't think we're even at that stage.

>>> Maybe every software application has its own set of physical laws?
>>
>> If so, i don't think they'd qualify as laws, would they?
>
> Why not? For all we know, there might be an infinite number of parallel
> universes each with their own set of physical laws.

True, but we don't build each bridge in a different one. Universality has
long been considered a fundamental requirement for scientific laws.

tom

--
This is your life and it's ending one minute at a time.

==============================================================================
TOPIC: Types through a macro
http://groups.google.com/group/comp.lang.c++/t/bb3a4df299d49059?hl=en
==============================================================================

== 1 of 1 ==
Date: Sat, Nov 29 2008 6:29 am
From: courpron@gmail.com


On 29 nov, 13:32, Kaba <n...@here.com> wrote:
>  wrote:
> > On 28 nov, 23:48, Kaba <n...@here.com> wrote:
>
> > > The thing that motivates me to search for this kind of solution is this:
>
> > >http://kaba.hilvi.org/Programming_C++/Texts/Restricted_Deduction.htm
>
> > I've quickly checked your article about restricted deduction.
> > It seems to me that there is a simple solution using type traits, that
> > resolves the problems you described.
>
> Yep, it is essentially the attempt 4 on the article.

Yes, I read too quickly and I didn't see that attempt. It is indeed
rather similar to what I proposed.

> However, using a separate Identity metafunction is more generic.

Question is : " does we really need this generecity, since we control
the declaration of the class ?"

Generally, you use the identity function from a library, boost for
example (otherwise the "identity" solution is obviously the worst one
since you have to declare the identity structure each time).

So the identity solution requires :
-including the header :
#include "...."

- taking care of the namespace of identity :
boost::mpl::identity<...>


On the other hand, the type_trait solution just need a nested
typedef :
typedef Type type_trait;

Since a typedef is as short and as simple as an inclusion of a file,
generecity doesn't bring here anything in terms of DRY (don't repeat
yourself) ; except if you already include that header because, by
chance, your class needs elsewhere the identity structure or any other
structure present in the header.

It seems that, with the identity solution, you have to write more
code, you depend on an external structure and on an (additional)
library, and you put more stress on the compiler.

Note that this can be more of a general debate about the (abusive) use
of generic code.


Alexandre Courpron.


==============================================================================
TOPIC: Dereferencing a list Structure
http://groups.google.com/group/comp.lang.c++/t/8c5c4aff6ded0433?hl=en
==============================================================================

== 1 of 2 ==
Date: Sat, Nov 29 2008 7:02 am
From: Rolf Magnus


Mike Copeland wrote:

> In the following code, I get a C2679 error that I don't know how to
> handle. The error says I don't have a "binary = operator", but I don't
> know what that means, nor how to correct it.

There is no such thing as a binary = operator.

> I guess the cause of the problem lies with the string within the
> struct, but I need the comparison operator for the sort, don't I?

Yes. The comparison operator has nothing to do with it. Didn't your compiler
tell you which operator= it wants? It doesn't know how to assign a string to
a TIMESTRUCT, because you didn't write such an operator.
I'd say that instead of this:

> workTime = timeIter->time_bib; <- C2679 error

You actually want:

workTime = *timeIter;

== 2 of 2 ==
Date: Sat, Nov 29 2008 7:02 am
From: Rolf Magnus


Mike Copeland wrote:

> In the following code, I get a C2679 error that I don't know how to
> handle. The error says I don't have a "binary = operator", but I don't
> know what that means, nor how to correct it.
> I guess the cause of the problem lies with the string within the
> struct, but I need the comparison operator for the sort, don't I?

Yes. The comparison operator has nothing to do with it. Didn't your compiler
tell you which operator= it wants? It doesn't know how to assign a string to
a TIMESTRUCT, because you didn't write such an operator.
I'd say that instead of this:

> workTime = timeIter->time_bib; <- C2679 error

You actually want:

workTime = *timeIter;


==============================================================================
TOPIC: binary format of the number.
http://groups.google.com/group/comp.lang.c++/t/bf11dd6e68624537?hl=en
==============================================================================

== 1 of 1 ==
Date: Sat, Nov 29 2008 7:53 am
From: Gennaro Prota


James Kanze wrote:
> I suspect that the main reason C++ doesn't support binary
> literals is because C doesn't, and the main reason C doesn't is
> because no one has proposed them to the committee.

They were proposed for C++, as early as in 1993, together with
other lexical-related improvements (n0259). I don't know why
they were rejected, but the general committee attitude seems to
be way less conservative now: in fact, the current draft allows
defining a "literal operator" (which is not an operator; very
bad naming), such as:

unsigned long operator "" b( char const * ) ;

or a "literal operator template":

template< class ... Types >
unsigned long operator "" b() ;

and have whichever of them you define called for literals with
the b suffix:

11000111b

Hmm.

--
Gennaro Prota | name.surname yahoo.com
Breeze C++ (preview): <https://sourceforge.net/projects/breeze/>
Do you need expertise in C++? I'm available.

==============================================================================
TOPIC: Initialising a constant object
http://groups.google.com/group/comp.lang.c++/t/1d73105076e0e724?hl=en
==============================================================================

== 1 of 1 ==
Date: Sat, Nov 29 2008 8:28 am
From: "Fraser Ross"


>> Am I right in thinking that a constant object of a class must have an
>> accessible user provided constructor if it is not list-initialised?

>You are quite right.

class B {
};

class A {
B b_;
public:
A() {}
};

B const b={};
A const a;

void func() {
B const b={};
A const a;
}

Borlands compiler confirms my deductions with the above code.

Fraser.

==============================================================================
TOPIC: What is the difference between .cpp + .h vs .cxx and .hxx ?
http://groups.google.com/group/comp.lang.c++/t/e664fec03455e417?hl=en
==============================================================================

== 1 of 1 ==
Date: Sat, Nov 29 2008 8:30 am
From: nick


Patrick Brehmer wrote:
> What is the difference between the two pairs of extensions?
> A long time I know I only .h + .cpp
>
> When and why was the other pair introduced?
>
> Can I mix them in one and the same project?
>
> Patrick
>

it is compiler dependent but with some compilers you can even make a
file names blank.notcpp and include it by saying

#include <blank.notcpp>

however its good programing practice to choose the extention that makes
the most sence. i usualy just use .cpp and .h however headers can alos
be .hpp, c++ files can still be in a .c file if the compliler is c++...


==============================================================================
TOPIC: Basic .H/.CPP Location Question
http://groups.google.com/group/comp.lang.c++/t/6056e1d45918a0f9?hl=en
==============================================================================

== 1 of 1 ==
Date: Sat, Nov 29 2008 10:09 am
From: NvrBst


On Nov 29, 2:26 am, James Kanze <james.ka...@gmail.com> wrote:
> On Nov 29, 1:03 am, NvrBst <nvr...@gmail.com> wrote:
>
> > This seems like a very basic question but I can't seem to
> > google the answer.  Should the .H and .CPP always be in the
> > same directory?  Or is it safe to put all my ".h" file in a
> > "inc" folder, and all my .cpp files in a "src" folder?
>
> There's no real rule.  Different projects organize things in
> different ways.
>
> > MSDN says (#include"") "This form instructs the preprocessor
> > to look for include files in the same directory of the file
> > that contains the #include statement, and then in the
> > directories of any files that include (#include) that file.".
> > How is the 2nd part of the statment possible?
>
> In what way shouldn't it be possible?  (Note that not all
> compilers support that second part.)
>
> > For example
> > MyProj1/inc/*.h
> > MyProj1/src/*.cpp
>
> > MyProj2/inc/*.h
> > MyProj2/inc/*.cpp
> > Say a file in MyProj2 wants to include something in the "MyProj1/inc"
> > folder, it'd go "include <MyProj1File.h>" and then add   -I"path/
> > MyProj1/inc"  to the command line, would I also have to add the source
> > directory   -I"path/MyProj2/src"?
>
> First, you'd probably want to use ``#include "MyProj1File.h"'';
> the <...> form is for "system" headers.  And why would you have
> to add the source directory to the list?  You're not including
> anything from it.  (Also, I'm very dubious about including a
> header from another project.  Normally, you would export the
> project at some point when it is stable, and include the header
> from where ever you exported it to.)
>
> > This is just a cosmetic thing, I'm a little new to C++ and
> > wanted to know if I'd be laughed out of the room by having
> > seperate "inc" and "src" folders,
>
> Certainly not.  It seems to be a common organization for
> freeware.
>
> > and also how a header file finds it's source file (aka just
> > magic, the -I flag, or something else).
>
> The header file doesn't find its source file.  It has no need of
> the source file.  The linker will need to find the corresponding
> library, of course, so you'll have to provide the appropriate
> flags there.
>
> --
> James Kanze (GABI Software)             email:james.ka...@gmail.com
> Conseils en informatique orientée objet/
>                    Beratung in objektorientierter Datenverarbeitung
> 9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Thanks, I understand it better now -headers don't need their source
files-; that was the part that was tripping me up. :) So I just have
to find the "-I" equavalent(maybe same) flag for the linker (pointing
to the .o files). Thanks again.


==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.c++"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.c++?hl=en

To unsubscribe from this group, send email to comp.lang.c+++unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c++/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

No comments: