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.

65 points
*

understanding what the machine spits out

This is exactly why people will still need to learn to code. It might write good code, but until it can write perfect code every time, people should still know enough to check and correct the mistakes.

permalink
report
reply
13 points

I very much agree, thank you for indulging my question.

permalink
report
parent
reply
12 points
*

I used an LLM to write some code I knew I could write, but was a little lazy to do. Coding is not my trade, but I did learn Python during the pandemic. Had I not known to code, I would not have been able to direct the LLM to make the required corrections.

In the end, I got decent code that worked for the purpose I needed.

I still didn’t write any docstrings or comments.

permalink
report
parent
reply
9 points

I would not trust the current batch of LLMs to write proper docstrings and comments, as the code it is trained on does not have proper docstrings and comments.

And this means that it isn’t writing professional code.

It’s great for quickly generating useful and testable code snippets though.

permalink
report
parent
reply
8 points

For a very long time people will also still need to understand what they are asking the machine to do. If you tell it to write code for an impossible concept, it can’t make it. If you ask it to write code to do something incredibly inefficiently, it’s going to give you code that is incredibly inefficient.

permalink
report
parent
reply
1 point
Deleted by creator
permalink
report
parent
reply
2 points
*

I’ve even seen human engineers’ code thrown out because no one else could understand it. Back in the day, one webdev took it upon himself to whip up a mobile version of our company’s very complex website. He did it as a side project. It worked. It was complete. It looked good. It was very fast. The code was completely unreadable by anyone else. We didn’t use it.

permalink
report
parent
reply
41 points

After a certain point, learning to code (in the context of application development) becomes less about the lines of code themselves and more about structure and design. In my experience, LLMs can spit out well formatted and reasonably functional short code snippets, with the caveate that it sometimes misunderstands you or if you’re writing ui code, makes very strange decisions (since it has no special/visual reasoning).

Anyone a year or two of practice can write mostly clean code like an LLM. But most codebases are longer than 100 lines long, and your job is to structure that program and introduce patterns to make it maintainable. LLMs can’t do that, and only you can (and you can’t skip learning to code to just get on to architecture and patterns)

permalink
report
reply
7 points
*

I think this is the best response in this thread.

Software engineering is a lot more than just writing some lines of code and requires more thought and planning than can be realistically put into a prompt.

permalink
report
parent
reply
5 points

Very well put, thank you.

permalink
report
parent
reply
3 points

The other thing is, an LLM generally knows about all the existing libraries and what they contain. I don’t. So while I could code a pretty good program in a few days from first principles, an LLM is often able to stitch together some elegant glue code using a collection of existing library functions in seconds.

permalink
report
parent
reply
1 point

Also in my experience LLM can often propose solutions which are working but way too complex.

Story time: just yesterday, in VueJS I was trying to iterate over a list of items and render .text of reach item as HTML, but I needed to process it first. Note that in VueJS this is done by adding eg. <span v-html="item.text"></span> where content of the attribute is the JavaScript expression needed to get the text.

First I asked ChatGPT to write the function for processing the text. That worked pretty well and even used part of the JavaScript API which I was not aware about.

Next, I had a “dumb moment” when I did not realize that as I’m iterating through items I can just say <span v-html="processHtml(item.text)"></span>, that’s all I really needed. Somehow I thought (or should I say, “hallucinated”, ba dum tsss) for a moment that v-html is special or something (it is used differently than the most abundant type of syntax). So I went ahead and asked ChatGPT how to render processed texts while iterating.

It came with a rather contrived solution which involved creating another computed property containing a list of processed texts. I started to integrate it into the existing loop: I would have to add index and use that index to pull the code from the computed property, which already felt a little bit weird.

That’s when it struck me: no, no, no, I can just f*ing use the function.

TL; DR: The point is, while ChatGPT was helpful I still needed to babysit it. And if I didn’t snap from my lazy moment, or if I simply didn’t know better, I would end up with code which is more complex, more surprising, which means harder to reason about for both humans and LLM’s. (For humans because now it forces you to speculate about coder’s intent, and for LLM’s because it’s less likely to be reminiscent of surrounding code in its learning data.)

permalink
report
parent
reply
30 points
*

Great question.

is there any legit reason anyone should learn advanced coding techniques?

Don’t buy the hype. LLMs can produce all kinds of useful things but they don’t know anything at all.

No LLM has ever engineered anything. And there’s no sparse (concession to a good point made in response) current evidence that any AI ever will.

Current learning models are like trained animals in a circus. They can learn to do any impressive thing you an imagine, by sheer rote repetition.

That means they can engineer a solution to any problem that has already been solved millions of times already. As long as the work has very little new/novel value and requires no innovation whatsoever, learning models do great work.

Horses and LLMs that solve advanced algebra don’t understand algebra at all. It’s a clever trick.

Understanding the problem and understanding how to politely ask the computer to do the right thing has always been the core job of a computer programmer.

The bit about “politely asking the computer to do the right thing” makes massive strides in convenience every decade or so. Learning models are another such massive stride. This is great. Hooray!

The bit about “understanding the problem” isn’t within the capabilities of any current learning model or AI, and there’s no current evidence that it ever will be.

Someday they will call the job “prompt engineering” and on that day it will still be the same exact job it is today, just with different bullshit to wade through to get it done.

permalink
report
reply
6 points

I appreciate your candor, I had a feeling it was cock and bull but you’ve answered my question fully.

permalink
report
parent
reply
3 points

Wait, if you can (or anyone else chipping in), please elaborate on something you’ve written.

When you say

That means they can engineer a solution to any problem that has already been solved millions of times already.

Hasn’t Google already made advances through its Alpha Geometry AI?? Admittedly, that’s a geometry setting which may be easier to code than other parts of Math and there isn’t yet a clear indication AI will ever be able to reach a certain level of creativity that the human mind has, but at the same time it might get there by sheer volume of attempts.

Isn’t this still engineering a solution? Sometimes even researchers reach new results by having a machine verify many cases (see the proof of the Four Color Theorem). It’s true that in the Four Color Theorem researchers narrowed down the cases to try, but maybe a similar narrowing could be done by an AI (sooner or later)?

I don’t know what I’m talking about, so I should shut up, but I’m hoping someone more knowledgeable will correct me, since I’m curious about this

permalink
report
parent
reply
6 points
*

Isn’t this still engineering a solution?

If we drop the word “engineering”, we can focus on the point - geometry is another case where rote learning of repetition can do a pretty good job. Clever engineers can teach computers to do all kinds of things that look like novel engineering, but aren’t.

LLMs can make computers look like they’re good at something they’re bad at.

And they offer hope that computers might someday not suck at what they suck at.

But history teaches us probably not. And current evidence in favor of a breakthrough in general artificial intelligence isn’t actually compelling, at all.

Sometimes even researchers reach new results by having a machine verify many cases

Yes. Computers are good at that.

So far, they’re no good at understanding the four color theorum, or at proposing novel approaches to solving it.

They might never be any good at that.

Stated more formally, P may equal NP, but probably not.

Edit: To be clear, I actually share a good bit of the same optimism. But I believe it’ll be hard won work done by human engineers that gets us anywhere near there.

Ostensibly God created the universe in Lisp. But actually he knocked most of it together with hard-coded Perl hacks.

There’s lots of exciting breakthroughs coming in computer science. But no one knows how long and what their impact will be. History teaches us it’ll be less exciting than Popular Science promised us.

Edit 2: Sorry for the rambling response. Hopefully you find some of it useful.

I don’t at all disagree that there’s exciting stuff afoot. I also think it is being massively oversold.

permalink
report
parent
reply
3 points

Hasn’t Google already made advances through its Alpha Geometry AI?? Admittedly, that’s a geometry setting which may be easier to code than other parts of Math and there isn’t yet a clear indication AI will ever be able to reach a certain level of creativity that the human mind has, but at the same time it might get there by sheer volume of attempts.

Wanted to focus a bit on this. The thing with AlphaGeometry and AlphaProof is that they really treat doing math as a game, not unlike chess. For example, AlphaGeometry has a basic set of rules, it can apply them and it knows when it is done. And when it is done, you can be 100% sure that the solution is correct, because the rules of the game are known; the 28/42 score reported in the article is really four perfect scores and three zeros. Those systems do use LLMs, but they really are only there to suggest to the system what to try doing next. There is a very enlightening picture in the AlphaGeometry paper here: https://www.nature.com/articles/s41586-023-06747-5#Fig1

You can automatically verify correctness of code the same way. For example Lean, the language AlphaProof uses internally, can be used for general programming. In general, we call similar programming techniques formal methods. But most people don’t do this, since this is more time-consuming than normal programming, and in many cases we don’t even know how to define the goal of our code (how to define correct rendering in a game?). So this is only really done when the correctness of the program is critical, like famously they verified the code of the automatic metro in Paris this way. And so most people don’t try to make programming AI work this way.

permalink
report
parent
reply

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.

permalink
report
reply
16 points

That’s some 40k shit.

“What does it mean?” “I do not know, but it appeases the machine spirit. Quickly, recite the canticles.”

permalink
report
parent
reply
2 points

This is directly how we’re getting to a 40k future and I hate it. The bad future!

If we must I might join the Mechanicus though. I’m good at chanting and doing things by rote.

permalink
report
parent
reply
8 points

My CTO thoroughly believes that within 4-6 years we will no longer need to know how to read or write code, just how to ask an AI to do it. Coincidentally, he also doesn’t code anymore and hasn’t for over 15 years.

permalink
report
parent
reply
1 point

From a business perspective, no shareholder cares at how good an employee is at personally achieving a high degree of skill. They only care about selling and earning, and to a lesser degree an enduring reputation for longer term earnings.

Economics could very well drive this forward. But I don’t think the craft will be lost. People will need to supervise this progress as well as collaborate with the machines to extend its capabilities and dictate its purposes.

I couldn’t tell you if we’re talking on a time scale of months or decades, but I do think “we” will get there.

permalink
report
parent
reply
4 points

Hackers and hobbiests will persist despite any economics. Much of what they do I don’t see AI replacing, as AI creates based off of what it “knows”, which is mostly things it has previously ingested.

We are not (yet?) at the point where LLM does anything other than put together code snippets it’s seen or derived. If you ask it to find a new attack vector or code dissimilar to something it’s seen before the results are poor.

But the counterpoint every developer needs to keep in mind: AI will only get better. It’s not going to lose any of the current capabilities to generate code, and very likely will continue to expand on what it can accomplish. It’d be naive to assume it can never achieve these new capabilities… The question is just when & how much it costs (in terms of processing and storage).

permalink
report
parent
reply
0 points

I think he’s correct and there’s a ton of cope going on on lemmy right now. I also think tons of art/graphic design jobs will disappear never to return.

permalink
report
parent
reply
-1 points

Don’t be, there will come a time when nearly all code is AI created, and not human readable.

You need to worry for the future when big data sites are running code they literally don’t know how it works and have no way to verify because of how cheap and relatively effective it is.

Then after that LLMs will get better at coding than any human can achieve, but will still be black box human unreadable code but there will be no chain of discipline left to teach new programmers.

Hardly anyone is taking this seriously because corporations stand to make a fucktonne of money and normal people are in general clueless about complex subjects that require a nuanced understanding, yet strangely arrogant about their ignorant opinions based on movies and their drinking buddies malformed opinions.

permalink
report
parent
reply
22 points

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.

permalink
report
reply
2 points

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

permalink
report
parent
reply
2 points

Ask it to make a function, then do some other function, then make them work together etc. Making it write a lot in one go won’t work. It’s more pair programming than having it write for you.

permalink
report
parent
reply

No Stupid Questions

!nostupidquestions@lemmy.world

Create post

No such thing. Ask away!

!nostupidquestions is a community dedicated to being helpful and answering each others’ questions on various topics.

The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:

Rules (interactive)


Rule 1- All posts must be legitimate questions. All post titles must include a question.

All posts must be legitimate questions, and all post titles must include a question. Questions that are joke or trolling questions, memes, song lyrics as title, etc. are not allowed here. See Rule 6 for all exceptions.



Rule 2- Your question subject cannot be illegal or NSFW material.

Your question subject cannot be illegal or NSFW material. You will be warned first, banned second.



Rule 3- Do not seek mental, medical and professional help here.

Do not seek mental, medical and professional help here. Breaking this rule will not get you or your post removed, but it will put you at risk, and possibly in danger.



Rule 4- No self promotion or upvote-farming of any kind.

That’s it.



Rule 5- No baiting or sealioning or promoting an agenda.

Questions which, instead of being of an innocuous nature, are specifically intended (based on reports and in the opinion of our crack moderation team) to bait users into ideological wars on charged political topics will be removed and the authors warned - or banned - depending on severity.



Rule 6- Regarding META posts and joke questions.

Provided it is about the community itself, you may post non-question posts using the [META] tag on your post title.

On fridays, you are allowed to post meme and troll questions, on the condition that it’s in text format only, and conforms with our other rules. These posts MUST include the [NSQ Friday] tag in their title.

If you post a serious question on friday and are looking only for legitimate answers, then please include the [Serious] tag on your post. Irrelevant replies will then be removed by moderators.



Rule 7- You can't intentionally annoy, mock, or harass other members.

If you intentionally annoy, mock, harass, or discriminate against any individual member, you will be removed.

Likewise, if you are a member, sympathiser or a resemblant of a movement that is known to largely hate, mock, discriminate against, and/or want to take lives of a group of people, and you were provably vocal about your hate, then you will be banned on sight.



Rule 8- All comments should try to stay relevant to their parent content.

Rule 9- Reposts from other platforms are not allowed.

Let everyone have their own content.



Rule 10- Majority of bots aren't allowed to participate here.

Credits

Our breathtaking icon was bestowed upon us by @Cevilia!

The greatest banner of all time: by @TheOneWithTheHair!

Community stats

  • 9.5K

    Monthly active users

  • 1.2K

    Posts

  • 24K

    Comments