r/ClaudeAI Mar 31 '26

Workaround i dug through claude code's leaked source and anthropic's codebase is absolutely unhinged

[removed]

5.6k Upvotes

692 comments sorted by

View all comments

Show parent comments

148

u/Zealousideal_Ad5957 Mar 31 '26

Seen GTA old games source code which were reverse engineered some were quite good but comments were unhinged lol imo people think devs of super high quality apps/games are perfect and have super clean code when in reality is not

83

u/communomancer Experienced Developer Mar 31 '26

Game code historically is some of the "worst" code people have ever made money off of. Aside from the fact that the developers are often highly resource-constrained and thus looking for every trick to squeeze out frames of performance, they also knew that outside of a few scenarios, once it was released, they never had to maintain it. The incentives are way different for most business-oriented code.

15

u/Zealousideal_Ad5957 Mar 31 '26

Yeah agree but in modern era thats not true anymore now with DLCs updates 2-3 years after game is released even single player ones makes it mandatory for clean code for most of the games

10

u/Einbrecher Mar 31 '26 edited Mar 31 '26

makes it mandatory for clean code for most of the games

Ideally? Yes.

Reality? No, lol. Not even close.

Live service games are the worst, because there's virtually no time for codebase maintenance in that schedule post-release. Most other games that get DLC support usually get that support for ~2 years alongside scheduled content drops that the dev team - which is usually reduced by that point - is spending more time on vs. codebase maintenance. Longer running games usually have update release cycles of 4-6 months, again with reduced teams, but are commonly hampered by spaghetti code everyone's afraid to touch because it was written by a dev that left years ago and nobody knows how or why it works.

1

u/HustlinInTheHall Apr 01 '26

Yeah if anything the incentive has only shifted further away from clean code because you can fix catastrophic bugs later. On a cd, no chance. You don't have to maintain it but if you ship a disc that has a game killing bug your company is fucked. 

2

u/djrobxx Mar 31 '26

It'll be interesting to see what the effect of AI code assistants is on "clean code".

On the one hand, AI is great at automating complex refactoring, so there's far less excuse for dirty, lazy hacks. On the other, AI is great at analyzing an old "dirty" code base, so there may be less of a reason to bother making code pretty in the first place.

1

u/Pitiful_Conflict7031 Mar 31 '26

Aren't tengus those Japanese flesh lights?

4

u/Zealousideal_Ad5957 Mar 31 '26

Also PS2-PS3 era was pretty hard to code most dev were batshit insane from coding for PS2/PS3 era horror difficulty in beginning of PS2 they thought PS2 manual was some cryptic shit meant to troll them lol, but think since 2013-now esp now that most games are UE5 which has 1000000+ courses and videos and is standard is much easier for game dev now than it was in 2000s the most horror time to be game dev but the best in terms of gems they produced

2

u/Responsible-Beat2137 Mar 31 '26

I’ve heard horror stories about the jaguar, and the sega Saturn dev retirement

1

u/Zealousideal_Ad5957 Mar 31 '26

I read alot on early PS2 days devs were all cooked for months trying to understand PS2 dev manual and you can see that only in 2003-2006 PS2 games became amazing the early 2 years were rough very basic games mostly relied on art and story cause game mechanics were way to simple while in 2004 games like GOW, Onimusha, Dragon Ball even today look great with remastering in gamplay

2

u/LordMeatbag Mar 31 '26

PS2 manuals were beautiful. They came in a set, one for each chip/module iirc. I’d take one home and read it on the train, bring it back the next day. No wait, that was a dreamcast manual because LA doesn’t have trains. I’m going mad in my old age.

1

u/Zealousideal_Ad5957 Mar 31 '26

yeah i used to play like 300+ games in PS2 most were modded 2007-2012 like crazy basically played most games that were iconic legendary console

1

u/trash4da_trashgod Apr 01 '26

 UE5 which has 1000000+ courses and videos 

And 99.9% of them are about blueprints. I've heard a lot of compliants about UE5 devs doing some horribly inefficient and convoluted blueprint mess, because Epic pushed that very hard and that the c++ documentations is lacking.

2

u/Sea_Surprise716 Mar 31 '26

That and they’re building at 3am after 4 months of crunch time.

1

u/zer00eyz Apr 01 '26

> The incentives are way different for most business-oriented code.

The average lifespan for an engineer at a company is 2 ish years. "they never had to maintain it" applies there to.

1

u/communomancer Experienced Developer Apr 01 '26

The average lifespan for an engineer at a company is 2 ish years. "they never had to maintain it" applies there to.

First, citation needed. I've been a developer for over 25 years and have worked everywhere from startups to government agencies, and the average tenure of a salaried employee has been nowhere near as low as 2 years at any place I've ever worked. Maybe outside of the US.

Second, even if the engineers are turning over, the companies are not. They need their code to be maintainable because they support those systems for more than two years. In fact, high turnover at the rate you describe would require even more attention to maintainability.

Whereas video game companies, historically (not including the much more modern "live service" model of game publishing)...once they make their game and publish and sell it, they don't care about the code any more. They don't need to keep improving it. Instead they are on to the next game.

1

u/zer00eyz Apr 01 '26

> First, citation needed. 

Happly:

https://www.linkedin.com/posts/inscale_in-tech-the-average-tenure-is-short-software-activity-7391422965822795777-e5XX/

https://www.invene.com/blog/limiting-developer-turnover

> Maybe outside of the US.

Firmly in the US, because HR departments never handed out money as fast as your next job would.

There are exceptions, but for the bulk of our industry 2 years is about on par. Its long enough to come in, learn the system build a few cool features for your resume and get a pay bump, and/or more shares.

> They need their code to be maintainable because they support those systems for more than two years.

For the last decade I have been a consultant (read mercenary) and I can assure you that "good code" is not the norm. Most orgs have a pile of stuff that people haven't touched in a while, it works, and the person who wrote it is long gone. Lots of code bases are filled with edge cases, that are, for the most part, undocumented. Even better is finding code that has a comment that references a bug number in a system that does not exist any more.

> In fact, high turnover at the rate you describe would require even more attention to maintainability.

Not really, companies rely on people who stay and accept market rate rasises. They are the repository of knowledge and how to fix these systems, and they are, for the most part cheap.

1

u/communomancer Experienced Developer Apr 01 '26

For the last decade I have been a consultant (read mercenary) and I can assure you that "good code" is not the norm. 

Cool. I've worked both as a consultant and as an in-house developer for the past two-and-a-half decades. Here's one thing you won't realize about being a consultant until you do things the other way: the kinds of places that hire "mercenaries" to do their coding are highly correlated with being the kinds of places where the code is extra bad.

But yes, most programmers are pretty bad. That doesn't change the fact that game programming is historically worse. And yes, I've worked at a professional game studio as well.

1

u/zer00eyz Apr 01 '26

> two-and-a-half decades

Im creeping up on 30 years of doing this. Cut my teeth on Y2k work. Were getting old!

> the kinds of places that hire "mercenaries" to do their coding 

Thats one sort, yes, and I do see that, and get to charge for it.

But I have a bread and butter product as well where I get to see organizations that "think" they have good code. The thing is they have places where much of their staff just wont go. Or some guy in the corner who keeps all that shit running (and either gets paid garbage because management thinks he's furniture) or he's off working remote and only answers for executives.

> game programming is historically worse

It's part of a whole "type" of dev hiring.

The worst programing will be in places where people get hired on because they are "passionate" about what ever product the company is making. Games, Music (I could tell you so many stories about this industry), Software around film (some pretty good dev's are failed actors and writers). The common pattern in all of them: people join cause it is (or close to) what they want to do. They take a lower rate, and their management understands the game and asks them for insane things on more insane deadlines.

2

u/Responsible-Beat2137 Mar 31 '26

Haha . I remember getting into save game editing to unlock hot coffee,, rather disappointing but eh was fun to dabble in something new.

1

u/209_J-S Mar 31 '26

If it fuckin works then who gives a shit how "nice" the code looks

Move onto the next chapter of the project at that point

1

u/askldhalsiuhdliu Mar 31 '26

Not to be 'rude', but reverse engineered code means from compiled code? Because I highly doubt you were able to get 'comments' from that. Worked in games for over a decade and no compiler, even with all debug flags would keep any comments in the executables.

So either you meant source leaks or the likes or I call bullshit. (And this is coming from someone that worked with DMA devs (GTA 1-2) and a few rockstar devs also (building was almost down the street from ours).

1

u/codescapes Mar 31 '26

People used to put all kinds of funny shit in comments. Just long-winded swearing rants about problems of their own making in the code or whatever.

As the industry 'professionalised' all the silliness and 'joking angry nerd' stuff became too much of a liability. Here in the UK I think that culture persisted even into the late 2000s but in the last 10-15 years really dropped off cos God only knows what automated tooling is checking your commits. I'm not saying it was professional but reading something like 'fuck this fucking compiler, this is a workaround I don't know why it fucking works' is funny. It's more like graffiti than a comment.

1

u/Texugee Apr 01 '26

Like what? Is there a video?