Hacker Newsnew | past | comments | ask | show | jobs | submit | frodowtf2's commentslogin

> In both cases the code will be crap, as no model I've seen produces good code.

I'm wondering if you have actually used claude code because results are not so catastrophic as you describe them.


I used LLMs to write what seems like far too many lines of code now. This is an example Opus 4.6 running at maximum wrote in C:

    if (foo == NULL) {
       log_the_error(...);
       goto END;
    }
    END:
    free(foo);
If you don't know C, in older versions that can be a catastrophic failure. (The issue is so serious in modern C `free(NULL)` is a no-op.) If it's difficult to get a `FOO == NULL` without extensive mocking (this is often the case) most programmers won't do it, so it won't be caught by unit tests. The LLMs almost never get unit test coverage up high enough to catch issues like this without heavy prompting.

But that's the least of it. The models (all of them) are absolutely hopeless at DRY'ing out the code, and when they do turn it into spaghetti because they seem almost oblivious to isolation boundaries, even when they are spelt out to them.

None of this is a problem if you are vibe coding, but you can only do that when you're targeting a pretty low quality level. That's entirely appropriate in some cases of course, but when it isn't you need heavy reviews from skilled programmers. No senior engineer is going to stomach the repeated stretches of almost the "same but not quite" code they churn out.

You don't have to take my word for it. Try asking Google "do llm's produce verbose code".


C is fundamentally a bad target for LLMs. Humans get C wrong all the time, so we can not hope the nascent LLM, which has been trained on 95% code that does automatic memory management, to excel here.

I always found myself writing verbose copypasta code first, then compress it down based on the emerging commonalities. I think doing it the other way around is likely to lead to a worse design. Can you not tell the LLM to do the same? Honest question.


> I always found myself writing verbose copypasta code first, then compress it down based on the emerging commonalities. I think doing it the other way around is likely to lead to a worse design.

I do pretty much the same thing, which is to say I "write code using a brain dump", "look for commonalities that tickle the neurons", then "refactor". Lather, rinse, and repeat until I'm happy.

> Can you not tell the LLM to do the same?

You can tell them until you're blue in the face. They ignore you.

I'm sure this is a temporary phase. Once they solve the problem, coding will suffer the same fate as blacksmiths making nails. [0] To solve it they need to satisfy two conflicting goals - DRY the code out, while keeping interconnections between modules to a minimum. That isn't easy. In fact it's so hard people who do it well and can do it across scales are called senior software engineers. Once models master that trick, they won't be needed any more.

By "they" I mean "me".

[0] Blacksmiths could produce 1,000 or so a day, but it must have been a mind-numbing day even if it paid the bills. Then automation came along, and produced them at over a nail per second.


> C is fundamentally a bad target for LLMs.

I found it exceptionally good, because:

a) The agent doesn't need to read the implementation of anything - you can stuff the entire projects headers into the context and the LLM can have a better birds-eye view of what is there and what is not, and what goes where, etc.

and

b) Enforcing Parse, don't Validate using opaque types - the LLM writing a function that uses a user-defined composite datatype has no knowledge of the implementation, because it read only headers.


Is foo a pointer in your example? Is free(NULL) not a valid operation?


Yes `foo` is a pointer.

`free(NULL)` is harmless in C89 onwards. As I said, programmers freeing NULL caused so many issues they changed the API. It doesn't help that `malloc(0)` returns NULL on some platforms.

If you are writing code for an embedded platform with some random C compiler, all bets on what `free(NULL)` does are off. That means a cautious C programmer who doesn't know who will be using their code never allows NULL to be passed to `free()`.

In general, most good C programmers are good because they suffer a sort of PTSD from the injuries the language has inflicted on them in the past. If they aren't avoiding passing NULL to `free()`, they haven't suffered long enough to be good.


> That means a cautious C programmer who doesn't know who will be using their code never allows NULL to be passed to `free()`.

If your compiler chokes on `free(NULL)` you have bigger problems that no LLM (or human) can solve for you: you are using a compiler that was last maintained in the 80s!

If your C compiler doesn't adhere to the very first C standard published, the problem is not the quality of the code that is written.

> If they aren't avoiding passing NULL to `free()`, they haven't suffered long enough to be good.

I dunno; I've "suffered" since the mid-90s, and I will free NULL, because it is legal in the standard, and because I have not come across a compiler that does the wrong thing on `free(NULL)`.


So what would be the best practice in a situation like that? I would (naively?) imagine that a null pointer would mostly result from a malloc() or some other parts of the program failing, in which case would you not expect to see errors elsewhere?


> imagine that a null pointer would mostly result from a malloc() or some other parts of the program failing, in which case would you not expect to see errors elsewhere?

Oh yes, you probably will see errors elsewhere. If you are lucky it will happen immediately. But often enough millions of executed instructions later, in some unrelated routine that had its memory smashed. It's not "fun" figuring out what happened. It could be nothing - bit flips are a thing, and once you get the error rate low enough the frequency of bit flips and bugs starts to converge. You could waste days of your time chasing an alpha particle.

I saw the author of curl post some of this code here a while back. I immediately recognised the symptoms. Things like:

    if (NULL == foo) { ... }
Every 2nd line was code like that. If you are wondering, he wrote `(NULL == foo)` in case he dropped an `=`, so it became `(NULL = foo)`. The second version is a syntax error, whereas `(foo = NULL)` is a runtime disaster. Most of it was unjustified, but he could not help himself. After years of dealing with C, he wrote code defensively - even if it wasn't needed. C is so fast and the compilers so good the coding style imposes little overhead.

Rust is popular because it gives you a similar result to C, but you don't need to have been beaten by 10 years of pain in order to produce safe Rust code. Sadly, it has other issues. Despite them, it's still the best C we have right now.


Having used Claude Code extensively, catastrophic is a perfect word to describe it.


Military service in the west is not for defence. Irak, Iran, Syria, Vietnam...


The German constitution explicitly prohibits starting wars: https://www.gesetze-im-internet.de/englisch_gg/englisch_gg.h...


It's about time to finally grok that all world's military is only there to wage wars at the whim of the 0.001% under the guise of being defence-only, and that constitutions worth less than toilet paper these days.


What's an example of the German constitution being "worth less than toilet paper these days"?


There's none yet until there suddenly is.


So what's your proposed solution? Not have a military and just roll over when someone decides to attack you?


My proposed solution is understanding what this scene means:

In front of a blood-stained chessboard littered with mutilated chess pieces finely dine two royal couples - black and white - cheering their endgame.


How does that solve any problem?


Kill the royal couples, no problem. There is an argument to be made that those that start wars should be sentenced to death for doing so. Particularly frivolous ones of aggression.


If the civilian populous has access to arms and armories they can make it a worthless proposition to invade them. Its not like the world is entirely composed of large countries with strong militaries already. An insurgency can last decades under fire from a superior force, an organized military won't. So if you can't match the organized military might of potential enemies, its probably mostly a waste to try.


Defense doesn't mean not to start a war. Think about how Vietnam justified their invasion of Cambodia in 1978, or how China started the war with Vietnam the following year, or how Turkey entered Syria, how Pakistan fought the Taliban recently, and of course what Russia did in Ukraine, 2014 and 2022.

Wars are messy and have always been. Military actions are to be decided by the governments. Those who have resources are more willingly to use it, west or east.


Germany was one of the least militarized countries after WWII. They were kind of scared of themselves.


Rather: the "victorious" countries of the Second World war were afraid of a re-militarization of Germany. On the other hand, they wanted to re-militarize the Western part of Germany just a little bit so that West Germany could become part of the NATO.


Quite the contrary; up until the end of the Cold War both German states were highly militarized. They were quite happy to be able to roll back a lot of it after the reunification though.


It is for the defense of the American national interests and friend nations:

- Iraq: 1) to expel Iraq from Kuwait, and 2) weapons (though this turned out to be mistaken) after the 9/11 attacks

- Iran: we don’t need another nuclear nation

- Syria: destroy terrorists (ISIS), enforce the red line on chemical weapons, and to protect US troops (when we attacked Iran-supported militias)

- Vietnam: to stop the spread of communism and protect neighboring nations


That is basically redefining the word defense, though.

I can’t be like “it was self defense” if I beat somebody up because they are getting too big at the gym and they could beat me up later if I don’t beat them up first.

That doesn’t mean such a thing is never ever justified, in international relations, it just ain’t “defense”.


> That is basically redefining the word defense, though.

I guess that dogemaster2026 wanted to express this in a little bit more indirect way. :-)


[flagged]


Well that depends. Are they saying this because they have a problem with me specifically? Or is it because they have a problem with my asshole friend who I for some reason support financially?

If it’s the latter (like it is in reality, AFAICT), I would first do some serious reflection about my friend.


They are not saying DEATH TO YOUR FRIEND. They are saying DEATH TO PFANNKUCHEN.

How much more specific do you want them to be?

Again, why would you let them get strong? Just so they kill you and your family? You don’t seem to care about yourself nor about your family enough.


In the analogy, if you are financially supporting guy A who is harassing guy B and his family constantly over years, and as a kicker guy A acts like he’s done nothing wrong, it is human nature for guy B to be pissed not only at guy A but also at YOU who financially supports guy A even while you know what he is doing.

If you stop financially supporting guy A and sincerely apologize to guy B, and guy B continues to be pissed at you, THEN you can act like he is unreasonable and take steps to protect yourself, even if those steps hurt guy B.

You can’t pretend guy A is blameless and act confused why guy B is pissed at you, which is what is happening in real life.


Of course I am going to support Guy A because HE IS MY FRIEND or FAMILY.

But the fact remains your strategy will only lead to your death and your family’s. Which it would be good for your family to know.


Of course you are free to support abusive behavior but especially with friends and family it would probably be useful for your own sake not to do so, and it is factually correct to view (and treat) you as enabler if you continue to do so despite knowing about the abuse.


I don’t care how things started. If someone wants to chop my head off and has shown evidence of chopping the heads off of people of my tribe, I will try to beat them first But you do you.


So while many of the reasons are questionable (understatement of the year), let’s focus on the last one. After America lost the war in Vietnam, what happened to those neighboring nations? Did they suffer from Vietnamese communists? The only Vietnamese intervention was in Cambodia, and hardly anyone thinks that wasn’t the right thing to do.


The OP said it was not for “defence.” I am arguing the reasons were for the defense of American interests. That is objectively true.


The OP probably thought of defense in the narrow sense as "the action of defending against or resisting an attack", and not in the broader sense defined as "we’re going to travel halfway around the world to kill a million people because that’s who we are". A common mistake.


Not because “that’s who we are.” That’s a ret*rded retort. You go halfway around the world because you want to protect your friends and your nation’s interest.

Wouldn’t you do that to protect your family and your home, now and into generations? I think I know the answer.


That depends greatly on which interests you allow to be defined as "American". The vast majority of American people would have preferred not to be involved in most of our foreign adventures. The rich and powerful thought differently. Is our citizenship determined by the size of our bank accounts?


This is factually incorrect. Here are the estimates for the rates of support for each conflict at the beginning of the conflict:

- Iraq (Gulf War): 75-80%

- Iraq (2003): 65-76%

- Syria: 35-50%

- Vietnam: 65-75%

- Iran: 42%

Alexander Hamilton wrote that governance should involve people with “wisdom to discern” and “virtue to pursue the common good”. The US is not a direct democracy; it is a constitutional republic. The definition of what constitutes American interests is literally whatever the United States federal government says it is.

SOURCES:

- https://en.wikipedia.org/wiki/Iraq_War

- https://news.gallup.com/poll/8212/only-americans-believe-war...

- https://en.wikipedia.org/wiki/US_domestic_reactions_to_the_2...

- https://en.wikipedia.org/wiki/Opposition_to_United_States_in...

- https://www.washingtonpost.com/politics/2026/04/01/iran-war-...


Invading other countries to take their resources and kill civilians is not defence.

With your logic, Russia is also acting in a defensive manner.


I'm probably going to get flagged for this, but here goes anyway.

Russia absolutely has reason to not want Ukraine to join NATO. I'm not condoning the invasion, but I say it absolutely makes sense for Russia to carry it out. Not a reason to commit war crimes, or to cause any more suffering than necessary, but from a national security perspective it makes sense to want to disrupt the process of Ukraine joining NATO.


Only if you accept the hidden assumption that Russia is an antagonist toward the rest of Europe. Otherwise the common "national security" justifications make no sense, because Russia benefits immensely from other NATO members investing resources into the development of institutions in newer member states.

A former Russian foreign minister has labeled NATO "free-of-charge security" for Russia, because NATO membership requirements turn a country into a stable and predictable place. The best neighbors Russia has are in NATO, and much of that stability is directly attributable to their membership.


They meant "defense of interests", not "defense of the country" (as in a geographical entity).


Yeah, by such definitions any country is justified to wage a war and always find a way to claim it’s for self-defense (which is indeed how most causus belli have worked throughout the history – they always claim to have the moral high ground when launching the war). This is also how essentially in every country it’s called the Department of Defense (unless you’re Trump) but that means nothing as they start wars all the same. Not a trace of any rules, accountability or restraints still remains under such a framing.


Correct. The strongest always wins.

Also it’s not defense. It’s national security what matters.

Prior to WW2, almost every nation called it “ministry of war.” The defense branding is a modern woke framing to appease the masses.


_We don't need another nuclear nation unless it's Israel_


Germany participated how there?


Germany participated in the NATO military campaign/occupation of Afghanistan, including ground forces, naval activities and special operations units. Its seems a total of 150,000 German soldiers (and police officers?) were deployed overall (not at the same time of course); of them, 62 were killed and 249 wounded:

https://en.wikipedia.org/wiki/German_Armed_Forces_casualties...

Germany was also directly involved in the NATO campaign against (former) Yugoslavia:

https://en.wikipedia.org/wiki/NATO_bombing_of_Yugoslavia

and finally, Germany hosts large contigents of US forces, including air forces likely involved in the current illegal war against Iran.

https://en.wikipedia.org/wiki/Ramstein_Air_Base


To put the number of 150000 total deployes soldiers into perspective, the Bundeswehr contingent in the end had a ceiling of 5350 troops.


5350 troops supposed to defend Germany, were instead waging a useless war in Afghanistan. 5350 troops too many.


Iran, Iraq, Syria, Vietnam? Hosting US forces in Germany is participating?


yes it is, how is that not obvious?


It's vibe coded because every button looks different.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: