kuuhana
  • Communities
  • Multi-communities
  • Support Lemmy
  • Search
  • Login
  • Sign Up
Programmer Humor@programming.devbyBjörn@swg-empire.de
2 years

Pretty straight forward

swg-empire.de

By https://www.youtube.com/@yousuckatprogramming

47
    You must log in or register to comment.

    • Scoopta@programming.dev
      2 years

      …this is so much more cursed than it needs to be. If you want to bash in C just system("echo hello world");

        • tempest@lemmy.ca
          2 years

          That wouldn’t necessarily be bash though

            • smeg@feddit.ukEnglish
              2 years

              Fine, system("bash -c 'echo hello world'"); then!

                • xthexder@l.sw0.com
                  2 years

                  Now print “¯\_(ツ)_/¯” with the quotes

                    • ultrafastsloth@lemmy.world
                      2 years

                      I decided to throw my PC in the composter and become a gardener

                      • Beanie@programming.dev
                        2 years

                        my best guess: system("bash -c 'echo \\\"¯\\\\_(ツ)_/¯\\\"'");

                        which will get parsed as: bash -c 'echo \"¯\\_(ツ)_/¯\"'

                        which will run: echo "¯\_(ツ)_/¯"

                        and since echo just prints whatever was given to it, it’ll print "¯\_(ツ)_/¯" with the quotes

                        • smeg@feddit.ukEnglish
                          2 years

                          That was actually the first line of C I’ve ever written so there’s no way I’m guessing the right number of escapes, but I guess I’d cheat by finding the value of each char and printing those one at a time.

                      • Scoopta@programming.dev
                        2 years

                        Fair, should’ve just said shell

                    • xia@lemmy.sdf.orgEnglish
                      2 years

                      Tsk tsk… forgot to clean up your temp file!

                      • DreamButt@lemmy.worldEnglish
                        2 years

                        For shame. They forgot to make a script to make a tmp script using mktmp, so they can store their tmp script in the tmp script and have proper cleanup

                        • ClassifiedPancake@discuss.tchncs.de
                          2 years

                          That emoji annoys me more than I would like

                            • kamen@lemmy.world
                              2 years

                              As if someone’s telling a joke and saying “This is where you should laugh”

                                • Deebster@programming.devEnglish
                                  2 years

                                  It’s the meme version of a laugh track

                                    • kamen@lemmy.worldEnglish
                                      2 years

                                      Laugh tracks have a purpose though. I understand they’re not to everyone’s liking - and that’s fine, but they work for some comedy shows - and usually they’re from the live audience that sees things performed in front of them.

                                • Artyom@lemm.ee
                                  2 years

                                  Always follow best practices, make sure you cleanup by deleting the hello world bash file!

                                  • misteloct@lemmy.world
                                    2 years

                                    My coworkers could learn a thing or two from this. For one, it actually works.

                                    • MonkderVierte@lemmy.ml
                                      2 years

                                      Sure.

                                        • potoo22@programming.dev
                                          2 years

                                          Okay but 🍒 shouldn’t output 🍉. This is inconsistent and confusing. We have standards.

                                          • Opisek@lemmy.world
                                            2 years

                                            Picking emojis that make sense actually made it easy to read.

                                          • mkwt@lemmy.world
                                            2 years

                                            Violates CERT C ENV33-C.

                                              • ArtVandelay@lemmy.worldEnglish
                                                2 years

                                                It violates oh so much including that.

                                              • tiredofsametab@fedia.io
                                                2 years

                                                Now call that C program from some other program in another language.

                                                  • JasonDJ@lemmy.zip
                                                    2 years
                                                    with open('program.c', 'w') as f:
                                                        f.write(
                                                    """I'm not actually going to copy down the program... 
                                                    
                                                    But you get the idea of the joke.
                                                    
                                                    Right?""")
                                                    • Björn@swg-empire.de
                                                      2 years

                                                      Rust, to make it safe.

                                                        • tiredofsametab@fedia.io
                                                          2 years

                                                          step 1: unsafe fn()…

                                                            • Traister101@lemmy.today
                                                              2 years

                                                              Ah yes now I can… dereference a raw pointer (yes that’s essentially the only thing unsafe rust actually enables you to do, it doesn’t disable the borrow checker or anything else, it just allows you to play with pointers)

                                                                • calcopiritus@lemmy.world
                                                                  2 years
                                                                  unsafe fn<'a, T>(p: &'a T) -> &'static mut T {
                                                                      p as *cons T as *mut T as &'static mut T
                                                                  }
                                                                  

                                                                  It is a bit more than just dereferencing raw pointers.

                                                            • xthexder@l.sw0.com
                                                              2 years

                                                              May I present to you: https://github.com/mame/quine-relay

                                                                • tiredofsametab@fedia.io
                                                                  2 years

                                                                  It’s… Beautiful.

                                                              • tetris11@lemmy.ml
                                                                2 years

                                                                why would you hurt me like this

                                                                • CrimsonMishaps@lemmy.world
                                                                  2 years

                                                                  Fucking brilliant

                                                                  • BartyDeCanter@lemmy.sdf.org
                                                                    2 years

                                                                    Thanks, I hate it.

                                                                    • thann@lemmy.dbzer0.comEnglish
                                                                      2 years

                                                                      Who says C isnt mem safe?

                                                                      • qaz@lemmy.worldEnglish
                                                                        2 years

                                                                        Some time ago I wrote a program in COBOL and half of it was just CALL "SYSTEM" BY CONTENT in the end.

                                                                          • mexicancartel@lemmy.dbzer0.comEnglish
                                                                            2 years

                                                                            I did the same with python once lol.

                                                                            I didn’t know enoug python or bash so i mixed both with os.system

                                                                          • SnausagesinaBlanket@lemmy.world
                                                                            2 years

                                                                            Dave is not here.

                                                                            Programmer Humor@programming.dev

                                                                            programmer_humor@programming.dev

                                                                            Subscribe from remote instance

                                                                            Create post

                                                                            Report community

                                                                            Modlog
                                                                            You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

                                                                            Welcome to Programmer Humor!

                                                                            This is a place where you can post jokes, memes, humor, etc. related to programming!

                                                                            For sharing awful code theres also Programming Horror.

                                                                            Rules

                                                                            • Keep content in english
                                                                            • No advertisements
                                                                            • Posts must be related to programming or programmer topics
                                                                              • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
                                                                            Visibility: Public

                                                                            This community is visible to everyone.

                                                                            • 2.11K users / Day
                                                                            • 4.22K users / Week
                                                                            • 8.12K users / Month
                                                                            • 12.3K users / 6 months
                                                                            • 2.64K posts
                                                                            • 98.7K comments
                                                                            • 2 local subscribers
                                                                            • 34.4K subscribers
                                                                            • UI: 1.0.0-beta.0
                                                                            • BE: 1.0.0-alpha.20
                                                                            • Modlog
                                                                            • Instances
                                                                            • Docs
                                                                            • Code
                                                                            • join-lemmy.org