For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | more astine's commentsregister

Testing against a real database is an example of integration testing. Using mocks is for unit testing. Ideally, you want to do both. Unit testing entails isolating particular components for testing which is important because it let's you be more precise in what exactly you're testing. Using mocks also makes it easier to run automated tests because it means you don't need to have a database or credentials handy during the build process.

Integration testing is also important because the closer you get to running things in a production environment, the more likely you are to detect issues. Some things just won't be apparent until you start running code in production or near production. The thing to understand though, is that you want to do both if you can, not either-or.


Then just use a database for unit testing as well.


Then you get a slow test suite. It's important to have a fast test suite to be able to do proper test driven development (which I still believe is the most efficient and effective way to write software, in general). Unit tests should be near 100% coverage. That means a lot of tests.


That's not always true — database-backed tests can be extremely fast, see https://github.com/peterldowns/pgtestdb.


databases can run hundreds of test in a ms. Sure without you could get to thousands in that ms - who cares.


Because then you wouldn't be doing unit testing; you'd be doing integration testing. You'd also probably not be testing the database in a realistic configuration and thereby missing the whole point.


Yes, that's true, but the problem is that these past four years have been bad for everybody, so they remember the Trump years as being better than they actually were.


> these past four years have been bad for everybody

They've been pretty good for some people.


Yeah, if you're a high earner living the urban/suburban life you've probably done really well. The problem is that rural turnout was off the charts last night, which what handed Trump the popular vote - something that has not happened with a Republican candidate since 2004.


Absolutely not. Inflation hit us very hard and we had to make real lifestyle changes to get back in the black.


I'd love to know the details.


We got hit too. We adjusted mostly in our eating habits. Moved to zero eating out, more bulk buying, cheaper foods, etc. We're also much more discriminating on what activities we do for the kids.

I'm not gonna go all "woe is me" since we're doing fine, but as someone with a family of 5 the discretionary income basically went to zero the last 4 years.


Yes, I was going to come back to say basically all of this. We noticed that not only were we no longer saving money, but we weren't even living paycheck to paycheck and had to make all these sorts of changes and cuts to get off a very bad trajectory.


I agree. But GP said that everybody was feeling pain. That's not true.


I lost my job a few months back, and I feel like the messaging from Harris/Biden was everything's great! Keep doing whatever is happening. Voted for who spoke to me.

Every company I join literally has an arm in Mexico, India, Pakistan, Colombia or Ukraine - and it always started feeling like at any minute those people would have my job. And they do. I want an administration that makes it so that those people don't have my job. And yes, I have always been willing to work for a lot less, but all the other Americans want more and more and more, so that it's expected for a programmer in the US to make 200k, so these companies decide to hire someone in Colombia for 80k. I'll take 100 and work a lot closer than that person in Colombia. But no companies here will listen to that. And I'll do it as someone with 20 years of experience.

But the only thing people on the left care about, as usual, are issues that actually don't matter. Yes I get it you want Gay rights and you want Abortion rights, but the reality is those things are not going away in the states you're already in. But on the other side, American people are being pushed into a terrible economic state.

Go ahead and not listen, HN doesn't. It's WAAAY to left.


Whatever measures are used to portray the economy as great(it's not just the stock market) or unemployment is down do not match with the impact people feel in their own lives. Maybe they aren't lies, but they aren't accurate either. Massive layoffs in our industry and a glut of H1Bs still hanging around are a problem for an American job seeker in this industry and we'll look out for our interests despite what we're told.


unemployment was at historic lows, you just got unlucky. idk what to tell you man


There was a massive downward revision in August, with most sectors hit hard, leaving the gains that remained increasingly dominated by government/education/healthcare jobs.

Telling people 'X' when their eyes/lived experiences tell them 'Y', and then frequently insulting them for not agreeing on top is certainly part of the reason for the popular vote going as it did.


this person basically just went: bad thing happened to me -> blame the president -> vote for the other person.

i have no interest in coddling people's feelings and telling them how right they are when they are operating with this level of analysis. Im not a politician so i dont have to deal with that, but im so tired of trying to explain how the world works to stupid people and getting shit for it because im not validating their delusions.


When presidents are quick to take credit for economic successes, surely it isn't unreasonable to hold them accountable for economic failures.

The disconnect between government data and the economic realities MANY people experienced (as evidenced by exit polling on the economy) only further salts the wounds for people not doing well.


again, youre assuming people's delusions about their personal finances are worth entertaining. theres absolutely no economic indicator you could point me to that validates people's feelings about the economy.

There were no economic failures during Joe Biden's presidency.


Economic indicators are manufactured by government agencies to support the narrative the current administration wants to spin. Meanwhile, people living in the real world observe some actual state of economy, based on things such as "how hard it was to find a new job".


Or maybe they said that "Bad thing happened to me", tired to recover, no recovery happening and it begins to feel like being lied to, blame the president.


It's at historic lows while layoffs are happening all over. I don't know what to say but it doesn't feel like good times to a bunch of people.

John Deere: https://www.msn.com/en-us/money/companies/john-deere-faces-b...

GM: https://www.cnn.com/2024/09/21/business/gm-layoffs-kansas/in...

Stellantis: https://www.npr.org/2024/10/11/nx-s1-5145932/stellantis-jeep...

https://intellizence.com/insights/layoff-downsizing/leading-...


Exactly what Harris was saying, hence the direction of my vote! Also, 50 job apps and no call backs, this is the WORST economy ever. In 2018, I would submit 3 and get 3 offers at the end of it.


Do you genuinely think that this is the worst economy ever?


In my lifetime, yes.


Does that include the 2000s tech crash? AI winters?


[flagged]


I think the issue is that when people are desperate (lost job, can't pay for needs, etc) critical thinking can be limited to just short term survival mode. Even if it doesn't make sense big picture wise.

Democratic party needs to listen and at the very least fluff up a response that people in this situation feel heard. Even if there nothing they can really do. It's all about appeasing emotions.


Sounds like a skill issue. I never even saw a slowdown of recruiter spam. Maybe you should just try a little?

Also, maybe look into a little history while youre at it - the economy is not even close to the worst one ever, see: 1930s, 1970s, the turn of the millenium, and 2008-2012 for examples in living memory.


It is a skill issue. The folks at the bottom today within the USA economically when unemployment is so low and social mobility is so high do so out of choice. I've traveled the rest of the world and seen what actual poverty looks like (the kind where you have no real hope even if you work hard or are smart). I've seen how much better the US handled every crisis/pandemic vs others. We have it better than anyone else BY FAR.

I'm tired of pretending it's not. Want to call me a coastal elite like it's a slur? I'll wear it with a badge of honor. We are better than you at economic planning and becoming prosperous - also with defending social freedoms (i.e. legalizing the mushrooms).

We lost the low information voters. Bad from the perspective of winning elections but good from the perspective of self selecting your friends and people you associate with. The democrats really are a social club.


> We lost

This is what matters.


you think trump is going help programmers in the US at all? How? Trump merchandise isn't made in the US. His daughters brands are manufactured in Asia.


Under Biden, Mexico is the China replacement for manufacturing.

I have my doubts that Trump will change that.


China heavily invested in Mexico. They are building up Mexico's manufacturing capacity to cover American demand. Either way, China wins.


They've been great for US Stock holders, which basically comprises most of the Upper and Upper Middle Class.

In fact, so good, people think anything buy 10-20% yearly gains on assets is bad


This is probably one of the most dickish comments I've read in a while. I have tourettes too. I would never use it as a weapon to diminish other people's difficulties. Just because my problems are manageable doesn't mean other people's are.


I would like to see his sources because that contradicts the most well known studies. There are still a lot of paleoanthropologists who don't think that interbreeding was possible at all and the apparent Neanderthal admixture in modern humans is due to contamination.

https://www.sciencedirect.com/science/article/abs/pii/S10406...


dont have time to find it. he basically says the 2% thing is an antiquated understanding that conflicts with recent ancient dna studies. Go watch the podcast

https://www.youtube.com/watch?v=Uj6skZIxPuI


I can track down the studies he’s criticising. A Google search doesn’t show up anything refuting those. What are the studies he’s citing?


Watched it. He didn't present _any_ sources supporting his claims. There's nothing there.


Publishing a ton of research on this would basically be a career ending move


Ok, you're almost there. Why would it be career ending?


The dinosaur to birds comparison isn't a particularly good one. Birds are cladistally dinosaurs, that is, the common ancestor of all birds was a dinosaur. In that sense, there are no birds that are not also dinosaurs.

That's not true with modern humans and neanderthals. A tiny amount of their dna remains in some human populations, but neanderthals are not the common ancestor of all humans. We are all descended from early homo sapiens and the tiny amount of neanderthal dna that persists is totally swamped by the homo sapiens dna.


I agree. Robots.txt is a suitable means of preventing crawlers from accidentally DOSing your site, but it doesn't really give you any protections as to how your content is used by automated services. The current anything-goes approach is just too exploitable.


I think that prioritizing fixing bugs, especially security related bugs, over new features makes sense for most software projects. The problem comes from defining bugs. Is a bit of unexpected behavior a bug if it doesn't impact users? The article defines bugs as unmet product requirements but if that's the case I don't think the difference between a bug-fix and a new-feature is that clear because new features also help meet product requirements. Perhaps what they mean is that a bug is any regression from what they currently believe the system to be doing.

I do think a lot of this has to do with the size of the project. In smaller projects with fewer requirements, it's easier to define what is considered "working", but as projects grow that becomes harder and harder, partly because meeting all of the requirements becomes harder but also because the requirements interact with each other in unexpected ways making it harder to even figure out what even is required. And of course the volume of bugs increases, eventually making it impossible to completely stay on top of them even if you give up on new features altogether. A bug-tracker becomes necessary eventually.


That's not what the GP said. They said Huberman's incorrect statements on something they understood made them more skeptical regarding his other statements, not that these other statements were definitely wrong because the first statements were wrong. It's about judging Huberman's reliability as a source of information, not deciding whether he's correct or not, ie whether it makes sense to take Huberman at his word or whether one should doublecheck the things that he says.


But imagine if our C/C++/Java/Rust/Go/etc. compilers were like "syntax error, but ehhhhh you probably meant to put a closing brace there, so let's just pretend you did". That would be a nightmare of bugs and security issues.

That's how Perl ended up the way it is.


On the contrary, morality has everything to do with free will. It's one of the central motivations of the concept and always has been. From the greeks right up through the enlightenment, the question was always "in what sense are we capable of making responsible choices," with that term 'responsible' just dripping with moral implications. Without the moral implications, free will would not have the place it does in our cultural ethos.


Morality motivates our interest in the question of free will, but I understand morality to be a concept only whereas free will is supposed to be a feature of reality. That’s why it seems crazy to me and probably the above poster that morality should be a test of free will.

Please excuse my probably oversimplified understanding of the debate as someone who hasn’t read most of the arguments yet.


you might be making a case that you can't talk about morality without talking about free will.

but you have not made a case that talking about free will requires talking about morality


You can talk about free will without talking about morality in the same way that you can talk about ICBMs without talking about nuclear war. Sure you can do it, but complaining when other people discuss both things together is silly.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search:

HN For You