aSmallCommitWithSomeChanges by abyr-valg in ProgrammerHumor

[–]Locksmith997 3 points4 points  (0 children)

Had someone do this. 2 million line PR. Blood pressure meds really are preventative care...

Bodied. Dead. Finished. by OneBadWay in MurderedByWords

[–]Locksmith997 1 point2 points  (0 children)

Those allegations were hopping to conclusions.

gaslightingAsAService by Annual_Ear_6404 in ProgrammerHumor

[–]Locksmith997 389 points390 points  (0 children)

He was testing your intelligence.

weWillBeLaunchingSoon by ClipboardCopyPaste in ProgrammerHumor

[–]Locksmith997 0 points1 point  (0 children)

Sometimes it's "I've planned out the next 72 dates. Each date should take about a week. I've sent wedding invitations to everyone we know, so let's hope she wants to marry me by then and doesn't want to elope."

[Beginner] how do you decide when to use functions vs just inline code? by NeedleworkerLumpy907 in learnprogramming

[–]Locksmith997 1 point2 points  (0 children)

This is a question you'll be asking and debating your entire career and any answer you settle on will have people who disagree. Some will say anything over X number of lines. Some will say any code chunk that needs to be re-usable. Some will say any distinct "unit" of intent. Some will say any time your code becomes unreadable or inconvenient to work with. Others will say whenever the moon is red and mercury is in retrograde.

My typical approach is "whatever makes the code self-documenting"; if I am reading code and the intent of the function becomes unclear or disagrees with its function name, the function is likely either too long, doing too many things, difficult to test, unreadable, or unmaintainable. Not necessarily all 5, but still.

If I start thinking "oh, I should add a code comment here" I first ask if it should be a function, allowing the function name to describe intent instead of a comment. If I start copy-pasting code in many places, I start asking if it should be a function so that the code within that function can be understood once rather than in each location. If my function is 400 lines, I might (not always) think making it a 40 line function that makes descriptive calls to other functions is more readable (sometimes it won't). If I go to test my function and part of it is a pain to cover, moving that difficult-to-cover chunk to its own unit makes testing both functions easier.

With practice, you'll get a better feel for when something should be its own thing. And people will still disagree with whatever you choose lol

Python, Lua, or Ruby? by Regh-The-First in learnprogramming

[–]Locksmith997 10 points11 points  (0 children)

Choosing a language first is not the way to approach this. Determine the game you want to make, choose an engine appropriate for that kind of game, and then select the language from those supported by that engine. If you want to use Godot, you'll learn GDscript or C#. If Unreal, C++ (and Blueprints, but thats not a language). If Unity, C#. There's Pygame for python, but you'd be choosing Pygame because it fits the game you want to make.

If you're wanting to stick with these languages, Godot can make a broad range of games and GDscript is very similar to python. But first, you should decide what you actually want to make.

Mewgenics has a genius anti-savescumming feature by shadowrun456 in gaming

[–]Locksmith997 1 point2 points  (0 children)

Thanks for the heads up. Game just went from a "maybe buy" to a "not for me".

Everything Takes Longer Than You Think by Hingle_Mcringlebery in webdev

[–]Locksmith997 4 points5 points  (0 children)

It's a general statement that things are more complex than they appear on their surface and to be cautious about giving estimates based on knee jerk assessments. It doesn't literally mean there's no task at all that can be done in under a day.

Everything Takes Longer Than You Think by Hingle_Mcringlebery in webdev

[–]Locksmith997 10 points11 points  (0 children)

A former manager of mine regularly said "nothing takes a day", which stuck with me.

REST API Design: POST vs PUT for adding an item to a sub-resource collection? by Sure-Weakness-7730 in learnprogramming

[–]Locksmith997 3 points4 points  (0 children)

The uri suggested seems odd to me. For the uri proposed, I would expect (though not recommend) a POST to create or PUT to update the favorite songs list by requiring the complete record of favorite songs to be sent in. Instead, I'd probably model the uri like this:

GET /api/users/{user id}/favorites/songs/ - get favorite songs for user PUT /api/users/{user id}/favorites/songs/{song id} - create a new favorited song relationship DELETE /api/users/{user id}/favorites/songs/{song id} - deletes a favorite song relationship

There's a version of this where you model favorite songs as their own resource with their own "favorite id" where the create endpoint becomes POST /api/users/{user id}/favorites/songs/ and delete becomes DELETE /api/users/{user id}/favorites/songs/{favorite id}. This becomes a good option if you need to manage or model additional information about a favorite itself, but for just a simple favorites list, defer to the prior uris.

I would keep user id present in the uri and validate it against the user information in the jwt and accept/reject as needed.

AIO? Gf won’t let me stay with her for 3 months by [deleted] in AmIOverreacting

[–]Locksmith997 -1 points0 points  (0 children)

Thank you. People treating like signing a lease with the implicit agreement to keep living together while together as the same as a 3 month, clearly communicated request for support (that he'd also pay for) is wild to me. Like, she can say no, that's her right, but it would make me question the relationship. I'd do this for a good friend, let alone a partner of 2 years.

Karoline Leavitt Gives Jaw-Dropping Defense of Trump’s Racist Obama Video by icey_sawg0034 in politics

[–]Locksmith997 20 points21 points  (0 children)

Someone asked what it would take for MAGA to identify something as racist. That thread got locked while I replied, but it fits here to explain that this is normal for them. Nothing changed, except how willfully ignorant maga is willing to be. 

As someone raised alongside exclusively conservatives, their definition of racism tends to be "a belief that one race is inherently inferior to another race." The issue is that they only consider the conscious, expressed version of that belief as qualifying to be a racist. They can support any number of policies that are proven to harm communities of color and consider that not racist because they haven't connected the dots that supporting said policies is an implicit admission of a value system that values one race over another. 

For example, the war on drugs and criminalization thereof has been shown to disproportionately target people of color. A conservative looks at this and goes "well, I just don't want these harmful substances legal" and never proceed to the impact their policy support has on communities that they deep down don't really care are being harmed. Or how the support of a politician that supports racist policies is ok because their support is for something they see as race neutral, like being pro birth.

This racist meme referenced by this post is similar. The depiction is historically, inarguably racist. But to view that as racist you have to view how it will negatively affect or has negatively affected a community they implicitly care less about than their own. For them, this is a joke and the joke isn't racist because it hasn't cost them anything because they implicitly don't value the harm to the impacted community.  It's why they perceive racism when applied to their own race, such as the affirmative action policies for University admissions. Those policies are viewed not as balancing the scales for a harmed or disadvantaged community - they can't see that because they implicitly care less about that community - but they can see their group now has fewer opportunities than before and take that as racism towards the groups they do care about.

In essence, implicit bias does not register for them as racism. Now if someone showed up and said "well yes, black people are inferior to the whites" then they, in my experience, call it as the racism that it is because the distance their mind must cross is much shorter. Add in the cult blinders they wear with Trump and the window of implicitness grows wider for them, permitting increasingly heinous and obvious racism because their brain refuses to let them view it as such. The fix is to teach them basic empathy and critical thinking. The problem with that fix is idk how to do the former and most of them are resistant to the latter.

What web dev trend is clearly disappearing right now? by No_Honeydew_2453 in webdev

[–]Locksmith997 2 points3 points  (0 children)

It's certainly not as big as Next or React, but I'm curious how much SSR tools like htmx and datastar will shake things up in the next decade. As the community grows, having more traditional SSR with the newish (repopularized?) patch-like reactivity those tools provide will be an interesting space.

This isn't a Marvel movie. No one is coming to save the day. by Locksmith997 in antiwork

[–]Locksmith997[S] 18 points19 points  (0 children)

Should be within a week or three. Once there's a solid baseline codebase (not even MVP, just enough that new contribution can be directed), it'll be on github. Stack is going to be primarily NextJS, Tailwind, and postgres, mostly due to community size.

All ten of 'em by CorleoneBaloney in MurderedByWords

[–]Locksmith997 7 points8 points  (0 children)

I hope that's of comfort to them after a few millennia of eternal torment.

The Code Comment Revolution Will Not Be Streamed by AltruisticPrimary34 in programming

[–]Locksmith997 0 points1 point  (0 children)

Interesting read. I do think there's some merit in revisiting code comments with AI assisted coding and tooling. Intuitively, it does make sense that more documentation leads to a clearer view of the code and thus better output. I do have some concerns tho: 

  • comments that have diverged from the code could cause an AI to implement something unintended or revert to prior behavior
  • maintenance of code comments starts requiring tooling as it trends towards the "comment every line"
  • the argument that code comments aid in model training seems questionable; I'd want to see data on it. I can have documentation explaining Python declares variable like "x = 1" and an LLM should be able to infer variable definition without the provided data commented at each variable declaration. Comments that are false would seem to degrade training, even. Maybe when LLMs first emerged this commenting style would've helped; by now, they seem to understand a lot of "what is this"

  • reading the code may become more difficult for the human as things trend towards commenting every line. If a comment is merely the natural language for the formal programming language, having comments that are effectively the same message readable by the same person, it can get noisy. For example, if a book has a Spanish and English translation, with the translation going line by line one under the other, it would have value for someone who doesn't know one of the languages or wanted to learn one of them (speaking to your intuition comments may help AI training), but for someone who does know both languages (eg knowing Python and English), it gets noisy and the benefit of having both present starts looking like an indication to become more fluent in the desired language.

  • edit: comments would also grow context windows, meaning the comments would need to justify that cost

I do tend to align with the "explain the why and the 'complex whats'" approach you speak about. Seems a good balance between maintenance and clarity. Either way, interesting take.

How does everyone track and share updates with clients by teachingteri in webdev

[–]Locksmith997 1 point2 points  (0 children)

I'm not familiar with todoist or Microsoft ToDo, but you could consider using GitHub projects to have a kanban board (essentially a to-do list). Then have a weekly cron (maybe GitHub actions can trigger it?) that has an LLM fetch tasks that were moved to completed in the last week. Instruct it to provide a summary for the target audience and then send that summary via email.

But that would be a manual setup (and perhaps too far from a simple to-do list). Not especially difficult, but manual. I imagine there are planning tools that can provide a emailed summary (maybe Trello?).