this post was submitted on 27 May 2025
1844 points (99.5% liked)

Programmer Humor

23497 readers
1067 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Tamo240@programming.dev 9 points 1 day ago (1 children)

Did the generated code get merged? I'd be curious to see the PRs

[–] markstos@lemmy.world 4 points 1 day ago (1 children)

The lead dev is not available this summer to review, but you can review here: https://github.com/edzdez/sway-easyfocus/pull/22

It's not great that four changes are rolled into a single PR, but that's my issue not Claude's because they were related and I wanted to test them all at once.

[–] coherent_domain@infosec.pub 8 points 1 day ago* (last edited 1 day ago) (1 children)

This is interesting, I would be quite impressed if this PR got merged without additional changes.

I am genuinely curious and no judgement at all, since you mentioned that you are not a rust/GTK expert, are you able to read and and have a decent understanding of the output code?

For example, in the sway.rs file, you uncommented a piece of code about floating nodes in get_all_windows function, do you know why it is uncommented? (again, not trying to judge; it is a genuine question. I also don't know rust or GTK, just curious.

[–] markstos@lemmy.world 5 points 1 day ago (2 children)

This is interesting, I would be quite impressed if this PR got merged without additional changes.

We'll see. Whether it gets merged in any form, it's still a big win for me because I finally was able to get some changes implemented that I had been wanting for a couple years.

are you able to read and and have a decent understanding of the output code?

Yes. I know other coding languages and CSS. Sometimes Claude generated code that was correct but I thought it was awkward or poor, so I had it revise. For example, I wanted to handle a boolean case and it added three booleans and a function for that. I said no, you can use a single boolean for all that. Another time it duplicated a bunch of code for the single and multi-monitor cases and I had it consolidate it.

In one case, It got stuck debugging and I was able to help isolate where the error was through testing. Once I suggested where to look harder, it was able to find a subtle issue that I couldn't spot myself. The labels were appearing far too small at one point, but I couldn't see that Claude had changed any code that should affect the label size. It turned out two data structures hadn't been merged correctly, so that default values weren't getting overridden correctly. It was the sort of issue I could see a human dev introducing on the first pass.

do you know why it is uncommented?

Yes, that's the fix for supporting floating windows. The author reported that previously there was a problem with the z-index of the labels on these windows, so that's apparently why it was implemented but commented out. But it seems due to other changes, that problem no longer exists. I was able to test that labels on floating windows now work correctly.

Through the process, I also became more familiar with Rust tooling and Rust itself.

[–] coherent_domain@infosec.pub 1 points 1 day ago

Thank you! This is very helpful.

[–] Zexks@lemmy.world 1 points 20 hours ago

Holy shit someone on here that know how to use them. Surprised you haven't been downvoted into oblivion yet.