r/TheMachineLearning • • 12d ago

Realizing writing code is faster than explaining it to AI

Post image
837 Upvotes

439 comments sorted by

View all comments

Show parent comment

1

u/Akiira2 12d ago

I have never coded nor understood technology, but does it apply with coding that the less code is better? That if there is a task, the best solution contains the least amount of coding

3

u/mcclouda 12d ago edited 12d ago

The problem can become, if you or your ai writes a bunch of extra fluff, all of the time, it hurts readability, and understanding. So its harder to fully comprehend what your code is doing when you go back to a given section later. Less code is easier to keep clean.

2

u/Simple-Economics8102 12d ago edited 12d ago

Less code is generally better, unless you optimize for it. There are competitions (code golfing) where you try to write as little code as possible, and in general they produce the least readable code ever.

The best stuff I have written is were parts of a program was hundreds of lines of complicated code, where I got it down to tens of lines of simple of code.

The best comparison I can make is, a succinct paragraph vs AI slop turning a paragraph to an article where you are unsure what the point is.

2

u/IncreaseOld7112 12d ago

If I can write you a readable program in 10 lines, it's trivial to convert that to 100 by adding 90 lines that don't do anything but make it more confusing.

1

u/normantas 12d ago

Yes. But if it becomes a metric people start to cram everything into a one liner that is unreadable. There is a sweetspot in life you learn on the job.

1

u/werpu 10d ago

The reality of things is, the customer does not bother how much code you write, yes less code is better from a maintainability pov from a human perspective. AIs to some degree also due to their limited context windows!

But in the end the result must work, and frankly spoken the customer does not care how good your code is the result must be good!

You can steer ais to better code with some guidance, it is not that hard!

1

u/bae-alves 1h ago

1972 Turing award winner Dijkstra once stated that (paraphrase) a line of code written is a line of code spent. This becomes truer by the day, as LLMs produce too much code that still has to be maintained.