Better HN
topnewbestaskshowjobs
Log inSign up

MockObject

804 karma · joined May 4, 2017 (9y ago) · 695 submissions

Submissions

comment 6y ago · link · parent

What is "GA"?

comment 7y ago · link · parent

Yes, it is, in the only objective way that people actually care about: the size and simplicity of the source code.

(What people don't care about is the size of libraries that are scoped for the test context only, and don't even impact artifact size at all.)

Also, a Mockito mock is simpler in usage than a hand-written and normally instantiated test double.

comment 7y ago · link · parent

Adding interfaces whose only purpose is unit tests is not keeping the code simpler. Using a test library that automatically generates mocks for unit testing is what keeps the code simpler.

comment 7y ago · link · parent

Close! That's Mockito.

https://site.mockito.org/

comment 7y ago · link · parent

I'm always suspicious of people who offer opinions about Java, but then mention "J2EE", a term which has been obsolete since 2006.

comment 7y ago · link · parent

> Broadly though I'm finding it difficult to reconcile the prospect of someone exceptional who is working at a top tech company, with someone whose intelligence is low enough to advocate outright racism or bigotry.

It's simple if the threshold for racism and bigotry is driven low enough that it ends up including the private beliefs of most of the country and even more of the world.

comment 7y ago · link · parent

If they were honest about this, Snopes would publish a single entry covering all the prominent satire sites by name, and "warning" people that they are satire. As opposed to whacking moles.

comment 7y ago · link · parent

I can't seem to find even one variable-width font with programming ligatures.

comment 7y ago · link · parent

I find Dank's "f" disturbingly idiosyncratic.

comment 7y ago · link · parent

Unless the domain was purchased using Google Domains? Then what happens if the owner's Google account is killed?

comment 7y ago · link · parent

Weightlifting, Provigil, and 2000 IU Vitamin D if I'm not getting serious sunlight

Now I am almost always operating above 95% quality.

comment 7y ago · link · parent

> it should be the default for how we treat each other

What should be included in the set of "each other"? You're suggesting we include entities that are totally amoral, who happily destroy other sentient beings in the most painful ways, and who are incapable of reform. There is no imaginable social contract that could possibly include such monsters.

Surely there must be some element of symmetry as a condition of such a set membership. It's implied by the very phrase "each other".

comment 7y ago · link · parent

I wonder if the ISIS fighters themselves suffer from PTSD from taking part in such slaughter. Does strong ideology protect against brain trauma?

comment 7y ago · link · parent

Either animals are moral entities, or they're not.

If they are, we owe them moral treatment, but then they are subject to being held accountable for their own moral failings.

If they're not, then they can't be said to accrue any moral failings, and we don't owe them moral treatment.

comment 7y ago · link · parent

Doesn't it, though? The point of human society is to make life nicer for its humans, not for the state of nature that comes into contact with it.

comment 7y ago · link · parent

> If we "return" to not discussing anything with our peers and just being professional robots, to avoid 'chaos', we'll have lost our last healthy outlet for this sort of thing.

Absolutely not. It means your healthy outlet will be with your friends, those mututally selected for compatibility, and in contexts where such discussions are presumably welcome.

As opposed to the workplace, with people brought together by happenstance to cooperate productively, despite personal differences that are irrelevant to the production process.

> I attribute this far more towards the current climate of virtue signalling:

In many a historical era, tiny theological or political disputes have set neighbor against neighbor, brother against brother.

In the aftermath, the solution that civilized societies evolved was: don't discuss politics or religion! It worked. Let's restore it.

comment 7y ago · link · parent

> I have seriously had conversations with some people who believe that we are _less_ free here in Australia that them in the US because we do not have the right to bear arms.

You seem to be conflating "freedom" with "safety". Often they're correlated, but in this case they conflict.

comment 7y ago · link · parent

Can every human being agree that military recruitment ads are unambiguously bad speech?

comment 7y ago · link · parent

> Hard to complain when we've been doing it for 50+ yrs.

Exactly the opposite. If I don't like America doing it, I like even less China doing it.

comment 7y ago · link · parent

iTunes hasn't been intuitive to me in ages. Every update in the past 10 years has made it more confusing.

comment 7y ago · link · parent

> Refactoring is badge of disgrace, and should not be considered a standard practice any more than putting out kitchen fires should be considered a standard practice of cooking.

I can only grant you the benefit of the doubt and assume you aren't quite using the word the way the rest of the industry does.

Replacing two similar code fragments with two calls to a single method is an example of refactoring. In no universe would that ever be considered any sort of kitchen fire.

comment 7y ago · link · parent

> However, as the years went by, people started to realize that the strict approach to object orientation created a number of problems. These problems tended to be of the kind that makes code complex, hard to understand, and hard to test.

No, ease of testing is one of the reasons for OO adoption, and probably the primary reason software is much more stable than it was in the mid 90s.

> Many of those higher-level classes are “polluted” with methods and properties that are only relevant to a small number of subclasses.

Well, then it's broken and needs to be refactored.

> During my last couple years working at Google, I created a new user interface toolkit called “Quantum Wiz”

Of course, in true Google style, you wrote something from scratch instead of refactoring the old.

> composition > inheritance

Not a new finding. I learned this in 2000, at the peak of OO craze.

> Because object oriented inheritance is about organizing things into classes, it doesn’t model the real world very well; what it does model well is the way humans think about the real world.

That's the idea. Good software is written for the simplicity of those poor slobs charged with maintaining it -- often ourselves a year later.

> A physical object has many uses other than the specific purpose for which it was built. I can use a coffee cup as a paperweight or a doorstop;

The whole idea of modeling is to remove certain details! Otherwise the model would be identical to the genuine article, and would provide no benefit.

comment 7y ago · link · parent

I've always found it rather strange that library silence is considered required for study, but not for programming, which requires equal or more focus.

comment 7y ago · link · parent

How are they even able to teach students who can't afford the class? And if they managed to (distance learning?), how is that hypocritical?

comment 7y ago · link · parent

My supreme techniques are

* Provigil

* 2000IU daily Vitamin D during the darker half of the year

* Weightlifting, it really improves mental focus

* Get to sleep early enough to wake before the alarm goes off

* Strong coffee

comment 7y ago · link · parent

Why wouldn't the buck actually stop with Cognizant management? FB isn't demanding these horrible labor practices, Cognizant is.

comment 7y ago · link · parent

I would guess he's alluding to Soviet influence on our 60s counterculture.

https://en.wikipedia.org/wiki/Soviet_influence_on_the_peace_...

comment 7y ago · link · parent

I'm watching this viciously accurate post get silently downvoted into oblivion.

comment 7y ago · link · parent

A match for what? Was she donating her spare shoulder?
1
181920
24