- Saint Paul, Minnesota user group - 1 Update
- Structured binding considered harmful - 24 Updates
woodbrian77@gmail.com: Mar 21 11:42AM -0700 On Saturday, March 14, 2020 at 4:28:29 PM UTC-5, Real Troll wrote: > If you are serious about this than please start a new group at this link: > <https://www.meetup.com/> There are some good alternatives to that: https://duckduckgo.com/?q=meetup+alternatives&ia=web > After the meeting, people normally go for drinks at > their own costs, of course. G-d willing, we'll be able to do that again soon, but the restaurants and bars in this area are closed for "dining in". Brian Ebenezer Enterprises http://webEbenezer.net |
"Öö Tiib" <ootiib@hot.ee>: Mar 20 04:37PM -0700 On Friday, 20 March 2020 19:36:35 UTC+2, Daniel wrote: > > And that is the other property of bad code, things named "iter", "ptr", > > "data", "buf", "container" and other such "foo" and "poo". > I would use "it", for a local iterator variable :-) Also i/j/k for indices. Good idea, "it" instead of "iter" saves whole whopping 2 characters from: std::vector<std::pair<std::string, int>>::const_iterator it = container.begin(); > > std::cout << e.first << ": " << e.second << '\n'; > > } > I disagree. From that, you _know_ that e is not a proxy type. That does not grant me any understanding. I still do _not_ know if it is copy of object or implicit conversion of it. Ironically from "auto e" I would at least know that it is copy. Bad code stays bad. |
Daniel <danielaparker@gmail.com>: Mar 20 05:17PM -0700 On Friday, March 20, 2020 at 7:37:25 PM UTC-4, Öö Tiib wrote: > Good idea, "it" instead of "iter" saves whole whopping 2 characters from: > std::vector<std::pair<std::string, int>>::const_iterator it > = container.begin(); Personally, I would use auto it = container.begin(); (I'm reading a lot of rust code these days, where the convention is to use very short names.) > Ironically from "auto e" I would at least know that it is copy. Yes, but a copy of what? In the case of a proxied container, that would be a copy of a proxy, which you probably wouldn't want. A proxy cannot be safely assumed to have a life longer than a single statement. Daniel |
James Kuyper <jameskuyper@alumni.caltech.edu>: Mar 20 08:15PM -0700 On Friday, March 20, 2020 at 8:40:21 AM UTC-4, Bonita Montero wrote: > > therefore don't need to read the part where the container was > > defined or declared. ... > Usually not. "Often" is fully compatible with "usually not". A situation that comes up 30% of the time could still be described as coming up fairly often, despite not usually coming up. So that doesn't constitute a disagreement. |
Sam <sam@email-scan.com>: Mar 20 11:23PM -0400 Daniel writes: > > In your case, definitely. But not in the case of those who have above- > > average C++ skills and experience. > Bm7 | E7 | Some kind of a secret code? > He's Trolling > G F#m7 I misplaced my secret decoder ring, so this won't work for me. > And he hopes you like trolling too Well, all the available evidence suggests that I've been trolling, off and on, since he/she/it was in diapers. The only major difference is that I only troll the trollers. |
Keith Thompson <Keith.S.Thompson+u@gmail.com>: Mar 20 09:08PM -0700 Sam <sam@email-scan.com> writes: [...] > Well, all the available evidence suggests that I've been trolling, off > and on, since he/she/it was in diapers. The only major difference is > that I only troll the trollers. No, when you post on a public newsgroup you troll all of us. If you feed the troll, you are a troll. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */ |
Bonita Montero <Bonita.Montero@gmail.com>: Mar 21 06:30AM +0100 >> Usually not. > In your case, definitely. But not in the case of those who have > above-average C++ skills and experience. It doesn't depend on the skills. You have to know the type of the container which is usually not necessary if there is an explicit definition of the type iterated through. |
Bonita Montero <Bonita.Montero@gmail.com>: Mar 21 06:31AM +0100 >> It doesn't depend on how good the code is written. You would have to >> have a crystal bulb to guess the type auto refers to in this case. > No, the type it refers to is very obvious. ... if you know the type of the container. |
Ralf Goertz <me@myprovider.invalid>: Mar 21 08:24AM +0100 Am Fri, 20 Mar 2020 23:23:30 -0400 > > G F#m7 > I misplaced my secret decoder ring, so this won't work for me. > > And he hopes you like trolling too The code is not that secret considering that e.g. Bm7 just means "bd(f#)a" in any order… |
jacobnavia <jacob@jacob.remcomp.fr>: Mar 21 08:32AM +0100 Le 21/03/2020 à 04:15, James Kuyper a écrit : > comes up 30% of the time could still be described as coming up > fairly often, despite not usually coming up. So that doesn't > constitute a disagreement. That is often true, sometimes. :-) |
Daniel <danielaparker@gmail.com>: Mar 21 01:36AM -0700 On Friday, March 20, 2020 at 11:23:42 PM UTC-4, Sam wrote: > Daniel writes: > > Bm7 | E7 | > Some kind of a secret code? No, chord suggestions > G F#m7 > And he hopes you like trolling too > I only troll the trollers. It's not working. Bonita is replying, but staying measured and reasonable. That's not what a troll wants. Daniel |
Daniel <danielaparker@gmail.com>: Mar 21 01:43AM -0700 On Tuesday, March 17, 2020 at 3:46:46 PM UTC-4, Melzzzzz wrote: > It's called destructuring/pattern match in other languages. C++ wants that > badly. > Rust => is that way. Totally agree. If C++17 had gotten matching into the language, there would have been no need for std::visit <shudder>. Daniel |
David Brown <david.brown@hesbynett.no>: Mar 21 11:27AM +0100 On 21/03/2020 08:32, jacobnavia wrote: >> constitute a disagreement. > That is often true, sometimes. > :-) Can we pretend that this is stackoverflow.com, mark this post as "the answer", and close the thread? This pantomime thread has been seriously tedious. <https://i.pinimg.com/originals/d5/46/b2/d546b28c3c679602ef229917efff1ed1.gif> |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Mar 21 01:34PM On 21/03/2020 10:27, David Brown wrote: >> :-) > Can we pretend that this is stackoverflow.com, mark this post as "the answer", and close the thread? This pantomime thread has been seriously tedious. > <https://i.pinimg.com/originals/d5/46/b2/d546b28c3c679602ef229917efff1ed1.gif> Unsurprisingly tedious, relative speaking, perhaps, of course! /Flibble -- "Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
Sam <sam@email-scan.com>: Mar 21 09:50AM -0400 Bonita Montero writes: >>> have a crystal bulb to guess the type auto refers to in this case. >> No, the type it refers to is very obvious. > ... if you know the type of the container. A real C++ developer doesn't need to know the type of a container in order to implement well-defined algorithms. You better everyone who writes template code that what they're doing is impossible. They're writing code that operates on templates whose type they don't know, after all. |
Sam <sam@email-scan.com>: Mar 21 09:51AM -0400 Bonita Montero writes: >> In your case, definitely. But not in the case of those who have above- >> average C++ skills and experience. > It doesn't depend on the skills. Yes, it does. > You have to know the type If you have the right skills, you don't need to know the type. That's what separates a real C++ developer from a wanna-be. |
Bonita Montero <Bonita.Montero@gmail.com>: Mar 21 02:59PM +0100 > You better everyone who writes template code that what they're doing is > impossible. They're writing code that operates on templates whose type > they don't know, after all. Usually the container isn't a template-parameter itself so you know the type of the container. |
Daniel <danielaparker@gmail.com>: Mar 21 07:11AM -0700 On Saturday, March 21, 2020 at 6:28:08 AM UTC-4, David Brown wrote: Regarding auto, the only substantive issue here is whether auto can always be used safely, and the _answer_ is clearly and demonstrably "no", which is Bonita's point. In particular it can't be used with classes following popular proxy idioms without introducing undefined behavior. I don't believe that's applicable to the OP's post, though :-) Daniel |
Sam <sam@email-scan.com>: Mar 21 10:42AM -0400 Bonita Montero writes: >> don't know, after all. > Usually the container isn't a template-parameter itself so you know > the type of the container. Completely wrong, you're just not very experienced with template metaprogramming. |
Sam <sam@email-scan.com>: Mar 21 10:45AM -0400 Daniel writes: > Regarding auto, the only substantive issue here is whether auto can always be > used safely, and the _answer_ is clearly and demonstrably "no", which is > Bonita's point. Can a while loop always be used safely? Of course not. I've seen plenty of while-loops that result in undefined behavior, due to memory corruption. Everyone: please stop using while loops. They are not safe. |
Daniel <danielaparker@gmail.com>: Mar 21 08:03AM -0700 On Saturday, March 21, 2020 at 10:45:35 AM UTC-4, Sam wrote: > Can a while loop always be used safely? Of course not. "Therefore, send not to know For whom the troll trolls, It trolls for thee." |
Bonita Montero <Bonita.Montero@gmail.com>: Mar 21 04:09PM +0100 >> the type of the container. > Completely wrong, you're just not very experienced with template > metaprogramming. You didn't understand what I wrote. |
Sam <sam@email-scan.com>: Mar 21 11:12AM -0400 Bonita Montero writes: >> Completely wrong, you're just not very experienced with template >> metaprogramming. > You didn't understand what I wrote. Only the voices in your head understand what you write. |
"Öö Tiib" <ootiib@hot.ee>: Mar 21 10:09AM -0700 On Saturday, 21 March 2020 02:17:22 UTC+2, Daniel wrote: > > = container.begin(); > Personally, I would use > auto it = container.begin(); And I don't use neither "it" nor "container" for name of anything. > (I'm reading a lot of rust code these days, where the convention is to use > very short names.) Perhaps people are translating their legacy algorithms from FORTRAN to see how it performs. > > Ironically from "auto e" I would at least know that it is copy. > Yes, but a copy of what? In the case of a proxied container, that would be > a copy of a proxy, which you probably wouldn't want. A proxy cannot be safely assumed to have a life longer than a single statement. I do not have nor use peroxided containers. Several tools warn me about std::vector<bool> usage. It is not container nor does it contain bools. Such things are worse than raw pointers that at least lack bloat. You use it? Maybe you overload operator,() and unary operator&() as well ... I don't and my tools warn about lot of such usage of nuisance language features that should not be there at first place. |
Daniel <danielaparker@gmail.com>: Mar 21 11:21AM -0700 On Saturday, March 21, 2020 at 1:09:21 PM UTC-4, Öö Tiib wrote: > people are translating their legacy algorithms from FORTRAN ... > I do not have nor use peroxided containers ... > Maybe you overload operator,() and unary operator&() as well ... I'm sorry if my post has made you angry and upset. I don't know how to respond to any of your statements above. My point was narrow, and fully expostulated in my other posts. Best regards, Daniel |
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:
Post a Comment