Sunday, June 10, 2018

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

wyniijj@gmail.com: Jun 10 02:15AM -0700

Alf P. Steinbach於 2018年6月10日星期日 UTC+8上午1時10分51秒寫道:
> maps directly (mechanically, one to one) to C++03 notation. The modern
> C++ notation is much like Rust and like math notation. But I don't think
> either notation has any strong advantage for this particular concrete code.
 
I take it as suggestions to use keyword auto this way (in the future)
 
I do not know many new C++ things. But when I need them, they will come
to me naturally.
 
 
> A semicolon there has never been a requirement in standard C++, and as I
> recall not in ARM C++ before the first standard, either.
 
> Throw that compiler on the fire.
 
g++ had once interpreted the C++ standard's wording 'straitforwardly'.
The DOS time Turbo/Watcom C++, IIRC might had been slightly different.
E.g.
 
void test_throw()
{
try {
throw char(4);
}
catch(int e) {
cout << "caught int(4)";
}
 
try {
throw char(3);
}
catch(char e) {
cout << "caught char(3)";
}
}
 
That older g++ would caught the 1st 'throw char(4)' in the 2nd
catch(char e) if without the ending ';'.
I tried newer g++'s, program behaviors as average users expected, now.
 
Probably I should say 'earlier', because C++ compliler implements
had once debated about the ending ';' issues, e.g. the following
class declaration might had once worked.
 
class B {
void a(int);
void b(char) {}
}
 
 
> You can directly reuse that code (perhaps more properly beefed up for
> reuse), by just moving it to a header.
 
> I put everything in a single file so that it would be easy to check out.
 
OK. when I see fit.
 
> pretty sure it must have been just about the same as in C.
 
> If instead the SPL notation had been ptr_, or like that, then I would
> most likely have understood it because it's self-describing.
 
This reminded me of several other similar programming practices:
E.g 'const char' or 'char const'
'if(a==0)' or 'if(0==a)'
...
 
Most difficult coding styles taking time to decipher I encountered
were from people just graduate from school, they didn't want people to
share their 'know-how' or just show off (newer C++ syntax provides more
such chances)
 
> > modification of the source wrapper from the underlying things that
> > can change over time
 
> Sorry, I don't understand that. Can you give an example?
 
That basic goal is an ideal to pursue. It basically means the impl.
better not to add other things. So the changes of wrapped underlying
functions can be transparent/intact. E.g. various C++ implements are
always tempted to add things ('policy'...) to look like 'real C++',
that might lead to the need to update the C++ wrappers. I'd like to
save such time, I have something else as important to do.
 
getaddrinfo(2) looks stable and thread safe, but who knows? Latter
version might expose more details of struct addrinfo or add 'flags' to
the argument of getaddrinfo(..) like some others do. For this,
thanks to a C++ feature, we can add default argument in response.
 
 
> The docs I found for *nix systems:
> <url: https://linux.die.net/man/3/getaddrinfo>
 
> Are you referring to a different function?
 
I meant the return code of getaddrinfo(2). I can't read it from your
post. It's different from errno. There are couple of clib functions
use different return code, too. Because it is a big thing to look for,
i.e. 'error handling mechnism', the big picture.
I know you know this had been a long long thing ever discussed.
In libwy-0.55, I decided to give up the original design to use errno
directly (wrapped by WyRet).
 
> > hints.set_family(AF_UNSPEC);
 
> I don't see any problem with providing the hinting functionality, that's
> just adding an argument.
 
So the argument is a pointer type, but still, that means using default
settings
 
> to assume the silly SO authoritarianism and herd behavior on Usenet.
 
> Cheers!,
 
> - Alf
 
Sorry, I don't understand 'Reddit' and 'SO mode'. From what I can perceieve
,Stack Overflow is a commercial website like Yahoo, the heart is money.
Users, these year, have been showing some kind of ...ism emerging, or
redefinition of the so called democrocy communism fascism socialism terrorism,..., are just begun.
Manfred <noname@invalid.add>: Jun 10 03:45AM +0200

On 06/08/2018 09:37 PM, Richard wrote:
> so that feels like another straw man point.
 
> Feel free to cite a case where a well known TDD advocate proposes it
> as a substitute for understanding the problem domain.
 
I was thinking about the process itself, not about understanding the
problem domain. Obviously for any development technique such an
understanding is a precondition.
I doubt that for such systems having the process driven by a series of
test cases is a very effective approach.
 
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: