Tuesday, January 16, 2018

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

James Kuyper <jameskuyper@verizon.net>: Jan 16 08:52AM -0500

On 01/15/2018 04:54 PM, Vir Campestris wrote:
> On 15/01/2018 20:22, Mr Flibble wrote:
...
 
> There are 4 options -
> 4) Some of the code base won't build on the new compiler (IME this is
> usually because of bugs, and it's worth fixing them)
 
That's covered by item 3.
Vir Campestris <vir.campestris@invalid.invalid>: Jan 16 09:01PM

On 16/01/2018 13:52, James Kuyper wrote:
>> 4) Some of the code base won't build on the new compiler (IME this is
>> usually because of bugs, and it's worth fixing them)
 
> That's covered by item 3.
 
OK. I was thinking in terms of no chip support for the new one.
 
Andy
Lynn McGuire <lynnmcguire5@gmail.com>: Jan 16 03:23PM -0600


>> 1,605 pages ! ! !
 
>> I would still like to see a standard windowing user interface library.
 
> Wasn't this attempted on *nix a few decades ago?
 
And X-Windows failed to make it outside of Unix (that I know of).
 
Lynn
scott@slp53.sl.home (Scott Lurndal): Jan 16 09:25PM


>>> I would still like to see a standard windowing user interface library.
 
>> Wasn't this attempted on *nix a few decades ago?
 
>And X-Windows failed to make it outside of Unix (that I know of).
 
But still in wide use by linux and bsd unix systems, underlying
all modern toolkits (gtk, qt, Xaw, et alia). Attempts to replace
it (e.g. Wayland) haven't yet succeeded, thankfully.
Daniel <danielaparker@gmail.com>: Jan 16 01:32PM -0800

On Wednesday, December 6, 2017 at 6:09:51 PM UTC-5, Lynn McGuire wrote:
 
> I would still like to see a standard windowing user interface library.
 
What would they standardize? User interfaces are moving on. Old style
desktop interfaces aren't that interesting anymore.
 
My wishes are more modest: a standard date and a standard decimal class.
At least for these there is prior work.
 
Daniel
legalize+jeeves@mail.xmission.com (Richard): Jan 16 10:36PM

[Please do not mail me a copy of your followup]
 
Lynn McGuire <lynnmcguire5@gmail.com> spake the secret code
 
>>> I would still like to see a standard windowing user interface library.
 
>> Wasn't this attempted on *nix a few decades ago?
 
>And X-Windows failed to make it outside of Unix (that I know of).
 
It was succesful in that it conquered all the unixes, which was no
small feat. It crushed every vendor specific windowing system, of
which there were quite a few in the late 80s/early 90s. Even SGI had
to relent eventually and they were a powerful force in the workstation
market and in graphics.
 
As far as the cross-platform API wars, wxWidgets and Qt are the clear
winners. They have different enough approaches that they still
survive to this day (Qt reimplements everything from first principles
and wxWidgets acts more as a minimal adapter layer to give a common
API).
 
This is exactly why these things are not needed in the standard. I
need to write a paper to the committee.
--
"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>
Lynn McGuire <lynnmcguire5@gmail.com>: Jan 16 05:19PM -0600

On 1/16/2018 3:25 PM, Scott Lurndal wrote:
 
> But still in wide use by linux and bsd unix systems, underlying
> all modern toolkits (gtk, qt, Xaw, et alia). Attempts to replace
> it (e.g. Wayland) haven't yet succeeded, thankfully.
 
Are the Android systems running X-Windows ?
 
Lynn
scott@slp53.sl.home (Scott Lurndal): Jan 16 11:22PM

>which there were quite a few in the late 80s/early 90s. Even SGI had
>to relent eventually and they were a powerful force in the workstation
>market and in graphics.
 
Sort of, GL still exists as OpenGL.
Vir Campestris <vir.campestris@invalid.invalid>: Jan 16 09:04PM

On 16/01/2018 13:47, James Kuyper wrote:
> precisely the same reason, I declare them const according to the same
> policy I use for other local variables: they are const by default unless
> I plan to modify them.
 
Another vote for const here. You never know, it might help the compiler...
 
Where I'll disagree with Alf is on auto. I use it only when I have to -
for example, lambdas. I don't think it adds clarity.
 
Sure, my GUI will (usually) tell me the type if I hover on it. But I
have to move the mouse, not my eyes, and my eyes are faster.
 
Andy
legalize+jeeves@mail.xmission.com (Richard): Jan 16 08:41PM

[Please do not mail me a copy of your followup]
 
Suppose you have some code that is repeated for a bunch of disparate
values. Prior to C++11 you'd typically squish out the difference by
extracting the common code into a named function and then call the
function repeatedly with the disparate values:
 
void foo(const char *word)
{
std::cout << word << '\n';
}
 
void bar()
{
foo("bar");
foo("meta");
foo("word");
}
 
or perhaps you put the disparate values in a C-style array with
aggregate initialization and then looped over the array:
 
const char *words[] = {"bar", "meta", "word"};
for (int i = 0; i < sizeof(words)/sizeof(words[0]); ++i)
{
std::cout << words[i] << '\n';
}
 
This required introducing a name for the repeated code/data (not
necessarily a bad idea as it is an opportunity to use an intention
revealing name when the code is complex). However, when the code is
just a few lines, the extra boilerplate of a named function/data might
feel too burdensome. You might also not want to expose those named
entities for fear that someone else will couple to them as they are
just an implementation detail of what you're trying to do in the
small.
 
With range for loops and std::initializer_list, you can do the
following:
 
#include <initializer_list>
 
void bar()
{
for (auto word : {"bar", "meta", "word"})
{
std::cout << word << '\n';
}
}
 
(The std::cout is admittedly a gratuitous example here, but it
illustrates the idiom.) Now we can just write the repeated chunk of
code without having to extract it into a named function when it is a
small repeated body.
--
"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>
legalize+jeeves@mail.xmission.com (Richard): Jan 16 06:08PM

[Please do not mail me a copy of your followup]
 
Vir Campestris <vir.campestris@invalid.invalid> spake the secret code
>> expectation that average programmers will have to look up a reference
>> manual to interpret it correctly.
 
>Thank you. I am not alone.
 
I would change "average programmers" to "average programmers on your
team" before I would agree with the statement.
 
We can work to increase the level of understanding of our teammates,
but we can't hold back because the entire world is not up to speed
yet.
--
"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>
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: