Wednesday, August 31, 2022

Digest for comp.lang.c++@googlegroups.com - 1 update in 1 topic

Lynn McGuire <lynnmcguire5@gmail.com>: Aug 30 08:29PM -0500

On 8/29/2022 8:35 PM, Lynn McGuire wrote:
> statement after the label ?
 
> Thanks,
> Lynn
 
Thanks to all ! I now understand a little bit better. I've been
programming in Fortran for 47 years, C for 35 years, and C++ for 20
years. I always like learning a little bit more about each.
 
Lynn
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.

Tuesday, August 30, 2022

Digest for comp.lang.c++@googlegroups.com - 14 updates in 2 topics

Lynn McGuire <lynnmcguire5@gmail.com>: Aug 29 08:35PM -0500

I just found out that a label at the end of a c/c++ function must have
an executable statement after it.
 
int aMethod ()
{
int aFakeVar = 0;
 
goto aLabel;
 
aLabel:
 
aFakeVar++;
}
 
Is there any way to get around the requirement of the executable
statement after the label ?
 
Thanks,
Lynn
Sam <sam@email-scan.com>: Aug 29 10:42PM -0400

Lynn McGuire writes:
 
> }
 
> Is there any way to get around the requirement of the executable statement
> after the label ?
 
There are two options:
 
1) get rid of the label and the goto. The more goto-s get written, the more
likely is it for Chulhu to appear and bring humanity to an end. Very messy.
 
2) a single semicolon should be executable enough. I'm too lazy to check. In
any case
 
if (0)
;
 
will definitely work.
Ike Naar <ike@sdf.org>: Aug 30 05:50AM

> }
 
> Is there any way to get around the requirement of the executable
> statement after the label ?
 
Put an empty statement after the label:
 
int aMethod()
{
/* ... */
goto aLabel;
/* ... */
aLabel:
;
}
 
or use ``return'' instead of ``goto'':
 
int aMethod()
{
/* ... */
return;
/* ... */
}
Bo Persson <bo@bo-persson.se>: Aug 30 09:14AM +0200

On 2022-08-30 at 03:35, Lynn McGuire wrote:
> }
 
> Is there any way to get around the requirement of the executable
> statement after the label ?
 
Not right now, but it will be allowed in C++23. :-)
 
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2324r2.pdf
Elephant <diespammer@yahoo.it>: Aug 30 10:14AM +0200

On 8/30/22 07:50, Ike Naar wrote:
 
> return;
> /* ... */
> }
 
Preferebly with a value, since the signature says the function returns
an int :)
 
Seriously, the fact that the question was asked on a non void-returning
function is an additional code-smell over the goto in itself.
Anton Shepelev <anton.txt@g{oogle}mail.com>: Aug 30 12:46PM +0300

Sam:
 
> The more goto-s get written, the more likely is it for
> Chulhu to appear and bring humanity to an end.
 
I disagree. Structured use of GOTO's (the topic of a Knuch
article!), especially when they jump down and nest stack-
like can greately simplify certain code structures. They
help to avoid returns from mid-function, and let the
programmer execute common deinitialisation code. My standard
pattern of error-handling is based on GOTO's:
 
https://nedbatchelder.com/text/exceptions-vs-status.html#comment_15239
 
--
() ascii ribbon campaign - against html e-mail
/\ http://preview.tinyurl.com/qcy6mjc [archived]
Juha Nieminen <nospam@thanks.invalid>: Aug 30 11:20AM

> like can greately simplify certain code structures. They
> help to avoid returns from mid-function, and let the
> programmer execute common deinitialisation code.
 
That may be true in C, but C++ throws a spanner in the works because
of one fun feature: Exceptions.
 
If running the deinitialization code is crucial (or else for example
resources will be leaked, such as file handles left open), it won't
be run no matter how many gotos you use if anything along the line
throws an exception and it's not caught.
 
This is one of the main reasons to use RAII instead of gotos: Object
destructors will always be run no matter how the function is exited,
be it an early return, be it an exception.
 
As a bonus, if you implement it properly, the code will actually become
cleaner.
scott@slp53.sl.home (Scott Lurndal): Aug 30 01:21PM

>}
 
>Is there any way to get around the requirement of the executable
>statement after the label ?
 
Your function is missing a return statement.
gazelle@shell.xmission.com (Kenny McCormack): Aug 30 02:44PM

In article <99oPK.21145$6Il8.5192@fx14.iad>,
 
>>Is there any way to get around the requirement of the executable
>>statement after the label ?
 
>Your function is missing a return statement.
 
Or they misspelled "void" as "int".
 
P.S. Why is this also posted to a Fortran group?
 
--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/InsaneParty
Opus <ifonly@youknew.org>: Aug 30 08:15PM +0200

Le 30/08/2022 à 11:46, Anton Shepelev a écrit :
> programmer execute common deinitialisation code. My standard
> pattern of error-handling is based on GOTO's:
 
> https://nedbatchelder.com/text/exceptions-vs-status.html#comment_15239
 
This is a relatively common pattern in C, and I also use it occasionally
(meaning, not in all cases.)
 
I find it quirky though, and it works for lack of better flow control in
C. Something that is sometimes implemented as "defer" in other languages.
Lynn McGuire <lynnmcguire5@gmail.com>: Aug 30 04:08PM -0500

On 8/30/2022 9:44 AM, Kenny McCormack wrote:
 
>> Your function is missing a return statement.
 
> Or they misspelled "void" as "int".
 
> P.S. Why is this also posted to a Fortran group?
 
Because I typed comp.lang.c into Thunderbird and Thunderbird graciously
also put comp.lang.fortran in there for me which I did not notice.
 
Lynn
Anton Shepelev <anton.txt@gmail.com>: Aug 31 01:04AM +0300

Lynn McGuire to Kenny McCormack:
 
 
> Because I typed comp.lang.c into Thunderbird and
> Thunderbird graciously also put comp.lang.fortran in there
> for me which I did not notice.
 
Amazing grace. Did you mean `gratuitiously'?
Manfred <noname@add.invalid>: Aug 30 02:28AM +0200

On 8/29/2022 3:56 PM, Marcel Mueller wrote:
> The latter was likely the problem. The automatically generated move or
> copy constructor probably somehow generated a dangling reference.
 
> Marcel
 
If you have virtual functions, then it's not a POD.
Richard Damon <Richard@Damon-Family.org>: Aug 30 07:49AM -0400

On 8/29/22 9:44 AM, Marcel Mueller wrote:
 
>> I can see it happening with threads (the constructor/destructor is in
>> a different Thread).
 
> That's UB. Anything can happen.
 
Yep, and the error mentioned is one of them.
 
 
> The compiler should prevent that kind of slicing because no variable of
> an abstract type can exist.
 
> Marcel
 
That's why I said "Not Sure". I wasn't going to say definitively that it
wasn't possible.
 
The comment about accessing the distructed object was one way to get
such a sliced object (but again, invoking Undefined Behavior).
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.

Digest for comp.programming.threads@googlegroups.com - 1 update in 1 topic

Amine Moulay Ramdane <aminer68@gmail.com>: Aug 29 04:24PM -0700

Hello,
 
 
 
 
More of my philosophy about the stock price and about bitcoin and more of my thoughts..
 
I am a white arab from Morocco, and i think i am smart since i have also
invented many scalable algorithms and algorithms..
 
 
Microsoft stock price stood in year 2022 at $268.09
 
According to the latest long-term forecast, Microsoft price will hit $300 by the end of 2022 and then $400 by the middle of 2025. Microsoft will rise to $500 within the year of 2026, $600 in 2027, $700 in 2028, $800 in 2031 and $900 in 2033.
 
 
Read more here:
 
Microsoft Stock Forecast 2022 - 2025 - 2030
 
https://coinpriceforecast.com/msft#:~:text=Microsoft%20stock%20price%20stood%20at,2031%20and%20%24900%20in%202033.
 
 
I think i am highly smart since I have passed two certified IQ tests and i have scored above 115 IQ, and i think that my below thoughts
about investments in stocks is valid, since look at the above example
at the Mircrosoft stock prices above, the first thing to notice is that
it is just a forecast, but as i am saying below that it is
too risky, since you have to diversify your investment by
for example investing in index funds as i am explaining it
below, and second important thing to notice is that the stock
price is the current price that a share of stock is trading for on the market , but it looks by analogy like the bitcoin currency, since
it also follows demand and supply, but i think that investing in
the stocks is better than investing in bitcoin, since there is
a return of investment in stocks that also permits you to sell much easily your shares of stock, and i think that this return of investment doesn't exist in bitcoin, also i think bitcoin has still much lesser value.
 
 
Here is my new proverb:
 
 
"When you see a giant killer wave coming to swallow you,
you have not to waste your time at being pessimistic,
but i think you have to know how to beautifully swim so that
to survive the giant killer wave. And i think it is my kind of spirit,
and notice that it is by logical analogy like my way of being the
good vibes that i am talking about below, even if our world
is too much pessimistic."
 
More of my philosophy about the good vibes and about Love and more of my thoughts..
 
I am a white arab from Morocco, and i think i am smart since i have also
invented many scalable algorithms and algorithms..
 
 
How can we Love when we are no more innocence ? and when we are no more adolescence ? so i think that there is still a beautiful "kind" of Love
and it is a kind of Love that comes from the good vibes, and i think that the good vibes also come from a wise spirit, and take for example a look at my following poems that i have invented quickly, and i think that you have to notice the good vibes in them, since i think that i am both showing my good vibes in form of my poems of Love and i am also showing my wise kind of spirit in form of my other poems, and this kind
of wise spirit of mine is also like the good vibes of like being good professionalism, and i think that the good vibes also make the good fans (i mean the when you are fan of someone) and attracts customers in business, and it is my way of doing in business, and notice that those good vibes are a first step to a trustworthy relationship, since i can also say that you cannot love without trusting a person. Since i think that trust is the building block of love. Just like how a child trusts her mother and thereby loves her, your partner needs to know that you are trustworthy and won't ditch them in difficult times. This feeling is important for love to sprout and flourish. Trust is also very important for Business Relations in the Arab World, so i invite you to read the following interesting article from the Arab world about it:
 
Al-Ississ: Trust is at the Heart of Business Relations in the Arab World
 
https://www.aucegypt.edu/news/stories/al-ississ-trust-heart-business-relations-arab-world
 
So i invite you to look at my following poems in english and french
in the following web link so that to notice my good vibes in them:
 
https://groups.google.com/g/alt.culture.morocco/c/NOpq_uc2gOg
 
 
More of my philosophy about being a seller of Amazon products and more of my thoughts..
 
 
I have just said the following:
 
"I think i am highly smart since I have passed two certified IQ tests and i have scored above 115 IQ, I have quickly taken a look at Amazon profit margin and ROI(Return of investment), and i think by being a sellers of Amazon(or the like) products you can become rich, since you can buy in more quantity so that to lower the price of an Item of Amazon, so it is better for you if you have more money when you start selling Amazon products, and after that i think that you can use Amazon shipment strategy that easy the things for you, and after you make much more money by being a seller of Amazon products, you can invest a part of your money in index funds in stocks that have an average ROI of around 10%, so i think you can become rich by this way of doing, and i think that it is better than Real Estate investment."
 
 
But i think there is still a problem in the being a seller of Amazon products, and it is that when you are a seller and you buy more quantity of a product so that to lower the price of an Item, there is a "competition" in this process of buying more quantity of a product, like in the process of creativity below, so there can be others that can buy much more quantity than you, so that to lower more than you the price of an Item , so it is i think the problem, so i think so that to be successful as a seller of Amazon products, you have to have much more money when you start selling Amazon products and so that to "also" lower the Risk, also you have to know that in most cases, customers(that i think can be sellers of Amazon products) can request returns within 30 days of receiving their order, and this shows that it is not easy to become rich as i am explaining it below.
 
 
More of my philosophy about Real Estate investment and about
creativity and about stocks and bonds and more of my thoughts..
 
 
According to the National Council of Real Estate Investment Fiduciaries (NCREIF), as of Q1 2021 the average 25-year return for private commercial real estate properties held for investment purposes slightly outperformed the S&P 500 Index, with average annualized returns of 10.3% and 9.6%, respectively. Residential and diversified real estate investments also averaged returns of 10.3%, and i think that a good ROI for a rental property is usually above 10%, but 5% to 10% is also an acceptable range. Real estate investing can be lucrative, but it's important to understand the "risks". Key risks include bad locations, negative cash flows, high vacancies, and problem tenants. Other risks to consider are the lack of liquidity, hidden structural problems, and the unpredictable nature of the real estate market, so i think because of the Risks in Real Estate, i think it is in accordance with what i am saying below, so reread it carefully:
 
More of my philosophy about what about creativity and how to get rich and more of my thoughts..
 
I think i am highly smart since I have passed two certified IQ tests and i have scored above 115 IQ, and as you have just noticed i have
just said , read it below, that you can not get easily rich,
but as you have just noticed i have not taken into account the factor of creativity, so let us look at what the following web page is saying about creativity:
 
Everyone can be creative
 
https://edu.gcfglobal.org/en/creativity/everyone-can-be-creative/1/
 
 
But i think i am highly smart, and i say that what is not saying the
above web page, is that creativity is not just creativity , since
so that make much more money with your creativity, you have to be also
"competition" with the other humans that can be much better than you
in the kind of your creativity, so this can lesser the value of your creativity, so then we can not generalize and say that everybody can become rich or easily rich by being creative, and this is in accordance with what i am saying below, so reread it again:
 
 
More of my philosophy about Benjamin Franklin and about investments..
 
 
I am a white arab from Morocco, and i think i am smart since i have also
invented many scalable algorithms and algorithms..
 
I have just looked at the following video about the US. president Benjamin Franklin that talks about the EASIEST way to become rich:
 
https://www.youtube.com/watch?v=-hWbRmkVqhQ
 
 
I think i am highly smart since I have passed two certified IQ tests and i have scored above 115 IQ, and i am not in accordance with the US. president Benjamin Franklin in the above video, since let us take a look at the following interesting web page of the Investment growth calculator from Fidelity investments in Canada, since i am understanding it easily, and here it is and take a look at it carefully:
 
https://www.fidelity.ca/en/growthcalculator/
 
 
But notice that it is asking to put two important informations that are:
 
1- Rate of return
2- Inflation rate
 
 
But i think that for the long-term investment, the Inflation rate is not so important, so i think that we have to focus on the "Rate to return",
so i am highly smart, and i say that you can not be rich easily, since
you can not for example invest in stocks of this or that company
since it is so much more risky, so you have to "diversify" correctly by investing in index funds in stocks, since they are much less risky and i think that they have an average of around 10% of rate of return or return of investment, so i think that you can not get rich easily with it, since the Time to grow in the above calculator has to be set to around 40 years or so and this will permit you to have a "good" retirement, but it will not permit you to easily become rich, and i think that the Bond that is a fixed-income instrument that represents a loan made by an investor to a borrower (typically corporate or governmental) is not better in rate of return or return of investment than index funds, so then this shows that it is not easy to get generally rich for the people, and i mean "generally".
 
 
More of my philosophy about IQ tests and more of my thoughts..
 
 
I think i am highly smart, and I have passed two certified IQ tests and i have scored above 115 IQ, but i have just passed more and more IQ tests, and i have just noticed that the manner in wich we test with IQ tests is not correct, since in an IQ test you can be more specialized and above average in one subtest of intelligence than in another subtest of intelligence inside an IQ test, since IQ tests test for many kind of intelligences such as the spatial and speed and calculations and logical intelligence etc., so i think that you can be really above average in logical intelligence, as i am really above average in logical intelligence, but at the same time you can be below average in calculations and/or spatial.., so since an IQ test doesn't test for this kind of specializations of intelligence, so i think it is not good, since testing for this kind specializations in intelligence is really important so that to be efficient by knowing the strong advantages of this or that person in every types of intelligences. And about the importance of specialization, read carefully my following thought about it:
 
 
More of my philosophy about specialization and about efficiency and productivity..
 
The previous CEO Larry Culp of General Electric and the architect of a strategy that represented a new turning point in the world corporate strategies, Larry Culp's strategy was to divide the company according to its activities. Something like we are better of alone, seperately and
focused on each one's own activity, than together in a large
conglomerate. And it is a move from integration to specialization.
You see it is thought that a company always gains economies of scale
as it grows, but this is not necessarily the case, since as the company
gains in size - especially if it engages in many activities - it
also generates its own bureaucracy, with all that entails in term
of cost and efficiency. And not only that, it is also often the case
that by bringing together very different activities, strategic focus is lost and decision-making is diluted, so that in the end no one ends up
taking responsability, it doesn't always happen, but this reasons are
basically what is driving this increasing specialization. So i invite to look at the following video so that to understand more about it:
 
The decline of industrial icon of the US - VisualPolitik EN
 
https://www.youtube.com/watch?v=-hqwYxFCY-k
 
 
And here is my previous thoughts about specialization and productivity so that to understand much more:
 
More about the Japanese Ikigai and about productivity and more of my thoughts..
 
Read the following interesting article about Japanese Ikigai:
 
The More People With Purpose, the Better the World Will Be
 
https://singularityhub.com/2018/06/15/the-more-people-with-purpose-the-better-the-world-will-be/
 
I think i am highly smart, so i say that the Japanese Ikigai is like a Japanese philosophy that is like the right combination or "balance" of passion, vocation, and mission, and Ikigai and MTP, as concepts, urge us to align our passions with a mission to better the world, but i think that Japanese Ikiai is a also smart since it gets the "passion" from the "mission", since the mission is also the engine, so you have to align the passion with the mission of the country or the global world so that to be efficient, and Japanese Ikigai is also smart since so that to higher productivity and be efficient, you have to "specialize" in doing a job, but so that to higher more productivity and be more efficient you can also specialize in what you do "better", and it is what is doing Japanese Ikigai, since i think that in Japanese Ikigai, being the passion permits to make you specialized in a job in what you do better, and here is what i have just smartly said about productivity:
 
I think i am highly smart, and i have passed two certified IQ tests and i have scored above 115 IQ, and i will now talk about another important idea of Adam Smith the father of economic Liberalism, and it is about "specialization" in an economic system, since i say that in an economic system we have to be specialized in doing a job so that to be efficient and productive, but not only that, but we have to specialize in doing a job in what we do better so that to be even more efficient and productive, and we have to minimize at best the idle time or the wasting of time doing a job, since i can also say that this average idle time or wasting time of the workers working in parallel can be converted to a contention like in parallel programming, so you have to minimize it at best, and you have to minimize at best the coherency like in parallel programming so that to scale much better, and of course all this can create an economy of scale, and also i invite you to read my following smart and interesting thoughts about scalability of productivity:
 
I will talk about following thoughts from the following PhD computer scientist:
 
https://lemire.me/blog/about-me/
 
Read more carefully here his thoughts about productivity:
 
https://lemire.me/blog/2012/10/15/you-cannot-scale-creativity/
 
And i think he is making a mistake in his above webpage about productivity:
 
Since we have that Productivity = Output/Input
 
But better human training and/or better tools and/or better human smartness and/or better human capacity can make the Parallel productivity part much bigger that the Serial productivity part, so it can scale much more (it is like Gustafson's Law).
 
And it looks like the following:
 
About parallelism and about Gustafson's Law..
 
Gustafson's Law:
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.programming.threads+unsubscribe@googlegroups.com.

Monday, August 29, 2022

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

olcott <NoOne@NoWhere.com>: Aug 28 10:11PM -0500

On 8/28/2022 9:57 PM, Mike Terry wrote:
> and bow out comfortably... [the latter is actually not an unreasonable
> path for you]
 
> Mike.
 
I can't possibly publish *UNTIL AFTER I AM UNDERSTOOD*
 
If people fully understood what I am saying then they would understand
that that the dogma of computer science textbooks that say that H(P,P)
must base its halt status decision on the behavior of P(P) is incorrect.
 
They have to very carefully to go through every single detail of my
explanation of exactly how and why it is incorrect and
 
*utterly stop short-circuiting to the dogma*
*utterly stop short-circuiting to the dogma*
*utterly stop short-circuiting to the dogma*
 
One of the ways that they short circuit is to say that it is a
definition thus cannot be incorrect. A definition can be incorrect
*only* when it directly contradicts other correct definitions.
 
 
--
Copyright 2022 Pete Olcott
 
"Talent hits a target no one else can hit;
Genius hits a target no one else can see."
Arthur Schopenhauer
Juha Nieminen <nospam@thanks.invalid>: Aug 29 11:24AM


> When we study the theory of computation using physically existing
> machines such as the x86 architecture then the incoherent abstract ideas
> are shown to be incoherent in that they cannot be physically implemented.
 
You can't limit yourself to a particular computer architecture because if
you do, then your results are useless.
 
If, for example, we limit ourselves to the x86 computer architecture, then
in principle every single algorithm is technically either O(1) or can't be
computed. Which is a completely useless result.
olcott <NoOne@NoWhere.com>: Aug 29 01:01PM -0500

On 8/29/2022 6:24 AM, Juha Nieminen wrote:
 
> If, for example, we limit ourselves to the x86 computer architecture, then
> in principle every single algorithm is technically either O(1) or can't be
> computed. Which is a completely useless result.
 
By moving from an abstract model of computation where every detail is
merely imagined and never concretely demonstrated it is possible to
imaging that a decider must return a result to every caller even in the
case where the function call is not even executed.
 
When we move to a concrete model of computation we know that it is
utterly ridiculous that a program that is never executed produces any
output. From this we can know that decider are not supposed to return
any values when a function call to them is never actually executed.
 
void P(ptr x)
{
H(x, x);
return;
}
 
int main()
{
Output("Input_Halts = ", H(P, P));
}
 
 
_Px()
[00001102](01) 55 push ebp
[00001103](02) 8bec mov ebp,esp
[00001105](03) 8b4508 mov eax,[ebp+08]
[00001108](01) 50 push eax // push P
[00001109](03) 8b4d08 mov ecx,[ebp+08]
[0000110c](01) 51 push ecx // push P
[0000110d](05) e880fdffff call 00000e92 // call H
[00001112](03) 83c408 add esp,+08
[00001115](01) 5d pop ebp
[00001116](01) c3 ret
Size in bytes:(0021) [00001116]
 
H aborts its simulation of P as soon as H sees that P would call H at
machine address [0000110d] before this call is even executed.
 
According to what two people have said computer science requires
deciders to return values to their callers even if the call is never
executed.
 
--
Copyright 2022 Pete Olcott
 
"Talent hits a target no one else can hit;
Genius hits a target no one else can see."
Arthur Schopenhauer
Bonita Montero <Bonita.Montero@gmail.com>: Aug 29 04:48PM +0200

If you throw a system_error with system_category and a platform-specific
error code as an integer the error-code is translated by the runtime to
a platform-specific error string. I think under Windows FormatMessage()
is used and under Unix strerror() is used(). This translation is done
by the error_cateogy-subclass you supply while throwing the error.
Unfortunately under Windows this error string isn't localized. So I
wrote my own error_cagegory subclass for Win32 and Unix:
 
// xsystem_category.h
 
#pragma once
#include <system_error>
 
struct xsystem_category : public std::error_category
{
xsystem_category() = default;
xsystem_category( xsystem_category const & ) = delete;
virtual ~xsystem_category() override = default;
void operator =( xsystem_category const & ) = delete;
virtual char const *name() const noexcept override;
virtual std::error_condition default_error_condition( int code ) const
noexcept override;
virtual bool equivalent( int code, std::error_condition const
&condition ) const noexcept override;
virtual bool equivalent( std::error_code const &code, int condition )
const noexcept override;
virtual std::string message( int condition ) const override;
};
 
// xsystem_category.cpp
 
#if defined(_WIN32)
#include <Windows.h>
#elif defined(__unix__)
#include <string.h>
#include <locale.h>

Sunday, August 28, 2022

Digest for comp.lang.c++@googlegroups.com - 15 updates in 5 topics

olcott <NoOne@NoWhere.com>: Aug 28 02:47PM -0500

Since Turing machines are mathematical objects that only exist in the
mind people can have contradictory thus incoherent ideas about these
abstract mathematical objects and never realize that their ideas are
incoherent.
 
When we study the theory of computation using physically existing
machines such as the x86 architecture then the incoherent abstract ideas
are shown to be incoherent in that they cannot be physically implemented.
 
void Px(ptr x)
{
H(x, x);
return;
}
 
int main()
{
Output("Input_Halts = ", H(Px, Px));
}
 
If a decider must always return a value whenever it is called this
requires H to return a value to Px even though H is called in infinite
recursion.
 
This even requires that the function call from Px to H(Px,Px) must
return a value to Px even if this function call to H is not even
executed. In the physical model of computation it is an axiom the
programs that are not executed never return values because it is
physically impossible.
 
When simulating halt decider H sees that Px is about to call H(Px,Px) in
infinite recursion H aborts its simulation of Px before this call is
executed.
 
*Clearly computer science is incorrect on this point*
Computer science says that H must still return a value to Px even though
the call to H is not even executed because all deciders must ALWAYS
return to their caller.
 
 
--
Copyright 2022 Pete Olcott
 
"Talent hits a target no one else can hit;
Genius hits a target no one else can see."
Arthur Schopenhauer
Marcel Mueller <news.5.maazl@spamgourmet.org>: Aug 28 06:58PM +0200

Is there *any* scenario how this error can happen without any
constructor or destructor in the call stack?
 
 
Marcel
Richard Damon <Richard@Damon-Family.org>: Aug 28 01:12PM -0400

On 8/28/22 12:58 PM, Marcel Mueller wrote:
> Is there *any* scenario how this error can happen without any
> constructor or destructor in the call stack?
 
> Marcel
 
I can see it happening with threads (the constructor/destructor is in a
different Thread).
 
Not sure if there is any way to create or slice an object to result in
an "abstract" object.
Paavo Helde <eesnimi@osa.pri.ee>: Aug 28 08:37PM +0300

28.08.2022 19:58 Marcel Mueller kirjutas:
> Is there *any* scenario how this error can happen without any
> constructor or destructor in the call stack?
 
Sure, when you call via an invalid pointer where the object has been
already destroyed.
Lynn McGuire <lynnmcguire5@gmail.com>: Aug 27 10:40PM -0500

On 8/27/2022 5:24 PM, Thomas Koenig wrote:
>> subtracted from first: x--; *(x+i);.
 
> That's an f2c idiom, which is not valid C, AFAIK, because
> the pointer would point before the actual array.
 
While the second pointer is a bad pointer, it is not a illegal pointer.
Variables can point to anywhere, they are not illegal until referenced.
Otherwise, code would be crashing all over the place. If I malloc'd
some space, then free'd the space, and did not NULL the pointer, that
dangling pointer would crash if ever referenced (hopefully) but not if
it just hangs around.
 
I wish that C/C++ would provide some sort of pointer validation but it
does not. I keep track of my pointers for that reason and validate them
before using when I have some error prone code. In 850,000 lines of F77
and 30,000 lines of C/C++ code, I have suspicious pointers in several
areas due to programmers suballocating malloc'd space and forgetting to
nullify those suballocated pointers after freeing the allocated space.
Old code, you gotta love it.
 
Lynn
Keith Thompson <Keith.S.Thompson+u@gmail.com>: Aug 27 10:07PM -0700

> I malloc'd some space, then free'd the space, and did not NULL the
> pointer, that dangling pointer would crash if ever referenced
> (hopefully) but not if it just hangs around.
 
Computing a pointer before the beginning of an array causes undefined
behavior in C and C++, even if you never dereference it.
 
[...]
 
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */
Thomas Koenig <tkoenig@netcologne.de>: Aug 28 07:50AM

>> the pointer would point before the actual array.
 
> While the second pointer is a bad pointer, it is not a illegal pointer.
> Variables can point to anywhere, they are not illegal until referenced.
 
Unfortunately not.
 
Looking at n2596.pdf, one finds under J.2, "Undefined behavior",
 
— Addition or subtraction of a pointer into, or just beyond,
an array object and an integer type produces a result that does
not point into, or just beyond, the same array object (6.5.6).
 
> Otherwise, code would be crashing all over the place.
 
Undefined behavior does not mean that the code will reliably crash.
It just says that the C standard gives no guarantee about what will
happen, and, even if it works right now, such code is at the mercy
of future compiler revisions, cosmic rays, and other forseen and
unforseen circumstances.
"Fred. Zwarts" <F.Zwarts@KVI.nl>: Aug 28 10:01AM +0200

Op 27.aug..2022 om 22:01 schreef Lynn McGuire:
 
> Yup.  So Fortran x(i) is equivalent to *(x+i-1).  Or, the x is
> subtracted from first: x--; *(x+i);.
 
> Lynn
 
I don't understand the idea of x--. Why modifying x? What happens if x
is indexed later again?
Thomas Koenig <tkoenig@netcologne.de>: Aug 28 08:14AM


>> Lynn
 
> I don't understand the idea of x--. Why modifying x? What happens if x
> is indexed later again?
 
The idea is to use this modified pointer for one-based array
accesses, so that it would be possible to translate Fortran's A(1)
into a[1] on the C side, or A(N) into a[n].
 
The correct way to do this according to the C standard would be to
translate A(N) into a[n-1] on the C side. There are several reasons
why this might not have been done: Readability of the generated
code (although f2c code is already hard to read), because it made
the code slower with compilers of the day, and probably because it
"just worked" with the compilers.
Bonita Montero <Bonita.Montero@gmail.com>: Aug 28 11:07AM +0200

Am 26.08.2022 um 22:49 schrieb Lynn McGuire:
 
> My Fortran starts at one.  My C++ starts at zero.  This has made my life
> hell.
 
> Lynn
 
On the CPU-level you heave the least number of calculations to
determine an address of an indexed entity if the index starts
at zero.
David Brown <david.brown@hesbynett.no>: Aug 28 11:52AM +0200

On 28/08/2022 09:50, Thomas Koenig wrote:
> happen, and, even if it works right now, such code is at the mercy
> of future compiler revisions, cosmic rays, and other forseen and
> unforseen circumstances.
 
Indeed.
 
C was designed to have as few restrictions on the hardware as it could,
while still having a minimum feature set. If you have a segmented
memory architecture (such as x86), then addresses might have a form
"segment:offset". If an array starts at offset 0, what does it mean to
have an address one before that? It might make no sense, or have
different meanings in different contexts, or require inefficient extra
instructions to get right. Some architectures pre-load information
about memory pages or segments when a pointer register is loaded,
causing trouble if it does not actually point to valid memory. Leaving
this all undefined is much simpler for everyone.
 
(The other end, one past the end of the array, is too useful in common C
idioms to leave undefined - even if it might mean that an implementation
can't use the last address in memory.)
Paavo Helde <eesnimi@osa.pri.ee>: Aug 28 07:43PM +0300

28.08.2022 06:40 Lynn McGuire kirjutas:
 
>> That's an f2c idiom, which is not valid C, AFAIK, because
>> the pointer would point before the actual array.
 
> While the second pointer is a bad pointer, it is not a illegal pointer.
 
The C++ standard (n4861) calls this "an invalid pointer value".
 
For pointers which continue to point to freed objects, it says "A
pointer value becomes invalid when the storage it denotes reaches the
end of its storage duration".
 
About invalid pointers it says:
"Indirection through an invalid pointer value and passing an invalid
pointer value to a deallocation function have undefined behavior. Any
other use of an invalid pointer value has implementation-defined behavior."
 
There is also a footnote:
"Some implementations might define that copying an invalid pointer value
causes a system-generated runtime fault."
 
So, while technically one might get away with the "x--" trick most of
the time with the linear memory addressing used by mainstream
implementations nowadays, still various diagnostic tools would mark
these as invalid pointers, causing an avalanche of errors whenever you
want to solve your actual memory access problems.
 
I guess it might also subvert automatic garbage collection which is
sometimes used with C++. There is a special case of "safely-derived"
pointer values which I suspect is made exactly for making GC possible,
and changing the pointer value to x-1 would apparently ruin this.
 
And with segmented memory, like with 16-bit x86, it might cause all kind
of surprises.
Bonita Montero <Bonita.Montero@gmail.com>: Aug 28 11:49AM +0200

template<std::input_iterator CharInputIt, typename Callback>
requires std::is_integral_v<std::iter_value_t<CharInputIt>>
&& requires( Callback callback, CharInputIt cri ) { { callback( cri,
cri ) }; }
void linify( CharInputIt begin, CharInputIt end, Callback callback )
{
CharInputIt
scn = begin,
lineBegin;
if( scn == end ) [[unlikely]]
return;
auto checkedCallback = [&]() { if( lineBegin != scn ) callback(
lineBegin, scn ); };
for( ; ; )
for( lineBegin = scn; ; ++scn )
if( *scn == '\n' ) [[unlikely]]
{
checkedCallback();
if( ++scn == end )
return;
break;
}
else if( *scn == '\r' ) [[unlikely]]
{
checkedCallback();
if( ++scn == end || *scn == '\n' && ++scn == end )
return;
break;
}
}
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Aug 27 11:15PM -0700

On 8/8/2022 9:43 AM, Alan Beck wrote:
 
> Shouod I be learing C,C++ or Arduino "sketch" language.
 
> I have books for all three.l
 
> Thand beforo hand
 
To C or not to C... Well, actually, I just might have to design a plugin
interface and I would want C bindings. An end user can program a plugin
in C, C++, C#, ect... I just need to design the C API and
data-structures. So, I choose to use C for the raw plugin logic API.
David Brown <david.brown@hesbynett.no>: Aug 28 11:30AM +0200

On 27/08/2022 18:44, Manfred wrote:
> within the company you work for, and your career information, which is
> often public if you are employed in a public institution, like a
> university.
 
People working at public institutions such as universities also often do
work for commercial companies. Some aspects of that are often made
public, such as which companies and universities are working together,
while many details are generally kept private.
 
So you would expect to see information that Google has been working with
Monster University on harnessing the power of laughter. You would /not/
expect to see that Professor Plum wrote the pun generator library for
the joke engine.
 
And if neither contributing organisation is a public entity, you would
not expect to see any information at all about collaborating companies,
much less the contributions of individuals, unless both companies felt
there was significant marketing or publicity gains to be had, and both
companies agreed on it - then you'd see the information in press
releases, not developers biographies.
 
There are exceptions, of course, but that is common practice. The whole
point is that the fact that Malcolm failed to find information about
commercial software written by Jens Gustedt tells us absolutely
/nothing/ about how much commercial software he has worked on.
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.

Friday, August 26, 2022

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

Lynn McGuire <lynnmcguire5@gmail.com>: Aug 26 03:49PM -0500

"Why do arrays start at 0?"
https://buttondown.email/hillelwayne/archive/why-do-arrays-start-at-0/
 
"It's not the reason you think. No, it's not that reason either."
 
My Fortran starts at one. My C++ starts at zero. This has made my life
hell.
 
Lynn
Sam <sam@email-scan.com>: Aug 25 07:39PM -0400

JiiPee writes:
 
 
> Yes. When the classes cannot much communicate, and then the other class
> deletes that pointer... then my class somehow needs to be sure its still
> valid.
 
If the "other class deletes that pointer", then the other class must
directly, or indirectly, make provisions for that. Nothing in C++ happens
automatically, by magic.
 
> buttons. But how can this manager know if the button still exists... and
> that was the issue. I was just wondering is its poissible without changing
> code around the class.
 
If there's something that called a "button group manager", that's
responsible for managing these "buttons", but this manager isn't the one
that's creating these buttons, then there must be some formal process by
which thus "button group manager" must become aware of these buttons,
somehow. That also doesn't happen automatically, by magic. There must be
some procedure by which these buttons get handed over to this "button group
manager".
 
Therefore, there must also be a procedure by which this "button group
manager" must be notified that a particular button should no longer be under
its control. So, whatever this process or procedure is, it needs to be used
before deleting this button, so that the "button group manager" does not use
a pointer to a deleted object.
 
The End.
Manfred <noname@add.invalid>: Aug 26 02:26AM +0200

On 8/24/2022 8:59 PM, Keith Thompson wrote:
 
> Most C++ compilers aren't fully conforming by default. Any conforming
> C++ implementation must diagnose `void main()` (and may then either
> accept it or reject it).
 
Curiously, the C standard poses no requirements on main() for
freestanding implementations.
Apparently the C++ standard does instead: it says that main() may not be
present in a freestanding implementation, but, as it is written, if it
is present then it must have int return type.
Paul N <gw7rib@aol.com>: Aug 26 05:49AM -0700

On Thursday, August 25, 2022 at 3:29:09 PM UTC+1, JiiPee wrote:
> existing buttons. But how can this manager know if the button still
> exists... and that was the issue. I was just wondering is its poissible
> without changing code around the class.
 
Can't you make it that only the manager can delete buttons? That way the manager will always know what buttons are there and which are not. It seems a reasonable responsibility for a "manager" to have. Other parts of the program can request the manager to delete a button, but they don't actually do it themselves.
JiiPee <kerrttuPoistaTama11@gmail.com>: Aug 26 07:35PM +0300

On 26/08/2022 15:49, Paul N wrote:
> Can't you make it that only the manager can delete buttons?
 
Not really, because I cannot really touch much the existing code....
that would require re-testing etc.... so its not so easy.
Louis Krupp <lkrupp@invalid.pssw.com.invalid>: Aug 26 12:25PM -0600

On 8/26/2022 10:35 AM, JiiPee wrote:
>> Can't you make it that only the manager can delete buttons?
 
> Not really, because I cannot really touch much the existing code....
> that would require re-testing etc.... so its not so easy.
 
Could you create an intermediate subclass of Parent that would add the
required functionality?
 
A crude outline:
 
===
class Parent // can't be modified
{
public:
    void foo2() {}
};
 
class Nanny : public Parent
{
public:
   Nanny(Parent* parentptr, Child* childptr) : Parent(parentptr); //
keep list of children
   ~Nanny(); // notify children of nanny's impending deletion by
calling Child::nanny_byebye
}
 
class Child
{
public:
    Nanny* m_nanny{nullptr, this}; // add child to list
    void nanny_byebye() {
        m_nanny = nullptr;
    }
    void foo() {
        // check to see if nanny has been deleted
        if (m_nanny) m_nanny->foo2();
    }
};
 
void main()
{
    Parent* nanny = new Nanny;
    Child child;
    child.m_nanny = nanny;
    delete nanny;
    child.foo(); // Nanny::foo2 won't be called
 
}
===
 
Louis
Manfred <noname@add.invalid>: Aug 26 01:59AM +0200

On 8/25/2022 7:11 PM, JiiPee wrote:
>     }
> };
 
> Can anybody suggest this to Bjarne? hehe
 
I don't think this would be a good idea ("selective" friendship, not
contacting Bjarne..)
- friend by itself should be used parsimoniously: it goes against
encapsulation, so more often than not it is a symptom of poor design
(exceptions apply, but they are in fact exceptions)
- "selective" friendship, in the way you are suggesting, breaks
encapsulation even more, in that it introduces a new level of its
fragmentation.
 
Others have given solutions that do what you are trying to do.
If I had to address this issue, I'd look for a different and possibly
more consistent design, e.g. simply:
 
class Parent_public
{
public:
void foo();
};
 
class Parent : public Parent_public
{
private:
void foo2();
};
JiiPee <kerrttuPoistaTama11@gmail.com>: Aug 26 07:19AM +0300

On 26/08/2022 02:59, Manfred wrote:
> private:
>   void foo2();
> };
 
 
A good idea, and I might use this also. Although a small "problem" I see
here is that it complicates the code a little more (more layers and more
typing ).
This would be much shorter, what I suggested:
 
void foo2() { : friend Child
 
Only two words .
 
For me, I like it a little more if its less typing and more simple.
But ok, maybe there is a logical reason not to support selective
friendship. But I have been looking that feature to be honest many
times. Because I rarely need one class have FULL friendship. Almost
always the friendship needs to be only partial.. normally 1-2 funktions.
JiiPee <kerrttuPoistaTama11@gmail.com>: Aug 26 07:25AM +0300

On 26/08/2022 02:59, Manfred wrote:
> - friend by itself should be used parsimoniously: it goes against
> encapsulation, so more often than not it is a symptom of poor design
> (exceptions apply, but they are in fact exceptions)
 
I also use rarely friends and its the last solution.
But... sometimes it is just easiest and most practical way, if the
classes are tightly linked with each others (like some kind of cache
class for another), and the classes go together "privately".
 
Also it keeps the code more simple. Instead of writing 20 new lines,
only 1-2 lines of code needed. So its kinda looking for a balance
between "best practices" and practicality/simple-short code.
 
But again, I only do it if no other easy solution and it has some logic
in it.
Paavo Helde <eesnimi@osa.pri.ee>: Aug 26 12:13PM +0300

25.08.2022 20:11 JiiPee kirjutas:
>     }
> };
 
> Can anybody suggest this to Bjarne? hehe
 
 
You mean the C++ committee, not Bjarne. And I think everybody agrees C++
has already too many features, so it would be hard to propose a new one,
especially related to things like friends which are kind of frown upon
anyway.
 
Meanwhile, what about this? Instead of a private function accessible to
all friends define a public function accessible only to a "privileged
friend":
 
class Child1;
class Child2;
 
class Child1Key {
friend class Child1;
Child1Key() {}
};
 
class Child2Key {
friend class Child2;
Child2Key() {}
};
 
class Parent {
public:
void foo(Child1Key key) {}
void foo2(Child2Key key) {}
};
 
class Child1 {
public:
Parent* m_parent{ nullptr }; // later initialized ...
void foo3() {
// Can access only foo()
m_parent->foo(Child1Key{}); // this is OK
// cannot access any other privates
m_parent->foo2(Child2Key{}); // this is NOT OK
}
};
Michael S <already5chosen@yahoo.com>: Aug 26 03:55AM -0700

On Thursday, August 25, 2022 at 8:11:37 PM UTC+3, JiiPee wrote:
> }
> };
 
> Can anybody suggest this to Bjarne? hehe
 
When somebody is obsessed with encapsulation enforcement
tools (private/protected/friend etc) it's a sure sign of him
having too much time and too little real work to do.
If I was your boss I'd knew how to handle that.
JiiPee <kerrttuPoistaTama11@gmail.com>: Aug 26 07:29PM +0300

On 26/08/2022 12:13, Paavo Helde wrote:
> m_parent->foo2(Child2Key{}); // this is NOT OK
> }
> };
 
Thanks. a nice trick. Yes this is one of the best ways. I ll definitely
keep this in my mind. I think I have seen the "key" pattern before, this
seems similar.
Paavo Helde <eesnimi@osa.pri.ee>: Aug 26 08:49PM +0300

26.08.2022 19:29 JiiPee kirjutas:
 
> Thanks. a nice trick. Yes this is one of the best ways. I ll definitely
> keep this in my mind. I think I have seen the "key" pattern before, this
> seems similar.
 
Yes, but also bear in mind that these kind of tricks are most often a
sign of serious over-engineering. If the intent is that foo() should be
called only by Child1 then just name if FooForChild1() and be done with it.
Ben Bacarisse <ben.usenet@bsb.me.uk>: Aug 26 12:33AM +0100

>> not a joke)?
 
> "Beware of bugs in the above code; I have only proved it correct, not
> tried it." (Donald Knuth)
 
A well-known quote meaning pretty much the opposite of the remark that
piqued my interest.
 
> just one that has passed some test cases.
 
> (You can look up the book "Programming from Specifications" by Carroll
> Morgan, which is freely available.)
 
There are few books on that sort of topic. Hoare's comes to mind.
 
> practical work that involved actual programming on computers, we were
> expected to learn whatever language the course tutor thought
> appropriate for the task - C, Modula 2, and Occam, perhaps more.
 
You could just have said "no"!
 
--
Ben.
Manfred <noname@add.invalid>: Aug 26 03:11AM +0200

On 8/25/2022 12:29 PM, Ben Bacarisse wrote:
 
> In what way is making bool a type keyword expressing an academic ideal?
> My thoughts were the reverse: the "purist" route -- of only using
> already reserved identifiers -- has been ditched.
 
My take on this is that the academic idealist would be less bothered
with practical distractions like maintainability.
The idealist would code an algorithm just matching the theoretical
model, so if a boolean type is involved, type bool it is.
 
Your "purist" route also make sense, but more like the collector's focus
rather than the innovator impulse.
Using _Bool is clearly motivated by not breaking existing code, which is
a priority in most industry jobs, arguably less in an academic
environment where focus is more on researching new results rather than
maintaining existing products.
 
That said, I share your sentiment that keeping _Bool and staying on
<stdbool.h> would have been the correct thing to do.
The problem was solved, and solved well. No need to reopen and break it.
Malcolm McLean <malcolm.arthur.mclean@gmail.com>: Aug 25 07:56PM -0700

On Thursday, 25 August 2022 at 19:36:10 UTC+1, David Brown wrote:
> with or been promoted by one person - Jens Gustedt. I don't know if he
> should be considered an "academic", or a "practical programmer", or
> both, or neither.
 
I looked him up. He's very clearly what I would call an academic rather than a
practical programmer. That doesn't mean that he's never produced a piece of
code that has run "for real" in his life. But I cannot find a single reference to
any commercial software he has worked on. I don't think he's ever held a job
as programmer.
 
He has produced some hydrological software (determining where the water goes
when it rains). I haven't looked at it in detail and I don't know much about the field.
But I don't think the software is designed to be downloaded by the civil engineer
and used to help build reservoirs. It's more a proof of concept. The algorithms can
be taken by someone else, reimplemented, and used as the core of a commercial
hydrology package.

Of course he's a more highly educated, and more able man than the average
commercial programmer. I'm not trying to say "academic bad, practical good".
But it's not the same thing.
David Brown <david.brown@hesbynett.no>: Aug 26 10:39AM +0200

On 26/08/2022 01:33, Ben Bacarisse wrote:
>> tried it." (Donald Knuth)
 
> A well-known quote meaning pretty much the opposite of the remark that
> piqued my interest.
 
Knuth's comment was (AFAIUI) intended to provoke thought - it is not so
much a warning specifically against untested code, as a reminder that
there is no simple answer to knowing when code is correct. Proof of
correctness alone is not enough, as people can make mistakes or invalid
assumptions in their proof (especially in non-trivial cases where proofs
are necessarily long and complex). There is also the real risk that
there are problems in the original specification, which are not noticed
until testing the code. On the other hand, testing is not enough - it
can only prove the existence of bugs, not their absence.
 
My remark was not a joke as such - it was intended in the same manner as
Knuth's quotation.
 
 
>> (You can look up the book "Programming from Specifications" by Carroll
>> Morgan, which is freely available.)
 
> There are few books on that sort of topic. Hoare's comes to mind.
 
Yes, he has written a few. "Communicating Sequential Processes" was
another on our required reading list. The lecturers rarely recommended
their own books directly, but they were very fond of recommending each
other's books!
 
>> expected to learn whatever language the course tutor thought
>> appropriate for the task - C, Modula 2, and Occam, perhaps more.
 
> You could just have said "no"!
 
You've known me on Usenet for quite some time - when have I ever been
able to give a one word answer? :-)
David Brown <david.brown@hesbynett.no>: Aug 26 10:47AM +0200

On 26/08/2022 04:56, Malcolm McLean wrote:
> code that has run "for real" in his life. But I cannot find a single reference to
> any commercial software he has worked on. I don't think he's ever held a job
> as programmer.
 
If you look me up (and good luck with that - my name is so common I
might as well be anonymous) you'll find no references to commercial
software that I have worked on, and probably no more than obscure
references in a local Norwegian newspaper concerning what jobs I have
had. Yet I have over 25 years of professional software development
practice.
 
So your search results have almost no worth at all, as far as I can see.
 
 
> Of course he's a more highly educated, and more able man than the average
> commercial programmer. I'm not trying to say "academic bad, practical good".
> But it's not the same thing.
 
You do seem to be making a distinction here that others (myself, at
least) do not see. I've known people who work as "practical"
programmers who are interesting in the theory, academics who do
practical work, and all sorts of mixes - there is so much "grey area"
that there is no black or white.
 
All you can really say is that since C is a very practical language, and
so completely unsuited to purely theoretical computer science, that
anyone interested in the C language is interested in the practical use
in real programs.
 
If you want more information on Jens Gustedt, read his blog.
Malcolm McLean <malcolm.arthur.mclean@gmail.com>: Aug 26 02:48AM -0700

On Friday, 26 August 2022 at 09:47:36 UTC+1, David Brown wrote:
> references in a local Norwegian newspaper concerning what jobs I have
> had. Yet I have over 25 years of professional software development
> practice.
 
You don't hold an academic post at a university. Pretty much everybody who
holds an academic post at university puts up online some bit of information
listing their research interests, and a bit of biographical detail.
 
> So your search results have almost no worth at all, as far as I can see.
 
If Gustedt had done significant work on commercial software, I would have
expected it to be listed. You can't prove 100% that he did such work but didn't
think it was interesting enough to mention, but it's not likely.
> programmers who are interesting in the theory, academics who do
> practical work, and all sorts of mixes - there is so much "grey area"
> that there is no black or white.
 
There are grey areas, because problems which are theoretically interesting
are also sometimes of practical use. However one fairly unambiguous test
is "is someone paying money for the right to execute this piece of code?".
If the answer is "yes", it must be practical code. If the answer is "no", it might
still be practical, because not every activity that adds value involves economic
exchange, but likely it's not.
> so completely unsuited to purely theoretical computer science, that
> anyone interested in the C language is interested in the practical use
> in real programs.
 
That is another rule of thumb. If you use C, the code can be deployed in a
program designed for mass market release. If you use a language like Scheme,
it's much harder to get the code out into real world use. However, as you say,
there are grey areas, and not all C is intended for deployment in commercial
programs.
 
> If you want more information on Jens Gustedt, read his blog.
 
I've had a look at it. He's an impressive person. I don't want to say anything as
crude as "theoretical work bad, practical work good".
Ben Bacarisse <ben.usenet@bsb.me.uk>: Aug 26 10:57AM +0100

>>>>> prove it is correct on the blackboard" programming, which is as
>>>>> academic as it comes.
 
> Knuth's comment was (AFAIUI) intended to provoke thought
<...>
> My remark was not a joke as such - it was intended in the same manner
> as Knuth's quotation.
 
Then I misunderstood. I thought your remark was intended to
characterise or at least suggest an attitude that was common or accepted
in the instituting you attended. Hence my curiosity as to which.
 
--
Ben.
David Brown <david.brown@hesbynett.no>: Aug 26 12:49PM +0200

On 26/08/2022 11:57, Ben Bacarisse wrote:
 
> Then I misunderstood. I thought your remark was intended to
> characterise or at least suggest an attitude that was common or accepted
> in the instituting you attended. Hence my curiosity as to which.
 
Ah, you thought I was taught coding by people who didn't believe code
should be tested? I see your point now.
 
The degree was "Mathematics and computation" - it was not a programming
course, or course in any one language, or even a "software engineering"
course. So there was a strong emphasis on viewing the programming as
mathematics, and applying mathematical styles to code development. The
aim was to have an understanding of how code relates to specifications
and how you can be sure it is correct. Then details such as programming
languages, structure, testing methodology, etc., are just practical
details to fill in later as appropriate.
David Brown <david.brown@hesbynett.no>: Aug 26 01:02PM +0200

On 26/08/2022 11:48, Malcolm McLean wrote:
 
> You don't hold an academic post at a university. Pretty much everybody who
> holds an academic post at university puts up online some bit of information
> listing their research interests, and a bit of biographical detail.
 
True. But even if someone has such information available, that does not
tell you about what they have or have not done outside of this information.
 
 
> If Gustedt had done significant work on commercial software, I would have
> expected it to be listed. You can't prove 100% that he did such work but didn't
> think it was interesting enough to mention, but it's not likely.
 
If he has done significant work on commercial software, I would expect
it to be extremely likely that it is /not/ mentioned. If he is working
as a researcher (at a university or in a research institute of some
kind), I expect his interests to be listed and perhaps involvement in
research-related software, especially if publicly funded. But work done
on commercial software is usually a matter between you and the company,
and no one else - it is not information that is publicised. /Sometimes/
work on commercial software is publicised, perhaps for particular key
roles or because the person has particular interest in taking the
credit. But in the great majority of cases, work on software is pretty
anonymous.
 
As so often happens, you are extrapolating your somewhat niche personal
experience in a way that is not at all justified on a wider scale.
 
> If the answer is "yes", it must be practical code. If the answer is "no", it might
> still be practical, because not every activity that adds value involves economic
> exchange, but likely it's not.
 
Even if that test was appropriate (and I would classify it as "possibly
vaguely relevant", rather than "fairly unambiguous"), it is not
information you would normally have about someone.
 
>> in real programs.
 
> That is another rule of thumb. If you use C, the code can be deployed in a
> program designed for mass market release.
 
Nonsense. Plenty of C code is written for small audiences. None of the
C code I have ever written has been or ever could be a "mass market
release". Equally, mass market software can be and is written in a vast
number of programming languages. You are making a pointless and
non-existent division.
 
 
>> If you want more information on Jens Gustedt, read his blog.
 
> I've had a look at it. He's an impressive person. I don't want to say anything as
> crude as "theoretical work bad, practical work good".
 
It is not a matter of being good or bad, it is a question of whether it
is even /relevant/.
Malcolm McLean <malcolm.arthur.mclean@gmail.com>: Aug 26 04:57AM -0700

On Friday, 26 August 2022 at 12:03:20 UTC+1, David Brown wrote:
> Even if that test was appropriate (and I would classify it as "possibly
> vaguely relevant", rather than "fairly unambiguous"), it is not
> information you would normally have about someone.
 
You don't normally go up to someone in the street and quiz them about their career.
 
However if you meet someone socially, then it's fairly normal to ask "what do you do
for a living?". If they say "I'm a software developer", then you'd say "I'm also in the
software business." Then that would lead on to which programs they work on. If they
are a games programmer, for example, you'd almost always get a list of titles they
have contributed to. If they develop software for a bank, you'd probably leave it,
unless they really want to tell you all about the big systems integration project they
are engaged in. But they wouldn't be developing code for the bank for free, and the
bank wouldn't normally pay for code that didn't achieve commercial objectives.
David Brown <david.brown@hesbynett.no>: Aug 26 02:55PM +0200

On 26/08/2022 13:57, Malcolm McLean wrote:
> unless they really want to tell you all about the big systems integration project they
> are engaged in. But they wouldn't be developing code for the bank for free, and the
> bank wouldn't normally pay for code that didn't achieve commercial objectives.
 
You do understand there is a difference between what you say to a
friend, colleague or relative socially, and what you publish for the
world to see in an biography page? If we were talking in person, and I
felt I could trust you with confidential information, I could well tell
you about particular customers of mine. But neither I nor anyone else
can publishing details about who I worked with, what programs I worked
on, or for which customers, without explicit permission from myself, my
employer, and the relevant customer(s). Details of commercial
agreements are confidential by default, and something like the
connection between developers and customers usually remains confidential
because it is rarely in anyone's interest to know the details.
 
I think this thread should probably end here.
Malcolm McLean <malcolm.arthur.mclean@gmail.com>: Aug 26 06:20AM -0700

On Friday, 26 August 2022 at 13:55:38 UTC+1, David Brown wrote:
> connection between developers and customers usually remains confidential
> because it is rarely in anyone's interest to know the details.
 
> I think this thread should probably end here.
 
Maybe it's different in your world.
In my world, details of the current project are often a secret. But once it is completed,
it's no longer a secret. Just the opposite, in fact. You want everybody to know about
the software and its capabilities.
But yes, we've gone rather far from C++.
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.