Selfhost Cat
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Björn Tantau@swg-empire.de to Programmer Humor@programming.dev · 2 months ago

Pretty straight forward

swg-empire.de

message-square
47
fedilink
734

Pretty straight forward

swg-empire.de

Björn Tantau@swg-empire.de to Programmer Humor@programming.dev · 2 months ago
message-square
47
fedilink

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

alert-triangle
You must log in or register to comment.
  • Scoopta@programming.dev
    link
    fedilink
    arrow-up
    116
    ·
    2 months ago

    …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
      link
      fedilink
      arrow-up
      58
      ·
      2 months ago

      That wouldn’t necessarily be bash though

      • smeg@feddit.uk
        link
        fedilink
        English
        arrow-up
        60
        ·
        2 months ago

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

        • xthexder@l.sw0.com
          link
          fedilink
          arrow-up
          10
          ·
          2 months ago

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

          • ultrafastsloth@lemmy.world
            link
            fedilink
            arrow-up
            17
            ·
            2 months ago

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

          • Beanie@programming.dev
            link
            fedilink
            arrow-up
            4
            ·
            2 months ago

            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.uk
            link
            fedilink
            English
            arrow-up
            3
            ·
            2 months ago

            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
        link
        fedilink
        arrow-up
        21
        ·
        2 months ago

        Fair, should’ve just said shell

  • xia@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    68
    ·
    2 months ago

    Tsk tsk… forgot to clean up your temp file!

  • DreamButt@lemmy.world
    link
    fedilink
    English
    arrow-up
    42
    ·
    2 months ago

    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
    link
    fedilink
    arrow-up
    42
    ·
    2 months ago

    That emoji annoys me more than I would like

    • kamen@lemmy.world
      link
      fedilink
      arrow-up
      25
      ·
      2 months ago

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

      • Deebster@programming.dev
        link
        fedilink
        English
        arrow-up
        16
        ·
        2 months ago

        It’s the meme version of a laugh track

        • kamen@lemmy.world
          link
          fedilink
          English
          arrow-up
          4
          ·
          2 months ago

          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
    link
    fedilink
    arrow-up
    34
    ·
    2 months ago

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

  • misteloct@lemmy.world
    link
    fedilink
    arrow-up
    28
    ·
    2 months ago

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

  • MonkderVierte@lemmy.ml
    link
    fedilink
    arrow-up
    27
    ·
    2 months ago

    Sure.

    • potoo22@programming.dev
      link
      fedilink
      arrow-up
      10
      ·
      2 months ago

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

    • Opisek@lemmy.world
      link
      fedilink
      arrow-up
      9
      ·
      2 months ago

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

  • mkwt@lemmy.world
    link
    fedilink
    arrow-up
    20
    ·
    2 months ago

    Violates CERT C ENV33-C.

    • ArtVandelay@lemmy.world
      link
      fedilink
      English
      arrow-up
      14
      ·
      edit-2
      2 months ago

      It violates oh so much including that.

  • tetris11@lemmy.ml
    link
    fedilink
    arrow-up
    19
    ·
    2 months ago

    why would you hurt me like this

  • tiredofsametab@fedia.io
    link
    fedilink
    arrow-up
    19
    ·
    2 months ago

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

    • JasonDJ@lemmy.zip
      link
      fedilink
      arrow-up
      27
      ·
      edit-2
      2 months ago
      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 Tantau@swg-empire.deOP
      link
      fedilink
      arrow-up
      24
      ·
      2 months ago

      Rust, to make it safe.

      • tiredofsametab@fedia.io
        link
        fedilink
        arrow-up
        15
        ·
        2 months ago

        step 1: unsafe fn()…

        • Traister101@lemmy.today
          link
          fedilink
          arrow-up
          1
          ·
          2 months ago

          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
            link
            fedilink
            arrow-up
            1
            ·
            2 months ago
            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
      link
      fedilink
      arrow-up
      7
      ·
      2 months ago

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

      • tiredofsametab@fedia.io
        link
        fedilink
        arrow-up
        2
        ·
        2 months ago

        It’s… Beautiful.

  • CrimsonMishaps@lemmy.world
    link
    fedilink
    arrow-up
    17
    ·
    2 months ago

    Fucking brilliant

  • BartyDeCanter@lemmy.sdf.org
    link
    fedilink
    arrow-up
    11
    ·
    2 months ago

    Thanks, I hate it.

  • thann@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    7
    ·
    2 months ago

    Who says C isnt mem safe?

  • qaz@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    2 months ago

    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.com
      link
      fedilink
      English
      arrow-up
      4
      ·
      2 months ago

      I did the same with python once lol.

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

  • Cosmic Cleric@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 months ago

    Apologies for being off-topic, but the domain name, “swg-empire.de”, does the ‘swg’ part ‘Star Wars Galaxies’ by chance?

    This comment is licensed under CC BY-NC-SA 4.0

    • Björn Tantau@swg-empire.deOP
      link
      fedilink
      arrow-up
      5
      ·
      2 months ago

      No. It was for a Star Wars roleplay but not a video game. It started life in the newsgroup de.rec.sf.starwars and I played the role of Emperor.

      • Cosmic Cleric@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        2 months ago

        No. It was for a Star Wars roleplay but not a video game. It started life in the newsgroup de.rec.sf.starwars

        Ah, ok, nice! Was that the old D6 version, or the newer D20 one?

        and I played the role of Emperor.

        You dark person you! 😜

        This comment is licensed under CC BY-NC-SA 4.0

        • Björn Tantau@swg-empire.deOP
          link
          fedilink
          arrow-up
          8
          ·
          2 months ago

          No set rules, just goofing around. When we got too annoying for the rest of the newsgroup we moved to a mailing list and met up in real life a bunch of times.

          First time my father flew me there in a small sports plane. They had gotten the permission to greet me on the air field with a limousine blasting the Force Commander remix of the Imperial March and a black carpet. All the Jedi, Sith and in-betweens were waving Emperor-flags and greeted me as was befitting a man of my status.

          Did I mention that I was 14 at the time and everyone else about 30?

          Good times.

          • Cosmic Cleric@lemmy.world
            link
            fedilink
            English
            arrow-up
            3
            ·
            2 months ago

            Sounds like good times, indeed.

            This comment is licensed under CC BY-NC-SA 4.0

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
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: [email protected]

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
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 856 users / day
  • 4.43K users / week
  • 8.97K users / month
  • 15.5K users / 6 months
  • 1 local subscriber
  • 23.1K subscribers
  • 644 Posts
  • 11.5K Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.8
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org