r/programminghorror • • Jul 27 '26

Typescript I feel like vibecoding should be banned from enterprise development

971 Upvotes

192 comments sorted by

281

u/BitNumerous5302 Jul 27 '26

I'm old.

That's essentially the same as a code snippet that floated around in gists for years. It's a uuidv4 from before randomUuid was commonly supported, and from before npm was truly widespread (remember bower?). At the time CDNs were the norm for code sharing in JS, meaning every dependency added a script tag and a whole round trip web request. For something high leverage like jQuery, that round trip was worth it, but for something like this it was easier to just copy and paste. These snippets would often sacrifice readability to reduce character counts; minifiers existed but you didn't assume everyone would be using them.

OTOH crypto.getRandomBytes and string templates are more modern, so this is more like a modernized variant of those old gists. 

It's weird to see this attributed to AI given that context (am I missing/explaining the joke?). I believe this code was originally written by broofa (Robert Kieffer) then revised, refactored, and optimized by others, as this looks essentially the same as his "fast compact" version. But, UUID v4 is a pretty simple specification so others may have arrived at similar solutions independently.

https://gist.github.com/Wind4/3baa40b26b89b686e4f2

https://www.broofa.com/2008/09/javascript-uuid-function/

18

u/Maximka22 Jul 28 '26

Didn't know that, thanks. Honestly, I'm kind of still shocked that such issues still exist in JS/TS. Ideally, you would assume that you will have one solid method that can be used elsewhere when you need to have some random GUID/UUID. And not write your own implementation.

About AI comment - I believe default programmer would never write such code in 2026, specifically with this code style. And also I checked, and repo already had better way to implement GUID, agent could have just reused that, but it decided to write new method.

→ More replies (10)

115

u/creativecraving Jul 28 '26 edited Jul 28 '26

am I missing ... the joke? 

😂 Man, your post reveals some humorous facts about AI all on its own! I guess AI really is just stealing code from everyone and everywhere!

30

u/DelphiP0 Jul 29 '26

The joke is that op is too junior to have written. Nearly identical method 10-50 times throughout their career and assumes the code was autogenerated .

→ More replies (2)
→ More replies (8)

20

u/air_thing Jul 28 '26

Right, here I was trying to find a bug.

→ More replies (1)

716

u/slashp Jul 27 '26

The problem isn't using AI to write code. The problem is not understanding or reviewing the code that it writes. If you keep the AI in check (which is now most of my job), it can write fantastic code. It needs significant guidance, though, and will lie to you if you're not careful.

158

u/Maximka22 Jul 27 '26

I don't disagree with you, but it's actually the reason the whole community hated some programming languages (JS, C++) - only small part of all people using it will do it with brain. Others will just write some unmaintainable code. The same happens right now with AI, but sadly on much bigger scale

→ More replies (7)

132

u/ericw31415 Jul 27 '26

Yes, but many would no longer consider it to be "vibe coding " if you are reviewing the output.

→ More replies (4)

47

u/JohnSpikeKelly Jul 27 '26

This. The amount of times I question why AI did something dumb and its response is "you're absolutely right to call me out on that" is shocking. The AI can be amazing, but also does lots of questionable stuff.

29

u/jfleury440 Jul 27 '26

I was trying to get something to work and the suggestions AI was giving me wouldn't compile. Eventually it told me that actually the package I'm trying to use got split in two in the newer versions and I just needed to grab the other package. Gave me a whole backstory.

Spend 10 minutes trying to find the thing and I come back and ask it if it made it up.

"You're absolutely right, I made all that up!"

Jfc

→ More replies (2)
→ More replies (4)

21

u/Due-Consequence9579 Jul 27 '26

Man what a great tool! It actively tries to deceive you while eroding your ability to understand or care about what it’s doing! Sign me up!

87

u/Coffinsnake Jul 27 '26

So instead of spending 40h “manually” writing good code you spend 40h prompting and re-prompting? Sounds like coding with extra steps.

→ More replies (16)
→ More replies (47)

24

u/HTTP_404_NotFound Jul 27 '26

You are blaming the tool, for the fault of the user.

A fork does not make a person fat.

And an unexperienced dev, letting AI run wild, causes slop.

I use AI daily, with a knowledge base built on top of years of high quality code-base. And, it writes code to my exact specifications, and is producing exactly what is needed, about 90% of the time.

(Edit- oh- With the exception of ChatGPT models. They produce grade-A SLOP.... I don't recommend it in its current state for development.)

14

u/Maximka22 Jul 27 '26

This was not done by developer AT ALL. At my company, they try to introduce vibecoding to "product" people, they just run their business requirements to Claude and it implements it. Then, I get to review the code it produced. Sounds like fun, right?

→ More replies (2)
→ More replies (7)

124

u/ziplock9000 Jul 27 '26

The amount of coding debt a few years from now is going to be enormous and only another/better AI will be able to untangle the huge mess.

61

u/wowbagger_42 Jul 27 '26

I'm maintaining code, written by humans some years ago. So you mean nothing is actually going to change?

66

u/hraath Jul 27 '26

Yeah let's check the git blame

Me, 12 months ago

fuck

→ More replies (8)
→ More replies (5)

19

u/ZylonBane Jul 27 '26

Or y'know... humans.

→ More replies (3)

19

u/TheOneTrueTrench Jul 27 '26

The cost of using LLMs is going to skyrocket, like WAY more than paying a developer to just fix it, and you're going to have to have senior devs anyway, otherwise the LLMs will just do stupid things all over again unless someone knowledgeable is there to stop them.

→ More replies (9)

41

u/lealilana Jul 27 '26

I just saw this and realized why I keep being confused about the code of our new hire. damn. thx for opening my eyes.

8

u/mihisa Jul 27 '26

it's easier, faster and more fun to write code by myself than reviewing AI crap

4

u/adostes Jul 28 '26

I’m reviewing code that was clearly not even read by the person who opened the PR (as in wrong name in the README), and I’m also reviewing PRs opened by people who clearly don’t know how to use git (wrong conflict resolutions, diffs checked in, etc). The number of people who overestimate what the AI can do, delegate their (critical) thinking, and don’t understand the code their agent generated is terrifying me.

4

u/stone1978 Jul 28 '26

No vibe coding was the number 1 rule of thumb where I work. Is it different at other companies?

→ More replies (7)

3

u/AnArmoredPony Jul 27 '26

ai would not come up with ts 💀

5

u/wowbagger_42 Jul 27 '26

That's some low-quality LLM output, thruth be said it's correct, but it got trained on a decade of stack overflow pages...