top 99 comments

sorted by: hot top controversial new old
[–] 112 points 1 month ago (4 children)

Don't worry half of those will be useless code comments

  • source
  • hideshow 4 child comments
  • [–] 123 points 1 month ago (3 children)

    // Here I'm not using that other thing that is now completely irrelevant, but I'll leave a comment to the non-existing thing anyway because I'm avoiding it.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 19 points 1 month ago (2 children)

    REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

  • source
  • parent
  • hideshow 2 child comments
  • [–] 26 points 1 month ago* (1 child)

    The comment:

    # This code does exactly what you asked: Never change state, only fetch the state and return the difference

    the code: hallucinated database table drops

  • source
  • parent
  • hideshow 1 child comment
  • [–] 89 points 1 month ago (12 children)

    I struggle to review a 1k line change. When people give me such big changes I normally don't believe they've reviewed them either.

  • source
  • hideshow 12 child comments
  • [–] 18 points 1 month ago (2 children)

    Try working on a codebase that's all event-driven hexagonal CQRS with hand-crafted SQL for persistence. Add additional buzzwordy methodologies to taste.

    Adding a single property to your product means you now have to update an aggregate class, several DTOs, and several event classes and handlers before you can even think about touching the UI.

    And that's in your main solution. There's also at least one facade service you'll need to make compatible and you also need to update the event simulator used for testing. The latter night involve having to touch every single line in a 2000 lines long SQL script.

    Having to go though three separate 600-2000 LOC PRs for one PBI isn't that exotic.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 6 points 1 month ago (6 children)

    Occasionally I do that…but only because 500 of those lines are my comments explaining everything.

  • source
  • parent
  • hideshow 6 child comments
  • [–] 6 points 1 month ago* (last edited 1 month ago) (5 children)

    Please don't explain that much, make your code easier to understand.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 5 points 1 month ago* (4 children)

    I’m aware. Not always feasible. For example, had to add a custom video capture solution that captures the last 30 seconds of a process for crash handling purposes.

    You most definitely need to do add that much comments explaining the mp4 box format along with the box “hierarchy” of what is being written. Add to that MFT (h264 encode) code…

    Basically, if anything, the comments are for me for when I look back at that code.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 1 month ago (3 children)

    had to add a custom video capture solution that captures the last 30 seconds of a process for crash handling purposes.

    Commanded from above? This smells like a noob idea.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 1 month ago (2 children)

    I have no idea what your response even means/is getting at.

  • source
  • parent
  • hideshow 2 child comments
  • [+] 2 points 1 month ago (1 child)
  • [–] 5 points 1 month ago
    1. Legal has issues with using existing libraries (including MIT). Definitely idiotic, but I can’t control that.
    2. Idea was mine.
    3. Subprocess that captures parent process active video with a rolling buffer for crash handling purposes is absolutely necessary when trying to reproduce issues in development (Gamedev editor). If you think associating the last 15s prior to a crash with a mindump isn’t helpful for debugging, I don’t know what to tell you.
  • source
  • parent
  • [–] 39 points 1 month ago (5 children)

    We've had a very recent uptick in engineers submitting PRs of hundreds of lines across multiple files, for Jira tickets that only asked for a one-line change. The engineers involved have been using AI assistants for nearly two years now, but there seems to have been a change in the last month or so in how aggressive the new models are at changing code.

  • source
  • hideshow 5 child comments
  • [–] 38 points 1 month ago (1 child)

    That's an automatic reject from me, that's not a patch, it's an overhaul

  • source
  • hideshow 1 child comment
  • [–] 8 points 1 month ago

    Same. I don't care too much about you using Ai but I will not tolerate your bad code and bad coding practices. I don't care if it's human or machine made. If you don't make a fully sanctioned rewrite then this goes straight to the bin.

  • source
  • parent
  • [–] 35 points 1 month ago

    🛑 Changes requested

    Too big. Break into smaller individual PRs.

  • source
  • [+] 33 points 1 month ago* (last edited 1 month ago) (17 children)
  • [–] 8 points 1 month ago (2 children)

    Lol nothing bigger than 250 lines of code goes through at our company without complaints.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 6 points 1 month ago* (last edited 1 month ago) (1 child)

    i’d say it’s a balance… you’re totally right that individual requests for review should be relatively small (mostly so that they can all fit in your head at once), but imo equally valid is that everything in main should be a complete feature/fix: if you were to be gone immediately after merging, would someone need to continue or revert the change? would there be unused code laying around?

    this is where merge trains and a decent UI around them comes in handy: your main work is on a branch many small PRs each reviewed individually merge into that branch, and then when you’re done pretty much just automated integration tests, lint, and you’re good to merge the whole

    but equally some people prefer to solve this with things like gitflow, or just not at all and accept that main is always in flux

    refactor to support a new feature is also tricky: does it belong with the feature because it’s unnecessary abstraction without it? or is it its own PR because it stands in its own? and if it’s its own PR then how do you base your own feature branch on it before someone reviews and merges? how do you know you’re done without finishing? what if your assumptions are wrong and you need to try something new - just a lot of unnecessary churn and review?

    dev is messy and as always LOC is a pretty useless metric… keeping things understandable is key, and somethings a 17k line PR is the cleanest way to proceed

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 1 month ago

    Oh I totally agree with you. However I tried pitching the whole integration branch idea to my team and they didn't really like it that much for whatever reason. We now just stack small feature branches on top of each other (to build the whole feature) and integrate the parts directly to master.

  • source
  • parent
  • [–] 5 points 1 month ago* (last edited 1 month ago)

    The review process is all wrong if something like this is ever on the table as a single PR*.

    Big changes like this were made before, and knowing how to split the work (or at least trying to work it out) used to be part of the job.

    Hopefully, strong unions and worker involvement can remedy this, given we change our work culture to be closer to what projects like SQLITE and FFMPEG have (noting, of course, the fact these are FOSS, and made by volunteers, yet are very dependable), slower and stable development cycle that prioritizes high quality work that people can actually depend on and trust.

    • As in one single PR you're expected to read, instead of one backed by tests and the like.
  • source
  • parent
  • [–] 5 points 1 month ago* (last edited 1 month ago) (6 children)

    Jeez. Now I feel bad. I've been working on a project with some new people, and I've never used Github before. I'm still learning the etiquette.

    I made a branch, and spent a month viciously hunting every bug I could find. I don't trust AI, so I was doing it all by hand. Dawn to dusk, I was staring at code and typing like I had a fever and the only cure was figuring out where tf that invalid scope is supposed to go.

    This is my first real project with other people, so of course I'm so proud when I send the PR and it has 40,000 lines added and 60,000 lines removed. I worked really hard on it, and it sorely needed the update.

    It was almost all bug fixes, the actual new stuff was about 1,000 or so lines. But what should I do in the future? I don't wanna be an asshole, I wanna be helpful.

  • source
  • parent
  • hideshow 6 child comments
  • [–] 5 points 1 month ago* (3 children)

    Generally it's more considerate to submit smaller batches of (self-contained!) work at a time. Sometimes the work or existing code is so interconnected that this can't really be done, though. You mentioned spending a month, that's also a long time in most environments to be off working on bulk changes for later review. A week is probably long enough in most cases, some orgs even prefer to push (if not review) code daily.

    Don't agonize over it though, wanting to improve your impact on others while working is the right direction to point, keep walking that way and you'll do awesome, let it develop over time. As in, don't let your desire for politeness slow down your work or growth too much (I do this lol, why I'm mentioning).

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 1 month ago* (last edited 1 month ago) (2 children)

    I'll try to keep that in mind. What do I do the next time I'm working on a very long branch? The next big project to do on this thing is fixing the myriad localization issues that have been plaguing this project, and that'll mean pruning maybe thousands of lines. Merging my fixes to the main branch was apparently a nightmare (I've already apologized. Profusely. And haven't done it again.)

    Should I just try to get as much work done in as few commits as possible?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 1 month ago (1 child)

    First off, don't sweat it, the "nightmare" was probably 20-30 annoying minutes for the senior.

    But commit count isn't what would've made it tough to merge, and strictly speaking smaller commits is typically better.

    Concretely: limit the kinds and the reach of changes you're asking someone to review & merge. I've never done localization but I'll try to guess for an example -

    1000 lines changed because you're replacing an incorrect punctuation character misused everywhere - that's really only one change to have to think about, it's 1000 lines but one fairly trivial change.

    Now, if each of those lines was improving some phrasing, done by a native speaker that found existing phrasing clunky for their language? Well, each of those are their own judgment call and have to be assessed individually. A thousand fairly subtle changes, and a PR isn't meant to accept some and reject others.

    More abstractly, try to put yourself in the reviewer's shoes (hard when new) - how much stuff do they have to keep in mind in order to make judgment calls about this whole batch of code?

    More if you want it:

    spoilerMoving on from localization, ask yourself, how many "places" in the codebase does your code touch? Are you lumping every single possible thing into a single change set because it feels like a single feature, when it could have been architecturally segmented? Like sure a single PR for a single overall feature makes sense conceptually, but can it be split? Your skill with splitting up tasks is like 70% of your skill as an engineer over time, btw.

    So for example, single feature - all code and PR for DB models, separate PR for API updates, separate PR for UI updates. One feature but the UI folks don't have to think about the other parts, etc. Maybe the ideal case is obvious.

    There are always complicating factors. Some tasks aren't well suited to that segmentation and really require big far reaching changes. Some codebases (bad ones) make it impossible to change one part without touching ~all of it.

    When you're starting out, doing this reliably well requires seniors scoping out tasks properly so that they are developed (and then reviewed) in a sensible, segmented way.

  • source
  • parent
  • hideshow 1 child comment
  • load more comments (-1 replies)
  • [–] 2 points 1 month ago

    If you can digest a 17k lines of code from someone else in 1 week you're either delusional or a beautiful mind, I would close such PR immediately but it would still ruin my day

  • source
  • parent
  • [–] 2 points 1 month ago (4 children)
  • [–] 6 points 1 month ago (3 children)

    > 1k lines in internal tool = idc, do what you want.

    > 1k lines in critical path = lol no.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 10 points 1 month ago (2 children)

    Who cares? It's company code. They want AI, they get AI 🤷

  • source
  • parent
  • hideshow 2 child comments
  • When you have ownership of the project you care.

    We go by description of the PR. If you can briefly describe the changes you want to merge, We will consider accepting it. If you have two paragraph or more, insta close. If someone has made large changes, there is no way they can have a short description, either break it down to smaller PRs or admit you don't know what you are doing and are trying to merge garbage.

  • source
  • parent
  • [–] 86 points 1 month ago (27 children)

    The problem with Claude is that it doesn't write code to be modular & reusable. Every tiny change requires a complete rewrite.

  • source
  • hideshow 27 child comments
  • [–] 68 points 1 month ago (9 children)

    I've completely banned any code that can't be explained. I've had my CTO send me code at 3 AM to implement and when I ask him what I'm looking at he just says it doesn't need review, just push it.

    Uhh, no sir, I'm not doing shit because you've handed me GCC and we're MSVC.

    After I bitched endlessly to the CEO about that he said I have final say on what goes into the project.

  • source
  • parent
  • hideshow 9 child comments
  • [–] 28 points 1 month ago (7 children)

    I've had my CTO send me code at 3 AM

    I hope you don't even respond until your next normal working hours!

  • source
  • parent
  • hideshow 7 child comments
  • [–] 16 points 1 month ago (6 children)

    I love my job, even when I have to deal with nonsense like that and I'm compensated very well to be on call 24/7.

  • source
  • parent
  • hideshow 6 child comments
  • [–] 8 points 1 month ago (4 children)

    that sets a really bad example. you shouldn't do that to yourself and you shouldn't allow it to happen to anyone else.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 10 points 1 month ago (1 child)

    He knows best what's best for him. If he's explicitly paid extra to be on call 24/7, and he's happy with that extra. Let him be om-call 24/7.

    There are situations and jobs where 24/7 availability is needed. Someone has to do it. And if that someone believes he's getting enough of a compensation for it, there's nothing wrong with it.

  • source
  • parent
  • hideshow 1 child comment
  • [–] -1 points 1 month ago (16 children)

    well, that depends entirely on your prompt/process, it can be done

  • source
  • parent
  • hideshow 16 child comments
  • [–] 11 points 1 month ago

    With enough seniour developer's time and dedication you can spend days and enough water to flood a town, so you can badly maybe do something that a junior dev can do already (your shit will still be worse). If that's not an achievement of a modern technology I don't know what is.

  • source
  • parent
  • [+] 3 points 1 month ago (13 children)
  • [+] -8 points 1 month ago* (12 children)

    unironically, a better prompt does yield better results - shocking, I know

  • source
  • parent
  • hideshow 12 child comments
  • [–] 8 points 1 month ago* (last edited 1 month ago) (11 children)

    Unironically Claude (or whatever you use) will almost always deliver code that is shit, it's just less shit if you prompt it better, LLMs are good to make short snippets if you get stuck tho; And remember to fucking check what the code is and rewrite bad shit

  • source
  • parent
  • hideshow 11 child comments
  • [–] -3 points 1 month ago* (10 children)

    I've seen plenty of code in my life, from humans and AI.

    For the past year or so, these agents can code just fine most of the time, as long as they are given enough context (or have the tools to get it). Regardless of how many downvotes I get here, they really are capable of generating decent code. I'm sorry you couldn't make it work yet.

  • source
  • parent
  • hideshow 10 child comments
  • [–] 4 points 1 month ago (8 children)

    I've seen too as I have to review it. AI produces very professionally looking bad code.

    It is so weird to explain, but that's basically what I see.

    Before LLM I could immediately tell someone's code is crap, now I have to spend a lot of time trying to understand what it does to reach the same conclusion.

  • source
  • parent
  • hideshow 8 child comments
  • [–] -1 points 1 month ago (7 children)

    My honest opinion is that it's bad because a lot of people using LLMs have no standards and push the first thing that seems to work. Be mad at who's at the driving wheel, not the car.

    You absolutely can generate crap with agents/LLMs, and like a humans writing, the first draft will probably be subpar or maybe complete garbage. Every new session is a clean slate, that's why putting effort in the documents guiding it is so important.

  • source
  • parent
  • hideshow 7 child comments
  • [–] 4 points 1 month ago (4 children)

    The car analogy doesn't work because you're not the one making the code/driving the car. It drives itself, and you sometimes can propose some directions for it to steer.
    The problems with llm aren't just that sometimes your shit doesn't work or obviously bad, that's what you're talking about, and that's what minimally responsible sloperators can catch. The main problem is it writes something that looks OK to a human (that's a criteria for it) but sometimes it's unexpectedly idiotic in random places (because not being idiotic wasn't a criteria). You need to check way more thoroughly for it, and you can't use normal shortcuts that help you with it. So you obviously don't do that.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 0 points 1 month ago (3 children)

    See, that's the issue. People letting it "drive itself" get worse results. You should be the one holding the standards and guiding the model, otherwise you will be frustrated.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 3 points 1 month ago (1 child)

    I saw this advice too, the problem with being very detailed is a question why not use a less ambiguous languages to do it?

    Why not write the explanation in language like Python. Why should I write it in English when I can say the same thing in Python and it is actually easier to do for me.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 0 points 1 month ago* (last edited 1 month ago)

    This kind of specification applies to the agent behavior or the agent behavior in a project. You don't write it on every conversation, you write/review it once for the project or agent and let the harness include it on every conversation. You can even ask the agent to scan the codebase and pull desirable patterns out of it for future sessions.

    The entire point of using an agent is to not have to write everything yourself, so that when you write "implement feature X", the feature gets implemented in a way that makes sense in that project, is reviewed, refactored, and tested by agents, and it's good enough to bring in a human reviewer.

  • source
  • parent
  • [–] 3 points 1 month ago (1 child)

    Maybe I have some ridiculously high standard, but whenever I used it, I wasn't happy with what it generated.

    I noticed that the time it did it + the time for me to review it and possibly fixed was at best the same amount of time it took me to write, at worst it was longer.

    For hard problems that I stumbled on it was useless.

    For simple problems it worked and produced good code, but it still took less time for me to write it than waiting for Claude to finish thinking.

    Everyone swears that they can produce good code with LLM and it is others who are bad, and LLM is force multiplier to them. But from what I see the only time it can speed up their work is if they never review it or even take time to understand the actual problem they are trying to solve.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 1 month ago* (last edited 1 month ago)

    I don't know you, but it doesn't sound like a high standards issue to me, sounds like a lack of process. I've been a thorough reviewer before AI, at least thorough in the ways that mattered, not nitpicking formatting. And I'll tell you an automated reviewer today can catch more things before I have time to confirm the first item I find. There are still false positives, but it's still more thorough than I have time to be. Bc of that it really helps including a round of automated review before looping in a human, regardless of who/what wrote the code.

    The main kind of review problems AI still struggles with are the project direction ones: "does it make sense to implement this/like this?", "should this be a new package instead?", and things involving tacit knowledge that often goes undocumented "last time we did this, someone had to access prod on a Sunday" - so that's what I focus my reviews on. And the other area is if you're writing UI code, whether it's a web app or a game, it'll also struggle to determine what "feels" good to use, so it'll need a human earlier in the loop.

  • source
  • parent
  • [–] -4 points 1 month ago

    But AI bad and human code is so awesome! Better downvote. But seriously, there are people here saying that LLMs can not add anything of value in any way. About as delusional as Republicans.

  • source
  • parent
  • [–] 28 points 1 month ago (4 children)

    Our PR checks auto reject the PR if it has 1k changes

  • source
  • hideshow 4 child comments
  • [–] 11 points 1 month ago* (1 child)

    is it auto reject, or just doesn't auto approve and leaves it open for manual review

    It seems weird that you can't do a pr at all with 1000 line changes, any moderate size feature addition could hit that mark

  • source
  • parent
  • hideshow 1 child comment
  • [–] 6 points 1 month ago

    Stupid question, but what happens to a rejected PR? Because features get built for a reason (there's usually a Ticket/Story for the feature that the PR adds) so do those just get closed? Or does the person have to re-write the code entirely?

    I know in my team, the most I could do is tell the coworker to self-review while keeping the PR open until they change some stuff. I have never rejected a PR before because no matter how bad a PR is, it always is technically necessary for the feature.

  • source
  • parent
  • [–] 28 points 1 month ago

    It is not even peer review anymore, unless we are pretending that claude is our peer.

  • source
  • [–] 56 points 1 month ago (8 children)

    No

    You ask your LLM of choice to look it over, completing the shit-cycle

  • source
  • hideshow 8 child comments
  • [–] 17 points 1 month ago (7 children)

    I fully expect this to become the new normal being pushed by management.

    "We identified PR reviews to be blocking our newfound AI-powered efficiency, so we are now mandating all the reviews to done by AI. Also we figured all the developers are now useless since all you do is ask Claude to solve tickets, so you are all fired"

    I wonder how long it takes for the first high profile disaster happening because of a policy like that.

  • source
  • parent
  • hideshow 7 child comments
  • [–] 6 points 1 month ago (5 children)

    How is bun doing btw after their "We used 60 agents and 200k in tokens to rewrite in Rust" ?

  • source
  • parent
  • hideshow 5 child comments
  • [–] 7 points 1 month ago* (last edited 1 month ago) (4 children)

    Actually I think it's doing well? The language to language rewrite is actually a strong suit of LLMs, as long as there is extensive years worth of tests to check rewrite behaviours.

    I don't have practical use cases for that strong suit though.

    Oh, and bun seems to be dead now with 2.5k open PRs.

    And merge to main takes over an hour.

    And the total rewrite cost was significantly higher than the headline (multiple Prs by Anthropic employees, rough count 20% of total LoC of rewrite)

    And there is still no release in sight on Github - but Claude is shipping with rust bun afaik.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 2 points 1 month ago* (2 children)

    It was higher sure, but anthropic also has some of the most expensive models out there. That cost could be 5x-10x less just by going with cheaper model providers (if one were to pay the API costs, not the case for bun).

    bun 1.4 was released 3 weeks ago, btw

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 1 month ago (1 child)

    That cost could be 5x-10x less just by

    My point was that it was cost of model rewrite by agents + 3 months worth of coding by lots of people.

    5k open PRs atm + 3.5k open issues. I have no idea what is the state of Bun right now, but I am not confident in it.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 0 points 1 month ago*

    I don't think there was a lot of people working on the rewrite. Most PRs are from bots. Original estimates for a manual rewrite were a small team working for a year or so, which puts total costs over $1M. Even doubling the token cost estimates, it was still cheaper than doing it manually by a factor of 2x-3x

  • source
  • parent
  • [–] 25 points 1 month ago

    Merge that shit, watch it all collapse, enjoy your forever holiday

  • source
  • [–] 22 points 1 month ago* (last edited 1 month ago) (1 child)

    Yep.

    We have one PR still blocked. Last change is a simple comment from me “Why ?”

  • source
  • hideshow 1 child comment
  • [–] 42 points 1 month ago (3 children)
  • [–] 31 points 1 month ago (1 child)

    If you can't be bothered to write your own code, I can't be bothered to review

  • source
  • hideshow 1 child comment
  • [–] 13 points 1 month ago

    No Mr Bond, i expect you to approve

  • source
  • load more comments
    view more: next ›