• _stranger_@lemmy.world
    link
    fedilink
    arrow-up
    18
    ·
    4 hours ago

    Ugh, terrible memory unlocked.

    I asked someone a similar question in an interview once. They weren’t doing well and I wanted to end on a positive at least. I asked them to make a dict in python and for extra credit, turn it into a string using whatever library or method they want.

    This was not for a junior position.

    5 minutes of for loop insanity later they disconnected crying. I always felt bad for that guy.

    • Pup Biru@aussie.zone
      link
      fedilink
      English
      arrow-up
      6
      ·
      4 hours ago

      i agree but hate to add the caveat that it (well, typescript) these days is by far the language that i’m most productive in, with the fewest bugs

      it took me a long time to admit that to myself

      it’s still a human rights violation

  • Avicenna@programming.dev
    link
    fedilink
    arrow-up
    113
    ·
    10 hours ago

    alternative scenerio:

    Guy: “it turns javascript objects into texts in json format”

    Soldier: “He uses javascript, shoot the poor bastard”

    • Blue Label@lemmy.world
      link
      fedilink
      English
      arrow-up
      45
      ·
      edit-2
      9 hours ago

      Alternative scenario:

      Soldier B: Soldier A asked a JavaScript question instead of a software engineering question. He’s not a real soldier, shoot him

        • Rose@slrpnk.net
          link
          fedilink
          arrow-up
          2
          ·
          58 minutes ago

          Name 3 UML diagrams

          Class diagram, use case diagram and… What was the useless, barely readable evolution of flowcharts called again? Activity diagram?

          and 3 architectures!

          MOS 6502, amd64, and… I’ve never figured out the ARM naming scheme. AAAAAAarch64 or something?

  • porous_grey_matter@lemmy.ml
    link
    fedilink
    arrow-up
    52
    ·
    11 hours ago

    Not sure every software engineer needs to know this. If they’d said web developer I suppose this would really be expected knowledge, but then you’d probably want to shoot them anyway.

    • SparroHawc@piefed.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      4 hours ago

      Web developer, or business developer. A lot of inter-system communications these days is in JSON, whether there is any JavaScript involved or not.

    • Waterpumpee@lemmus.org
      link
      fedilink
      English
      arrow-up
      10
      ·
      9 hours ago

      honestly, this is used for debugging. Why not just pass the object as value to the console.log()

      • jaybone@lemmy.zip
        link
        fedilink
        English
        arrow-up
        4
        ·
        7 hours ago

        Stringify is used to serialize an object. This is useful if you are going to store the object or transfer the object contents to some other system or component, possibly over a network using a network protocol.

        For debugging, you should use a function like console.log, which depending on the client might even offer an interactive UI to explore the object with structurally aware context. Not just print a giant string, which you get from stringify.

      • TrickDacy@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        7 hours ago

        Not only used for debugging and also if you log a complex object, the way it gets displayed in the console is not always easy/possible to fully inspect. It will get… truncated for lack of a better word

  • lime!@feddit.nu
    link
    fedilink
    arrow-up
    61
    ·
    11 hours ago

    i’ve designed my own communication protocols that run directly on udp. i couldn’t tell you either.

    • lobut@lemmy.ca
      link
      fedilink
      arrow-up
      1
      ·
      2 hours ago

      I refuse to believe you couldn’t infer what this is, you’re way too smart and you could definitely just guess.

    • ramble81@lemmy.zip
      link
      fedilink
      arrow-up
      5
      ·
      6 hours ago

      I mean, that’s fine, right up till you have to communicate with something else. Given that 99% of APIs out there use JSON.

    • MalReynolds@slrpnk.net
      link
      fedilink
      English
      arrow-up
      17
      ·
      10 hours ago

      Ima guess it’s javascript-ese to turn a json object into a string, perhaps for serialization. But no clue, coding for decades but always hated js, I guess my way through with a linter and IDE when I absolutely, positively, cannot find an alternative, which seldom happens.

        • anomnom@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          7
          ·
          7 hours ago

          Before yaml, I used json with Ruby it was way nicer to read than xml config files ( but way before that I started using it with PHP and Actionscript)

          • jaybone@lemmy.zip
            link
            fedilink
            English
            arrow-up
            7
            ·
            7 hours ago

            Yeah you don’t have to be using JavaScript to use json. Yes I know it’s part of the name, but it’s just an object notation which is the other part of the name, and this has become widely accepted for use in nearly all popular languages and frameworks.

            • lad@programming.dev
              link
              fedilink
              arrow-up
              1
              ·
              3 hours ago

              Are there any other languages that would also have Json.Stringify? I only read JS sometimes and never write those, so I may be wrong about that.

              JSON itself is fine, yeah

              • anomnom@sh.itjust.works
                link
                fedilink
                English
                arrow-up
                1
                ·
                edit-2
                1 hour ago

                Not sure but with Ruby it was JSON.generate(ruby_array/hash/object).

                And it returned - JSON string of your argument.