The new IoT?
-
Not even your if-statements of mass destruction? ;p
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
Those if statements are designed to test your mettle, not to blow up children. :sigh:
Real programmers use butterflies
-
Those if statements are designed to test your mettle, not to blow up children. :sigh:
Real programmers use butterflies
honey the codewitch wrote:
not to blow up children in your face
FTFY :thumbsup: Consider my mettle tested :laugh:
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
Those if statements are designed to test your mettle, not to blow up children. :sigh:
Real programmers use butterflies
Hey, they are multifunctional! :-D
"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!
-
honey the codewitch wrote:
not to blow up children in your face
FTFY :thumbsup: Consider my mettle tested :laugh:
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
I can't even recall a time I've ever run into the problem {} is supposed to solve w/ if statements. Maybe it's you? :laugh:
Real programmers use butterflies
-
Hey, they are multifunctional! :-D
"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
-
I can't even recall a time I've ever run into the problem {} is supposed to solve w/ if statements. Maybe it's you? :laugh:
Real programmers use butterflies
I have ... back in the days before editors auto-indented for you. And it was a sod to track down, because I tend to read what I meant to write, rather than what I actually did. :sigh:
"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 have ... back in the days before editors auto-indented for you. And it was a sod to track down, because I tend to read what I meant to write, rather than what I actually did. :sigh:
"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'm still using editors that don't. I guess I'm just wired such that it doesn't trip me up. I always read the next line of non-comment code after an if as conditional. That's just how I work, for better or worse.
if(flag.test_and_set());
would screw me up but nobody would do that on purpose. Not even me.
Real programmers use butterflies
-
I'm still using editors that don't. I guess I'm just wired such that it doesn't trip me up. I always read the next line of non-comment code after an if as conditional. That's just how I work, for better or worse.
if(flag.test_and_set());
would screw me up but nobody would do that on purpose. Not even me.
Real programmers use butterflies
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 ... :laugh: That's why I always use curly brackets:
if (a == b)
{
c();
d();
}Even I can't muck it up then! :-D Hopefully. :sigh:
"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!
-
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 ... :laugh: That's why I always use curly brackets:
if (a == b)
{
c();
d();
}Even I can't muck it up then! :-D Hopefully. :sigh:
"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
-
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 ... :laugh: That's why I always use curly brackets:
if (a == b)
{
c();
d();
}Even I can't muck it up then! :-D Hopefully. :sigh:
"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 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?!Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing. -
[Iran scientist 'killed by remote-controlled weapon' - BBC](https://www.bbc.com/news/world-middle-east-55128970) Internet of Termination?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
in the 1997 remake the Jackel, the assassin uses a remote controlled machine gun housed in a van. sound familiar
-
[Iran scientist 'killed by remote-controlled weapon' - BBC](https://www.bbc.com/news/world-middle-east-55128970) Internet of Termination?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
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
-
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
-
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
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.
-
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