Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • 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
Brand Logo

agnos.is Forums

  1. Home
  2. Programmer Humor
  3. average c++ dev

average c++ dev

Scheduled Pinned Locked Moved Programmer Humor
programmerhumor
116 Posts 63 Posters 3 Views
  • 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.
  • B [email protected]

    But it will let you do it if you really want to.

    Now, I've seen this a couple of times in this post. The idea that the compiler will let you do anything is so bizarre to me. It's not a matter of being allowed by the software to do anything. The software will do what you goddamn tell it to do, or it gets replaced.

    WE'RE the humans, we're not asking some silicon diodes for permission. What the actual fuck?!? We created the fucking thing to do our bidding, and now we're all oh pwueez mr computer sir, may I have another ADC EAX, R13? FUCK THAT! Either the computer performs like the tool it is, or it goes the way of broken hammers and lawnmowers!

    C This user is from outside of this forum
    C This user is from outside of this forum
    [email protected]
    wrote on last edited by [email protected]
    #107

    Yeah, but there's some things computers are genuinely better at than humans, which is why we code in the first place. I totally agree that you shouldn't ever be completely controlled by your machine, but strong nudging saves a lot of trouble.

    1 Reply Last reply
    1
    • merc@sh.itjust.worksM [email protected]

      "C++ compilers also warn you..."

      Ok, quick question here for people who work in C++ with other people (not personal projects). How many warnings does the code produce when it's compiled?

      I've written a little bit of C++ decades ago, and since then I've worked alongside devs who worked on C++ projects. I've never seen a codebase that didn't produce hundreds if not thousands of lines of warnings when compiling.

      A This user is from outside of this forum
      A This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #108

      My team uses the -Werror flag, so our code won't compile if there are any warnings at all.

      1 Reply Last reply
      4
      • A This user is from outside of this forum
        A This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #109

        Debugging code is always harder that writing it in the first place. If you make it as clever as you can, you won't be clever enough to debug it.

        1 Reply Last reply
        1
        • danhab99@programming.devD [email protected]

          I don't think that casting a range of bits as some other arbitrary type "is a bug nobody sees coming".

          C++ compilers also warn you that this is likely an issue and will fail to compile if configured to do so. But it will let you do it if you really want to.

          That's why I love C++

          O This user is from outside of this forum
          O This user is from outside of this forum
          [email protected]
          wrote on last edited by [email protected]
          #110

          The problem is that it's undefined behavior. Quake fast inverse square root only works before the types just happen to look that way. Because the floats just happens to have that bit arrangement. It could look very different on other machines! Nevermind that it's essentially always exactly the same on most architectures. So yeah. Undefined behavior is there to keep your code usable even if our assumptions about types and memory change completely one day.

          1 Reply Last reply
          1
          • danhab99@programming.devD [email protected]

            I don't think that casting a range of bits as some other arbitrary type "is a bug nobody sees coming".

            C++ compilers also warn you that this is likely an issue and will fail to compile if configured to do so. But it will let you do it if you really want to.

            That's why I love C++

            lillypip@lemmy.caL This user is from outside of this forum
            lillypip@lemmy.caL This user is from outside of this forum
            [email protected]
            wrote on last edited by [email protected]
            #111

            Why use a strongly typed language at all, then?

            Sounds unnecessarily restrictive, right? Just cast whatever as whatever and let future devs sort it out.

            $myConstant = ‘15’;
            $myOtherConstant = getDateTime();
            $buggyShit = $myConstant + $myOtherConstant;

            Fuck everyone who comes after me for the next 20 years.

            1 Reply Last reply
            6
            • V [email protected]

              With say a 3bit int, then a 2bit int and various char, int etc and so on you did have to use the pragma with gcc & visual around 2012 at least

              T This user is from outside of this forum
              T This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #112

              OK, I use the Keil ARM compiler, and never needed to push anything.

              V 1 Reply Last reply
              1
              • B [email protected]

                But it will let you do it if you really want to.

                Now, I've seen this a couple of times in this post. The idea that the compiler will let you do anything is so bizarre to me. It's not a matter of being allowed by the software to do anything. The software will do what you goddamn tell it to do, or it gets replaced.

                WE'RE the humans, we're not asking some silicon diodes for permission. What the actual fuck?!? We created the fucking thing to do our bidding, and now we're all oh pwueez mr computer sir, may I have another ADC EAX, R13? FUCK THAT! Either the computer performs like the tool it is, or it goes the way of broken hammers and lawnmowers!

                P This user is from outside of this forum
                P This user is from outside of this forum
                [email protected]
                wrote on last edited by
                #113

                New copypasta just dropped

                1 Reply Last reply
                0
                • T [email protected]

                  OK, I use the Keil ARM compiler, and never needed to push anything.

                  V This user is from outside of this forum
                  V This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #114

                  Then I'd make a unit test, there is no requirement to do so by the compiler (not even the order).

                  1 Reply Last reply
                  0
                  • danhab99@programming.devD [email protected]

                    I don't think that casting a range of bits as some other arbitrary type "is a bug nobody sees coming".

                    C++ compilers also warn you that this is likely an issue and will fail to compile if configured to do so. But it will let you do it if you really want to.

                    That's why I love C++

                    K This user is from outside of this forum
                    K This user is from outside of this forum
                    [email protected]
                    wrote on last edited by
                    #115

                    Guys hi, just looking for some support share, a Fantasy Adventure Story, for all ages and just some entertain with some storyes: https://www.youtube.com/watch?v=_mVIvQ1wsgg - maybe you are curious

                    1 Reply Last reply
                    0
                    • merc@sh.itjust.worksM [email protected]

                      So, did you get it down to 0 warnings and manage to keep it there? Or did it eventually start creeping up again?

                      S This user is from outside of this forum
                      S This user is from outside of this forum
                      [email protected]
                      wrote on last edited by
                      #116

                      Once we were at zero warnings, we enabled warnings as errors, despite the protestation of the grognards on the team.

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


                      • Login

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