|
The problem comes when you get this:
if (a == b)
c();
d(); Or you try to add debugging lines to find out what is happening:
if (a == b)
printf("a equals b\n");
c();
d(); And you start scratching your head to work out why adding debug code changes the results ...
That's why I always use curly brackets:
if (a == b)
{
c();
d();
} Even I can't muck it up then!
Hopefully.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I mean, I get it but even skimming really fast I saw that c() and d() always get called. It's probably just me.
Real programmers use butterflies
|
|
|
|
|
I make this clear by writing
if(a == b) c();
I don't see the need for the line break (or a space after control keywords like if , he says, donning his asbestos suit). But if it won't fit in my self-imposed 80 columns, or if I want a line break for debugging purposes, I add braces:
if(a == b)
{
c();
}
Unless, of course, there's an else clause, which also makes things clear:
if(a == b)
c();
else
d();
But if either the "then" part or else part needs braces for multiple statements, the other one also gets them.
Aren't you glad you brought this up?!
|
|
|
|
|
Hey, they are multifunctional!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Warning: This code comes with side effects.
Real programmers use butterflies
|
|
|
|
|
in the 1997 remake the Jackel, the assassin uses a remote controlled machine gun housed in a van.
sound familiar
|
|
|
|
|
That's a seriously irritating article. I feel like they are talking to 5 yo's.
fwiw, I know I've read where in Syria, one side was using cheap drones to drop C4 on soldiers. It's amazing we haven't had a swarm attack somewhere. And there is another story where some Australian decided to try and build a cruise missile with nothing but off the shelf components. I think he got it to significant range, GPS navigation, and could carry a "payload" of something like 100 Kg.
Yeah, genie is out of the bottle.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
charlieg wrote: That's a seriously irritating article. I feel like they are talking to 5 yo's. Gee ... The 5 yo's you are talking to are quite different from those I meet!
|
|
|
|
|
My point is that there is zero information in it. It's like they are having a conversation with themselves.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
The hardware has obviously existed for a few decades, at least. I remember a regular column in Byte back in the '80s, Ciarcia's Circuit Cellar, in which Steve Ciarcia built all manner of interesting gadgets, publishing the circuit diagrams. Building something like a remote-controlled machine gun would have been simple for him.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Hi all
Where are the Sacha Barber articles?
I wanted to read the newest one and got a 404
sincerely
|
|
|
|
|
I can see them: Search Sacha[^]
Sometimes CodeProject is a bit too busy apparently ...
|
|
|
|
|
|
Nothing wrong with it
|
|
|
|
|
Now it works
|
|
|
|
|
Clear your browser cache. I ran into a similar issue before.
Real programmers use butterflies
|
|
|
|
|
Are you using FireFox, by chance? I found that the new settings for proxy :
Enable DNS over HTTPS
Use Provider: CloudFlare
were failing fairly regularly and causing blank page loads. Just a thought.
|
|
|
|
|
I was looking into buying an e-reader, one with the e-paper so I can read it outdoors ( having computers enough at home for the purpose). It turns out that it's no easy matter.
In particular, there are accessibility concerns and privacy concerns.
From what I could gather online, Kindle makes you jump through hoops if you don't get the items through them. Apparently, a credit card is necessary to activate it, as well. I want one that doesn't need to be connected to the internet ever, unless I want it to be.
Anyone here know anything, or is it a lost cause.
Time to cook and have our evening feeding. G'night all
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I got fed up with dedicated readers, and just use my Surface Go 2(with Sumatra PDF), or an Android tablet (with FB Reader).
The battery life isn't as good as an eInk / ePaper device, but it's a whole load more flexible when you need it to be.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Upvoted for FB Reader
Cheers,
विक्रम
"We have already been through this, I am not going to repeat myself." - fat_boy, in a global warming thread
|
|
|
|
|
That would have been (i.e., a tablet or something akin to it) the easy choice except that they're not very good in bright light. I'm thinking outdoors environments.
Fed up as a decision seems to coordinate with what is described by users, at least for the more current models.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I have FB Reader everywhere, including on my phone which is good enough for the couple of hundred books I keep there. Handles all formats I know about except .CBR (for comics).
You can customise it with black background and some whitish colour text so it works in bright light.
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
|
I want one that will accept lots of sources without any sort of conversions or add-in applications.
Also, one that doesn't have a vested interest beyond selling me the device and making me happy so I eventually am a repeat customer.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I have a Kindle (only second generation), which is connected to the internet (via wifi) only when I allow it. I can read anything that is loaded on it anywhere. I can create documents and email them to Kindle to get them downloaded onto the reader. I can read other e-books in mobi format quite happily. I also have the Kindle reader on my PC and iPad and can sync any book with those devices if I want. All in all one of the most useful PC type devices I ever bought.
|
|
|
|