Wednesday, January 13, 2021

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

Juha Nieminen <nospam@thanks.invalid>: Jan 13 08:30AM

> using namespace std;
 
You are making the already-hard-to-read code even harder to read by avoiding
all the clarifying std:: prefixes. And for what? What exactly do you gain
from it? Not clarity, that's for certain.
Bonita Montero <Bonita.Montero@gmail.com>: Jan 13 01:56PM +0100

> You are making the already-hard-to-read code even harder to read by avoiding
> all the clarifying std:: prefixes. ...
 
That doesn't make the code hard to read.
Juha Nieminen <nospam@thanks.invalid>: Jan 13 01:44PM

>> You are making the already-hard-to-read code even harder to read by avoiding
>> all the clarifying std:: prefixes. ...
 
> That doesn't make the code hard to read.
 
It does, because you are mixing names from Windows.h and from the standard
library, and it's not as easy to see which names are from the latter by a
quick visual scan. Likewise names from the standard library get confused
with local variable names because they all look visually very similar and
there's nothing distinguishing them.
 
When names from the standard library are visually denoted with the "std::"
prefix, they stand out from all the other names, making it easier to make
the distinction, and to more quickly see which standard library utilities
are being used and where.
 
There is literally zero advantage in *not* using the prefix. There are
arguably disadvantages. Even if you think that those disadvantages are
minuscule, they are still disadvantages, and there's absolutely no reason
to have them, no matter how small you think they may be.
 
This especially so when you are posting code to a forum where you are
asking other people to examine your code and understand what it's doing.
You should make your code as easy for others to understand as possible.
Clarity of your own code is your responsibility, not the responsibility
of the people you are asking.
Bonita Montero <Bonita.Montero@gmail.com>: Jan 13 04:30PM +0100


> It does, because you are mixing names from Windows.h and from the standard
> library, and it's not as easy to see which names are from the latter by a
> quick visual scan. ...
 
Your point is absolutely compulsive.
Someone who programs C++ should know the standard library.
 
Haven't read the rest of your nonsense.
Nikolaj Lazic <nlazicBEZ_OVOGA@mudrac.ffzg.hr>: Jan 13 09:29PM


> Your point is absolutely compulsive.
> Someone who programs C++ should know the standard library.
 
> Haven't read the rest of your nonsense.
 
Maybe you should at least try to...
Paavo Helde <myfirstname@osa.pri.ee>: Jan 14 12:08AM +0200

13.01.2021 17:30 Bonita Montero kirjutas:
>> quick visual scan. ...
 
> Your point is absolutely compulsive.
> Someone who programs C++ should know the standard library.
 
And someone who includes Windows.h should know all the half zillion
names it declares, right?
 
You are forgetting a tiny point: computer code is not meant as an exam
or test for readers' ability to remember and recognize tons of names
from various large interfaces. The purpose of the source code is to
present a working algorithm in a way that is as easy as possible for
people to understand and modify.
 
Otherwise, we could just compile our work into machine code and forget
about source code repositories.
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: