4 ms·
The code looks, at a glance, as bad as you expect.
by q3k 7mo ago
The code looks, at a glance, as bad as you expect.
- loevborg 7mo agoCan you give an example? Looks fairly decent to me
- Insensitivity 7mo agothe "useCanUseTool.tsx" hook, is definitely something I would hate seeing in any code base I come across. It's extremely nested, it's basically an if statement soup `useTypeahead.tsx` is even worse, extremely nested, a ton of "if else" statements, I doubt you'd look at it and think this is sane code
- luc_ 7mo agoFits with the origin story of Claude Code...
- werdnapk 7mo agoinsert "AI is just if statements" meme
- loevborg 7mo agouseCanUseTool.tsx looks special, maybe it'scodegen'ed or copy 'n pasted? `_c` as an import name, no comments, use of promises instead of async function. Or maybe it's just bad vibing...
- Insensitivity 7mo agoMaybe, I do suspect _some_ parts are codegen or source map artifacts. But if you take a look at the other file, for example `useTypeahead` you'd see, even if there are a few code-gen / source-map artifacts, you still see the core logic, and behavior, is just a big bowl of soup
- Overpower0416 7mo agoexport function extractSearchToken(completionToken: { token: string; isQuoted?: boolean; }): string { if (completionToken.isQuoted) { // Remove @" prefix and optional closing " return completionToken.token.slice(2).replace(/"$/, ''); } else if (completionToken.token.startsWith('@')) { return completionToken.token.substring(1); } else { return completionToken.token; } } Why even use else if with return...
- kelnos 7mo agoI always write code like that. I don't like early returns. This approximates `if` statements being an expression that returns something.
- catlifeonmars 7mo agoI’m not strongly opinionated, especially with such a short function, but in general early return makes it so you don’t need to keep the whole function body in your head to understand the logic. Often it saves you having to read the whole function body too. But you can achieve a similar effect by keeping your functions small, in which case I think both styles are roughly equivalent.
- whilenot-dev 7mo ago> This approximates `if` statements being an expression that returns something. Do you care to elaborate? "if (...) return ...;" looks closer to an expression for me: export function extractSearchToken(completionToken: { token: string; isQuoted?: boolean }): string { if (completionToken.isQuoted) return completionToken.token.slice(2).replace(/"$/, ''); if (completionToken.token.startsWith('@')) return completionToken.token.substring(1); return completionToken.token; }
- worksonmine 7mo ago> Why even use else if with return... What is the problem with that? How would you write that snippet? It is common in the new functional js landscape, even if it is pass-by-ref.
- matltc 7mo agoLol even the name is crazy
- duckmysick 7mo agoI'm not that familiar with TypeScript/JavaScript - what would be a proper way of handling complex logic? Switch statements? Decision tables?
- catlifeonmars 7mo agoHere I think the logic is unnecessarily complex. isQuoted is doing work that is implicit in the token.
- deleted 7mo ago[deleted]
- q3k 7mo ago1. Randomly peeking at process.argv and process.env all around. Other weird layering violations, too. 2. Tons of repeat code, eg. multiple ad-hoc implementations of hash functions / PRNGs. 3. Almost no high-level comments about structure - I assume all that lives in some CLAUDE.md instead.
- loevborg 7mo agoYou're right about process.argv - wow, that looks like a maintenance and testability nightmare.
- darkstar_16 7mo agoThey use claude code to code it. Makes sense
- s3p 7mo agoIt probably exists only in CLAUDE or AGENTS.md since no humans are working on the code!
- delamon 7mo agoWhat is wrong with peeking at process.env? It is a global map, after all. I assume, of course, that they don't mutate it.
- hu3 7mo agoFor one it's harder to unit test.
- q3k 7mo agoIt's implicit state that's also untyped - it's just a String -> String map without any canonical single source of truth about what environment variables are consulted, when, why and in what form. Such state should be strongly typed, have a canonical source of truth (which can then be also reused to document environment variables that the code supports, and eg. allow reading the same options from configs, flags, etc) and then explicitly passed to the functions that need it, eg. as function arguments or members of an associated instance. This makes it easier to reason about the code (the caller will know that some module changes its functionality based on some state variable). It also makes it easier to test (both from the mechanical point of view of having to set environment variables which is gnarly, and from the point of view of once again knowing that the code changes its behaviour based on some state/option and both cases should probably be tested).
- wklm 7mo agohave a look at src/bootstrap/state.ts :D
- PierceJoy 7mo agoNothing a couple /simplify's can't take care of.
- tokioyoyo 7mo agoIt really doesn’t matter anymore. I’m saying this as a person who used to care about it. It does what it’s generally supposed to do, it has users. Two things that matter at this day and age.
- FiberBundle 7mo agoThis is the dumbest take there is about vibe coding. Claiming that managing complexity in a codebase doesn't matter anymore. I can't imagine that a competent engineer would come to the conclusion that managing complexity doesn't matter anymore. There is actually some evidence that coding agents struggle the same way humans do as the complexity of the system increases [0]. [0] https://arxiv.org/abs/2603.24755 https://arxiv.org/abs/2603.24755
- tokioyoyo 7mo agoI agree, there is obviously “complete burning trash” and there’s this. Ant team has got a system going on for them where they can still extend the codebase. When time comes to it, I’m assuming they would be able to rewrite as feature set would be more solid and assuming they’ve been adding tests as well. Reverse-engineering through tests have never been easier, which could collapse the complexity and clean the code.
- maplethorpe 7mo agoWell what is Anthropic doing differently to deal with this issue? Apparently they don't write any of their own code anymore, and they're doing fine.
- bakugo 7mo agoNothing, apparently, which is probably why Claude Code has 7893 open issues on Github at the time of writing.
- otterley 7mo agoAll software that’s popular has hundreds or thousands of issues filed against it. It’s not an objective indication of anything other than people having issues to report and a willingness and ability to report the issue. It doesn’t mean every issue is valid, that it contains a suggestion that can be implemented, that it can be addressed immediately, etc. The issue list might not be curated, either, resulting in a garbage heap.
- breppp 7mo agoHonestly when using it, it feels vibe coded to the bone, together with the matching weird UI footgun quirks
- tokioyoyo 7mo agoTeam has been extremely open how it has been vibe coded from day 1. Given the insane amount of releases, I don’t think it would be possible without it.
- breppp 7mo agoI don't really care about the code being an unmaintainable mess, but as a user there are some odd choices in the flow which feel could benefit from human judgement
- catlifeonmars 7mo agoIt’s not a particularly sophisticated tool. I’d put my money on one experienced engineer being able to achieve the same functionality in 3-6 months (even without the vibe coding).
- derwiki 7mo agoKinda reads like the Dropbox launch thread
- deleted 7mo ago[deleted]
- deleted 7mo ago[deleted]
- tokioyoyo 7mo agoThe same functionality can be copied over in a week most likely. The moat is experimentation and new feature releases with the underlying model. An engineer would not be able to experiment with the same speed.
- linesofcode 7mo agoCode quality no longer carries the same weight as it did pre LLMs. It used to matter becuase humans were the ones reading/writing it so you had to optimize for readability and maintainability. But these days what matters is the AI can work with it and you can reliably test it. Obviously you don’t want code quality to go totally down the drain, but there is a fine balance. Optimize for consistency and a well thought out architecture, but let the gnarly looking function remain a gnarly function until it breaks and has to be refactored. Treat the functions as black boxes. Personally the only time I open my IDE to look at code, it’s because I’m looking at something mission critical or very nuanced. For the remainder I trust my agent to deliver acceptable results.
- bakugo 7mo agoIt's impressive how fast vibe coders seem to flip-flop between "AI can write better code than you, there's no reason to write code yourself anymore; if you do, you're stuck in the past" and "AI writes bad code but I don't care about quality and neither should you; if you care, you're stuck in the past". I hope this leak can at least help silence the former. If you're going to flood the world with slop, at least own up to it.
- cruffle_duffle 7mo agoIt'd dogfooding the entire concept of vibe coding and honestly, that is a good thing. Obviously they care about that stuff, but if your ethos is "always vibe code" then a lot of the fixes to it become model & prompting changes to get the thing to act like a better coder / agent / sysadmin / whatever.