Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. The Lounge
  3. The new IoT?

The new IoT?

Scheduled Pinned Locked Moved The Lounge
comiotquestionannouncement
23 Posts 9 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • honey the codewitchH honey the codewitch

    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

    OriginalGriffO Offline
    OriginalGriffO Offline
    OriginalGriff
    wrote on last edited by
    #14

    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 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

    honey the codewitchH 1 Reply Last reply
    0
    • OriginalGriffO OriginalGriff

      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!

      honey the codewitchH Offline
      honey the codewitchH Offline
      honey the codewitch
      wrote on last edited by
      #15

      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

      OriginalGriffO 1 Reply Last reply
      0
      • honey the codewitchH honey the codewitch

        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

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #16

        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 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

        honey the codewitchH Greg UtasG 2 Replies Last reply
        0
        • OriginalGriffO OriginalGriff

          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!

          honey the codewitchH Offline
          honey the codewitchH Offline
          honey the codewitch
          wrote on last edited by
          #17

          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

          1 Reply Last reply
          0
          • OriginalGriffO OriginalGriff

            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!

            Greg UtasG Offline
            Greg UtasG Offline
            Greg Utas
            wrote on last edited by
            #18

            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.

            <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
            <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

            1 Reply Last reply
            0
            • D Daniel Pfeffer

              [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.

              T Offline
              T Offline
              The Other John Ingram
              wrote on last edited by
              #19

              in the 1997 remake the Jackel, the assassin uses a remote controlled machine gun housed in a van. sound familiar

              1 Reply Last reply
              0
              • D Daniel Pfeffer

                [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.

                C Offline
                C Offline
                charlieg
                wrote on last edited by
                #20

                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

                T D 2 Replies Last reply
                0
                • C charlieg

                  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

                  T Offline
                  T Offline
                  trønderen
                  wrote on last edited by
                  #21

                  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!

                  C 1 Reply Last reply
                  0
                  • C charlieg

                    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

                    D Offline
                    D Offline
                    Daniel Pfeffer
                    wrote on last edited by
                    #22

                    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.

                    1 Reply Last reply
                    0
                    • T trønderen

                      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!

                      C Offline
                      C Offline
                      charlieg
                      wrote on last edited by
                      #23

                      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

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups