HNHacker News
TopNewBestAskShowJobs

wesselbindt

1,547 karma · joined July 7, 2023

submissionscomments
wesselbindt··on Just Write a Test for It
This section:

> Apart from parsing the SQL query, I also considered an alternative testing approach that I might implement in the future: go through each migration one by one, and insert some dummy data into the database before applying it, to make sure that we test each migration being applied on a non-empty database. The data would either have to be generated automatically based on the current database schema, or we could commit some example DB dataset together with each migration, to make sure that we have some representative data sample available.

Suggests that this may also be a fairly complicated direction. Although it's not entirely clear to me why he can't just put one record in the db before any migrations, and then pull it all through. Plus it has the added drawback of removing your coverage for the (not unimportant) zero case.

wesselbindt··on You Need Subtyping
Yes of course, but again, I don't think anyone disagrees with you on this.
wesselbindt··on Just write a test for it
Totally with you on the merits of simplicity, writability, readability. But I'm getting strong "rest of the owl" vibes. How would you have prevented this defect instead, in a way that you find simple?
wesselbindt··on You Need Subtyping
We're all in agreement there it seems.
wesselbindt··on You Need Subtyping
Maybe I'm off the mark here, but in my mind the definition of subtype is as follows: t1 is a subtype of t2 if any instance of t1 is an instance of t2. Surely with this definition String is a subtype of String?. Every instance of String (i.e. every string) is an instance of String?, after all.

Post-submit clarity edit: Ah, I think I understand. You're objecting to OP's definition of subtyping, as it breaks down for certain language implementations.

wesselbindt··on Architecture Patterns with Python
Forgive my ignorance on DDD, but what documents are you referring to?
wesselbindt··on Architecture Patterns with Python
What's dysfunctional about it?
wesselbindt··on Architecture Patterns with Python
> I am not convinced that domain driven design works. Objects doesn't model the real world well.

DDD does not necessitate OOP. You can do DDD in functional languages. I think there's a whole F# book about it. So I think you can conclude that OOP doesn't model the world well, which may or may not be true, but I think it's not valid to extend the conclusion to DDD. Is there a DDD-inherent reason why you think DDD does not work?

> And why do we even need to model something?

Well I suppose it depends on your definition of "model", but aren't you by necessity modeling something when you write software? Somewhere in your software there is a user thingy/record/object/type/dictionary/struct which is an imperfect and incomplete representation of a real life person. I.e., a model.

wesselbindt··on Don't Be Afraid of Types
I think protocols have two major drawbacks regarding readability and safety. When I have a protocol, I cannot easily find its concrete implementations, so it becomes harder to see what the code is actually doing. As for safety, protocols have no way of distinguishing between

  class Command:
    def execute(self) -> None:
      # some implementation
and

  class Prisoner:
    def execute(self) -> None:
      # some other implementation
The implementor of the Prisoner class might not want the Prisoner class to be able to be slotted in where the Command class can be slotted in. Your type checker will be of no help here. If you use abstract base classes, your type checker can prevent such mistakes.

So when it comes to your own code, the drawbacks of the structural Protocols in comparison the nominal ABCs are pretty big. The pros seem non-existent. The pro, I guess, is that you don't have to type the handful of characters "(Baseclass)" with every concrete implementation.

But they do have one major advantage: if you have third party code that you have no control over, and you have some part of this codebase that you want to replace with your own, and there's no convenient way to do something like the adapter pattern, because it's somehow a bit deeply nested then a Protocol is a great solution.

wesselbindt··on The Road Not Taken Is Guaranteed Minimum Income
So you're basing this on your feelings rather than the available data.
wesselbindt··on The Road Not Taken Is Guaranteed Minimum Income
What do you mean by wasting it? Is there a particular aspect of an outcome of a UBI study that you worry about?
wesselbindt··on Dutch Parliament: Time to ditch US tech for homegrown options
It sounds like you have a bone to pick with GL, which is totally fair. But do you have any thoughts on the proposal itself?
wesselbindt··on Breaking Up with On-Call
Wow, it's really important to you to have a picture of a concentration camp guard tower up.
wesselbindt··on France plots tax on super-rich to rearm – and Britain could be next
Don't threaten me with a good time.
wesselbindt··on DiceDB
You are absolutely right, my bad.
wesselbindt··on DiceDB
When I ctrl+F the landing page for key and value, I find nothing. Reading it in full, I also come up empty handed. Which part of the landing page implies it's a key value store?
wesselbindt··on Athena landed in a dark crater where the temperature was -280° F / -173° C
Exactly. I look forward to humanity genuinely progressing towards successfully landing stuff on the moon. One day, we may even be able to land humans there! Intuitive systems is really pushing the envelope here, and I think that's worthy of admiration.
wesselbindt··on “Normal” engineers are the key to great teams
About 15000 engineers have contributed to the Linux kernel. You should be more mindful of how facts line up with your feelings.
wesselbindt··on What made the Irish famine so deadly
Like the Holodomor, like the Bengal famine, this was a genocide.
wesselbindt··on Trees not profits: we're giving up our right to ever sell Ecosia (2018)
I see it a lot too, and it's called the Nirvana fallacy [1]. We shouldn't do anything about tax evasion because people will evade taxes anyway (ignoring that you reduce the total amount of tax evasion). We shouldn't ban drunk driving because people will drive drunk anyway (ignoring that you reduce the total number of drunk drivers). We shouldn't trust non-profits, because they seek revenue anyway (ignoring that it's much less severe for any non-profit in comparison to a for-profit company).

[1] https://en.wikipedia.org/wiki/Nirvana_fallacy

wesselbindt··on Wealth, Shown to Scale
> A wealth of data [1] now supports the idea that one-time cash transfers can permanently transform a local economy. Given a sudden windfall, people invest in their future. They go back to school, obtain transportation, pay for childcare, pay down debilitating debts, and do any number of things to improve their career prospects and financial future

This was interesting to me. It's in the section on the wealth of the 400 wealthiest Americans (who own about 3 trillion dollars). They look at what you can do with a 1-time 5% wealth tax. And most of it is stuff like preventing hundreds of thousands of children dying from malaria each year, which immediately raises the question "what do we do 20 ish years from now?". But you can permanently lift 38 million Americans out of poverty to no longer worry if they'll have a roof over their head tomorrow (or ever), or if they can feed their children. And from the spending patterns of the poor, this money will go straight back into the economy rather than being hoarded.

This is not a structural change, but a one-time miniscule tax on 400 people in the US, and it'd have a lasting positive impact on society.

It is an absolute positive, but it will not happen because the media and politicians (both sides) have been completely captured by billionaires to the point of not even acknowledging it when one of them does two Hitler salutes on stage.

[1] https://www.givedirectly.org/research-on-cash-transfers/

wesselbindt··on Federal workers ordered to return to offices without desks, Wi-Fi and lights
This has nothing to do whatsoever with RTO.
wesselbindt··on Show HN: Robyn – “Batman Inspired” Python Web Framework Built with Rust
I can't imagine someone having the chops to code up their own web framework and making a mistake like this. There must be something that we're missing. Another commenter suggested that since it's SQLite, the blocking calls are quick enough not to care, which may be true. I don't know enough about SQLite's performance characteristics to judge that.

In general I assume disk I/O is slow enough (even on SSD) to care about blocking the event loop and delegating the calls to a thread. But I've been wrong about this before. For example, a call to stat is technically blocking, but the overhead of delegating it to a thread is actually more expensive (on my Framework 13) and blocks the loop longer than just doing the call outright in the main thread.

wesselbindt··on A Letter to the American People
I'm not missing your point, I'm disagreeing with it.
wesselbindt··on Executive wealth as a factor in return-to-office
They're not out of touch. They know. They don't care.
wesselbindt··on A cross-platform multi-target dotfiles manager written in Rust
Are you using windows? I feel like dotfiles are much more common on unix-like systems. For me I've got dotfiles for zhs, ssh, git, two for my window manager, vim, and much more. I've even got one for nethack. I quite like it, I get new laptops up and running and feeling like home in a matter of minutes.
wesselbindt··on Show HN: Robyn – “Batman Inspired” Python Web Framework Built with Rust
I'm confused, in the example application I see all these async endpoints interacting with the database, but the function bodies are entirely sync. Wouldn't this block the event loop?
wesselbindt··on A Letter to the American People
Right because what defeated fascism in WWII was our politeness. You're being silly.
wesselbindt··on A Letter to the American People
Your point being? You asked why people are upset about the gutting of public services. I gave you a reason why. This thing about 9/11 is a bit of a non sequitur.
wesselbindt··on A Letter to the American People
> Why are so many people, who believe these things, crying about America being delegitimized?

Well for me personally it's because of empathy. The United States, as you rightly point out, was founded on slavery and genocide. I agree with you, and I would also add that the US is responsible for the deaths of millions globally in the past century (let's take Iraq and Vietnam, and I think you're already over a million). Generally a force for evil.

But a nation's citizens are not responsible for the actions of its government. They do not deserve to lose their homes in forest fires, have their children attend school hungry, go bankrupt on account of having cancer, be steeped in lifelong debt just to afford an education, lose their child in a school shooting, et cetera. What Elon Musk is doing will make those things much worse. That's why people are upset.

← PreviousPage 5 of 14Next →