• hendrik
    link
    fedilink
    English
    66
    edit-2
    5 months ago

    Our computer science professor in some programming course at university told us we were not supposed to take advice from the internet or answers from Stack Overflow for half a year… Until we learned the ropes. And could asses for ourselves what’s right and what is wrong. (And I believe that was some C/C++ course where you get lots of opportunuties to do silly things that might somehow work but for all of the wrong reasons.)

    I think he was right. There is lots of misinformation out there that isn’t a proper design pattern. And with copy-pasting stuff, you don’t necessarily learn anything. Whereas learning with some method is efficient and works.

    And I’m pretty sure I’m not super intelligent, but all of that isn’t really hard. I mean if someone codes regularly, they might as well learn how to do it properly. It takes a bit of time initially… But you get that time back later on. Though… I’d let AI write some boilerplate code. Or design a website if I’m not interested at all how the HTML and CSS works… I think that’s alright to do.

      • peopleproblems
        link
        fedilink
        English
        85 months ago

        Debugging and being able to interpret documentation when it exists.

        But good lord, the amount of programmers I work with that never use an IDE debugger is unreal. I get that you don’t have to, but Jesus Christ, if yout not getting an expected result, it’s way fucking faster to step through the code and see where the data changes then to slap logging into every line and attempt to read the output.

      • @wewbull@feddit.uk
        link
        fedilink
        English
        75 months ago

        Debugging only teaches logic. Not structure. No amount cut, paste, debug with teach you the factory pattern.

      • hendrik
        link
        fedilink
        English
        22
        edit-2
        5 months ago

        I mean it also contains great stuff. Niche workarounds, ways to do something more efficiently than some standard library function does.

        You just need a means of telling apart the good and the bad. Because there’s also people smashing their forehead on the keyboard until it happens to be something that compiles. And people repeating urban legends and outdated info. You somehow need background knowledge to tell which is which. AI didn’t invent phrasing some nonesense with full conviction. It is very good at doing exactly that, but we humans also have been doing that since the beginning of time.

  • @the_toast_is_gone@lemmy.world
    link
    fedilink
    English
    05 months ago

    Preface: If all you want is to get a simple script/program going that will more or less work for your purposes, then I understand using AI to make it. But doing much more than this with it will not help you.

    If you want to actually learn to code, then using AI to write code for you is a crutch. It’s like trying to learn how to write an essay by having ChatGPT write the essays for you. If you want to use an API in your code, then you’re setting yourself up for greater failure the more you depend on AI.

    Case in point: if you want to make a module or script for Foundry VTT, then they explicitly tell you not to use AI, partly because the models available online have outdated information. In fact, training AI on their documentation is explicitly against the terms of service.

    Even if you do this and avoid losing your license, you run a significant risk of getting unusable code because the AI hallucinated a function or method that doesn’t actually exist. You will likely wind up spending more time scouting the documents for what you actually want to do than if you’d just done it yourself to begin with.

    And if the code works perfectly now, there’s no guarantee that it will work forever, or even in the medium term. The software and API receive updates regularly. If you don’t know how to read the docs and write the code you need, you’re screwed when something inevitably gets deprecated and removed. The more you depend on AI to write it for you, the less capable you’ll be of debugging it down the line.

    This begs the question: why would you do any of this if you wanted to make something using an API?

  • @iopq@lemmy.world
    link
    fedilink
    English
    -25 months ago

    I’d rather be a bad programmer that gets stuff done than a good programmer who’s just jerking off about proper design

    t. good programmer

    • peopleproblems
      link
      fedilink
      English
      85 months ago

      Proper design will save an epic shit ton of money when it inevitably needs to be changed or fixed.

      • @iopq@lemmy.world
        link
        fedilink
        English
        15 months ago

        It depends, if you work in a statically typed language you can just use a tool to refactor. I bet a ton of advice is from JavaScript programmers where it’s simply not safe to do this.

        My first job doing JavaScript I realized the IDE’s refactor tool wasn’t aware that two variables of the same name were in fact a different variable. Due to how scoping works, it’s hard to write a reliable tool to rename variables for JS. I accidentally introduced a bug renaming a variable.

    • TimeSquirrel
      link
      fedilink
      85 months ago

      Once you move past a couple thousand LOC, you’ll appreciate having an easily modifiable, modular design you had the foresight to plan out.

      Or you can just trawl through thousand of lines of unstructured spaghetti code trying to figure out where to shoehorn your new feature in like a QBasic/Arduino kid.

      • @iopq@lemmy.world
        link
        fedilink
        English
        15 months ago

        I’ve never appreciated design decisions made before starting to code. I always have to refactor later when my requirements change or when I realize there’s a better way to do something.

  • @9point6@lemmy.world
    link
    fedilink
    English
    135 months ago

    Agree on the application side, but when it comes to the test suite, I’m definitely gonna consider letting an AI get that file started and then I’ll run through, make sure the assertions are all what I would expect and refactor anything that needs it.

    I’ve written countless tests in my career and I’m still gonna write countless more, but I’m glad I can at least spend less time on laborious repetition now and more time on the part of the job I actually enjoy which is actually solving problems.

    • @MeatsOfRage@lemmy.world
      link
      fedilink
      English
      -25 months ago

      Things like unit tests I just have AI do it all now. Since running the test tells you your coverage you can verify if it got everything or not.

      • @wewbull@feddit.uk
        link
        fedilink
        English
        55 months ago

        Here’s something that might blow your mind. Coverage is not the point of tests.

        If you your passing test gets 100% coverage, you can still have a bug. You might have a bunch of conditions you’re not handling and a shit test that doesn’t notice.

        Write tests first to completely define what you want the code to do, and then write the code to pass the tests.

  • @chakan2@lemmy.world
    link
    fedilink
    English
    35 months ago

    What’s really ugly is it makes really good code with fucking terrible bugs. My last job for all of six weeks was trying to fix and integrations wrapper of an integrations wrapper on a 3rd party library of integrations.

    It looked like really good code, but the architecture was fucked beyond repair. I was supposed to support it for a fortune 50. I quit before they could put me in the on call rotation.

  • @half_built_pyramids@lemmy.world
    link
    fedilink
    English
    05 months ago

    AI and the discussion around it doesn’t live in a vacuum.

    Occasionally you’ll get shit opinions like this. Easy slutty greek frat bro strawmen that’ll sleep with anything that moves and then dodge child support payments.

    We all have to remember the true Chad argument against AI is that it’s built on degenerate theft and corporate soulless shills. AI is the Shikrelli of creativity.

  • @antihumanitarian@lemmy.world
    link
    fedilink
    English
    25 months ago

    I recently removed in editor AI cause I noticed I was acquiring muscle memory for my brain, not thinking through the rest past the start of a snippet that would get an LLM to auto complete. I’m still using LLMs, particularly for languages and libraries I’m not familiar with, but using the artifacts editors in ChatGPT and Claude.

  • @normalexit@lemmy.world
    link
    fedilink
    English
    215 months ago

    I’ve been writing code professionally for nearly two decades, and I love having copilot available in my IDE. When there is some boilerplate or a SQL query I just don’t want to write, it’ll oftentimes get me started with something reasonable that is wrong in a couple of subtle ways. I then fix it, laugh at how wrong it was, or use part of the proposed answer in my project.

    If you’re a non-corder, sure it is pure danger, but if you know what you’re doing it can give you a little boost. Only time will tell if it makes me rusty on some basics, but it is another tool in the toolbox now.

    • @smiletolerantly@awful.systems
      link
      fedilink
      English
      35 months ago

      For me personally, there is only two applications of LLMs in programming:

      • doing tasks I kinda know how to do, but don’t want to properly learn (recent example: generate pgf plots from csv data in matplotlib. 90% boilerplate, I last had to do it 3 years ago and vaguely remember some pitfalls so can steer the LLM in that direction. Will probably never again have to do this, so not worth the extra couple hours to properly learn
      • things I would ordinarily write a script for, but aren’t worth automating because they won’t come up in the future again (example: convert this Lua table to a Nix set)

      Essentially, one-off things that you know how to check for correctness.

    • @RedditWanderer@lemmy.world
      link
      fedilink
      English
      2
      edit-2
      5 months ago

      Same here (15 years). I work in all sorts of frameworks and languages. I normally would have just googled a given question to see the code i need, paste it in with everything that’s wrong, and fix it to my liking. I know what I’m doing I was just missing the specific words i havent used in a couple years, i still understand them. Copilot just avoid me opening google, clicking through some bad SEO, passing the bad answers, and doing that a couple more times to bring in everything I need. It’s a google formatter.

      It’s also exactly like searching google. If you ask “is this cancer” you’ll find cases where it’s cancer, if you ask “is this not cancer” youll find cases where it’s cancer. You can’t trust it in that way, but you can still quickly parse the internet. I make juniors explain their code so even if they paste it in, they’re kind force to research it more to make sure they get it; it’s on the reviewers now to train llm kiddos.

  • AlexanderESmith
    link
    fedilink
    25 months ago

    Using an LLM to code is like using a block of wood as a hammer. It’s fast, and it’ll do a very specific thing quickly, but eventually it’ll splinter to the point of uselessness.

    I can’t wait until all the copy/code is created by LLMs, and they run out of things to train the LLMs on that won’t result in immediate hallucinations.

    Maybe they’ll start working on a real AI to replace the LLMs, instead of just marketing LLMs as AI.

    (probably not)

  • Random_Character_A
    link
    fedilink
    English
    195 months ago

    Not a coder. I can understand most python code and powershell scripts that others have done, but I don’t remember syntax, if I need to make something from scratch. Doing that involves ton of googling and reading awful documentation that still leaves some things out. I do this maybe twice a year.

    For someone like me AI coding is a god sent.

    • peopleproblems
      link
      fedilink
      English
      125 months ago

      doing that involves a ton of googling and reading awful documentation

      Yes. That is programming.

      To most of us, the syntax is the easy part to remember, and our IDEs take care of most of it. Being able to bang our heads through the documentation and experiment with libraries is pretty much what our jobs are.

      AI coding is basically a shortcut to some of the stuff we have to repeat with slight changes in our software. It’s also useful for setting up more complex code that we know we’ll have to tweak.

      Expecting it to produce something with the desired results is a recipe for disaster. It’s basically a cheaper outsourcing method that can’t actually compile and run it’s code before giving it to you.

    • Dot.OP
      link
      fedilink
      English
      55 months ago

      If you’re someone who has no actual interest in learning to code, and instead see AI as more of a freelancer—telling it stuff like “make a kart racer game,” and “that sucks, make it better”—then none of this really applies to you.

    • @kameecoding@lemmy.world
      link
      fedilink
      English
      25 months ago

      I use it to generate repetitive patterns that’s easy to guess what’s next, but PITA to write, eg. asserts in Unit tests

      • AlexanderESmith
        link
        fedilink
        15 months ago

        If your code has repeating patterns, you should probably be writing a function.

  • @vane@lemmy.world
    link
    fedilink
    English
    75 months ago

    Not using AI Generated Code won’t make you programmer at all. It’s just another way to start a journey to alcoholism and loneliness in front of computer screen. The only difference is that this time you travel with junior developer for poor people.

  • @TORFdot0@lemmy.world
    link
    fedilink
    English
    95 months ago

    I don’t have an encyclopedic knowledge of every random library or built-in function of every language on earth so what’s the difference between googling for an example on stack overflow or asking an LLM?

    If you are asking ChatGPT for every single piece of code it will be terrible because it just hallucinates libraries or misunderstands the prompt. But saying any kind of use makes you a bad programmer seems more like fud than actual concern