Saturday, June 4, 2016

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

JiiPee <no@notvalid.com>: Jun 04 12:25PM +0100

I have been struggling to deside which style to use for functions. I
originally used :
 
void ThisIsFoo();
 
but then noticing that many used lower letter I recently used some years:
 
void thisIsFoo();
 
but this year (as I saw somebody making a game library with the old
style) was thinking again that
 
void ThisIsFoo();
 
looks better. So I would like to ask that how many in this forum uses
which style and what is the reason? Is there any strong good reason to
use the other and not the other? For my eyes at the moment ThisIsFoo
looks prettier becouse its "even".
Jerry Stuckle <jstucklex@attglobal.net>: Jun 04 09:53AM -0400

On 6/4/2016 7:25 AM, JiiPee wrote:
> which style and what is the reason? Is there any strong good reason to
> use the other and not the other? For my eyes at the moment ThisIsFoo
> looks prettier becouse its "even".
 
It's all a matter of style. In my code, I capitalize the first letter
of classes and structs. Functions and variables start with a lower case
letter.
 
Another method is to use underscores, i.e. this_is_foo(), but I'm seeing
that less and less every year (it used t be a lot more common in the
70's and 80's in C).
 
But, as I said, it's all a matter of style. When working with a group,
I adapt to whatever style they use. When working alone for a client, I
look at what style they've used in the past. I think it's better to be
consistent than anything else.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
Wouter van Ooijen <wouter@voti.nl>: Jun 04 04:08PM +0200

Op 04-Jun-16 om 1:25 PM schreef JiiPee:
> which style and what is the reason? Is there any strong good reason to
> use the other and not the other? For my eyes at the moment ThisIsFoo
> looks prettier becouse its "even".
 
I prefer this_is_foo.
 
Note that there are many differen styles to choose from. Some prefer one
style (like I do), others put some semantic informatic in the style
(const, type/variable, type (Hungarian), parameter/attribute, ...)
 
IFYOUTHINKYOUAREIMPORTANTYOUCANSHOUTITOUT
BUT_IF_YOU_CARE_FOR_YOUR_READER_YOU_INSTER_UNDERSCORES
hey_guys_my_characterset_includes_lowercase
But_shouldnt_a_sentence_start_with_an_uppercase
HeyIamTooLazyToInsertUnderscoresWhyNotUseCapitalsInstead
butThenWhyCapitalizeTheFirstWord_thereIsNothingBeforeIt
 
Wouter "Objects? No Thanks!" van Ooijen
JiiPee <no@notvalid.com>: Jun 04 05:56PM +0100

I was more like interested in which of the two: thisFoo or ThisFoo
people use is they use one, becaouse I want to use one of them but i
keep changing the style
 
 
On 04/06/2016 15:08, Wouter van Ooijen wrote:
JiiPee <no@notvalid.com>: Jun 04 05:57PM +0100

On 04/06/2016 14:53, Jerry Stuckle wrote:
>> use the other and not the other? For my eyes at the moment ThisIsFoo
>> looks prettier becouse its "even".
> It's all a matter of style.
 
you mean a matter of personal taste?
 
Wouter van Ooijen <wouter@voti.nl>: Jun 04 07:42PM +0200

Op 04-Jun-16 om 6:56 PM schreef JiiPee:
> I was more like interested in which of the two: thisFoo or ThisFoo
> people use is they use one, becaouse I want to use one of them but i
> keep changing the style
 
I use neither. But changing is definitely worse than choosing one :)
 
Wouter
"Öö Tiib" <ootiib@hot.ee>: Jun 04 10:50AM -0700

On Saturday, 4 June 2016 14:25:31 UTC+3, JiiPee wrote:
 
> void ThisIsFoo();
 
> looks better. So I would like to ask that how many in this forum uses
> which style and what is the reason?
 
Source code is description of design of program and so the aesthetics
of it ("looks good") is less important than how easy is to understand
it.
 
If the code editor can not color names of macros, variables, data
members, functions and types differently then the code may be hard to
read if there are no other ways to differentiate between those entities.
Therefore the programmers often use different naming schemes for
different entities, it can make code easier to understand.
 
> Is there any strong good reason to
> use the other and not the other? For my eyes at the moment ThisIsFoo
> looks prettier becouse its "even".
 
If the reader of your code happens to be software engineer (and that is
so with close to 100% likelihood) then he values his time more than how
pretty it looks. When you named classes like "ThisIsFoo" then naming also
functions like "ThisIsFoo" causes ambiguity because call of such function
"ThisIsFoo()" is impossible to differentiate visually from constructing
a temporary of type "ThisIsFoo". So poor reader of your code has to look
it up what is going on and so you wasted reader's time.
JiiPee <no@notvalid.com>: Jun 04 06:54PM +0100

On 04/06/2016 18:50, Öö Tiib wrote:
> "ThisIsFoo()" is impossible to differentiate visually from constructing
> a temporary of type "ThisIsFoo". So poor reader of your code has to look
> it up what is going on and so you wasted reader's time.
 
 
you have a point, i ll think about it. I never though about this
G B <gb@gb.com>: Jun 04 06:55PM +0100

On 04/06/2016 17:56, JiiPee wrote:
> I was more like interested in which of the two: thisFoo or ThisFoo
> people use is they use one, becaouse I want to use one of them but i
> keep changing the style
 
If you coming from Delphi then ThisFoo() is better but C# users use
thisFoo(). Personally I prefer the ThisFoo() because I come from Delphi.
 
Are you using Visual Studio or something else?
Ian Collins <ian-news@hotmail.com>: Jun 04 11:42AM +1200

On 06/ 3/16 11:54 PM, Jerry Stuckle wrote:
 
>> Ever seen the term "evaluate"? I never sell anything I don't use.
 
> Yup, I understand "evaluate". And you're actually stoopid enough to
> think you can "evaluate" a 100Gbps link at your desk.
 
Not only do I know I can but I also know how to spell stupid and not to
start a sentence with "And".
 
--
Ian
Jerry Stuckle <jstucklex@attglobal.net>: Jun 03 08:10PM -0400

On 6/3/2016 7:42 PM, Ian Collins wrote:
>> think you can "evaluate" a 100Gbps link at your desk.
 
> Not only do I know I can but I also know how to spell stupid and not to
> start a sentence with "And".
 
ROFLMAO. Just another stoopid troll post.
 
You obviously have no idea what you are talking about. And you just
proved it once again.
 
Plus, I know how to spell "stupid". But YOU are "stoopid". Calling you
"stupid" would be an insult to stupid people everywhere.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
Jerry Stuckle <jstucklex@attglobal.net>: Jun 03 08:12PM -0400

On 6/3/2016 4:40 PM, Ian Collins wrote:
>> 500GB RAID out of 5MB disks.
 
> You really do live in the 80s, don't you? Where else would I get 5MB
> disks?
 
Hey, it was YOU who said "drive size is irrelevant". I just carried it
on to it's natural conclusion. If it is truly irrelevant, then you
could easily use 5MB drives.
 
>> Also, hardware RAID is still more reliable than SSDs.
 
> Where did this one come from?
 
You're the one who claimed "hardware RAID is less reliable". Not me.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
Jerry Stuckle <jstucklex@attglobal.net>: Jun 03 08:13PM -0400

On 6/3/2016 5:42 PM, Richard wrote:
> failed before that time, we would replace the card for you.
 
> This warranty was built-in to all our products, not something you
> purchased as an add-on.
 
Sure, they have a warranty. But nothing compared to what good magnetic
drives support.
 
Sorry, Charlie. Just because you have a warranty does NOT mean you are
more reliable. Magnetic drives typically last much longer.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
Jerry Stuckle <jstucklex@attglobal.net>: Jun 03 08:16PM -0400

On 6/3/2016 11:37 AM, Scott Lurndal wrote:
>> operation. Typical salesman.
 
> Distinguished Engineer, if you please. Getting paid to build
> processors. Those who can, do. Those who can't, consult.
 
Yes, getting paid to solder components to boards. You obviously can't.
 
And consultants get paid for their knowledge and abilities that are
needed by the clients, not their ability to solder components to a
board. Something I was doing long before you were born.
 
You obviously have no idea what consultants do, and would never make it
as one, that's for sure.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
Jerry Stuckle <jstucklex@attglobal.net>: Jun 03 08:19PM -0400

On 6/3/2016 11:45 AM, Dan Cross wrote:
> Jerry is a *successful* consultant at anything. As for his time
> working at IBM: Well, someone's got to clean the toilets.)
 
> - Dan C.
 
Ah, hi, Danny. Trolling here also, huh?
 
Of course, nothing you say here has any merit, just like the other
groups you troll.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
cross@spitfire.i.gajendra.net (Dan Cross): Jun 04 01:45AM

In article <nit69c$59i$2@jstuckle.eternal-september.org>,
Jerry Stuckle <jstucklex@attglobal.net> wrote:
[snip]
>proved it once again.
 
>Plus, I know how to spell "stupid". But YOU are "stoopid". Calling you
>"stupid" would be an insult to stupid people everywhere.
 
You can't even trim what you quote when you respond.
http://rationalwiki.org/wiki/Dunning-Kruger_effect
 
- Dan C.
Jerry Stuckle <jstucklex@attglobal.net>: Jun 03 10:58PM -0400

On 6/3/2016 9:45 PM, Dan Cross wrote:
 
> You can't even trim what you quote when you respond.
> http://rationalwiki.org/wiki/Dunning-Kruger_effect
 
> - Dan C.
 
I can trim - when I want to. But you're just a troll - as is well-known
in multiple newsgroups.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
Ian Collins <ian-news@hotmail.com>: Jun 04 04:03PM +1200

On 06/ 4/16 12:12 PM, Jerry Stuckle wrote:
 
> Hey, it was YOU who said "drive size is irrelevant". I just carried it
> on to it's natural conclusion. If it is truly irrelevant, then you
> could easily use 5MB drives.
 
Well let's see, getting hold of 5MB drives would be a little tricky and
finding controller cards even more so. There may be enough 64MB dives
and SCSI HBAs around so let's use 64MB files to represent those drives.
 
Create the "drives":
 
for i in 0 1 2 3 4 5 6 7 8 9; do for j in 0 1 2 3 4 5 6 7 8 9; do mkfile
64m d$j$i; done; done;
 
Create a stripe of double parity volumes:
 
zpool create silly raidz2 /tmp/d{00..09} \
raidz2 /tmp/d{10..19} raidz2 /tmp/d{20..29} raidz2 /tmp/d{30..39} \
raidz2 /tmp/d{40..49} raidz2 /tmp/d{50..59} raidz2 /tmp/d{60..69} \
raidz2 /tmp/d{70..79} raidz2 /tmp/d{80..89} raidz2 /tmp/d{90..99}
 
See what we have:
 
zpool list silly
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
silly 5.78G 710K 5.78G 0% 1.00x ONLINE -
 
zpool status silly
pool: silly
state: ONLINE
scan: none requested
config:
 
NAME STATE READ WRITE CKSUM
silly ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
/tmp/d00 ONLINE 0 0 0
/tmp/d01 ONLINE 0 0 0
/tmp/d02 ONLINE 0 0 0
/tmp/d03 ONLINE 0 0 0
/tmp/d04 ONLINE 0 0 0
/tmp/d05 ONLINE 0 0 0
/tmp/d06 ONLINE 0 0 0
/tmp/d07 ONLINE 0 0 0
/tmp/d08 ONLINE 0 0 0
/tmp/d09 ONLINE 0 0 0
raidz2-1 ONLINE 0 0 0
/tmp/d10 ONLINE 0 0 0
/tmp/d11 ONLINE 0 0 0
/tmp/d12 ONLINE 0 0 0
/tmp/d13 ONLINE 0 0 0
/tmp/d14 ONLINE 0 0 0
/tmp/d15 ONLINE 0 0 0
/tmp/d16 ONLINE 0 0 0
/tmp/d17 ONLINE 0 0 0
/tmp/d18 ONLINE 0 0 0
/tmp/d19 ONLINE 0 0 0
raidz2-2 ONLINE 0 0 0
/tmp/d20 ONLINE 0 0 0
/tmp/d21 ONLINE 0 0 0
/tmp/d22 ONLINE 0 0 0
/tmp/d23 ONLINE 0 0 0
/tmp/d24 ONLINE 0 0 0
/tmp/d25 ONLINE 0 0 0
/tmp/d26 ONLINE 0 0 0
/tmp/d27 ONLINE 0 0 0
/tmp/d28 ONLINE 0 0 0
/tmp/d29 ONLINE 0 0 0
raidz2-3 ONLINE 0 0 0
/tmp/d30 ONLINE 0 0 0
/tmp/d31 ONLINE 0 0 0
/tmp/d32 ONLINE 0 0 0
/tmp/d33 ONLINE 0 0 0
/tmp/d34 ONLINE 0 0 0
/tmp/d35 ONLINE 0 0 0
/tmp/d36 ONLINE 0 0 0
/tmp/d37 ONLINE 0 0 0
/tmp/d38 ONLINE 0 0 0
/tmp/d39 ONLINE 0 0 0
raidz2-4 ONLINE 0 0 0
/tmp/d40 ONLINE 0 0 0
/tmp/d41 ONLINE 0 0 0
/tmp/d42 ONLINE 0 0 0
/tmp/d43 ONLINE 0 0 0
/tmp/d44 ONLINE 0 0 0
/tmp/d45 ONLINE 0 0 0
/tmp/d46 ONLINE 0 0 0
/tmp/d47 ONLINE 0 0 0
/tmp/d48 ONLINE 0 0 0
/tmp/d49 ONLINE 0 0 0
raidz2-5 ONLINE 0 0 0
/tmp/d50 ONLINE 0 0 0
/tmp/d51 ONLINE 0 0 0
/tmp/d52 ONLINE 0 0 0
/tmp/d53 ONLINE 0 0 0
/tmp/d54 ONLINE 0 0 0
/tmp/d55 ONLINE 0 0 0
/tmp/d56 ONLINE 0 0 0
/tmp/d57 ONLINE 0 0 0
/tmp/d58 ONLINE 0 0 0
/tmp/d59 ONLINE 0 0 0
raidz2-6 ONLINE 0 0 0
/tmp/d60 ONLINE 0 0 0
/tmp/d61 ONLINE 0 0 0
/tmp/d62 ONLINE 0 0 0
/tmp/d63 ONLINE 0 0 0
/tmp/d64 ONLINE 0 0 0
/tmp/d65 ONLINE 0 0 0
/tmp/d66 ONLINE 0 0 0
/tmp/d67 ONLINE 0 0 0
/tmp/d68 ONLINE 0 0 0
/tmp/d69 ONLINE 0 0 0
raidz2-7 ONLINE 0 0 0
/tmp/d70 ONLINE 0 0 0
/tmp/d71 ONLINE 0 0 0
/tmp/d72 ONLINE 0 0 0
/tmp/d73 ONLINE 0 0 0
/tmp/d74 ONLINE 0 0 0
/tmp/d75 ONLINE 0 0 0
/tmp/d76 ONLINE 0 0 0
/tmp/d77 ONLINE 0 0 0
/tmp/d78 ONLINE 0 0 0
/tmp/d79 ONLINE 0 0 0
raidz2-8 ONLINE 0 0 0
/tmp/d80 ONLINE 0 0 0
/tmp/d81 ONLINE 0 0 0
/tmp/d82 ONLINE 0 0 0
/tmp/d83 ONLINE 0 0 0
/tmp/d84 ONLINE 0 0 0
/tmp/d85 ONLINE 0 0 0
/tmp/d86 ONLINE 0 0 0
/tmp/d87 ONLINE 0 0 0
/tmp/d88 ONLINE 0 0 0
/tmp/d89 ONLINE 0 0 0
raidz2-9 ONLINE 0 0 0
/tmp/d90 ONLINE 0 0 0
/tmp/d91 ONLINE 0 0 0
/tmp/d92 ONLINE 0 0 0
/tmp/d93 ONLINE 0 0 0
/tmp/d94 ONLINE 0 0 0
/tmp/d95 ONLINE 0 0 0
/tmp/d96 ONLINE 0 0 0
/tmp/d97 ONLINE 0 0 0
/tmp/d98 ONLINE 0 0 0
/tmp/d99 ONLINE 0 0 0
 
errors: No known data errors
 
There, easy wasn't it?
 
>>> Also, hardware RAID is still more reliable than SSDs.
 
>> Where did this one come from?
 
> You're the one who claimed "hardware RAID is less reliable". Not me.
 
Than software, not SSDs.
 
So here's a question for you to ponder: how reliable is a RAID volume
built from SSDs?
 
--
Ian
cross@spitfire.i.gajendra.net (Dan Cross): Jun 04 12:56PM

In article <nitg3o$slt$1@jstuckle.eternal-september.org>,
>> http://rationalwiki.org/wiki/Dunning-Kruger_effect
 
>I can trim - when I want to. But you're just a troll - as is well-known
>in multiple newsgroups.
 
Uh huh. It would require knowing how to use a text editor. I will
also bet you literally cannot help keep yourself from responding to
this. Oh well, I won't see it; welcome to my plonkfile -- globally.
 
- Dan C.
Jerry Stuckle <jstucklex@attglobal.net>: Jun 04 09:55AM -0400

On 6/4/2016 8:56 AM, the well known troll Dan Cross wrote:
> also bet you literally cannot help keep yourself from responding to
> this. Oh well, I won't see it; welcome to my plonkfile -- globally.
 
> - Dan C.
 
Glad to hear it. Now why don't you go back to alt.feminism? Or did
everyone there plonk you, also, so you have no one to troll?
 
Or any of the other dozens of groups you are known to troll.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
Jerry Stuckle <jstucklex@attglobal.net>: Jun 04 09:59AM -0400

On 6/4/2016 12:03 AM, Ian Collins wrote:
> /tmp/d99 ONLINE 0 0 0
 
> errors: No known data errors
 
> There, easy wasn't it?
 
And not the same thing as using 5MB drives, is it? So you lied - and
drive size DOES matter. Typically troll.
 
 
> Than software, not SSDs.
 
> So here's a question for you to ponder: how reliable is a RAID volume
> built from SSDs?
 
Less reliable than one built from magnetic drives.
 
I could go into the gory details, but they are well beyond the limited
intelligence of a troll. I suggest you read up on SSD drives,
limitations to the number of writes to a block before failure, and the
circuitry required to balance block writes in the device.
 
But I know you won't, because you are incapable of understanding
anything above a 3rd grade reader. Just like all trolls.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
cross@spitfire.i.gajendra.net (Dan Cross): Jun 04 02:40PM

In article <niumiu$iso$2@jstuckle.eternal-september.org>,
>> this. Oh well, I won't see it; welcome to my plonkfile -- globally.
 
>Glad to hear it. Now why don't you go back to alt.feminism? Or did
>everyone there plonk you, also, so you have no one to troll?
 
Huh? I'm pretty sure I've never posted to alt.feminism. You must
have me confused with someone else.
 
>Or any of the other dozens of groups you are known to troll.
 
I'm also pretty sure I haven't posted to "dozens of groups" at all
in the last 15 years. Aagain you must have me confused with someone
else.
 
But I'm also pretty sure you are a pathological liar, so maybe you
are just making it up. Or perhaps you are just incompetent. Well,
that is certainly true; these things are clearly not mutually
exclusive. *shrug*
 
Welp. Now that I have corrected that misconception, back into the
kill-file you go, Jerry. I'm sure you'll respond; you're too much
of a narcissistic boor not too, but I really won't see it. I kind
of pity you in a sense: you must be a very sad and angry little man
who can't figure out why people don't seem to like you very much,
or why they all seem to roll their eyes when you come around to
"set them straight" or "educate" them, what with your "extensive
experience" as a ham radio operator and "45 years of programming."
 
- Dan C.
"Chris M. Thomasson" <nospam@nospam.no>: Jun 03 11:13PM -0700


> You have got that wrong as well. I doubt a full memory barrier is
> required. Acquire/release is almost certainly adequate (which also
> makes volatile irrelevant).
 
Actually, wrt an Asymmetric reader-writer mutex, well, one does kind of
"need" something like:
 
https://msdn.microsoft.com/en-us/library/windows/desktop/ms683148(v=vs.85).aspx
 
wrt:
 
https://groups.google.com/d/topic/comp.programming.threads/jGwZaYlk0fY/discussion
"K. Frank" <kfrank29.c@gmail.com>: Jun 03 05:03PM -0700

Hi Paul!
 
On Friday, June 3, 2016 at 4:40:11 PM UTC-4, Paul wrote:
> > > However, I want to express the fact that the vector only contains iterators to charList; With the above code, itrs could contain iterators to any list<char> and I don't want that
> ...
> Thanks to both of you for your advice. However, my issue is that I would prefer it if vector<list<char>::iterator> was instead a container which is restricted to only containing iterators of the particular list<char> which I called characters; rather than accepting any list<char>::iterator.
 
I don't think you can do what you want with the type system.
 
The closet I can think of would be to wrap your list<char>
in its own class, and only instantiate one instance of
it (make it a singleton or just use discipline). Then use
a vector<MyCharList::iterator>.
 
There is a similar issue already in the library. A number
of algorithm templates take a start and end iterator. They
have to be iterators of the same type, but nothing in the
type or template system can enforce that they point into
the same collection. (Probably undefined behavior if they
don't.) One solution would be to have algorithms that take
a range object (that might be a wrapper for a pair of
iterators). If range objects can only be constructed from
instances of collections, the constructors can enforce that
both ends of the range point into the same collection.
 
> Paul
 
 
Good luck.
 
 
K. Frank
Kalle Olavi Niemitalo <kon@iki.fi>: Jun 04 08:54AM +0300

> They have to be iterators of the same type, but nothing in the
> type or template system can enforce that they point into the
> same collection. (Probably undefined behavior if they don't.)
 
The same default-constructed istreambuf_iterator value works as a
past-the-end iterator in any streambuf of the correct type. This
wouldn't be possible with a bidirectional iterator though.
 
SCARY iterators further relax the type checks. Not only will the
type system not notice that the iterators are for different
containers, now it might not even notice that the containers have
different types.
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: