Sunday, September 2, 2018

Digest for comp.lang.c++@googlegroups.com - 21 updates in 4 topics

James Kuyper <jameskuyper@alumni.caltech.edu>: Sep 02 05:28PM -0400

On 09/02/2018 01:38 PM, Chris Vine wrote:
> On Sun, 2 Sep 2018 12:28:01 -0400
> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
...
> commenting on the extent to which C++ has equivalents to _Bool,
> _Complex, _Imaginery, _Alignas, _Alignof, _Atomic, _Noreturn,
> _Static_assert and _Thread_local ...
 
Neither was I. I was making a point about how both language standards
have been carefully written to coordinate with each other, making the
fact that they use different spellings for those features a very minor
problem to solve.
 
> ... (it does have equivalents, albeit
> bool is a macro in C stdbool.h, and a type in C++ stdbool.h and
> cstdbool); it was that the fact that C++ doesn't support these names
 
My point was that both languages do support <stdbool.h>, and if it is
used, both languages do support "bool", so the fact that C++ doesn't
support _Bool, and that C doesn't support "bool" unless <stdbool.h> is
#included, isn't very important.
 
> restrict qualifier and is incompatible in other ways) means that VLAs
> are not "pretty much the only real issue preventing C++ being a proper
> superset of C".
 
I have no disagreement with that point, I was merely pointing out that
the other issues you raised were substantially less problematic that
those issues.
 
> If you were suggesting C++ stdbool.h has to provide _Bool, that is
 
No, I was suggesting that a fully conforming C implementation of
<stdbool.h> has to define a macro named bool which must expand to _Bool
(C2011 7.18p2), while a fully conforming C++ implementation of C++ is
prohibited from #defining that macro (n4567.pdf, 18.10p8), with the net
result that code can be written to compile with either language by
#including <stdbool.h> and using bool. Do you disagree with any part of
that suggestion?
James Kuyper <jameskuyper@alumni.caltech.edu>: Sep 02 05:33PM -0400

On 09/02/2018 12:46 PM, Stefan Ram wrote:
>> is in C. Is that out-of-date?
 
> Both David Bowie and Fidel Castro were still alive when
> n4567 was published.
 
I've been programming computers since 1976. The date on n4567.pdf is
2015-11-09, which counts as recent events by my standards. My twins were
born that same year, an event that sticks in my memory much better than
either of the other two you mentioned.
 
> The most recent C++ draft I am aware of is n4762 as of
> 2018-07-07. It mentions »_Pragma«:
 
So the spelling is still the same between the C and C++ standards. Good.
James Kuyper <jameskuyper@alumni.caltech.edu>: Sep 02 06:03PM -0400

On 09/02/2018 05:28 PM, James Kuyper wrote:
,,,
> (C2011 7.18p2), while a fully conforming C++ implementation of C++ is
 
That should have been "implementation of <stdbool.h>".
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Sep 03 12:27AM +0100

On Sun, 2 Sep 2018 17:28:31 -0400
> On 09/02/2018 01:38 PM, Chris Vine wrote:
[snip]
> have been carefully written to coordinate with each other, making the
> fact that they use different spellings for those features a very minor
> problem to solve.
 
OK. Your postings are sometimes in a style which takes some reading.
When replying to a posting, if you are raising a different point than
the one made in the posting to which you are replying it would help me
at least if you were to indicate that more explicitly.
 
Do I agree with your point? That's a difficult one because as I said I
don't write code intended to be both valid C and valid C++ apart from
headers, and I don't know of anyone else who does so. That does not
mean no one is doing it. But isn't 'bool' something of a special case?
For things like _Alignas and _Alignof you would need to litter your
code with #ifdef's providing a C version and a C++ version of the
alignment specification to make it compilable in both languages. But
how would you make std::complex and _Complex implementations work
together in the same code? I am not convinced that they are intended
for that.
 
If all you are saying is that these things have been designed (apart
possibly from _Complex) to make it not too difficult to port your C
code to C++, then that is probably true. There has been a definite
effort for the runtimes to be workable together; in consequence the
respective specifications for the memory model and threads and atomics
are supposed to be equivalent.
 
> result that code can be written to compile with either language by
> #including <stdbool.h> and using bool. Do you disagree with any part of
> that suggestion?
 
No, not really, although I still would not put 'bool' in a header
intended to be used in both C99 and C++. As far as I am aware there is
no requirement for C _Bool and C++ bool to be the same size. The
requirement for both is that objects of those types should evaluate to
either 1 or 0 for true and false respectively. It would be a poor
implementation which did have the types of different size however.
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Sep 02 01:39PM -0700

On 9/2/2018 3:15 AM, Rick C. Hodgin wrote:
>> radically beautiful and hyper intelligent being, far beyond any human
>> capability. It preaches total peace, and demands no war.
 
> Satan is only evil, the father of lies, the cause of all war.
 
When the beast returns, it comes in total peace. Satan will trick a heck
of a lot of people into thinking that it is indeed the real Jesus.
 
 
 
Ian Collins <ian-news@hotmail.com>: Sep 03 08:43AM +1200

On 03/09/18 08:39, Chris M. Thomasson wrote:
 
> When the beast returns, it comes in total peace. Satan will trick a heck
> of a lot of people into thinking that it is indeed the real Jesus.
 
But no one will be tricked into thinking this has anything to do with C++...
 
--
Ian.
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Sep 02 03:31PM -0700

On 9/2/2018 1:43 PM, Ian Collins wrote:
>> of a lot of people into thinking that it is indeed the real Jesus.
 
> But no one will be tricked into thinking this has anything to do with
> C++...
 
Amen! Sorry for indulging here, well, at least it is all bottled up in a
single thread. ;^o...
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 02 06:39PM -0400

On 09/02/2018 04:39 PM, Chris M. Thomasson wrote:
>> Satan is only evil, the father of lies, the cause of all war.
 
> When the beast returns, it comes in total peace. Satan will trick a heck
> of a lot of people into thinking that it is indeed the real Jesus.
 
God is allowing people who have rejected Him (rejected truth)
to have what they desire. He's turning each sinner over to
their sin to degrade themselves by their own choices. This
will serve against them on Judgment Day.
 
What God offers everyone who will seek the truth is escape
from that judgment. It's why Jesus came to the Earth. It's
why He offers salvation to everyone without reservation (even
Adolf Hitler or some such person could be saved if they truly
repented and asked forgiveness).
 
It's why He has us still on the Earth teaching people these
things.
 
The only people who will worship the beast and take the mark
are those who are damned by their own refusal to hear the
truth, by their own refusal to accept it.
 
--
Rick C. Hodgin
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Sep 02 03:54PM -0700

On 9/2/2018 3:39 PM, Rick C. Hodgin wrote:
> will serve against them on Judgment Day.
 
> What God offers everyone who will seek the truth is escape
> from that judgment.
 
Afaict, all beings go through judgment. Some might have something like:
 
You ripped off a candy bar from a store when you were 7 years old.
 
Others might be:
 
you murdered millions of people!
 
There is a difference.
 
 
> why He offers salvation to everyone without reservation (even
> Adolf Hitler or some such person could be saved if they truly
> repented and asked forgiveness).
 
Adolf just might be up for a "parole" hearing after spending a (trillion
raised up to the billionth power) of years in jail, added to a lot more.
Since his soul never dies in this scenario, well, can this happen?
 
 
 
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 02 07:03PM -0400

On 09/02/2018 06:54 PM, Chris M. Thomasson wrote:
 
> Others might be:
> you murdered millions of people!
 
> There is a difference.
 
One sin condemns a soul to Hell forever:
 

https://www.biblegateway.com/passage/?search=Ezekiel+18%3A20&version=KJV
 
20 The soul that sinneth, it shall die. The son shall not
bear the iniquity of the father, neither shall the father
bear the iniquity of the son: the righteousness of the
righteous shall be upon him, and the wickedness of the
wicked shall be upon him.
 
Anyone guilty of sinning in one area of the law, is guilty of
all of the law:
 

https://www.biblegateway.com/passage/?search=James+2%3A10-12&version=KJV
 
10 For whosoever shall keep the whole law, and yet offend
in one point, he is guilty of all.
11 For he that said, Do not commit adultery, said also, Do
not kill. Now if thou commit no adultery, yet if thou
kill, thou art become a transgressor of the law.
12 So speak ye, and so do, as they that shall be judged by
the law of liberty.
 
The standard to get into Heaven is perfection. No one is or
can be perfect in and of themselves. It's why we all need
Jesus Christ to wash us clean of sin by His blood.
 
What does that mean, to "wash us clean of sin by His blood?"
 
God demands justice for sin. Either we will pay our own
justice for sin, or we can have a substitute. The only
substitute God has given us is His own Son, Jesus. Jesus
came here, lived a sin free life, was condemned by man,
yet was innocent before God. As such, He was condemned
to die by man's law, and was innocent before God, and
therefore chose voluntarily to take on the weight of sin
so that He would die with that sin rather than us. Those
who put their faith in Jesus and ask Him to forgive their
sin literally have their sin taken off of their books, off
of their account, and transferred to Jesus. This makes us
sin-free before God, which causes us to no longer be under
condemnation, which makes our spirit come alive, which then
gives us the born again spirit nature which changes us here
on this Earth.
 
Only Jesus was righteous enough to come here, and to return
to Heaven. It's why we need Him to forgive us, for all who
do are made righteous by His blood.
 
--
Rick C. Hodgin
Ian Collins <ian-news@hotmail.com>: Sep 03 11:05AM +1200

On 03/09/18 10:54, Chris M. Thomasson wrote:
 
> Others might be:
 
> you murdered millions of people!
 
> There is a difference.
 
Where does spamming Usenet sit in that spectrum?
 
--
Ian.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 02 07:08PM -0400

On 09/02/2018 07:03 PM, Rick C. Hodgin wrote:
> who put their faith in Jesus and ask Him to forgive their
> sin literally have their sin taken off of their books, off
> of their account, and transferred to Jesus.
 
You can see this dramatized at the end of this video:
 
Begins at 23:33:
https://www.youtube.com/watch?v=es7w8G6Q5oc&t=23m33s
 
 
> Only Jesus was righteous enough to come here, and to return
> to Heaven.  It's why we need Him to forgive us, for all who
> do are made righteous by His blood.
 
People do not realize what they're facing (because they're
dead in sin). It's why only those who are being saved can
hear the gospel message, and only those who can hear it and
respond to it will be saved.
 
--
Rick C. Hodgin
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 02 07:12PM -0400

On 09/02/2018 07:05 PM, Ian Collins wrote:
 
>> you murdered millions of people!
>> There is a difference.
 
> Where does spamming Usenet sit in that spectrum?
 
Spamming would be an offense, though probably not a sin in the
Biblical sense. However, teaching people about Jesus Christ is
not spamming, nor is asking legitimate questions about those
things related to Him, salvation, His Kingdom, prophecy, etc.
 
Ian, can you hear anything in your heart? Any calling from
God calling you to repent of your sin? Can you hear any still,
small voice calling out to you at all?
 
--
Rick C. Hodgin
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Sep 02 04:15PM -0700

On 9/2/2018 4:05 PM, Ian Collins wrote:
 
>> you murdered millions of people!
 
>> There is a difference.
 
> Where does spamming Usenet sit in that spectrum?
 
I have to admit that this is sounding like some other debates about how
C is the true ONE, and C++ is basically akin to the anti-Christ. I have
read other threads like that before: Lang Wars! Might be a funny name
for a sarcastic book. ;^)
geza.herman@gmail.com: Sep 02 01:09PM -0700

On Sunday, 2 September 2018 21:47:29 UTC+2, Öö Tiib wrote:
 
> > What do you think about this idea? Is it reasonable? How big is the change
> > to the standard?
 
> I think that you need to start from reasons.
 
The reason is simple: we can avoid to write "std::" in cpp files with "using namespace std;". With current techniques, we cannot avoid it in header files conveniently. With my idea, we could, if I'm not mistaken.
 
> Why most senior and expert level specialists dislike "using namespace std;" in header files?
 
Because with current techniques, we cannot use "using namespace std;" conveniently. But if we could, maybe these expert level specialists would use it in header files too. Or maybe they could tell, why my idea is wrong. But to be honest, I think it is a perfectly reasonable demand that we can avoid putting "std::" all over the place in header files (not just cpp files). There are a lot of cases, where this "std::" is just noise.
 
Note, I don't talk about "using namespace std" only. We can use it for other namespaces, not just "std". If my huge program uses "SuperDuperLibrary" all over the place, I'd like to able to use "using namespace SuperDuperLibrary;" in header files as well.
 
> Why lot of them dislike it even in cpp files?
 
And a lot of them says otherwise. For example: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rs-using
 
Please don't discuss this subject here. It is highly subjective. There are a lot of scenarios, where "using namespace std;" or other namespace is perfectly fine.
 
> Can you imagine where code bases use standard library? Is it really only
> inside of implementation of "void func()"?
Sorry, I don't understand what you mean here.
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 02 09:28PM +0100


>> Can you imagine where code bases use standard library? Is it really only
>> inside of implementation of "void func()"?
> Sorry, I don't understand what you mean here.
 
You say don't discuss it because it is highly subjective but it is
subjective as to whether the issue you are trying to address is actually a
problem in the first place.
 
/Flibble
 
--
"Suppose it's all true, and you walk up to the pearly gates, and are
confronted by God," Bryne asked on his show The Meaning of Life. "What
will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery
that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a
world that is so full of injustice and pain. That's what I would say."
"Öö Tiib" <ootiib@hot.ee>: Sep 02 01:58PM -0700

> demand that we can avoid putting "std::" all over the place in header
> files (not just cpp files). There are a lot of cases, where this
> "std::" is just noise.
 
You avoid answering. Why they started to dislike it? Why it was bad?
What it was that they experienced? What convinced them?
 
> "using namespace SuperDuperLibrary;" in header files as well.
 
> > Why lot of them dislike it even in cpp files?
 
> And a lot of them says otherwise. For example: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rs-using
 
Should I interpret that answer as "I do not know"? Ok I explain then.
One major event that convinced many was arrival of C++11. Several
large code bases used super-duper-library "boost" at side of "std".
Some added "using namespace std; using namespace boost;" in every cpp
file. Arrival of C++11 turned those code-bases into pile of hard to
repair junk.
 
 
> Please don't discuss this subject here. It is highly subjective. There
> are a lot of scenarios, where "using namespace std;" or other namespace
> is perfectly fine.
 
You do not want to even discuss the reasons why most expert level
specialists dislike "using namespace std;"? Then how you can dream of
removing these reasons?

> > Can you imagine where code bases use standard library? Is it really only
> > inside of implementation of "void func()"?
 
> Sorry, I don't understand what you mean here.
 
I also suspect that you do not understand what I ask. I several times
asked reasons that your fix supposedly removes and you say that "it
is highly subjective". Do you think that it is matter of taste like
whitespace usage e.g. do we write "if (x)" or "if(x)"?
geza.herman@gmail.com: Sep 02 02:15PM -0700

On Sunday, 2 September 2018 22:58:57 UTC+2, Öö Tiib wrote:
> > "std::" is just noise.
 
> You avoid answering. Why they started to dislike it? Why it was bad?
> What it was that they experienced? What convinced them?
Supposedly because it has a global effect. "using namespace" "leaked" from the header file into user code which uses the header file. Which is bad, of course, no doubt it. And maybe there are other reasons as well (you should tell, if you know any). But note, my idea doesn't have this "leak".
 
> Some added "using namespace std; using namespace boost;" in every cpp
> file. Arrival of C++11 turned those code-bases into pile of hard to
> repair junk.
Sure, there can be problems, if you are not careful. That doesn't make "using namespace" inherently bad. Have you read the link I put here?
 
 
> You do not want to even discuss the reasons why most expert level
> specialists dislike "using namespace std;"? Then how you can dream of
> removing these reasons?
I don't want to discuss it, because that's another discussion. And I repeat myself here: have you read the link I put here? I would consider Bjarne Stroustrup and Herb Sutter as expert level specialists. They don't dislike "using namespace std;".
 
> asked reasons that your fix supposedly removes and you say that "it
> is highly subjective". Do you think that it is matter of taste like
> whitespace usage e.g. do we write "if (x)" or "if(x)"?
You could explain instead what you meant here.
 
And I don't get this sentence either, what you mean here: "I several times asked reasons that your fix supposedly removes and ..."
Paavo Helde <myfirstname@osa.pri.ee>: Sep 03 12:55AM +0300

>>> to the standard?
 
>> I think that you need to start from reasons.
 
> The reason is simple: we can avoid to write "std::" in cpp files with "using namespace std;". With current techniques, we cannot avoid it in header files conveniently. With my idea, we could, if I'm not mistaken.
 
Well, we can avoid writing std::, but why should we? Losing a lot of
clarity for ... what? Saving 5 keystrokes?
 
In my code, there is no "using namespace std;" in either header or
source files. There are "using namespace ..." directives for some
tightly coupled neighbor projects though - which makes it even more wise
to avoid "using namespace std;", btw.
"Öö Tiib" <ootiib@hot.ee>: Sep 02 03:08PM -0700

> On Sunday, 2 September 2018 22:58:57 UTC+2, Öö Tiib wrote:
> > On Sunday, 2 September 2018 23:09:12 UTC+3, geza....@gmail.com wrote:
 
Snipping it a bit.
 
> > repair junk.
> Sure, there can be problems, if you are not careful. That doesn't make
> "using namespace" inherently bad. Have you read the link I put here?
 
How you suggest to be careful about what wasn't there when you wrote the
code years earlier?
 
The link:
"Here (obviously), the standard library is used pervasively and apparently
no other library is used, so requiring std:: everywhere could be
distracting."
 
OK, that is careful.
 
You:
"If my huge program uses "SuperDuperLibrary" all over the place, I'd like
to able to use "using namespace SuperDuperLibrary;" in header files as
well."
 
And that is not careful. I explained how that approach turned hundreds of
thousands of lines of code into junk.
 
It was because both standard library and super duper libraries evolve and
not being explicit what exactly you use from what library (when you use
several) can and eventually will result with an overload picked from
library that wasn't there when you wrote the code.
 
...
> And I repeat myself here: have you read the link I put here? I would
> consider Bjarne Stroustrup and Herb Sutter as expert level specialists.
> They don't dislike "using namespace std;".
 
You either did not read it yourself or you did not understand what it
said. How lot of different libraries most code bases use side-by-side?
Why to avoid reasons? Why to turn it into like-dislike and argument
from authority? Such arguments are fallacious.
Vir Campestris <vir.campestris@invalid.invalid>: Sep 02 09:41PM +0100

Juha, Alf, please keep it calm.
 
I want to hear from both of you. Even though I don't always agree.
 
Andy
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: