- Clever or tidy code snippets - 4 Updates
- Hardware advice - 2 Updates
- C++ 17 in detail - Part 1 - Language Features - 1 Update
cdalten@gmail.com: Mar 06 03:59PM -0800 Here is something from a beta Java project that I'm working on.. https://github.com/cdalten/WorkReminder/blob/master/app/src/main/java/com/example/cd/workreminder/BootReceiver.java If I would invert the expression, I wouldn't get a possible error when the device boots up. |
cdalten@gmail.com: Mar 06 04:00PM -0800 This is in reference to line 39. |
James Kuyper <jameskuyper@alumni.caltech.edu>: Mar 06 08:34PM -0800 > This is in reference to line 39. Line 39 is: if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) That code is java, not C++ - just because something would be a problem in Java doesn't tell you whether or not it would be a problem with C++. I'm not particularly familiar with Java, and therefore anything I say about that code below might be irrelevant - to Java. But this is a C++ newsgroup, and in C++ a member function like equals() doesn't have the same kind of symmetry that the != operator has. As a result, it's not at all clear what change to the code you have in mind when you talk about inverting the expression. Depending upon the actual semantics of those member functions, it's entirely plausible that there might be some good reason why you would need to invert the expression to get good results. But whatever that reason might be, it doesn't apply to the C++ code that we've been talking about. |
cdalten@gmail.com: Mar 07 05:47AM -0800 On Friday, March 6, 2020 at 8:34:18 PM UTC-8, James Kuyper wrote: > reason why you would need to invert the expression to get good results. > But whatever that reason might be, it doesn't apply to the C++ code that > we've been talking about. Inverting the expression I mean having if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) as if ("android.intent.action.BOOT_COMPLETED").equals(intent.getAction()) Is a bad practice. Because in the above case, the first catches the error at runtime while the other doesn't. While this might be okay in C++, carry this kind of practice over to other programming languages has some really really bad consequences. |
woodbrian77@gmail.com: Mar 06 09:59PM -0800 On Friday, March 6, 2020 at 1:02:38 AM UTC-6, Jorgen Grahn wrote: > Personally I would start with an old used PC and make plans for > replacing it if needed: it's not clear that he needs sixteen cores, > either. An old PC isn't very reassuring. For someone thinking about risking their future with me, it's understandable to hope for more than that. Given that Elon Musk thinks it's reasonable to live on Mars, I don't think it's much of a stretch that a SaaS provider have quality hardware. |
Real Troll <real.troll@trolls.com>: Mar 07 02:10AM -0400 > I've been using Duckduckgo.com for years as an alternative > to Google. > I don't have a "trial period". It's a free service. So you must be a troll who don't even understand what people are discussing on your own thread. Who was talking about duckduck and Google search engines? are you another mentally retarded nutter here? Google is running a business than spans many products. Google have what is called Google Cloud. I suggest use your duckduck (I don't think duckduck is a good search engine but anyway you are using it!! because of your mental issues) and search for that service before exposing yourself as another retarded nutter from the jungle of Palestine. |
Real Troll <real.troll@trolls.com>: Mar 07 01:35AM -0400 <https://lp.embarcadero.com/Cpp17eBook?utm_source=Eloqua&utm_medium=email&utm_content=Article-200306-CppBuildereBook> I have uploaded the book here: <https://drive.google.com/file/d/1W0Em5ioHiBdIG3LeXqpwla4wcPxvOBKq/view?usp=sharing> It saves you filling out the form!!!! |
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