• 7 Posts
  • 20 Comments
Joined 1 year ago
cake
Cake day: June 14th, 2023

help-circle
  • The point about a binary protocol is interesting, because it would inherently solve the injection issue.

    However, constructing an ad-hoc query becomes tedious, as you’re now dealing with bytes and text together. Doing so in a terminal can be pretty tedious, and most people would require a tool to do so. Compare this against SQL, where you can easily build a query in your terminal. I think the tradeoff is similar to protobuf vs json.

    You could do a text representation (like textproto), but guess what? Now injection is an issue again.

    Another thing would be the complexity of client libraries. With SQL client libraries, the library doesn’t need to parse or know SQL - it can send off the prepared statement as-is. With a binary protocol, the client libraries will likely need to include a query builder that builds the byte representation since no developers are going to be concatenating bytes by hand, which makes the bar higher for open-source libraries. This also means that if you add a new query feature to your DB, all client libraries will likely need to be updated to use the feature.

    And you’re still going to need to tune and optimize queries for this new DB. That’s just the nature of the beast: scaling is hard especially when you can’t throw money at the problem.

    Quite frankly, it’s a lot of hard tradeoffs to not need to use prepared statements or query builders. Injection is still is an issue for SQL today, but it’s been “solved” as much as it possibly can.



  • I had a mixed experience adding types to a large enterprise Python codebase.

    I think the thing that really kills it is the (relative) lack of community support. Whereas with TS, almost every package big or small usually has types, I’ve found a lot of pip packages wouldn’t be typed out of the box, which means you gotta generate them automatically or use escape hatches like Any.

    Using escape hatches like Any basically kill the point of typing, as the static checker basically stops checking after it sees an Any. If your static checker is configured to ignore certain files because they aren’t typed yet, then any code that refers to those files also get ignored. You basically need to hit a threshold of your codebase and dependencies to get the benefits of typing. Until then, my experience was finding bugs that the type checker should’ve caught but didn’t.

    And obviously, to get the full power of types, you must buy in as a team, and that means really buy-in, without resorting to escape hatches like Any. Any reluctance, and you’re likely in for an uphill battle.

    Another thing that really hurt adoption, was that before using typing, a lot of the code just clearly broke type rules, eg a function that returns a string or a number, but the caller assumes the output is a number. Especially if it’s lower level code, those may take a nontrivial refactor to fix.

    All of this is assuming it’s trivial to enforce a static check on the codebase through CI/CD.

    This leads to my conclusion, that not being forced to use types is a BENEFIT of Python, not a downside. You are able to write code a lot faster and more expressively if you don’t need to worry about typing, for small scripts or whatnot. I think if you’re starting a project of any size and already know you want typing, consider using another language that has typing built in.






  • My bad, turns out the breweries being too small was a figment of my imagination. I reread the original Reddit comment, and it only mentioned the facilities were outdated.

    It looks like Sapporo was targeting 360,000 barrels by end of 2024, whereas Anchor Brewing’s expansion into Pier 48 would’ve brought the volume to 680,000 barrels. Anchor brewed 135,000 barrels in 2016 and it sadly dropped to only 65,000 barrels in 2023, which meant Anchor would’ve easily accommodated Sapporo’s volume.

    I’ll edit the original comment.

    Given that I can understand why Sapporo took the risk. They bought Anchor for 2.5 times sales at $85 million, when other breweries like Lagunitas was going for $1B. Sapporo likely thought they could’ve trimmed losses and made the money back in a few years, but sadly COVID happened, and Sapporo themselves are decreasing in value.


  • Suburban cities are reluctant to pay for any improvements to transit period. There’s a reason why the BART doesn’t extend past Millbrae. It’s always a combination of rich owners who don’t want “them” having easier access to their cities, and rich owners who have a comfortable driving commute and don’t want money spent on others.

    So yes, not technically NIMBYism, but it’s the same “fuck you, I got mine” attitude from existing property owners that blocks a lot of funding for transit.


  • There’s a lot of interesting extra context, mostly as hearsay on Reddit SF (if you want to find it) and HN.

    Basically it seems like:

    • Sapporo closed Anchor as a cost cutting measure, as Anchor has been losing money YoY for a while now (which I believe is known at time of acquisition)
    • Sapporo wanted to use Anchor to brew Sapporo in the US, but found out their brewery was too old to brew Sapporo
    • Sapporo instead bought Stone Brewing, which now brews Sapporo and Stone

    Feels bad, Anchor was definitely one of my go-to basic beer from the grocery. Guess I’m getting more Fort Point now?


  • But to be honest their beers just weren’t good enough

    That’s a bit much, don’t you think? Just because you don’t prefer them, did not mean they “weren’t good enough.” Beer (and drinks/food in general) are highly subjective, there’s no such thing as a definitive “good” beer, and thus their success is really controlled by marketing and business more than anything. That’s why gimmicks constantly come and go (remember kveik yeast?) and brewers race to see how much they can hop their IPAs. Anchor Steam hasn’t had a hold of their business side for a while, even after their acquisition, so they’re closing, there’s nothing more to it.

    People put a lot of good work into Anchor, and their offerings were more unique than the dime-a-dozen breweries that are everywhere. Really frustrating to see you come here and not respect other people’s hard work and craft just because it wasn’t to your taste.





  • That goes the other way too: California is more red than it appears. Reagan was governor of California, and OC has an airport named after John Wayne. The farmlands, and area around Sac can vote Republican too.

    I really don’t see a point in this increasing tribalism, where we attempt to sort out people into two camps and root for them like it’s some kind of sports game. I think it’s way more productive to focus on policies and specific issues: there are Republicans who support abortion (see: the abortion referendums in red states), and there are Democrats who don’t. Reality is much more nuanced than this article implies.