Monday, April 9, 2018

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

"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Apr 09 02:26PM -0700

On 4/8/2018 2:13 PM, Mr Flibble wrote:
>>> also posts using a Mac, whereas I advise everyone to totally shun Apple.
 
>> Why totally shun Apple?
 
> Rick probably shuns Apple because the CEO is gay, like me.
 
Hard to disagree with this. If Rick, God forbid, happened to develop
cancer in the future, and the best treatment happened to be created by a
gay person, well, would he even try it out? Humm...
gazelle@shell.xmission.com (Kenny McCormack): Apr 09 10:05PM

In article <paglpf$3j9$1@dont-email.me>,
Chris M. Thomasson <invalid_chris_thomasson@invalid.invalid> wrote:
...
 
>Hard to disagree with this. If Rick, God forbid, happened to develop
>cancer in the future, and the best treatment happened to be created by a
>gay person, well, would he even try it out? Humm...
 
Indeed. In fact, it's not hard to imagine that if Kiki came down with some
loathsome disease, and, upon inquiry, he found out that some medical
researcher had developed a cure for it, but then found out that said
researcher had used non-portable C code [*] as part of his research
activities.
 
Well, he would just have to politely, but firmly, decline the treatment.
 
[*] Such as, perhaps, relying on POSIX extensions to the C standards.
 
--
So to cure the problem of arrogant incompetent rich people we should turn
the government over to an arrogant incompetent trust fund billionaire
who knows nothing about government and who has never held a job in his
entire spoiled life?
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Apr 09 04:01PM -0700

On Monday, April 9, 2018 at 5:26:17 PM UTC-4, Chris M. Thomasson wrote:
> Hard to disagree with this. If Rick, God forbid, happened to develop
> cancer in the future, and the best treatment happened to be created by a
> gay person, well, would he even try it out? Humm...
 
Christians pray for people and seek to see them saved in eternity,
Chris. We teach people the truth, the ways of God, and that they
have sin and need to come to Jesus and ask forgiveness so they can
have their sin forgiven and enter in to eternity alive.
 
We are not here to judge. We are not here to condemn. We are here
to teach everyone the things God will judge, and the things God con-
demns.
 
Homosexuality is a sin, one explicitly named in that it will keep
a person out of Heaven in both the Old Testament and the New:
 
Old Testament:
 
https://www.biblegateway.com/passage/?search=Leviticus+18%3A22&version=KJV
 
22 Thou shalt not lie with mankind, as with womankind: it is
abomination.
 
New Testament:
 
https://www.biblegateway.com/passage/?search=1+Corinthians+6%3A9-10&version=KJV
 
Note: The King James Version calls the act "abusers of them-
selves with mankind," which was the term for homosexuality
in the 1600s.
 
9 Know ye not that the unrighteous shall not inherit the kingdom
of God? Be not deceived: neither fornicators, nor idolaters,
nor adulterers, nor effeminate, nor abusers of themselves with
mankind,
10 Nor thieves, nor covetous, nor drunkards, nor revilers, nor
extortioners, shall inherit the kingdom of God.
 
A more modern translation makes it clearer in our usage:
 
https://www.biblegateway.com/passage/?search=1+Corinthians+6%3A9-10&version=NIV
 
9 Or do you not know that wrongdoers will not inherit the kingdom
of God? Do not be deceived: Neither the sexually immoral nor
idolaters nor adulterers nor men who have sex with men[a]
10 nor thieves nor the greedy nor drunkards nor slanderers nor
swindlers will inherit the kingdom of God.
 
Footnotes:
[a] 1 Corinthians 6:9 The words men who have sex with men translate
two Greek words that refer to the passive and active participants
in homosexual acts.
 
Christians warn people of these things today because today you can
repent and be forgiven for your sin. If you die before being for-
given, there is only judgment, for the judgment of God looms over all
of mankind because of Adam's original sin:
 
https://www.biblegateway.com/passage/?search=Romans+5%3A12-21&version=KJV
 
12 Wherefore, as by one man sin entered into the world, and
death by sin; and so death passed upon all men, for that
all have sinned:
18 Therefore as by the offence of one judgment came upon all
men to condemnation; even so by the righteousness of one
the free gift came upon all men unto justification of life.
19 For as by one man's disobedience many were made sinners, so
by the obedience of one shall many be made righteous.
 
When Adam sinned we died spiritually. Our bodies are alive, but
only for a time. We have no spirit, no eternal life, of our own.
We are only here on a spirit quickening our body for the duration
of our days. Once those days are up, whenever that might be, we
are then solidified in our saved/unsaved state.
 
If you ever take the time to really think about these things,
Chris, you might begin to understand them.
 
-----
Christians are here to live our lives and serve God, teaching
others about who He is, why He came, why we need Him, and what
will happen to us without Him.
 
--
Rick C. Hodgin
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Apr 09 04:15PM -0700

On 4/9/2018 4:01 PM, Rick C. Hodgin wrote:
>> gay person, well, would he even try it out? Humm...
 
> Christians pray for people and seek to see them saved in eternity,
> Chris.
 
[...]
 
Would you consider using the treatment or not?
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Apr 09 02:48PM -0700

On 4/9/2018 7:40 AM, Rick C. Hodgin wrote:
> On Monday, April 9, 2018 at 10:28:22 AM UTC-4, Rick C. Hodgin wrote:
>> On Monday, April 9, 2018 at 10:09:15 AM UTC-4, Mr Flibble wrote:
[...]
> computer system from hardware to operating system to drivers to
> compilers to user apps, all as an offering to Jesus rather than
> to self
 
Would you flip out if Jesus totally passed on your vision? Remember what
happened to Cain...
 
[...]
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Apr 09 02:55PM -0700

On 4/9/2018 8:29 AM, Mr Flibble wrote:
>> are.
 
>> We would be stronger together than we are apart.
 
> I would rather stick pins in my eyes.
 
You forgot to add salt and concentrated lemon juice. ;^)
legalize+jeeves@mail.xmission.com (Richard): Apr 09 09:51PM

[Please do not mail me a copy of your followup]
 
Jorgen Grahn <grahn+nntp@snipabacken.se> spake the secret code
 
>He's right, of course: if you refactor your code in such a way that
>you have to read it all, every time, then that's /worse/ than one long
>function.
 
This is the same thinking that implies I have to read the implementation
details of the STL (or any other library) before I can use it in a
reasonably. Now maybe the reason you can't do this for your internal
classes is that you don't document them: no description of assumed
preconditions, guaranteed postconditions, purpose of each class, etc.
 
My experience with code bases has been that some, but not all, of the
code may be documented with such explanations, but it is generally
assumed that you will have to spend time understanding how the classes
work together and what the methods of the classes do. IMO, this is
not an argument against introducing new methods or classes. It is
only natural to add functions and methods are you add new
functionality.
 
What seems to be the rub on this discussion is the granularity of such
additions. The coworker referred to above feels that it should be
large grained functions that "do the feature". Large grained
functions are often full of lots of details of "how to do the feature"
and you have to juggle all those details in your head simultaneously
in order to understand the large function. The coworker may be able
to juggle all those details simultaneously, because *he* wrote them,
so they are *obvious* to him. The problem comes because they are not
obvious to anyone else *but* him. So, understanding by others is
impaired because we can't "see the forest for the trees", particularly
definition 2 as shown in wiktionary:
 
"(idiomatic, in the negative, by extension) To be overwhelmed by
detail to the point where it obscures the overall situation."
<https://en.wiktionary.org/wiki/see_the_forest_for_the_trees>
 
Many times my understanding of what is going on in a large function is
aided by doing Compose Method on the function and breaking it down
into a series of cohesive steps. That this is already the case is
usually hinted at by comments in the code:
 
// Get the frob for this widget
/* group of cohesive statements */
 
// Use the frob to perform the frannum
/* group of cohesive statements */
 
// Add the frob to the group of outstanding frobs
/* group of cohesive statements */
 
// Remove the frob from the group of pending frobs
/* group of cohesive statements */
 
etc.
 
This sort of coding style is acknowledging that there is already a
series of higher-order steps in this long function, they just couldn't
be bothered to extract those steps into cohesive functions.
 
Now there is a secondary issue I've seen with long functions. That is
separate from the issue of difficulty in understanding. It has to do
with the ability of our code to clearly represent the abstractions in
our problem domain and the consequences for reusability in a code
base. By analogy, consider that it is very hard to reuse the
Gettysburgh Address in it's totality (or even large chunks of it)
because it is deeply embedded in it's context. However, it is quite
easy to reuse the words from which the Address is written and it is
even possible to reuse phrases from that address.
 
The same is true for our code bases. Long functions with lots of
details prevent us from discovering the smaller, implied repeated
abstractions we could be using. The poster boy example is constantly
passing around int x and int y and doing low-level geometric
calculations instead of correctly identifiying a point_2d abstraction.
Yeah, it's not a huge abstraction. It's a concrete value class with a
couple well understood data members and some well defined, commonly
understood operations in the world of 2D point manipulation. It's not
a large class hierarchy with virtual functions and specializations
realized as derived classes. Still, it's an abstraction nonetheless,
and I would argue it has more of a chance of being reused than a large
class hierarchy. It lifts my code up from talking about raw integers
to talking about 2D points. If my domain is geometrically related,
I'm going to find much more use for 2D points as a concept in my code
and from there I can build further abstractions, e.g. the whole
canonical "2D shapes" library that might indeed involve virtual
functions.
 
We'll never discover those small or intermediate abstractions if we
insist on working at the lowest level of detail. I would argue that
those small and intermediate abstractions are worth much more than
large polymorphic class hierarchies because they tend to get used
everywhere and lift up the entire code base. Otherwise, we might as
well be programming in BASIC where everything is jam-fitted into
integer, float-point and string values. The whole point of using C++
is to identify the "zero-overhead abstractions" that lift us up out of
details.
 
Creating objects that represent abstractions from the problem domain
is the entire topic of Eric Evans "Domain Driven Design" book and goes
into much more detail about how to apply this thinking beyond simple
value types like point_2d. I highly recommend it.
<https://amzn.to/2EyHWVU>
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Terminals Wiki <http://terminals-wiki.org>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Apr 09 02:32PM -0700

On 4/9/2018 8:20 AM, Jorgen Grahn wrote:
>> blocked up by other concurrent tasks that happen to have some writes...
 
> I /do/ believe there are people who are interested in this stuff,
> but they don't seem to read comp.lang.c++ ...
 
Damn. Well, this simple proxy collector can help out. It is not the most
efficient solution, but it gives an idea on how something like this can
be implemented in pure C++ 11. Unfortunately, the following group seems
to have less traffic:
 
https://groups.google.com/forum/#!forum/lock-free
 
Argh!
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: