skysight-inc/HackerNews huggingface dataset:
My first job at a bigco had a very heavy read-the-code culture, and being able to read code and write readable code is one of the most valuable skills I learned there. The lack of this skill is one of the things I've found most frustrating about working with less talented or, now that I'm a bit later in my career, more junior engineers. There's a tendency to glom onto black-and-white, superficial rules without understanding them, instead of appreciating the principles underlying them and having a sense of how to balance trade-offs. This creates an unfortunate cycle: everyone writes unreadable code, so nobody practices reading code, so nobody internalizes what readable code looks like and continue to write bad code.

I tend to have a strong reaction to duplicated code, but DRY is risky if whatever you're pulling out isn't logically concise and coherent[1]. Some of the helper functions I've seen in code reviews (as well as the one in the OP) strike me as written by unsophisticated language AIs, catching textual similarities that aren't semantically linked and pulling them out.

The engineers I've mentored over the years, including ones starting with no eng experience, go on to write fantastic code (and no, this isn't just my opinion). But it's a very labor-intensive, hands-on process of thorough reviews and feedback until they internalize the underlying principles, and it can be tough to swing in very short-term-oriented company environments. Now that I'm running larger teams, I've been noodling over how to encapsulate this deeper understanding of what makes good code in a way that scales better. But the fact that Google et al haven't already done this makes me think it's not something you can teach with eg a bullet point list.

> I encourage my devs to follow a rule of thumb: don’t extract repetitive code right away, try and build the feature you’re working on with the duplication in place first. Let the code go through a few evolutions and waves of change.

(Note: this isn't a case of what I describe in the earlier part of my comment, as I don't think this is a superficial, black-and-white rule)

I disagree pretty strongly here, especially since you're #2 involves waiting til you hit a bug. IME, there are many cases in which a solid understanding of the code allows pulling repeated code out in a way that's principled enough that it's more likely to adapt well to future changes. Indeed, this is true of most changelists to some degree, or you'd end up with no functions or classes other than main().

[1] A good rule of thumb is whether the free function has a reasonably readable name that captures its logic, without having to abuse handleFoo() or processBar().
The one that caught a few was the not using real name on google+ ban.
I don't think failing to pay a debt is a "crime" under American law.

Edit: reading the article, these people have failed to pay the fines associated with criminal convictions.
I sure do hate how technology moved me away from my natural state of... checks notes... dying in childbirth.

I think the net this criticism casts is too wide.
Who said she decided? She may have just perceived it as one of those things that happens.
There is a similar Japan syndrome in NEETs and weebs who spend years obsessing over how amazing living in Japan would be and who then finally move there and realize it isn't as it is depicted in their anime and porn and on their imageboard
I Went Back Through My Old Emails. It Was Glorious
Duplication isn't necessarily 'messy'.
In the example, it's very easy to see what's going on, even if it's repetitive, since it's fairly uniform.

Adding an abstraction layer often adds complexity, and really does get messy/complex if you subsequently have to deal with specil cases and exceptions.
>We trade convenience for security every single day

Which is totally sucks.

>Ever get locked out of your house because you forgot your keys? Why is that level of inconvenience (requiring keys on doors) okay

I would not say that is okay, that is sucks too
If my library had a bar (it already has free parking, coworking desks, conference rooms, copy machines, and WiFi), I’d never leave. Just build condos above so I had someplace to sleep at night. Or just add showers, I can sleep in my car.
This also probably implies that they are the only ones who notice the "problem" with their lawn. :-)
“Superdiamond” carbon-boron cages can trap and tap into different properties
Your comment also showcases how IMO a lot of software companies don't compete on tech. They compete on UX [1].

When I first came on HN and learned about YC's motto (build something users love) this idea was reaffirmed.

[1] Google optimizes for a collaborative quick spreadsheet program (handy for consumers), and as other comments say, Microsoft focuses on pro spreadsheet use (e.g. finance).
tragedy of the commons for code :)
The idea of this is great.

On your personal system it probably works really well. In reality tracking thousands of containers on top of operating systems which are using different methodologies gets really complex and in reality isnt ever really done well. At least in my experience. ( granted fortune 100 / 500 never does anything well :) )

What seems to be happening is the burden of the developer to maintain dependencies is now shifted to operations to maintain the automation that manages the various versions of containers because the complexity is too great to do it any other way.

What I see happening in the application of this model is very similar to train wrecks. You see the crash coming for a long time but cant do anything to stop it.
your comment is judgemental and rude, imo. shame on you.
New deadline for Yahoo Groups data request
I think the idea is like that: if you think that the murderer in a A. Christie's story is shown unrealistically, you can write it off as a literary device to create an entertaining puzzle, and not expect a serious treatise on the criminal's psychology, motives, etc.

If you need a deep(er) view of a murderer's soul, you open Crime and Punishment, also a literary work and not a piece of academic research, and find it there.

For SF in 1970s, there was no such higher tier; there was no literary futurology. Lem himself was one of the biggest figures in the field of literary futurology, framed as SF. "Hard SF", like the works of Peter Watts or Greg Egan, did not yet exist.
The Year the Music Died
>This is by the way, why vegans complain about people teasing them or judging them about their food choices. With very few exceptions, it’s probably not malicious. It’s just people being stupid and not realizing the impact they’re having on others.

It could be that people feel judged, criticized by someone who doesn't drink alcohol/eat meat. That person seems to be setting themselves up as better than others, or more ethical, or with better habits. And they spoil the vibe and camaraderie. People feel attacked and feel justified in striking back, or release that psychological tension with jokes that only seem funny to those with the tension.
But most libraries are supposed to be quiet zones which discourage talking and socializing. No, that doesn’t necessarily mean libraries need to be #disrupted... they’re good at what they’ve for.

So this kind of thing seems like a nice idea in that it gives people more avenues for healthy behavior, while possibly making it more exciting.
That conflates pass by value/by reference distinction with being optional.

This means you need magic values for "maybe int" with no help from the type system. And you can't express "there's definitely an int at that address".
Of course there is, it can be on the same page (even hidden) up until the point it recognises a different mechanism is needed. Then browser autofill still works if the password is used.

I also have the opposite problem - sometimes I want Firefox to remember my username but not password; the only way seems to be to have it remember a dummy password (1 char so I recognise it as such) and then decline to 'update password' every time I change it in order to login.
Even in dynamic languages, the consequences can be pretty bad. For example, I've seen lots of Ruby bugs where things end up being unexpectedly `nil`, but I haven't seen as many Python bugs where things end up being unexpectedly `None`.

How does this happen? Well, in Ruby it's a lot more normal to just return nil. For example, consider the following code snippet:

[][0]

In both languages you are trying to examine the zeroth element of an empty array (or list, as Python calls it). In Ruby this evaluates to nil. Python throws an IndexError. So in Python, if you have a bug where you address an array with an invalid index, it manifests as an error in how you're indexing the list. Ruby silently returns nil, and the only actual error backtraces you see are when you actually try to call a method on this nil later on, which might not be anywhere near where your program messed up the array indexing.
Abuse of the legal system is definitely a legislative problem - the law has to work reasonably in the real world, not in some idealized, frictionless vacuum.

As for a solution - non-prejudicial defensive trials (I made that phrase up). Under this system, if someone sues you, you can at first ignore it. You'd get assigned a public defender, that would try to do a reasonably acceptable job defending you. You could cooperate with this defender, or ignore him. This defender will conduct a sort of mock trial. If you're found not guilty in this trial, then the lawsuit can't proceed, and you've lost no time or money. Only if you're found guilty (or infringing, or whatever outcome you don't like), can it then proceed to a real trial.

A sort of enhanced filter on whether a lawsuit has merit.
It's beautiful! It's a real shame that Haskell isn't portable.
It's actually not controversial at all among the people actually impacted by it. It's only "controversial" in that a lot of people are transphobic and are offended that trans people are allowed access to gender-affirming medical care.

Besides, nobody's asking for statistics on how many people are satisfied with surgery to remove cancer, or other "obviously" good surgeries. Why are we expected to justify the existence of gender-affirming surgeries?
I've had this reaction to working in some large corporations

I went in thinking it would be just amazing and expecting an exemplary brand experience only to land in HR hell with some dirty scoundrel managers and rampant corruption all through the ranks compounded by lame duck self-dealing executives

I eventually had to be airlifted out after a bad reaction similar to a psychotic break

People it doesn't have to be this way!
It's probably limited to people who are only able to endure life because they entertain a fantasy of Paris as a heaven of sorts. You can endure almost anything if you have hope, and some people daydream about a better life elsewhere or a perfect place they will visit one day. Then they finally go on their voyage and realize their life in Paris is still shit but made up of higher percentage of dog shit, and they just crack.

But yeah this only justifies a wikipedia article because we have memed it because it is funny.
Grave of Walter White
How do you induce an infection in a wart?
People in other states who are imprisoned for inability to pay child support, etc. are released at the end of a finite sentence; they are not held indefinitely until they pay off an ever-increasing debt to the state at a low wage job. That's what defines debtors prisons.
Super Hexagon is a game that when I first played it I could not believe it was possible to complete it, yet a year later I could get >60s in all the levels. An insane grind but somehow immensely satisfying.
>but are we much better?

Generally yes.

Worldwide the bar is not high.
Knock. Knock. The average human body is rather boring. especially for the 3/4ths that outside the young adult age range of 15-35.

As to insurance company exposure, almost all of these imaging procedures were paid by health insurance companies and already know all your ailments.
At 16, She’s a Pioneer in the Fight to Cure Sickle Cell Disease
Cancer mortality rate continues steady decline
What are earth are you talking about? I'm talking about the vibe I get from a site claiming that sending a password over TLS is "fake security". That's a bullshit claim. Coming here into this thread to use a bunch of buzzwords ("Snowden" is not an argument) doesn't make your site look any better. I was quite clear in my comment that I don't know if you're selling anything, but someone who isn't selling anything wouldn't be incentivized to characterize the situation the way your site does.
There's a strong cultural difference in how a library and a bar is viewed though. If you're going to a library it's meant more of a quiet affair, and trying to strike up conversations with others is more likely to annoy them.

Plus depending on where you're at, it's more likely that a bar is going to be open than your local public library. At least that's true for where I'm at.
Only if you consider having the highest percentage of population in incarcerated as winning.

United States represents about 4.4 percent of the world's population, it houses around 22 percent of the world's prisoners. So yay go USA!
> I suggest to think deeply about what you mean when you say “clean” or “dirty”.

I'd go one step further: I suggest to think deeply. Period. I used to think I was a slacker for taking one or two hours to go for a stroll during a work day, thinking hard about my code, my problems, the architecture, the abstractions... and daydreaming as well.

I had to shut down my inner Jiminy boss who was telling me that an hour with no code written was an hour lost. And I am still occasionally bad at it.

In the last project I did, there was a strong deadline, so I went straight into coding, went into two dead-end before backtracking and changing the approach totally. Probably could have been saved by some hard thinking at the beginning.
> instead of just adding to the interest bill on the national debt.

the billionaires are lowering the interest bill as they compete to purchase treasuries. (the money is borrowed from whoever will accept the lowest interest for it. see https://www.treasurydirect.gov/instit/auctfund/work/work.htm under "Bidding".)
Is type supposed to be "text" instead of "number" in the inputmode snippet? Wouldn't it still strip leading zeros the way it is now (with type set to "number")?
Bars in places you least expect them can feel like an oasis. I recently discovered many Nordstrom’s have bars, with rather tasty cocktails. I’m happy to oblige the occasional shopping trip now.
One is certainly more severe than the other, but in either case if people are getting imprisoned over debts, it seems like a pretty shitty situation. Do you disagree?
Story is from 2016.
There's lots of space between recognizing a system is better than most and "So yay go USA!"
Musk says Tesla's fully autonomous driving feature is coming soon
Yes, a static type system at least strong enough to support parametric polymorphism is an unmitigated win. JavaScript sucks in the same way Scheme does in this regard; but thankfully, there's TypeScript.
In that regard sure we arent the best. But there are far worse countries.
Not sure about gmail, but its been this way for awhile with gchat and i'd presume gmail too.
If you get convicted for embezzlement, as in the first example in the article, and don't pay your fines and restitution, what do you think the courts should do?
If you died in childbirth then you wouldn't be around to dwell upon it would you?
> The importance of the songwriter over the artist has been growing, all of this was mentioned in the article.

That has always been the case in the USA.

The band's songwriter buys a mansion, and the rest rent apartments.

The Go-gos (writer Jane Wiedlin), Twisted Sister (writer Dee Snyder) and Smashing Pumpkins (writer Billy Corrigan) broke up over that, and prolly a majority of other bands.

Songwriter Diane Warren is prolly a billionaire:
https://en.wikipedia.org/wiki/List_of_songs_written_by_Diane...

What's interesting is that above even that is owning publishing rights, pioneered by Frank Sinatra. He produced his own albums, then after he mastered he shopped for a distributor.

Almost no US musicians bothered to retain publishing rights, aside from Steve Vai, Frank Zappa and a few other hard-asses. I tell Youtubers to "own your publishing."

Source: in the biz.
Facts Still Matter, but They Don't Change Many Voters' Minds
Good contents
Wow, that's a much better answer than I've ever seen; I'm so glad I asked here. Thanks!
Build vs. Buy: How to blow $100k saving money
No, I wasn't making a moral argument. I was talking about facts as I see them - I don't believe that the US or anyone else will blow up the world in response to being nuked. That is based on my thinking the game theory logic doesn't hold together and never has, but also historical events that indicate it was definitely invalid as of sometime in the 1960s.
Straight talk, should I watch this show? :)
I don't use Ruby, and don't do OOP either, but my favourite talk is still Sandi Metz's "All The Little Things" and I think that's where she says "prefer duplication over the wrong abstraction." That's really changed me. I've since been seeing DRY and other misapplied dogma in a new light and have grown much over the years since.
> up until the point it recognises

But that's the point... how?

It recognizes that when the user confirms they've finished entering their username by clicking some kind of button.

At which point either a password box is shown or the alternative mechanism is shown.

There's no way to know in advance. And it's a UX problem if a password box is shown by default, because then users who don't have passwords think there's a bug in accessing the resource (because they don't have a password).

If your password manager has a problem with filling in the username, then the problem is with your password manager, not with the login flow. Starting with username-only is an industry standard for any product used in enterprises.
For those interested in this approach, I encourage you to read about the OG cancer immunotherapy, Coley's toxins:

https://en.wikipedia.org/wiki/Coley%27s_toxins

Approaches like this have been tried for a long time. Some of the best are using actual viruses, such as oncolytic viruses - see this recent article:

https://www.ncbi.nlm.nih.gov/pubmed/28886381
>>Planet discoveries have historically gone to those who first laid eyes on it.

>That's a good way to get a star named Starry McStarface

Huh? I thought that was from voting, i.e. democracy :

"The Boaty McBoatface saga is not the first time online polls have gone awry. Greenpeace launched a campaign to name a humpback whale in the South pacific in an attempt to keep them from being poached by the Japanese. The poll prompted a voting frenzy after Mr Splashy Pants was put forward – and ended up winning 78% of the vote.

Similarly in 2012, soft drinks brand Mountain Dew was forced to abandon a poll to name its new apple-flavoured drink after it was hijacked by message board 4chan who ensured that “Hitler did nothing wrong” won the vote.

The city of Austin, Texas, also learned the perils of public voting after a poll to rename the Solid Waste Services Department ended up with an overwhelming number of votes to call it The Fred Durst Society of the Humanities and Arts as an ode to the Limp Bizkit singer."

https://www.theguardian.com/environment/2016/apr/17/boaty-mc...
What a museum of disgusting food reveals about human nature
Wage garnishment?
Great, now cancer patients will start getting autism as well.

/s
The Rule of 3 is a great rule, except when it isn't.

I had a colleague some time ago who wrote a couple of data importers for FAA airspace boundaries. There were two data feeds we cared about, "class airspace" and "special use airspace". These airspace feeds have nearly identical formats, with altitudes, detailed boundary definitions, and such. There are a few minor differences between the two, for example different instructions for when a special use airspace may be active. But they are about 95% the same.

The developer wrote completely separate data definitions and code for the two. The data definitions mostly looked the same and used the same names for corresponding fields. And the code was also nearly the same between the two (in fact exactly the same for most of it).

It was clear that one importer was written first, and then the code and data structures were copied and pasted and updated in minor ways to create the second.

Because the data structures were unique for each (even if they looked very similar in the source code), this impacted all the downstream code that used this data. If you saw a field called FAA_AIRSPACE_MIN_ALTITUDE, you had be sure to not confuse the class airspace vs. special use airspace, because each of these had a field of the same name, the compiler wouldn't catch you if you used the wrong one, and you may have the wrong offset into the data structure.

I asked the developer and they told me, "I have this philosophy that says when you have only two of something, it's better to just copy and paste the code, but of course when you get to the third one you want to start to think about refactoring and combining them."

Yep, the Rule of 3.

In this case there were only ever going to be two. And the two were nearly the same with only minor differences.

But because of blind obedience to the Rule of 3, there were many thousands of lines of code duplicated, both in the importer and in its downstream clients.

I still like the Rule of 3 as a general principle, and I have espoused it myself. But I think it is best applied in cases where the similarities are less clear, where it seems that there may be something that could be refactored and combined, but it's not yet clear what the similarities are.

I think it is a very bad rule in a case like this, where it should be obvious from the beginning that there are many more similarities than differences.
I found something super interesting!

The EN and FR wikipedia state different values.

FR:

> On considère généralement que la température basale usuelle du corps humain est de 37,0 °C, [...] Une température corporelle normale se situe entre 36,1 °C et 37,8 °C

Baseline : 37C. Normal range, [36.1 - 37.8]

EN:

No baseline, provided,just a range:

> The normal human body temperature range is typically stated as 36.5–37.5 °C (97.7–99.5 °F).

The French version explains that for a long time, until the 1980s, everybody assumed correct a study made in 1868 about the body temperature that found 37.0 - 37.5 to be the normal range in healthy adults.

It suggests that the declining prevalence of infections in the population may be the exaplanation of the lowering of the average body temperature.

After all, one of the main causes of rising temperature is an active immune system. Lower temperatures in the population are actually good news.
>Beyond that there's cryptocurrency, where finding a less-efficient algorithm is a design goal to maximise the energy wasted, in order to impose a global rate limit on "minting" virtual tokens.

I don't disagree with the gist of this, but from a your technical description verges on nonsense. I'm questioning if you're serious.

>...finding a less-efficient algorithm is a design goal...

At no point is anyone searching for an algorithm. Most mining algorithms were chosen at random or for novelty; Bitcoin uses double SHA-256, Litecoin uses scrypt, Primecoin searches for primes.

>...maximise the energy wasted...

Energy is wasted during mining in order to maximize security. The waste is a side effect.

>...in order to impose a global rate limit...

This is plain false.

>..."minting"...

It's called "mining". I wouldn't complain if this wasn't in quotes.

The whitepaper is only nine pages, but nobody seems to read it.
https://bitcoin.org/bitcoin.pdf
> the vast majority of software being developed is simply not performance-critical

Programmers keep saying this, and users keep complaining about slow software.
People think pregnancy just .. happens?