spit_evil_olive_tips

joined 2 months ago

you will get better answers to your question, and a more productive discussion in general, if you leave your subjective opinion out of the question.

it’s not fully memory safe (there are some programming languages that are even safer, like Ada)?

for example, you might ask instead "why has Rust gotten widespread adoption, that previous safety-focused languages like Ada did not enjoy?"

[–] spit_evil_olive_tips@beehaw.org 15 points 3 days ago (2 children)

this is a big ol' "it depends"

if it's a hobby project, then by all means rewrite it if you want to.

if it's a commercial project of some kind - there's a business that's making money, and part of the business making money relies on this code working properly - then rewrites are almost always a bad idea.

read Things You Should Never Do, Part I, an almost 25-year-old blog post (man, that's a weird sentence to write) about why giant rewrites in a commercial setting are a bad idea.

in general, people greatly underestimate how much work is involved in a rewrite. it feels like it should be simpler to start from a blank slate, and tell yourself you're going to avoid all the mistakes that you hate with the existing codebase. maybe you're writing it in a new language, or at least a newer dialect/version of the same language.

if the current codebase is a mess...how did it get that way? lack of engineering discipline? a "just make it work now, we can go back and tidy it up later" attitude towards accumulation of tech debt? if those same attitudes are present on the team doing the rewrite, you're going to end up right back where you started after the rewrite is "done".

the main things you need for refactoring to be successful is a) tests, and b) a plan.

the tests allow you to refactor with the confidence that if you break something, the tests will point it out for you. trying to refactor something that lacks tests is the worst place to be in, because you'll want to add tests, and often adding tests requires refactoring the code to be more testable, placing you in a catch-22.

the plan allows you to make those refactoring changes gradually, over time, while still maintaining the system. in the context of a business that's paying developers to do this work, the businesspeople tend to look poorly on an engineer coming to them and saying "we're gonna spend the next year or two doing a big rewrite, so in the meantime you can't ask us for any new features or bugfixes to the existing system. but once it's done the new system will be really cool, trust me."

successful refactoring is a Ship of Thesus - you can replace the entire thing, but you have to do it one component at a time.

 

archive link

if you're not in Seattle, you probably haven't followed this incredibly stupid saga up until now:

May 2024: Adrian Diaz Out as Police Chief Amid Mounting Harassment and Discrimination Allegations

Seattle Police Chief Adrian Diaz has stepped down as chief after a series of scandals and lawsuits, many of them by women alleging discrimination and sexual harassment by Diaz and other officers in the department, multiple sources have confirmed.

Diaz will reportedly remain at the department in a special projects director instead of being fired—allowing him to retain a substantial six-figure salary without having to go back to his previous rank of lieutenant.

June 2024: Diaz Comes Out as Gay to Right-Wing Radio Host, Who Says this Proves His “Innocence”

Former police chief Adrian Diaz told conservative talk-radio host Jason Rantz that he is a “gay Latino man,” and suggested that his being gay undermines the claims of the women who have accused him of with sexual harassment, discrimination, and creating a hostile work environment toward women as well as Black officers.

July 2024: Former Police Chief Adrian Diaz Threatened PubliCola Over Post Describing His Coming-Out Interview

Former Seattle police chief Adrian Diaz, who was removed from his position earlier this year, threatened to sue PubliCola, and me personally, unless we removed a post describing the interview he did with conservative talk show host Jason Rantz.

so he gets accused of sexual harassment by multiple women, steps down as chief (but without getting fired, and retaining his salary)

then he tries to pull a Kevin Spacey by appearing on the radio show of a local two-bit Rush Limbaugh wannabe, and claiming to be gay, which means he obviously couldn't have harassed any women.

then he threatens to sue news outlets for reporting on that radio show appearance, because they reported on it skeptically rather than uncritically repeating "well, I guess he must be innocent then".

until finally an internal report into part of the harassment allegations is released (direct link to the 41-page PDF for my fellow primary source nerds)

the tl;dr of the investigation is that Diaz hired his girlfriend into a $200k/year job at the police department, where she reported directly to him. and that's too much even for our very pro-cop mayor, so he gets fired.

oh, and he bragged to other people at SPD about fucking his girlfriend, and showed them nude pics of her. which...uh...kinda lends some credence to those sexual harassment allegations.

golly, I sure do feel awful for those executives.

imagine having something happen in the world - something completely out of your control - and as a result, your cost-of-living skyrockets, in a way you have no control over, you just have to pay it. I'm sure that's an experience that is unique to CEOs and that other people have never had to deal with.

the primary source of this is annoyingly hard to track down for legislation that passed Congress and was signed by the President.

it turns out that's because it was part of H.R.815 - "Making emergency supplemental appropriations for the fiscal year ending September 30, 2024, and for other purposes."

if you want to read the actual text of the law, this PDF starting on page 61.

the gist is that it's illegal to:

Providing services to distribute, maintain, or update such foreign adversary controlled application (including any source code of such application) by means of a marketplace (including an online mobile application store) through which users within the land or maritime borders of the United States may access, maintain, or update such application.

everyone calls this a "ban on TikTok" and it kinda annoys the shit out of me, because as far as I can tell, the website tiktok.com is probably still going to be available in the US.

what this law actually does is require Google and Apple to remove TikTok from their app stores, for US-based users. and makes them subject to a fine of $5000 per user if they don't comply.

I'm generally in favor of more regulation of tech companies...but this is a really fucking stupid way to do it.

[–] spit_evil_olive_tips@beehaw.org 54 points 2 weeks ago (2 children)

oh golly why would anyone do such a thing

here's a totally unrelated news article from about a year ago: UnitedHealth uses AI model with 90% error rate to deny care, lawsuit alleges

[–] spit_evil_olive_tips@beehaw.org 28 points 2 weeks ago (1 children)

(my attorney has advised me to state that I think murdering CEOs is *checks notes* wrong)

tangentially related:

11 children worked 'dangerous' night shift at Iowa pork plant, investigators say

A sanitation contractor has been fined nearly $172,000

Burger King, Popeyes fined more than $2 million for violating child labor laws

poor people go to jail when they get caught committing crimes. wealthy people pay a fine and move on with their lives. usually the fine is small enough that they can just treat it as a cost of doing business.

when people can commit crimes without feeling any real consequences, vigilante justice like this is an entirely predictable outcome.

(and of course, there's a whole additional layer to this problem, where there's a ton of corporate malfeasance and misbehavior that harms society but technically isn't a crime because of some loophole or another...those child labor law violations are one of the few examples where employing children is unambiguously against the law as well as being relatively easy to prove)

 

archive link: https://archive.is/MFa7R

[–] spit_evil_olive_tips@beehaw.org 19 points 3 weeks ago (1 children)

you read a post about how awesome C is, asking why more people don't use it and instead gravitate towards replacements.

you ctrl-F for "security" - no mention

"buffer overflow" - nope

"memory safety" - nothing

"undefined behavior" - nada

this is sort of a reverse Chesterton's Fence situation. the fence is getting replaced, and you're talking about how great the old fence was, without understanding any of the actual problems it had.

you wrote some C and found it simple? OK, great, congratulations.

go work on a C codebase that spans 100 or more engineers all contributing to it.

go write some C code that listens on a TCP socket and has to deserialize potentially-malicious data received from the public internet.

go write some C code that will be used on an aircraft and has to comply with DO-178C.

and so on. after you've done that, come back here and tell us if you still think it's "simple and effective" and "applicable everywhere".

there is a reason C has stood the test of time over many decades. but there is also a reason it is being replaced with more modern languages.

it might be more complicated than you're looking for (requires a self-hosted server instead of just a desktop app), but take a look at the ecosystem surrounding Subsonic

Subsonic did some licensing shenanigans, but there's an actively-maintained GPL3 fork called airsonic-advanced

there's also alternate implementations, Gonic and Navidrome, that maintain compatibility with the original Subsonic API

because they all work with a common API, there's a variety of clients that can work with the backend.

I'm also a big fan of Beets for music organization, it's not tied in to the Subsonic ecosystem so you can use them completely separately if you want. it handles tagging, can fetch lyrics, and can also transcode the library (or an arbitrary subset of it) if you want to send it to a portable device. (not sure if this is what you mean by compatibility)

I currently have Beets organizing everything, run Navidrome on my server pointed at the Beets library directory, then Ultrasonic on my phone, and the Navidrome web interface on my desktop. the combo is especially nice for streaming to my phone - Navidrome will transcode FLAC to Opus on the fly, and Ultrasonic has an option to cache those files locally, and to pre-download them over wifi instead of mobile data. so I have my full collection available on my phone, can stream it from anywhere, and the songs I listen to frequently are already downloaded and I don't have to waste mobile data, or wait for them to load if I have poor cell signal.