• zib@kbin.social
      link
      fedilink
      arrow-up
      1
      ·
      11 months ago

      If you really need some nightmare fuel, some of us use c++ every day and even enjoy it.

  • flashgnash@lemm.ee
    link
    fedilink
    arrow-up
    1
    ·
    11 months ago

    Now imagine the poor sod who gets this as an interview question

    “Please extend the following code in the same code style to sort [😀,😃,😄,😁,😆] using bubble sort”

  • fri@compuverse.uk
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    11 months ago

    Looks like it creates a few emoji printers in a vector, then prints them all. The output is all emoji, of course. The main function exits with a random return value just to be more quirky.

    I’m not sure what the purpose of the 😎 function is. In main that first predicate is always true, so it prints the poop emoji. I don’t know why it’s behind an if.

    Also, there’s a copy-paste error on line 31. Wrong emoji is used.

  • erogenouswarzone@lemmy.ml
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    edit-2
    11 months ago

    It would be great to use some emojis in coding.

    Imagine how much more readable it would be if you could break a loop with 💀 or return true with 👍. Or use ❓for ifs, or ↔️ for switch (the emoji didn’t work for that one). Or use an emoji to represent a custom object?

    Maybe the ECMA should get on that!

    Edit: I guess you can use emojis for custom objects in js.

    Edit 2: ➡ for console.log

    • SubArcticTundra@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      11 months ago

      You’d still be left with the brackets and braces though. It might make more sense in a whitespace-based language pike Python

      • erogenouswarzone@lemmy.ml
        link
        fedilink
        arrow-up
        0
        arrow-down
        1
        ·
        11 months ago

        I see your point. Personally, I like the brackets and braces, they help organize. Or maybe that’s just what I’m used to.