• TechieDamien@lemmy.ml
      link
      fedilink
      arrow-up
      8
      ·
      7 hours ago

      To be fair, sometimes it is right to take the code from the questions. Eg if you want behaviour x and the question is “how do I do y, my code is only doing x?” Then the code you want is from the question.

  • MajorHavoc@programming.dev
    link
    fedilink
    arrow-up
    104
    ·
    edit-2
    1 day 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.

    • Mirror Giraffe@piefed.social
      link
      fedilink
      English
      arrow-up
      5
      ·
      11 hours ago

      I’ve ended up becoming the sole caretaker of two react native apps, something I did not ask for but some people were fried.

      I’m not going to manually troubleshoot and learn everything that breaks when I need to update a dependency. I’ll vibe through those errors, learn what I have time for and then test it like mad.

      A lot of the time I end up having to solve things myself but my job wouldn’t be tolerable if I had to manually work that shit.

    • Ephera@lemmy.ml
      link
      fedilink
      English
      arrow-up
      37
      ·
      1 day ago

      Interesting that the term was coined by someone who presumably intended it to mean a good thing. I assumed it to be an entirely derogatory term…

      • Ropianos@feddit.org
        link
        fedilink
        arrow-up
        13
        ·
        edit-2
        19 hours ago

        Well, lots of words are sort of derogatory in programming right? Hackers hacking things together, rubber duck debugging (you have a bug? Go talk to a toy!), git blame and probably more

        Edit: forget git blame, git itself is already slang for idiot. As Linus Torvalds once said, he created two successful projects, both named after himself

        • Ephera@lemmy.ml
          link
          fedilink
          English
          arrow-up
          4
          ·
          18 hours ago

          Sure, but those words have been coined by the nerds, or those that don’t try to sell you anything at least. The guy very much wants to sell you vibe coding and LLMs and whatnot.

          • Ropianos@feddit.org
            link
            fedilink
            arrow-up
            4
            ·
            18 hours ago

            Andrej Karpathy is absolutely a nerd to me. He’s not about selling you LLMs but about teaching you how to build your own (I recommend checking his videos out, they are one of the best resources on LLMs)

  • jmcs@discuss.tchncs.de
    link
    fedilink
    arrow-up
    89
    arrow-down
    1
    ·
    edit-2
    1 day 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.

  • vane@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    20 hours ago

    …into cursor or windsurf, how the fuck they come up with those names dude ? Vibe coding on windsurf.

  • Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    13
    ·
    1 day ago

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

      • Ephera@lemmy.ml
        link
        fedilink
        English
        arrow-up
        2
        ·
        15 hours ago

        Well, we have a tool for that called vendoring, a.k.a. copy-pasting the library code into your repo. It’s no worse than copy-pasting LLM-generated code…

        • chicken@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          15 hours ago

          To me the disadvantage would be, the library likely does many more things than just what you need it for, so there is way more code, so you probably can’t realistically read and understand it yourself before incorporating it. This would lead to among other issues the main thing that irritates me about libraries; if it turns out something in it is broken, you are stuck with a much bigger debugging problem where you first have to figure out how someone else’s code is structured.

          Although I guess that doesn’t apply as much to implementations of common algorithms like OP since the library is probably solid. I would consider favoring LLM code over most anything off npm though.

    • Rikudou_Sage@lemmings.world
      link
      fedilink
      arrow-up
      18
      ·
      edit-2
      24 hours ago

      Stupid term people use for “writing” code without the knowledge of programming by using AI.

      Kinda the next level of running random code from the internet without understanding what it does.

      • hddsx@lemmy.ca
        link
        fedilink
        arrow-up
        11
        ·
        24 hours ago

        Maybe I’m old, but I avoid AI specifically because I’ve seen the quality of code out there (not to say my quality is amazing), and if AI learned from that…. Well

        • yucandu@lemmy.world
          link
          fedilink
          arrow-up
          10
          ·
          23 hours ago

          AI is great for when you’re typing out 30 slight variations of the same thing, and you can just be like “see what I’m doing here? Do it for the other 30 variables” and it does it just fine.

          • Rikudou_Sage@lemmings.world
            link
            fedilink
            English
            arrow-up
            6
            ·
            22 hours ago

            It’s also great if you have a general knowledge of something but don’t know the details. Like today I needed to do some database introspection using queries in Snowflake, I knew exactly what I needed but not where the database schema is located etc., so I let GPT write the query instead.

            Or some time ago I needed to get all instances of classes implementing a specific generic interface in .NET, the code eventually dabbled into the very specifics of the runtime, it would’ve taken me much longer to find out with documentation.

            All in all, it’s my opinion that AI is great if two conditions are met:

            • you know exactly what you want to do and you can specify it to very tiny details
            • you have the knowledge to verify whether the result makes sense without running the code (or at least the knowledge that it can’t break your app or computer)
        • zenpocalypse@lemm.ee
          link
          fedilink
          English
          arrow-up
          2
          ·
          17 hours ago

          It’s taught me a few new tricks. It’s good at short bits of code, but anything longer is likely to have problems that take as much time to fix as writing it yourself to begin with.

          I also find learning something new to be much faster when you can just ask a question about best practices or why something works like it does.

        • Aurenkin@sh.itjust.works
          link
          fedilink
          arrow-up
          3
          ·
          20 hours ago

          I don’t think it’s necessary to strictly avoid it by any means, it’s quite a useful tool. You just have to use it appropriately, similar to stack overflow in some ways. That said, obviously you should use / avoid whatever tools as you want.

    • addie@feddit.uk
      link
      fedilink
      arrow-up
      21
      ·
      1 day 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
        16
        ·
        1 day 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.

        • barsoap@lemm.ee
          link
          fedilink
          arrow-up
          4
          ·
          edit-2
          22 hours ago

          This is often an exercise for beginning programmers

          And non-beginners have to weigh the skill of the interviewer to figure out whether “To invert, I’ll just keep the tree as it is” is an approach they can grasp. Enlightenment is realising that the tree is already in the perfect shape.