skysight-inc/HackerNews huggingface dataset:
Yeah, but 99% of projects aren't anywhere close to long lived. Most products fail to launch. Most products that launch shutter within a few years. Having a code base survive long enough in close enough to its original state for a commit message to be meaningful a year later is unlikely outside of a few cases.

Also, this is all predicated on the business case for the software being well understood that it could be written out beforehand by a entry level engineer. Which is not a situation I've seen outside of a processor design house. Otherwise, your thinking for this or that choice will be built on shifting sand anyway.
If USA, EU, Canada, Australia, Japan, SK and a few other countries agree, they can make China pay. But they are too fractured and each country might be looking to get a better deal out of China.
Redness of the eyes might be related to the blood clots that the virus is known to trigger.
I find it interesting that comments on these articles mainly discuss 1 aspect about it. But rarely this part:

> Don't get trapped by the sunk cost fallacy.

In my experience, yes, programmers are hesitant to throw out an abstraction. Why not work to change this, rather than telling people not to abstract?
I'll debate existential attacks with people who know what the word "existential" means, but not with people who think the term could apply to a Colin Kaepernick tweet.
Any advice on teaching this to junior engineers? Seems like folks with 3-5 years of experience keep trying to not only over-abstract but also keep re-inventing the wheel with abstractions (vs looking for existing libraries).
It's the other way around: rural ethnic minorities were previously allowed three children. This limit hasn't changed, but Han Chinese in rural areas are now allowed to have the same number of children.
As I've gotten older, I've come to really feel like humans just haven't been around that long and we really haven't progressed that much outside of technology. WW2 wasn't really that long ago and neither was the the American civil war, both wars based on race and atrocities. I think it's a bit of a fallacy to think that just because some country is technology and economically advanced it will have correct moral values. Germany in WW2 is an example of that and so is America now imo, it's just that in America we aren't as far gone (but there are people in America who probably wouldn't mind killing other groups).
i'm sure this is what the 'america first' crowd told themselves in the 30s.

china sees us as rivals and has designs on our allies and global institutions. ignoring them is at our own peril.

america has deep problems, like any country, but you are a fool if you think that a chinese hegemon would leave us better off or that the ccp can be ignored.
It's a million times easier than figuring out if those minor differences in duplicate code are accidental or on purpose.

As bad as a flag-laden method might be, you know the intent of all callers.
Nope. You've got a code review from an interested random stranger on the net that spend 10s looking at your code, who noticed something suspect is going on.

Given your response, I spent 10s extra reading the simdjson docs and noting you violate the SIMDJSON_PADDING requirement. So either your code is a crash waiting to happen, or you use a very non- optimal code path in simdjson that requires it to re-copy all data.

That's also the maximum amount of attention you'l get from this random stranger. my time is up ;-)
sometimes it's better to copy and paste some code only to make each copy diverge more and more over time (somewhat like a starting template) as opposed to introduction an abstraction to generalize some slightly different behaviors only to use said abstraction twice.

this makes even more sense when the code will live on in different programs

there's a point when incurring the cognitive overhead costs of the abstraction become worthwhile, probably after the 3rd time. but my point is that it's also important to consider that the abstraction introduces some coupling between the parts of the code.
Thanks, I hadn't seen those. I did a search, but I guess flagged submissions don't show up. It might be handy to have a link to see the flagged ones. If that was the case, I wouldn't have re-submitted.

Edit: Just did the search again, for "laboratory", and this flagged submission showed up. Not sure why the original one didn't show up for me.
How is it harder to copy/paste the helper method and modify as needed, vs tracking down and unifying multiple instances of the same code written slightly differently?
Hydrogen is also really small and can seep out of seals that we would ordinarily consider air-tight.
Sandi mentions this during a talk she gave on refactoring a few years ago. [0]

It’s a great little video for showing junior developers how a messy bit of code can be cleaned up with a few well chosen OOP patterns (and a set of unit tests to cover your ass).

[0] https://youtu.be/8bZh5LMaSmE
> There are good reasons for why the case is not being appealed.

I would assume the fact that this was a decision by the supreme court might be one such reason.
I have had exactly and overwhelmingly the opposite experience. I wonder if it's a function of our fields, or what...
Not so ugly, not so bad.

Interesting library for forms.

Maybe in the future we'll include in the second edition of the book "Cool tricks in Python"
Some more for the heck of it:

iPhone ringtone:

https://vimeo.com/247872788

Chocobo theme:

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

My Neighbor Totoro theme:

https://www.youtube.com/watch?v=WvYqqjsYE6I
> You should know that thousands of method lookups in a tight loop will be slow.

That's not always the case. Modern compilers do a lot of things like inlining and unrolling. These days I mostly try to write code that is easy to understand.
The UK was 1/6. Back when we had a financial services sector, before we brucked it all up for blue passports.

Strange how we ever punched that high. We only have 1/23 the people, and barely make anything ourselves these days.
“Premature optimization is the root of all evil”
I'd rather ctrl-f and change code in multiple places than deal with abstraction hell.
When that happens I long click the back button and select HN from there manually. This always seems to work.
Why solve matters with lawyers if you don't need to? If there's a failure of understanding, possibly due to language issues as the previous commenter suggested, then trying to establish a dialogue and trying to explain the matter to them would be a far easier (and cheaper!) option for everyone, regardless of locality.

It doesn't help that the GPL is not an easy document to read by the way :-/
He's been pretty tough on them compared to past presidents with the 25% tariff, plus he has a sanction bill coming to his desk to sign.

> The Senate just passed a bill that further sanctions China by authorizing the Treasury Department to identify Chinese banks and financial firms which enable the Communist Party regime, and punish them by restricting their access to the US dollar and visas for their executives.

> Unlike past Chinese sanction bills, the restrictions will apply not just to individuals, but the banks that employ them. And it will apply not just to Chinese-owned banks, but subsidiaries of American companies operating in the country.
Counter: Refactoring is far, far, far cheaper than duplication or wrong abstraction.

Duplication means you lose the wisdom that was gained when the abstraction was written. It means that any bug or weird cases will now only be fixed in one place and stay incorrect for all the places you duplicated the code.

About the rule of three: I personally extract functions for single-use cases all the time. The goal is to make the caller be as close to pseudo-code as possible. Then if a slightly different case comes up, I will write the slightly different case as another function right next to the original one. Otherwise, the fact that you have multiple similar cases will be lost.
All the Muslim majority nations are silent on this matter. It shows how hypocritical they are.
Happy to answer any further questions here too!
I feel some people here are misunderstanding the blog post.

Sandi Metz IMHO doesn't claim that the problem occurs at step 2 or 3. She doesn't claim that it's wrong to introduce abstraction when there is duplication.

What she is saying instead is that the problem occurs from step 6 onwards: when you find yourself wanting to reuse an abstraction that, regardless of whether it made sense in the first place or not, has outlived its usefulness.

I think this is in agreement with other points that she often makes, about being bold, but methodical about refactorings.

The whole discussion about "you should never abstract away code before you see the third duplication" has little to do with the article, and I'm also really not sure it's good advice.
>You don’t see the irony in that statement? You’re one person saying simdjson is faster, and you are also lacking a reproducible test. That doesn’t make your side of the argument particularly compelling either.

simdjson is a massively popular library (~9.9k stars, the third most popular json library on GitHub), that is well known to beat the pants off of every other json library. Likewise the simdjson library has reproducible benchmarks in its own repo with charts and the like. So yes, I would consider that statement pretty much "worthless" given the popularity of simdjson.
Hey, you're the one claiming you aren't arguing anecdotally. I never said I wasn't, and I can't say I'm much concerned now with you trying to call me on not doing something I never pretended to be trying to do.

It's not that I mind an anecdotal discussion. Most people live anecdotal lives in an anecdotal world, and that's very easy to lose track of when you try to reason out everything from first principles and raw data. For one thing, it's very easy to assume that a given number has weight independent of its sources or its context, as you seem to have done throughout this conversation. But of greater import is the ease with which one loses track of the fact that these matters, which we so easily discuss entirely in the abstract, determine the course of real people's real lives, and those lives are of greater import than any conclusions we might find comfortable to draw in an environment of security and comfort.

If you're not comfortable with an anecdotal discussion, that's fine too; as my rather longer comment in the other subthread demonstrates, I'm as willing to engage on that field as on this one - especially with an interlocutor who does such a poor job supporting his claims, having apparently chosen a few sources which even then only support his arguments if they're not examined in the slightest degree. But if you're going to claim that anecdotal commentary is a problem when I engage in it, I'd expect to see some behavior on your part other than yourself engaging in it, too.
https://www.statista.com/statistics/250650/number-of-births-...

The trend is clear, the limit was loosened late 2015, and it's not working coz people don't want/can't afford 2 kids.

China didn't care minorities having 10 kids before, why bother now?
"Good programmers write good code; great programmers "borrow" good code; best programmers remove good code." – Mike Gancarz, "The UNIX Philosophy", mutatis mutandis.
Moreso: I think when we start digitally encoding these environments - much as we have over ground in South America, using LIDAR to discover previously unseen, but right in-sight structures such as those of the Maya - we'll realise there's a lot of our old culture not far off.

Drone submersibles with high resolution sonar doing fully-realised coastal scans would, I'm sure, yield hugely interesting results.

- ed: drone wouldn't need to be submersible. that would just be cooler.
They sell you a pretty package around what you already want to hear. They sell you internal buy-in and political cover. And most importantly, they sell you on the next engagement. That’s their job: to keep the client coming back for more.
D&D Map Sketcher
Well, John Bolton in his new book alleges that Trump told Xi to keep locking up Uyghurs.

> “According to our interpreter, Trump said that Xi should go ahead with building the camps, which Trump thought was exactly the right thing to do,” Mr. Bolton wrote.

On the other hand, he also signed the Uyghur Human Rights Act.
Do you happen to know how Fork compares with Tower (https://www.git-tower.com)? I've been a Tower user for quite some time and like it, but I'm always interested in better options.
Thank you so much for this recommendation. I was looking for some kind of educational game to keep my 8-year-old occupied, and just downloaded this and it's so awesome.
I couldn't disagree more. There is no such thing as abstracting too early (this does not go for structural abstractions like factories, singletons, etc). The best code is code you don't have to read because of strong, well-named functional boundaries.
What I run into with juniors is that yes, they want to abstract the new problem, and that's good... But they show disinterest in learning the existing abstractions and the existing problems and how their new code would fit into that. Given that approach, you end up with a million individual "frameworks", each only solving a single specific case of a series of overlapping similar problems.

Because reading code is harder than writing it. And the only thing worse than "there, I fixed it code" is "there, I fixed it with this massive cool new framework I've built".
I'm having trouble with this, because it implies pretty directly that Lincoln betrayed the founding principles of the country when he abolished slavery. Obviously, you don't mean that. But how does your argument square with it? Or with women's suffrage? Is it just that Lincoln was nicer to the founding fathers?
“diffusing responsibility” is a feature, not a bug.

Another way I've heard this said is: "McKinsey doesn't typically sell you the plan for the hard change - they sell you the credibility to act on it."
> You seem to be under the impression that the cost of hydrogen storage comes almost exclusively from the cost of electricity used for electrolysis of water.

Nowhere did I say or imply that. My argument is actually the complete opposite.

What hydrogen does is get a much lower cost per unit of energy storage capacity, at the cost of lower efficiency . The cost per energy capacity of batteries is two orders of magnitude higher than for hydrogen storage. So, hydrogen exploits that for long term storage, it's ok to waste more input energy, if you can get the capital cost down.

> Us retail energy costs are about $.13/KWh. Industrial costs are $.07/KWh.

The correct figure to look at is wholesale price, which is often below $.03/kWh in US power markets, and lower at off peak times when one would make hydrogen.

https://www.eia.gov/todayinenergy/detail.php?id=42456

> For diurnal storage, hydrogen energy storage

I explicitly wasn't talking about diurnal storage. That's not the use case for hydrogen. The use case is long term storage.

> And for non-diurnal storage the costs are even higher per KWh because a smaller amount of delivered electricity needs to pay off the same amount of capacity cost.

Hydrogen has a huge advantage in long term storage, because the per-energy capacity cost is so damned low, compared to batteries. Yes, the cost per kWh stored in long term storage is higher than the cost per kWh in short term storage. But they are different use cases and one cannot be substituted for the other.

If you optimize the problem of providing a steady output from renewables over the days and years, you will find in most places that a mix of short term and long term storage is optimal. Neither substitutes for the other.
We're finally back on track to the cyberpunk "anything goes" vision i think is gonna be the final winner of the design wars.

consumers don't give a shit about consistency. they want fun
oh man, I didn't even know it was possible to just buy a castle. That's crazy cool
I'm sorry but the Uyghur birth rate in Xingjiang has dropped 83% year on year. The Uyghur people are being exterminated and you're more interested in a conspiracy about who is behind us caring about it.

FYI you don't have a direct political ability to meaningfully influence policy on China but you are directly supporting the CCP by buying blood-goods.
That's a non-issue.

Belgium counts any suspected Covid death as a confirmed one, so we have approx. 2* as much deaths in statistics.

It's mentioned a lot, but I guess not everyone knows ;)
> Having the same "unit conversion" function duplicated in 3 parts of the code can be disastrous.

This.

I feel like it's really about cognitive load to remember and recognize the differences.

Duplication in 3 distant files, places a heavy load on the developer to:

1. Discover the duplication
2. To grasp the reason for the differences in the 3 different locations.
3. Remember these things

Whereas when the duplication is in the SAME file, #1, #2, and #3 can become very manageable cognitively.

Now the question changes to..

Is the cognitive load of dealing with the different special cases in a single de-duplicated method GREATER than simply leaving them in separate methods?

Often the answer is duplication WITHIN a file is less of a cognitive load.

Whereas duplication ACROSS files is a heavy cognitive load.

Minimizing cognitive load minimizes mistakes. And minimizes developer fatigue. Thus boosting productivity.

At least, that's my development philosophy, even though I've never seen it in a design pattern or a book.

It just seems to make sense.
"I have long argued that the atrocity in the region is a cultural genocide, not a literal genocide"

Headline is extremely misleading.
Scaling Pandas: Comparing Dask, Ray, Modin, Vaex, and Rapids
Another thing those juniors are seldom good at, is knowing how to refactor an existing old code base. Which is not surprising, as everything they worked on during education is new code. Knowing how to change a code base from one abstraction to another is a skill that often take many years and lots of mistakes to learn.
you forgot teardrop on android, which i use coz it's so hilariously bad but someone wanted it in so it got in.

aka google PM syndrome
If we did, we would be proud of it!

I once used two razors and a piece of wire plugged into the 220V outlet to boil some water.
Personally I went through the opposite process. I was a huge fan of Android up to and including KitKat, and I thought Holo was great. My enthusiasm for the entire platform disappeared as soon as Lollipop came out with the dreadful new Material UI. Even with themes I just hated using it on every level and eventually switched to an iPhone.
I definitely do. At least Trump and his supporters have the had guts to stand up to China. Nobody else seems to be doing this.
> we really haven't progressed that much outside of technology

This would imply that the measure of progression / advancement is civility, and that we are going to progress and become more civil given more time. That seems to be a fallacy also, it may be that evolution does not optimise for civility at all, after all being civil is not going to help you to crush your enemies or attract a mate in this environment.
The article is referring not to Facebook's specific policies being NK-like, but rather the complete control Zuckerberg exerts.

Some people argue that a large company should be regulated by the market, but what if that company is a near-monopoly with a single, unwavering leader?

There's also something troubling about the Mark Zuckerberg, one of the most powerful people alive, having secret talks with Donald Trump, arguably the most powerful person alive. One article suggested they have a non-aggression pact: Trump tamps down attempts to regulate FB, and FB gives him and his campaign the most powerful megaphone in history without any editing.
Quite nice. What I really want is an electric kei roadster, though. With luck we'll get them to coincide with the end of the ‘crease all the things’ fashion trend.
>Adrian Zenz is a senior fellow in China studies at the Victims of Communism Memorial Foundation

HAHAHAHA
I’m not saying the Iraq war should have happened, but war as a concept has been around since civilization started. What’s described here isn’t the same thing... there was no formal declaration or ability for them to fight back, and it’s happening largely in secret with denial to erase an entire culture from the earth.
Sounds like a genocide. /s
You can train starlings to speak.
https://www.youtube.com/watch?v=yhBaVInb3jI

This is the medium of Brian D Collier's brilliant art project Teach the Starlings http://teachstarlings.societyrne.net/html/intro.htm
A manager once asked me: please reuse as much code as you possibly can.

This reminded me of that.
The master never duplicates and all his abstractions are intuitive, readable and flexible.
"Adrian Zenz is a senior fellow in China studies at the Victims of Communism Memorial Foundation."

Victims of Communism Memorial Foundation? Ah ok.

Just as there is no prejudice or bias of any kind slipping into your scientific research ...
Choosing a Rust web framework
Traditional Chinese are quite consistent with simplified one.

I think you ought to say English and Spanish are replaced by British English and European Spanish?
> And they were not binding anyway. And I can assure you that USSR and the eastern bloc didn't comply at all.

Of course, there is no such thing as a binding international agreement—a state that feels itself empowered to abrogate an agreement will do so, regardless of anything that it has signed. As you say, in the end, the only sure-fire tool of enforcement is war, and even that is not sure fire, because victory in war is not guaranteed. Nonetheless, despite the many and flagrant violations of the Helsinki Accords, it is plausible to trace the beginning of the dissolution of the Warsaw Pact directly to the accords.
So much this. I've encountered many codebases (in science and in tech) where the coder did not even use basic abstractions. In one case there was a lot of

plot('graph1')
plot('graph2')
....
plot('graph100')

because somebody didn't know how to create strings at runtime in C++. Another codebase did complex vector calculations in components, I was able to reduce a 500 lines function to 50 lines (including comments, and with bugs fixed).

I can sympathize with this a bit, I started programming with BASIC - you could not return structs, you could not use indirect variables (no pointers/references)... but at least you had the FOR loop :-P

People get often called out for over abstracting (rightly so), but I've rarely seen somebody critisized for copypasta or for overly stupid code. Probably because we're too accidentially afraid to imply somebody can't code.
We've progressed in technology because of war & conflict.

But yes, it was incorrect to assume the CCP would play nice once they were a superpower.