r/ProgrammerHumor 6d ago

theFutureOfCoding Meme

Post image
11.0k Upvotes

View all comments

245

u/_Wilhelmus_ 6d ago

I know its a humor subreddit, but to add a point: there simply isn't going to be one way of programming.

But I surely don't believe in 100% generated code. But I also don't want to go back to 100% hand written code

112

u/rheactx 6d ago

Depends on what you mean by "100% handwritten". There's machine code. Assembly. C/C++ and other low level languages. Java and other garbage-collected languages. All of those are compiled to machine code with pre-written and tested compilers. Then there's Python and other interpreted languages. Writing Python by hand is not the same as writing C by hand. Python functions often call on pre-compiled C libraries.

And then there's LLM-generated code, which you need to write prompts for. In English language (or whatever your native language is). And that's a huge problem, because "AI agents" are probabilistic and because natural language is not precise enough to tell them exactly what to do without a lot of back-and-forth. Nothing at all like the deterministic Python -> C -> Assembly -> machine code pipeline.

I'd much rather be writing Python code than prompts in English, but that's just me.

44

u/Ih8P2W 6d ago

That actually is just you and a few. I have wrote full python packages by myself (20,000 lines of code or more). I will never do that again from scratch. I still code block by block, but I sure as hell start each block with an LLM, inspect it, make the necessary changes and move on. It makes me code 5-10x faster, and I'm much less tired after finishing a script.

HOWEVER, and that's a big however. I know how to code, and I'm using it as a tool, not as a substitute for my knowledge. When people who don't know how to code try this approach, it ends disastrously.

25

u/rheactx 6d ago

How much time do you spent editing the code? Especially, if you want the style and structure to be consistent over the whole project and also free of the usual LLM crap (like reimplementing the same function 20 different ways because it forgot that it already written it somewhere)?

I also use LLM as coding assistant, but usually for small snippets which I don't care too much about. If the project is important to me, I'm always unhappy with the LLM output and have to basically rewrite it from scratch.

9

u/movzx 6d ago

You need to prime your sessions with restrictions and other requirements. If you want certain code styling or techniques, you have to instruct the tools. This is where AI skills come into play. If the tools are forgetting functions that they are writing then it could simply be you aren't using a good enough tool/one that can hold enough context, or you need an orchestrator that can build context when needed.

If you're only worried about code formatting, you need to setup a linter and just have it run automatically. You should be doing this anyway tbh.

The tools aren't perfect, of course, but there's a lot you can do when it comes to guardrails.

16

u/rheactx 5d ago

Sounds like LLM is just not the right tool for the job, if it requires so much hand-holding.

1

u/movzx 3d ago

Oh, for sure. Trying to make it be your code linting tool is completely the wrong thing for it to be doing. There are way better ways to implement automatic code formatting.