• Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    23 minutes ago

    I mean, surely you did it for the exercise, right? If you needed a solution, you could’ve very likely used a library…

  • MajorHavoc@programming.dev
    link
    fedilink
    arrow-up
    46
    ·
    edit-2
    3 hours ago

    Today I learned the term Vibe Coding. I love it.

    Edit: This article is a treasure.

    The concept of vibe coding elaborates on Karpathy’s claim from 2023 that “the hottest new programming language is English”,

    Claim from 2023?! Lol. I’ve heard (BASIC) that (COBOL) before (Ruby).

    A key part of the definition of vibe coding is that the user accepts code without full understanding.[1] AI researcher Simon Willison said: “If an LLM wrote every line of your code, but you’ve reviewed, tested, and understood it all, that’s not vibe coding in my book—that’s using an LLM as a typing assistant.”[1]

    Did we make it from AI hype to AI dunk in the space of a single Wikipedia article? Lol.

  • jmcs@discuss.tchncs.de
    link
    fedilink
    arrow-up
    58
    ·
    edit-2
    4 hours ago

    Just wait until the vibe coder overwrites 3 months of “work” with garbage because ChatGPT never told them about git and then decided to poop the pants.

    • theneverfox@pawb.social
      link
      fedilink
      English
      arrow-up
      17
      ·
      3 hours ago

      I love the in between, where you have to actually adapt algorithms to useful situations

      It’s like 2% of all the work I do, but those moments stick with me

    • addie@feddit.uk
      link
      fedilink
      arrow-up
      7
      ·
      2 hours ago

      A binary tree is one way of preparing data, usually for sorting. Each node can have a left, right, or both, children.

        A
       / \
      B   C
         / \
        D   E
      

      “Inverting the tree” means swapping the children for each node, so that the order that the nodes are visited is reversed. Depending on whether you want to copy the tree or swap it in place then the algorithm is different. C++ provides iterators too, so providing a “order reversed” iterator can be done efficiently as well.

      You’re going to have to visit every node and do at least one swap for every node, and an efficient algorithm won’t do much more than that. Bring unable to do it suggests that the student programmer doesn’t understand stacks or recursion yet, so they’ve more to learn.

      • Thorry84@feddit.nl
        link
        fedilink
        arrow-up
        4
        ·
        2 hours ago

        Important context:

        This is often an exercise for beginning programmers, it’s a very simple task that’s easy to understand, but leaves enough room in the implementation to make it a good exercise.

        Sometimes it’s used as a test on job applications, which is total bullshit, it isn’t a good test of someones actual skills as a software developer. Because of this it’s become a bit of a joke on the internet.