The time to do that was _before_ writing a blog post titled "I am rich" and submitting it to HN
1,657 karma · joined April 3, 2023
The time to do that was _before_ writing a blog post titled "I am rich" and submitting it to HN
"Within 5 minutes of my first hike, the trees smiled at me and whispered their simple wisdom."
In runtime you can supply the actual DB, in test, you can supply a mock DB, OR an actual DB. Both are possible approaches. It's about how you want to wire up your tests. The author seems to be arguing for using the actual DB.
Like the other commenter explained, DI simply means that the function would depend on an abstract dependency which is supplied at runtime or test time.
In runtime you can supply the actual DB, in test, you can supply a mock DB, OR an actual DB. Both are possible approaches. It's about how you want to wire up your tests.
There's a continuum between extreme integration testing and extreme unit testing, each with their strengths and weaknesses.
There's a reason we don't do all testing through integration testing: it's slower, more flaky, and cripples developer velocity to a near standstill.
There's a reason we don't do all testing through pure unit testing: you have no idea whether the e2e plumbing works as expected.
DBs aren't special in this regard. That being said, it is true that investing in a light weight unit-testable setup for your DB is a good idea.
For purely technical topics you expect good quality discussion, but those threads barely get comments in the two digits.
But in this particular case, in order to comply with the instructions telling you to throw the butter away, you need to know that this is the butter you bought that actually contains milk but isn't labeled so.
The very act of noticing that the butter doesn't have the right label tells you that it contains milk.
The thought that taxpayer money is being wasted to tell taxpayers that "if they know they have bought butter they must throw said butter because the label doesn't say it _contains milk_" is something that will escape only those people's minds who think everything is fine with the status quo.
> I don't know mate, if you cannot ignore it, which I find it pretty easy to personally, then maybe this isn't a Derek Guy issue.
These swipes aren't necessary. This trick of trying to make me look like the bad guy isn't going to work. As for ignoring him, yes, I did. I unfollowed him because it was clear he was no longer a reliable authority on fashion for me.
Second, I _do_ understand the basic tenets (not tenants, btw) of the constitution, that's why I was able to describe them in my comment.
What I am trying to point out is that the Constitution as written is at odds with what a lot of people want (eg. progressives want a more authoritative state, with vaccine mandates as an example), and since they can't change the constitution easily, we have developed a complex web of quasi-legal systems in order to loophole our way around the constitution.
The judiciary and legislature are complicit in this.
The Commerce Clause has been expanded to basically include everything under the Sun (something that should be bothering you if you understand the basic tenets and the spirit of the constitution), which means there is very little left that the Congress cannot legislate on. However, the Congress then actually legislates on very little, sticking itself in permanent gridlock, and actual policy effectively being created ex-nihilo by federal agencies, which should ideally have only been enforcing them.
This was done with the agreement of the courts, but remember they can as easily choose to disagree tomorrow.
The American legislative system is bizarre.
To begin with, Congress is accorded very little power by the constitution, with most of it resting with "We the people" or the states.
This however, doesn't pattern match with the amount of power some people (typically progressives) _think_ the Congress or government _ought_ to have, or the amount of power Congress _wants_ to have (as much as possible), so we see BS things like the abuse of the Commerce Clause loophole to justify any Congressional intervention.
Now, you'd think that with all this power that they have loopholed their way into, they would actually exercise it, but that doesn't actually happen, because they are permanently gridlocked and can't pass any damn shit unless it's part of a giant 1000-page omnibus bill that has 100 unrelated things clubbed together based on whatever horse-trading they manage to do one day before the govt shutdown deadline.
So what actually happens is that the actual rule-making is done by the executive, in the form of these government agencies, which ideally should be enforcing things that the Congress has passed, but effectively are given pseudo-legal power through a variety of judicial interpretations (eg. the Chevron Doctrine) that can be overturned by the next Supreme Court as trivially as they were written in.
All in all, you get a massively dysfunctional system where regulatory agencies act as effectively unelected lawmakers, with the actual lawmakers doing jackshit, and the judiciary effectively supporting these shenanigans through capricious rulings.
And while doing all this, lawmakers can conveniently ramp on the rhetoric during campaigning because they know they don't actually need to do anything. They didn't even pass abortion-related legislation for 50 whole years, because they could use that division to reap votes every election cycle.
If it makes you look like a dork and yet it's the third most selling EV, you might blame the judgment of the average car buyer of the US (for whom you seem to have contempt), but you can't dispute that the product sold.
For example, if you are discussing manufacturing issues in China, talking about how good drop-shippers on Amazon are is irrelevant.
Putting a sticker on Bing and Yandex results doesn't make a Search company.