Brasil
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Björn Tantau@swg-empire.de to Programmer Humor@programming.dev · 2 个月前

Pretty straight forward

swg-empire.de

message-square
47
fedilink
721

Pretty straight forward

swg-empire.de

Björn Tantau@swg-empire.de to Programmer Humor@programming.dev · 2 个月前
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
    115
    arrow-down
    1
    ·
    2 个月前

    …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 个月前

      That wouldn’t necessarily be bash though

      • smeg@feddit.uk
        link
        fedilink
        English
        arrow-up
        60
        arrow-down
        1
        ·
        2 个月前

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

        • xthexder@l.sw0.com
          link
          fedilink
          arrow-up
          10
          ·
          2 个月前

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

          • ultrafastsloth@lemmy.world
            link
            fedilink
            arrow-up
            17
            ·
            2 个月前

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

          • Beanie@programming.dev
            link
            fedilink
            arrow-up
            4
            ·
            2 个月前

            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 个月前

            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 个月前

        Fair, should’ve just said shell

  • xia@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    68
    ·
    2 个月前

    Tsk tsk… forgot to clean up your temp file!

  • DreamButt@lemmy.world
    link
    fedilink
    English
    arrow-up
    42
    ·
    2 个月前

    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
    arrow-down
    1
    ·
    2 个月前

    That emoji annoys me more than I would like

    • kamen@lemmy.world
      link
      fedilink
      arrow-up
      25
      ·
      2 个月前

      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 个月前

        It’s the meme version of a laugh track

        • kamen@lemmy.world
          link
          fedilink
          English
          arrow-up
          4
          arrow-down
          6
          ·
          2 个月前

          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 个月前

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

  • misteloct@lemmy.world
    link
    fedilink
    arrow-up
    28
    ·
    2 个月前

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

  • MonkderVierte@lemmy.ml
    link
    fedilink
    arrow-up
    27
    ·
    2 个月前

    Sure.

    • potoo22@programming.dev
      link
      fedilink
      arrow-up
      10
      ·
      2 个月前

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

    • Opisek@lemmy.world
      link
      fedilink
      arrow-up
      9
      ·
      2 个月前

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

  • mkwt@lemmy.world
    link
    fedilink
    arrow-up
    20
    ·
    2 个月前

    Violates CERT C ENV33-C.

    • ArtVandelay@lemmy.world
      link
      fedilink
      English
      arrow-up
      14
      ·
      edit-2
      2 个月前

      It violates oh so much including that.

  • tetris11@lemmy.ml
    link
    fedilink
    arrow-up
    19
    ·
    2 个月前

    why would you hurt me like this

  • tiredofsametab@fedia.io
    link
    fedilink
    arrow-up
    19
    ·
    2 个月前

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

    • JasonDJ@lemmy.zip
      link
      fedilink
      arrow-up
      27
      ·
      edit-2
      2 个月前
      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 个月前

      Rust, to make it safe.

      • tiredofsametab@fedia.io
        link
        fedilink
        arrow-up
        15
        ·
        2 个月前

        step 1: unsafe fn()…

        • Traister101@lemmy.today
          link
          fedilink
          arrow-up
          1
          ·
          2 个月前

          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 个月前
            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 个月前

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

      • tiredofsametab@fedia.io
        link
        fedilink
        arrow-up
        2
        ·
        2 个月前

        It’s… Beautiful.

  • CrimsonMishaps@lemmy.world
    link
    fedilink
    arrow-up
    17
    ·
    2 个月前

    Fucking brilliant

  • BartyDeCanter@lemmy.sdf.org
    link
    fedilink
    arrow-up
    11
    ·
    2 个月前

    Thanks, I hate it.

  • thann@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    7
    ·
    2 个月前

    Who says C isnt mem safe?

  • qaz@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    2 个月前

    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 个月前

      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
    link
    fedilink
    arrow-up
    4
    ·
    2 个月前

    Dave is not here.

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

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

  • 761 users / day
  • 4.64K users / week
  • 9.23K users / month
  • 17.8K users / 6 months
  • 41 local subscribers
  • 23.1K subscribers
  • 1.39K Posts
  • 51K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.10
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org