There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Are LLMs capable of writing *good* code?

By “good” I mean code that is written professionally and concisely (and obviously works as intended). Apart from personal interest and understanding what the machine spits out, is there any legit reason anyone should learn advanced coding techniques? Specifically in an engineering perspective?

If not, learning how to write code seems a tad trivial now.

Septimaeus ,

Theoretically, I would say yes it’s possible, insofar as we could break down most subtasks of the development process into training parameters. But we are a long way from that currently.

cley_faye ,

For repetitive tasks, it can almost automatically get a first template you write by hand, and extrapolate with multiple variations.

Beyond that… not really. Anything beyond single line completion quickly devolves into either something messy, non working, or worse, working but not as intended. For extremely common cases it will work fine; but extremely common cases are either moved out in shared code, or take less time to write than to “generate” and check.

I’ve been using code completion/suggestion on the regular, and it had times where I was pleasantly surprised by what it produced, but even for these I had to look after it and fix some things. And while I can’t quantify how often it happened, there are a lot of times where it’s convincing gibberish.

anytimesoon ,

I’ve also had some decent luck when using a new/unfamiliar language by asking it to make the code I wrote more idiomatic.

It’s been a nice way to learn some tricks I probably wouldn’t have bothered with before

muntedcrocodile ,
@muntedcrocodile@lemm.ee avatar

I worry for the future generations of people who can use chatgpt to write code but have absolutely no idea what said code is doing.

bear ,

No. To specify exactly what you want the computer to do for you, you’d need some kind of logic-based language that both you and the computer mutually understand. Imagine if you had a spec you could reference to know what the key words and syntax in that language actually mean to the computer.

daniskarma ,

For small boilerplate or very common small pieces of code, for instance a famous algorithm implementation. Yes. As they are just probably giving you the top stack overflow answer for a classic question.

Anything that the LLM would need to mix or refactor would be terrible.

slazer2au ,

No, because that would require it being trained on good code. Which is rather rare.

gravitas_deficiency ,

LLMs are just computerized puppies that are really good at performing tricks for treats. They’ll still do incredibly stupid things pretty frequently.

I’m a software engineer, and I am not at all worried about my career in the long run.

In the short term… who fucking knows. The C-suite and MBA circlejerk seems to have decided they can fire all the engineers because wE CAn rEpLAcE tHeM WitH AI 🤡 and then the companies will have a couple absolutely catastrophic years because they got rid of all of their domain experts.

GBU_28 ,

For basic boiler plate like routes for an API, an etl script from sample data to DB tables, or other similar basics, yeah, it’s perfectly acceptable. You’ll need to swap out dummy addresses, and maybe change a choice or two, but it’s fine.

But when you’re trying to organize more complicated business logic or debug complicated dependencies it falls over

JeeBaiChow ,

Dunno. I’d expect to have to make several attempts to coax a working snippet from the ai, then spending the rest of the time trying to figure out what it’s done and debugging the result. Faster to do it myself.

E.g. I once coded Tetris on a whim (45 min) and thought it’d be a good test for ui/ game developer, given the multi disciplinary nature of the game (user interaction, real time engine, data structures, etc) Asked copilot to give it a shot and while the basic framework was there, the code simply didn’t work as intended. I figured if we went into each of the elements separately, it would have taken me longer than if i’d done it from scratch anyway.

Nomecks ,

I use it to write code, but I know how to write code and it probably turns a week of work for me into a day or two. It’s cool, but not automagic.

Manifish_Destiny ,

I find it better at things under 100 lines. Otherwise it starts to lose context. Any ideas how to address this?

nous ,

They can write good short bits of code. But they also often produce bad and even incorrect code. I find it more effort to read and debug its code then just writing it myself to begin with the vast majority of the time and find overall it just wastes more of my time overall.

Maybe in a couple of years they might be good enough. But it looks like their growth is starting to flatten off so it is up for debate as to if they will get there in that time.

WraithGear ,
@WraithGear@lemmy.world avatar

Its the most ok’est coder with the attention span of a 5 year old.

Arbiter ,

No LLM is trust worthy.

Unless you understand the code and can double check what it’s doing I wouldn’t risk running it.

And if you do understand it any benefit of time saved is likely going to be offset by debugging and verifying what it actually does.

FlorianSimon ,

Since reviewing code is much harder than checking code you wrote, relying on LLMs too heavily is just plain dangerous, and a bad practice, especially if you’re working with specific technologies with lots of footguns (cf C or C++). The amount of crazy and hard to detect bad things you can write in C++ is insane. You won’t catch CVE-material by just reading the output ChatGPT or Copilot spits out.

And there’s lots of sectors like aerospace, medical where that untrustworthiness is completely unacceptable.

xmunk ,

No, a large part of what “good code” means is correctness. LLMs cannot properly understand a problem so while they can produce grunt code they can’t assemble a solution to a complex problem and, IMO, it is impossible for them to overtake humans unless we get really lazy about code expressiveness. And, on that point, I think most companies are underinvesting into code infrastructure right now and developers are wasting too much time on unexpressive code.

The majority of work that senior developers do is understanding a problem and crafting a solution appropriate to it - when I’m working my typing speed usually isn’t particularly high and the main bottleneck is my brain. LLMs will always require more brain time while delivering a savings on typing.

At the moment I’d also emphasize that they’re excellent at popping out algorithms I could write in my sleep but require me to spend enough time double checking their code that it’s cheaper for me to just write it by hand to begin with.

PenisDuckCuck9001 , (edited )

Ai is excellent at completing low effort ai generated Pearson programming homework while I spend all the time I saved on real projects that actually matter. My hugging face model is probably trained on the same dataset as their bot. It gets it correct about half the time and another 25% of the time, I just have to change a few numbers or brackets around. It takes me longer to read the instructions than it takes the ai bot to spit out the correct answer.

None of it is “good” code but it enables me to have time to write good code somewhere else.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines