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 9 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.
  • 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++

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

    I don't know which is worse. Using C++ like lazy C, or using C++ like it was designed to be used.

    S 1 Reply Last reply
    12
    • 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++

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

      Structs with union members that allow the same place in memory to be accessed either word-wise, byte-wise, or even bit-wise are a god-sent for everyone who needs to access IO-spaces, and I'm happy my C-compiler lets me do it.

      V 1 Reply Last reply
      15
      • 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++

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

        No need to cast as any types at all just work with bits directly /s

        1 Reply Last reply
        6
        • 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++

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

          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!

          buboscandiacus@mander.xyzB D W anyoldname3@lemmy.worldA T 9 Replies Last reply
          28
          • 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!

            buboscandiacus@mander.xyzB This user is from outside of this forum
            buboscandiacus@mander.xyzB This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #32

            Ok gramps now take your meds and off you go to the retirement home

            B 1 Reply Last reply
            19
            • U [email protected]

              I used to love C++ until I learned Rust. Now I think it is obnoxious, because even if you write modern C++, without raw pointers, casting and the like, you will be constantly questioning whether you do stuff right. The spec is just way too complicated at this point and it can only get worse, unless they choose to break backwards compatibility and throw out the pre C++11 bullshit

              mobotsar@sh.itjust.worksM This user is from outside of this forum
              mobotsar@sh.itjust.worksM This user is from outside of this forum
              [email protected]
              wrote on last edited by [email protected]
              #33

              Depending on what I'm doing, sometimes rust will annoy me just as much. Often I'm doing something I know is definitely right, but I have to go through so much ceremony to get it to work in rust. The most commonly annoying example I can think of is trying to mutably borrow two distinct fields of a struct at the same time. You can't do it. It's the worst.

              1 Reply Last reply
              10
              • 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!

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

                I will botton for my rust compiler, I'm not going to argue with it.

                1 Reply Last reply
                10
                • 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++

                  gobbel2000@programming.devG This user is from outside of this forum
                  gobbel2000@programming.devG This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #35

                  I'm all for having the ability to do these shenanigans in principle, but prefer if they are guarded in an unsafe block.

                  1 Reply Last reply
                  20
                  • 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!

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

                    when life gives you restrictive compilers, don't request permission from them! make life take the compilers back! Get mad! I don’t want your damn restrictive compilers, what the hell am I supposed to do with these? Demand to see life’s manager! Make life rue the day it thought it could give BigDanishGuy restrictive compilers! Do you know who I am? I’m the man who’s gonna burn your house down! With the compilers! I’m gonna get my engineers to invent a combustible compiler that burns your house down!

                    1 Reply Last reply
                    5
                    • S [email protected]

                      https://en.m.wikipedia.org/wiki/Fast_inverse_square_root

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

                      They know. It's a comment from the code.

                      1 Reply Last reply
                      22
                      • I [email protected]

                        Rust isn't memory safe because you can invoke another program that isn't memory safe?

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

                        My comment is sarcastic, obviously. The argument Kairos gave is similar to this. You can still introduce vulnerabilities. The issue is normally that you introduce them accidentally. Rust gives you safety, but does not put your code into a sandbox. It looked to me like they weren't aware of this difference.

                        1 Reply Last reply
                        6
                        • 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!

                          anyoldname3@lemmy.worldA This user is from outside of this forum
                          anyoldname3@lemmy.worldA This user is from outside of this forum
                          [email protected]
                          wrote on last edited by
                          #39

                          Soldiers are supposed to question potentially-illegal orders and refuse to execute them if their commanding officer can't give a good reason why they're justified. Being in charge doesn't mean you're infallible, and there are plenty of mistakes programmers make that the compiler can detect.

                          B 1 Reply Last reply
                          8
                          • L [email protected]

                            People just think that applying arbitrary rules somehow makes software magically more secure, like with rust, as if the compiler won't just "let you" do the exact same fucking thing if you type the unsafe keyword

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

                            You don't need unsafe to write vulnerable code in rust.

                            https://github.com/Speykious/cve-rs

                            L 1 Reply Last reply
                            3
                            • anyoldname3@lemmy.worldA [email protected]

                              Soldiers are supposed to question potentially-illegal orders and refuse to execute them if their commanding officer can't give a good reason why they're justified. Being in charge doesn't mean you're infallible, and there are plenty of mistakes programmers make that the compiler can detect.

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

                              I get the analogy, but I don't think that it's valid. Soldiers are, much to the chagrin of their commanders, sentient beings, and should question potentially illegal orders.

                              Where the analogy doesn't hold is, besides my computer not being sentient, what I'm prevented from doing isn't against the law of man.

                              I'm not claiming to be infallible. After all to err is human, and I'm indeed very human. But throw me a warning when I do something that goes against best practices, that's fine. Whether I deal with it is something for me to decide. But stopping me from doing what I'm trying to do, because it's potentially problematic? GTFO with that kinda BS.

                              1 Reply Last reply
                              2
                              • buboscandiacus@mander.xyzB [email protected]

                                Ok gramps now take your meds and off you go to the retirement home

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

                                Stupid cloud, who's laughing now?

                                1 Reply Last reply
                                2
                                • 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++

                                  merc@sh.itjust.worksM This user is from outside of this forum
                                  merc@sh.itjust.worksM This user is from outside of this forum
                                  [email protected]
                                  wrote on last edited by
                                  #43

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

                                  J V S W zacryon@feddit.orgZ 11 Replies Last reply
                                  40
                                  • merc@sh.itjust.worksM This user is from outside of this forum
                                    merc@sh.itjust.worksM This user is from outside of this forum
                                    [email protected]
                                    wrote on last edited by
                                    #44

                                    Not only that, but everyone who sees that code later is going to waste so much time trying to understand it. That includes future you.

                                    zacryon@feddit.orgZ 1 Reply Last reply
                                    5
                                    • 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!

                                      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 [email protected]
                                      #45

                                      This comment makes me want to reformat every fucking thing i use and bend it to -my- will like some sort of technomancer

                                      1 Reply Last reply
                                      0
                                      • 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.

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

                                        You shouldn't have any warnings. They can be totally benign, but when you get used to seeing warnings, you will not see the one that does matter.

                                        merc@sh.itjust.worksM 1 Reply Last reply
                                        15
                                        • 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++

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

                                          As it should be. Airbags should go off when you crash, not when you drive near the edge of a cliff.

                                          1 Reply Last reply
                                          12
                                          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