Dynamic Invocation in PHP Exposed - <AUTHOR> http://www.recessframework.org/page/php-callables-is-callable-call-user-func-array-reflection <comment><USER3> Sigh. Must we? This kind of large-scale dynamic behaviour tends to go wrong even in languages that provide type-checking and sensible lexical scoping. In PHP it's basically just a recipe for the kinds of untouchable "black magic" code that haunt code bases. It's basically some nasty syntax wrapped around even nastier GOTO-style behaviour.

"is_callable" is no better, because if you don't know, you shouldn't even be trying it. It might as well be called "does_stick", because you're basically just throwing spaghetti (code) at a wall.

<comment><AUTHOR> Having a blog about programming languages and formal methods I understand the basis of your disgust with PHP. In a perfect world all programming languages would use robust type systems and be capable of formal verification. PHP makes no attempt at either.

Out in user land there are all sorts of scenarios where dynamic invocation makes sense. Higher-order functions are the most obvious. Is mapping strtolower on an array of strings really spaghetti code?

Most uses for dynamic invocation are at the utility/framework level, not in application land. You're right, it's dangerous when used improperly, but you should consider coming down from the theory clouds if you believe dynamic invocation and goto are in the same boat on the river styx.

<comment><USER3> > _Having a blog about programming languages and formal methods I understand > the basis of your disgust with PHP. In a perfect world all programming > languages would use robust type systems and be capable of formal > verification. PHP makes no attempt at either._

Way to straw-man, dude! Nowhere did I suggest anything about perfect worlds or what programming languages should be like. I said that this particular feature of this particular language is undesirable because it introduces unnecessary complexity and risky levels of unpredictability into code that probably doesn't need to use it.

> _Out in user land there are all sorts of scenarios where dynamic invocation > makes sense. Higher-order functions are the most obvious. Is mapping > strtolower on an array of strings really spaghetti code?_

What does "dynamic invocation" have to do with higher-order functions? Pretty much everything described in the article deals only with functions as first- class values and unrestricted indirection. There is nothing "higher order" about them. If you're talking about _implementing_ higher-order functions, then the only requirement is the ability to pass around functions as values. There is certainly no requirement for indirection on strings!

If functions are first-class values, that's absolutely fine. I'm complaining about situations where you end up passing _names of functions_ around (as strings), and they take on special meanings along the way. I characterise this as spaghetti code because it leads to a situation whereby control flow is embedded both within constructs in the language, _and_ within computed values based on using indirection on strings-indexing-functions. That's just nasty.

Just so I'm not misinterpreted, let me furnish my complaint with an example to show what I am and am not complaining about:

      ...
      $x = "hello$z$k$y";
      $x($foobar);

vs.

      ...
      $x = function() { echo "foo"; };
      $x();

The latter is (mostly) fine. The former is completely bonkers, and is what I am complaining about - the ability to do ad hoc indirection based on calculated values. In the first case, functions are _not_ values, and _strings_ have become semantically significant. In the latter case, the function _is_ a first-class value, and there is absolutely no magic going on - everything is hunky dory.

> _Most uses for dynamic invocation are at the utility/framework level, not in > application land._

I still can only think of a few restricted cases where indirection based upon strings (that values of which are not known until runtime) would be sensible or useful. The kinds of cases I can think of are where you would want to do something really dubious based on user-input. Keep in mind that I'm not railing against _reflection_ here! Any sensible dynamic language should be able to provide you with the means to get a _function value_ based on a name. This is not what you are describing. I think name-based reflection could have a use in utility or framework code, but relying on this kind of unrestricted indirection is really just a sign of deeper problems, I think.

> _You're right, it's dangerous when used improperly_

Which uh... was my point.

> _but you should consider coming down from the theory clouds if you believe > dynamic invocation and goto are in the same boat on the river styx._

Once again, you appear to be rebutting an argument I never made. Suggesting that I'm some sort of aloof theoretician is really a bit presumptuous. I developed an interest in all of those things you describe precisely _because_ I am a programmer. Sure, I know a reasonable amount about theory, but I don't see that that should be used to discount any and all knowledge I have about practical programming too.

Let me make very clear my objection, once again. I am going to leave out exactly one definition from each of the following code snippets:

      foobar(0);

vs.

      $x(0);

I left out the definition of 'foobar' in the first snippet, and the definition of '$x' in the second. Can _you_ tell me where program control goes in each case?

In the first case, you know that it goes to a function named "foobar" somewhere within scope.

In the second case, of course you can't! You have to go figure out how $x has been computed. You basically have to read most of the code in order to find out what value $x will have just to be able to predict what the program will do next! This is basically the same problem that goto-style code creates - <USER2> makes it considerably more difficult to mentally simulate the execution of the program.

 _Edit: This is getting down-voted? Really? I would love to know why._

<comment><AUTHOR> Didn't intend to cause harm in "straw-man"ing. I think it's valuable to know where people are coming from. You care enough about programming languages and verification to have a blog on it, that's awesome. It's perspective.

No where in the post is there an example advocating dynamic invocation based on computed strings. No where. In fact, the more I read your responses the less I believe what you're saying has anything to do with the contents and examples of the post. We're on the same page here: dynamic invocation with computed strings: bad. spaghetti code. evil like eval.

> What does "dynamic invocation" have to do with higher-order functions?

Everything? Whether you're rolling your own or making use of PHP's built-in higher order functions, like array_map <http://us.php.net/array_map>, you're dynamically invoking something: a lambda, a function, an instance method, or a static method. Unfortunately these are distinct things in PHP. So with array_map its first argument is a callback, or something that returns true to is_callable as described in the post. What you're arguing is that you should never send a string name of a function to array_map, but should instead wrap the invocation in a lambda. So..

      array_map(function($s) { return strtolowwer($s); }, $array);

Is preferable to:

      array_map('strtolowwer', $array);

Point blank, it's just not in PHP. It's more than twice as slow, it takes more than twice the memory, and, most importantly is every bit as unsafe. Notice I misspelled lower with an extra w? Let's imagine that's a bug, a programmer's typo. Neither case will error out until array_map is executed which means both parse and generate opcode just fine. Reconsider the function call wrapped with in a lambda. What must it mean deep down for PHP to be able to generate valid opcodes on a pure method call to a method that doesn't exist? It means the internal opcode must simply store the method name as a string waiting to be executed. So once we hit the op a table lookup based on a string in your code happens. Both ways. One string is wrapped in quotes, the other in a far more elaborate construct.

As for reflection, I'm all for it but in PHP a reflected function or method object is not a callable, thus cannot be passed to a function like array_map. Even if you could, I do not believe that, in PHP, the following is any less evil:

      array_map(new ReflectionFunction('strtolowwer'), $array);

Again, more memory, more code to execute, won't error out until runtime.

I really don't think you or I disagree on anything in terms of "best programming practices". The only thing we seem to disagree on is what this post was about and trying to demonstrate/advocate.

<comment><USER3> > _No where in the post is there an example advocating dynamic invocation > based on computed strings. No where._

Your example that uses a random number generator to select a string and then use that string as a function name is dynamic invocation based on computed strings.

> _What you're arguing is that you should never send a string name of a > function to array_map, but should instead wrap the invocation in a lambda._

No, that's not what I'm arguing at all. Your example above uses a string _literal_ , which is basically the same as having a first-class identifier in its place. I don't think that kind of behaviour significantly harms readability. However, there's really nothing more "dynamic" about this kind of invocation than any other invocation in PHP.

I kinda question your use of "dynamic invocation" as a blanket term to cover first-class anonymous function application, higher-order functions and indirection. These are all separate-but-related concepts. My cursory Googling didn't turn up any uses of 'dynamic invocation' that are anything like the way you are using it - do you have a source or reference or is this your terminology?

> _What must it mean deep down for PHP to be able to generate valid opcodes on > a pure method call to a method that doesn't exist? It means the internal > opcode must simply store the method name as a string waiting to be executed_

Perhaps I'm misunderstanding what the internals of the PHP interpreter are these days, but you appear to be describing the use of a symbol table or something. The use of 'opcode' confuses me, because if there was code generation going on, it would be possible to statically resolve names to first-class function values.

What I'm getting at is that I don't see that there is a difference (in PHP) between the "dynamic invocation" you are describing, and straightforward run- of-the-mill function-calling, given that PHP's internal representation of both is essentially just a string (which is looked up in some symbol table in order to resolve it to a piece of code).

And so my point is that there is no real reason to exploit this quirk of language design in order to exploit indirection on computed strings (which, as I said in my previous post, I consider to be a kind of goto-esque spaghetti code feature).</comment></comment></comment></comment></comment>


Stories That Should Be Banned from Hacker News: Immortality - <AUTHOR> https://h4labs.wordpress.com/2017/03/28/stories-that-should-be-banned-from-hacker-news-immortality/ <comment><USER2> So, I realize the title is probably rhetorical/hyperbolic, and the author doesn't necessarily actually endorse banning anything from anywhere. But... come on. This is the Internet. There's nothing wrong with having a philosophical conversation or bullshitting for a little while (if one even agrees that's what these discussions are). If the HN community ("hackers") are interested in it by and large, it can and should be posted. We don't need qualitative barriers based on some people finding some discussions less exciting than average.</comment>


The slowing in population growth in Africa has been less than anticipated - <AUTHOR> http://www.economist.com/news/briefing/21679781-fertility-rates-falling-more-slowly-anywhere-else-africa-faces-population <comment><USER2> As always, the article is a lot more nuanced than the headline. Stability, liberal government, and prosperity increase demand for and access to contraception. Eventually population stabilizes. The explosion from the headline is simply a forecast for growth to slow later than expected. But the message is that nobody really knows what's going to happen in Africa. News at 11.

<comment><USER3> Yes. As the article notes,

"The tendency for societies to have fewer children as they become richer appears to be universal. It holds good across races, religions and ethnicities. Thus the fertility rate is the same (2.3) in Azerbaijan (which is largely Muslim), Mexico (largely Christian), Myanmar (largely Buddhist) and Nepal (largely Hindu). By the same token, many countries that remain relatively rural—Bangladesh, India and Vietnam, for example—have nonetheless seen sharp falls in fertility, albeit not quite to the levels of heavily urbanised ones, such as Brazil."

The slowing in population growth in Africa has been less than anticipated in earlier projections, although the article points out that Addis Ababa has a fertility rate below two children per woman, just like the rates in rich countries. The article includes other nuanced information about what might help African people adjust to planning family sizes appropriate for the new economic realities in their countries as those countries prosper. Further economic development throughout the continent, which depends on improvements in governance, is still crucial.

</comment></comment><comment><USER4> "The UN reckons that the share of Ethiopian women aged 15-49 who use some form of contraception has risen from 6% in 2000 to 40% last year."

What a remarkable statistic. While 40% is still far from ideal, it does show that the push for sexual education has been at least somewhat successful.

<comment><USER5> Take UN statistics for a country like Ethiopia with a huge grain of salt. It is mostly just guesswork and later revisions tend to be extreme.

It is not quite the UN's fault - I'm sure their raw data comes with caveats. It is hard for anybody to get accurate data for a country with Ethiopian-style government, administration, and infrastructure.

</comment></comment><comment><USER6> Interesting this came up today. I was looking at maps of Greenland and then became reminded of how most of the maps we normally look at are wrong. (proportion-wise) Including the one in the article. Here is a Peter's map - [https://en.wikipedia.org/wiki/Gall%E2%80%93Peters_projection](https://en.wikipedia.org/wiki/Gall%E2%80%93Peters_projection)

My point is Africa is huge.

<comment><USER7> Perhaps you've already seen it, but this is a nice comparison – [http://kai.sub.blue/en/africa.html](http://kai.sub.blue/en/africa.html)

<comment><USER8> Thanks for sharing this, I had never seen it. I'm astounded that you can fit the entire US in Africa and still have room left over.

</comment></comment></comment><comment><USER9> Relevant: "DON'T PANIC — Hans Rosling showing the facts about population" [https://www.youtube.com/watch?v=FACK2knC08E](https://www.youtube.com/watch?v=FACK2knC08E)

<comment><USER10> From the article:

>The declining birth rate elsewhere has brought the world to the verge of what Hans Rosling, a Swedish demographer, calls "peak child"

But then:

>The revision of population predictions for Africa partly reflects the fact that HIV/AIDS has not proved quite as catastrophic for the continent as seemed likely ten years ago.

</comment></comment><comment><USER11> The comments are better than the article itself.

From: NdiliMfumu Dec 14th, 03:10

Today's problems with overpopulation are directly related to Mankind's evolution, as are many other modern discontents:

Prior to the modern era (especially, prior to the beginning of organized agriculture in the Middle East, 12,000 years ago), Mankind was a predominantly nomadic beast who wandered about, following natural herds and eating whatever fruits, nuts and other small vegetables he could find, whenever he couldn't fell another water buffalo or gazelle.

In this condition, food was generally scarce, disease common and rampant, children frequently taken by the passing lion or wave of dysentery, and the population constantly under threat. It made sense for us to evolve to be continuously fecund, always seeking meat, salt and sweets (fruits), and to avoid anything foul, bitter or unduly acidic. People tended to be lean and stringy, eager to sock away a bit of fat or sodium for the next dry and desperate week ahead.

We were not used to regular access to food, drink, salt or sugar, nor were we quite used to seeing our numbers grow.

Ah, then, we learned settled agriculture and everything began to change. Suddenly, there was a much more certain supply of food and drink. Sweets became more commonplace. Salt was easier to come by. And there was ever so much more opportunity for sex, now that the new girl just moved in next door.

Over the centuries after the onset of settled agriculture, human populations grew rather steadily. From merely about 25,000 souls in 50,000 BCE, we grew to around 100,000,000 souls around the year 1 CE. This is an intrinsic rate of population growth of only 0.016 % per year. Hardly much, but enough to be very successful as a species over a long period. Yet, it pales in comparison to the modern rate of intrinsic population growth, which has often been above 2.5% per year.

What has happened in the meantime? The Industrial Revolution enabled human populations to intensively urbanize, elevating millions from abject poverty, bringing in its train electricity, among other things, and the development of artificial ammonia production. This was critical.

Together with artificial fertilizer and increasing agricultural mechanization, farm productivity bounded and food became increasingly cheap in most parts of the world during the last 200 years. At the same time, SANITARY practices (especially, sewage system development and water purification projects) deprived the River Styx of legions of children who would otherwise have died of dysentery and early childhood respiratory illness. All this came about long before modern medicine could penetrate into most parts of the world, and well before antibiotics were developed and could play their role.

Between 1800 and 1950 (when penicillin began to become much more prevalent), death rates plummeted and the intrinsic rate of population growth exploded. At the same time, Mankind began to fall ill from diseases of excess: Excess salt leading to hypertension, excess sugar and fat tending towards morbid obesity and adult-onset diabetes, excess nicotine tending to heart attack, stroke and cancer.

What we see, here, are very swift cultural, economic and political changes sweeping over the Human Condition, much faster than can be accommodated by the usual evolutionary processes, alone. The Human Genome simply cannot respond quickly enough to doff the tendency to want more: More food, more sex, more sugar, more fat, more stimulation. All those things which for millennia we longed for, now, we have in great surfeit.

The tendency for wealthier, urbanized families to have fewer children and to start later is a direct reflection of the population pressure experienced by large numbers of people living in close quarters. We can help this along by encouraging people to continue leaving the countryside: Raise taxes on idle farmland and pastureland, on rural homes, and on train/bus rides terminating in the hinterland !

Similarly, give families income support and training to relocate into cities. Offer them apartments, jobs, healthcare and continuous education. Pay them to forego having more children, and to educate the ones they have better. Offer particularly young women money and apartments to stay single and childless until they're at least 25 years old thereby cutting their fecundity in half. And of course, make reproductive health services, including contraception and abortion services, broadly available, safe and cheap for young women.

The current and continuing crisis of world-wide deleterious climate change is, like overpopulation, a direct reflection of our evolutionary challenge and current inadequacy. Were it not for the 7.32 BN of us already alive in such vast numbers, there would be many more fish in the seas, much more oil in the ground and much less carbon in the atmosphere. Time for a thorough-going and purposeful change: Let's not leave it to evolution, lest we go the way of the dinosaurs !

Continuing fecundity in Africa is the direct result of the general lack of urbanization, there, as compared with other continents, as well as cultural values emphasizing fecundity and large families, and the general level of poverty and illiteracy.

But this is rapidly changing, as the article points out.

As African nations lift themselves from poverty and progressively urbanize, e.g., Nigeria, today, fecundity drops and the intrinsic rate of population growth along with it. Nigerian women, especially those who live in Lagos and other large cities (e.g., Abuja, Port Harcourt, Benin City, Ibadan, Kano, Kaduna) are increasingly interested in getting an education, making money and deferring marriage. Deferring the start of childrearing has a dramatic effect on overall fecundity. Deferring a first pregnancy to the age of 25 cuts an average woman's lifetime fecundity in half.

The major impediments to successful population control are largely culturally determined resistance -- especially male chauvinism, heterosexism, paternalism and religiously-driven moral imperatives to "be fruitful and multiply" (this, largely an attempt on the part of these religions to secure and increase their numbers by indoctrinating newborns in the faith).

But all these impediments tend to fall by the wayside, when young women and families enter into urban areas: The anomie of the cities assists young people in escaping the control of their parents and their clergy. "Traditional values" tend to fall victim to "modernism". "Contraception" is no longer a dirty word. Liberality and social mobility go hand in hand. Staid and stoic traditionalist parents tend to shut up, when their well-educated daughters are sending home then rent cheque from Lagos !

Africa's population will bound towards 2 billion or more by the end of the 21st century, but then it will stabilize. By that time, if we're lucky, the Earth will host more than 12 BN souls, and we shall be straining the world's resources to the limit.

If we have some real luck, hydrogen fusion power will replace fossil fuels and nuclear fission, entirely. We will devote the new, cheap and nearly limitless power to cleaning up the environment, sucking the carbon out of the atmosphere and burying it in the deep seas, planting billions of trees, and building tall and narrow cities, leaving vast tracts of open land to the animals, the insects and the other flora and fauna. We shall swing from mile-high elevators much like our distant ancestors swung through tropical forests.

And we shall begin to colonize the Moon, Mars and other regions of space, as well.

Time for a thorough-going change!

</comment><comment><USER12> Parasites (round worms) in Africa boost fertility in women since they seem to suppress imuno-reactions paving the way for sperms. (see Aaron Blackwell University of California)

Probably one reason why their fertility is with 4,7 children/women (2015) higher than 1,6 in EU. [http://de.statista.com/statistik/daten/studie/1724/umfrage/w...](http://de.statista.com/statistik/daten/studie/1724/umfrage/weltweite- fertilitaetsrate-nach-kontinenten/)

<comment><USER13> If true that is a minor factor compared to differences in birth control use, abortion rate and mother's age at first child.

</comment></comment><comment><USER14> Every time I read an ever more ridiculous "present continues into the future, unchanged, unlimited" claiming ever more billions of Africans, I think to myself a quote right out of this article "I couldn't feed more children,".

What I'm not sure is why. My guess is its financial propaganda such that if you assume food, jobs, energy, and economic activity will magically fall from heaven, then a company selling housewares would logically expect tripling the population would result in triple revenue leading to more than triple profits. That sounds like nice clickbait, and the bar rises every time clickbait is published, so I'm not surprised the bar right now is 4 billion africans. I'm sure to keep the financial press happy it'll be up to 8, maybe 10 billion by the end of next year.

Reality of course, with declining energy supplies and declining raw material and declining farmland, and increased lethality of weapons, is the 3rd world is going to take a bigger hit than the rest of the planet, so there's likely to be a modest population decline via the traditional unpleasant to think about methods.

There's a tragedy of the commons effect where on a societal level if at the gut level you know declines are coming, you're better off if everyone has fewer kids, but on an individual level both you AND all your other kids are better off if you have a larger family unit.

<comment><USER10> I'd like to nitpick a little. I'm bit of history buff and weapons buff and as a result military history buff.

"Lethality" of weapon could be defined in many ways. You could claim that lethality has not increased significantly since Hellenic period. Depends entirely form definition.

</comment></comment><comment><USER15> Hans Rosling Gapminder [https://www.youtube.com/watch?v=fJ4vFAGBG5k](https://www.youtube.com/watch?v=fJ4vFAGBG5k)

Babies per woman in Africa [https://www.youtube.com/watch?v=T7P1UiAo09E](https://www.youtube.com/watch?v=T7P1UiAo09E)

</comment><comment><USER16> Well yeah, that's what happens when you bring food aid without sexual education.

<comment><USER17> Its what happens when you bring any kind of improvement individual immediate circumstances without strong social safety nets, because family, especially immediate family, is the social safety net.

</comment></comment><comment><USER18> I've got no issues with a population explosion over there. They are sovereign people and noone should tell them what to do. As long as the west doesn't have idiots like Angela Merkel at the helm, everybody can mind their own business.

</comment><comment><USER19> And what people will be blamed when the eventual famine comes?</comment>


Western Digital Lawsuit for Shipping Slower SMR Hard Drives Including WD Red NAS - <AUTHOR> https://www.hattislaw.com/cases/investigations/western-digital-lawsuit-for-shipping-slower-smr-hard-drives-including-wd-red-nas/?shh <comment><USER2> The Red series was originally marketed and positioned specifically for Home/SMB NAS use. I have 4 of these (the old versions from before the SMR switch) running in my Synology NAS for years, and a 5th lying spare in its original sealed packaging just in case.

When WD stealthily swapped to using device managed SMR technology in the series, they hoped that typical users wouldn't notice the change in behavior of the drives, as they assumed a small NAS would have enough downtime for the drive to manage the data being behind the scenes rearranged towards the slow shingled sections.

This assumption is not always true, but specifically it doesn't hold at all when an array has to be rebuild e.g. because of a drive failure in a raid array, as that requires writing data continuously and for a long time.

WD was caught not just using a technology that made their drives unsuited for the advertised purpose, but initially even denying that they had done so.

<comment><USER3> If I'm not mistaken it's not the entire red series - it excludes 8TB.

<comment><USER4> True, there's a good list:

[https://nascompares.com/answer/list-of-wd-cmr-and-smr- hard-d...](https://nascompares.com/answer/list-of-wd-cmr-and-smr-hard-drives- hdd/)

<comment><USER2> The original 2TB - 3TB - 4TB - 6TB Reds with the 'EFRX' suffix were CMR, the later ones with the 'EFAX' suffix are SMR drives.

<comment><USER5> Update: EFBX looks to be entirely CMR

Know anything about EFBX? SMR I assume? I literally have one arriving today to replace a disk in my single disk redundancy JBOD

The whole disk buying process was irksome because I up until WD shut them down always depended on HGST.

<comment><USER2> If you mean the FFBX (I can't find any reference to EFBX models), the Red Pro series, those are CMS (and 7200rpm which is what the B stands for).

</comment></comment></comment></comment></comment></comment><comment><USER6> WD richly deserves to be raked over the coals for not labeling these drives clearly.

Their initial customer-facing reaction was even worse if I recall: One customer escalated his issue and asked WD to identify which drives used SMR, WD said something along the lines of We don't share that information with customers.

(If anyone has a pointer to that story I'd appreciate it. I can't find it at the moment).

EDIT:

[https://blocksandfiles.com/2020/04/14/wd-red-nas-drives- shin...](https://blocksandfiles.com/2020/04/14/wd-red-nas-drives-shingled- magnetic-recording/) cites a comment on a synology board:

""" Also: "Well the higher team contacted me back and informed me that the information I requested about whether or not the WD60EFAX was a SMR or PMR would not be provided to me. They said that information is not disclosed to consumers. LOL. WOW." """

</comment><comment><USER7> Nothing wrong with shipping slow SMR drives, the issue is, it was never explicitly disclosed to the customers/end users.

For that, they deserve the lawsuit.

<comment><USER8> Yes, there's nothing wrong with SMR at all, if it's not your primary storage device (though I doubt anyone reading this is in danger of making that choice in 2020).

It's roughly a 25% boost from the same physical platters. If you're storing large files with a primarily read workload, it's almost certainly the right choice.

<comment><USER9> Except it means you can't use the drives for RAID, as they'll fail the initial resilvering. Worse yet, their firmware appears to be buggy enough that they're not just slow, they start throwing errors once the PMR buffer zone is full.

<comment><USER10> Sounds like we'll need to add some sort of buffer congestion avoidance (anti- bufferbloat) logic as part of storage drivers to solve this issue. It can crop up in any use of SMR tech, not just RAID rebuilds. And of course solving this would also mitigate the issue w/ rebuilding drives dropping out of RAID arrays altogether.

<comment><USER11> Except the drives don't identify themselves to the OS as SMR, they lie. So it would be on the consumer to guess which drives are smr.

I consider that the biggest issue. Drive manufacturers are trying to charge CMR prices for SMR drives.

</comment></comment></comment></comment></comment><comment><USER12> And when it's done, I look forward to getting a settlement check for $2.46 while the lawyers make $18M.

<comment><USER13> What would you rather have, then? No lawsuit at all and no check? A bigger check for you? Who would pay this? WD? The lawyers? Keep in mind that lawsuits are expensive and the lawyers are essentially working on contingency. Lower payouts for them might dissuade them from suing altogether.

<comment><USER14> _> A bigger check for you? Who would pay this?_

WD, obviously.

They won't like being made to pay, but that's rather the point of fines.

<comment><USER13> That would need a dramatic change in the legal system. Either making the losing side pay the other side's legal fees, or increasing the amount of punitive damages that a judge can award. Both of these are non-trivial changes to get through congress, and have numerous side effects.

</comment></comment></comment></comment><comment><USER15> For anyone still doubting WD is at fault here, as I was (because I thought these were obviously inferior drives not appropriate for RAID or 24/7 operation), just look at the product page [1] which is still, as of Fri 29 May 13:50:16 UTC 2020, claiming that WD Red drives are "Built for NAS compatibility" and "Designed for RAID environments".

[1] [https://www.westerndigital.com/products/internal- drives/wd-r...](https://www.westerndigital.com/products/internal-drives/wd- red-hdd)

If some Red drives (most probably the SMR ones) require many day rebuild times or even fail to rebuild in common commercial consumer NAS solutions, they are obviously not viable for RAID environments and then WD is guilty of false advertising.

<comment><USER16> I recently lost two drives in a RAID 6 built from WD RED 3TBs in a single week. That was a tense few days during the rebuild with Seagate drives.

This long time WD customer is no longer a customer.

</comment></comment><comment><USER17> Where's the Seagate lawsuit? They've been doing this too for years now. AFAIK you can no longer buy 4TB Seagate consumer 3.5" drives now, the current product line is all undisclosed SMR unless you go to higher tiers.

E.g the ST4000DM000 (which I have a pile of in an array) was replaced with the ST4000DM004, which is sold as a direct replacement in that product line but is SMR.

<comment><USER18> Did they label them as being for NAS? This is the issue. They are unsuitable for use in a NAS.

<comment><USER19> As someone who has no experience in this field, why are they specifically unsuitable for NAS?

<comment><USER20> They'll work fine (although with the normal expected slower writes of SMR drives) until a drive fails normally and the raid array has to rebuild (which is kind of the reason you use a raid array), then it could take a week+ and there's a very good chance you'll get more failures during and lose all your data.

</comment></comment></comment></comment><comment><USER21> Remember when drive makers were constantly looking to one-up each other on reliability? Those were the good 'ole days. Bad press for consistently losing users' data back then could put them out of business. Now they're so big that even uber amounts of bad press and deliberately shipping inferior products can't do that - they'll pay a few million dollars in fines and go right back to doing what they were doing.

<comment><USER22> Honestly no I don't, as far as I remember it has always been a competition on price and capacity. Maxtor, IBM DeathStars, neither killed those manufacturers (IBM lives on as HGST, Maxstor as Seagate). Maybe it was different in the enterprise markets, but Red wasn't an enterprise drive.

<comment><USER11> Deathstar absolutely killed IBMs disk business. Hitachi bought that for a song.

</comment></comment></comment><comment><USER23> Kingston is another company that got caught doing a bait-and-switch after good reviews.

[https://www.extremetech.com/extreme/184253-ssd-shadiness- kin...](https://www.extremetech.com/extreme/184253-ssd-shadiness-kingston-and- pny-caught-bait-and-switching-cheaper-components-after-good-reviews)

</comment><comment><USER24> I don't know if iXsystems (the company behind FreeNAS) has a deal with WD, but their product page[0] still reads:

> WD Red drives are specifically designed to handle the rigors of 24×7 FreeNAS > workloads, offering excellent data protection and the highest level of > performance possible.

They probably should adapt their wording.

[0] [https://www.freenas.org/freenas-mini/](https://www.freenas.org/freenas- mini/)

<comment><USER25> They do have this blog post up: [https://www.ixsystems.com/blog/library/wd- red-smr-drive-comp...](https://www.ixsystems.com/blog/library/wd-red-smr- drive-compatibility-with-zfs/)

</comment></comment><comment><USER26> The raid rebuild speed with SMR drivers is scary long, see [https://www.servethehome.com/wd-red-smr-vs-cmr-tested- avoid-...](https://www.servethehome.com/wd-red-smr-vs-cmr-tested-avoid-red- smr/2/)

<comment><USER9> Which is strange, honestly. RAID rebuild is a streaming write from one end of the disk to the other; something which should be the ideal case for SMR, if the firmware catches on.

<comment><USER27> If it is software raid (like ZFS or Btrfs), the writes are random. Plus, it's not clear SMR can be made to accept heavy write load even when the load was predictable.

</comment></comment></comment><comment><USER28> Sometime ago was reading some zfs issues and it was first time I got to know there are SMR/CMR drives. Anyways, they mention exact serial numbers I see in this article. [WD WDx0EFAX drive unable to resilver]([https://github.com/openzfs/zfs/issues/10214](https://github.com/openzfs/zfs/issues/10214))

</comment><comment><USER29> For those wondering what SMR is: [https://en.wikipedia.org/wiki/Shingled_magnetic_recording](https://en.wikipedia.org/wiki/Shingled_magnetic_recording)

Earlier story: [https://news.ycombinator.com/item?id=22875094](https://news.ycombinator.com/item?id=22875094)

</comment><comment><USER30> I don't see how this succeeds. If you read the WD Red product brief, it says "without being tested for compatibility with your NAS system, optimum performance is not guaranteed." Then, the compatibility list I can find shows the Red's have limited options. FreeBSD and Debian weren't compatible, and I gave up after that.

Unless you can show that your hard drive is causing problems on something they claim compatibility with, it doesn't seem like they'd be liable. One of those times where they're clearly in the wrong, but not legally at fault.

</comment><comment><USER31> WD20EFRX, one letter off, I could have had a winning ticket

<comment><USER32> A ticket to a one time $15 rebate on WD products (expires in 6 months) 5 years from now.

Oh boy refrain me from celebration.

<comment><USER33> Any hope they will throw in some credit monitoring protection ?

</comment></comment></comment><comment><USER34> I have the blue 6TB, but am not in the US. I've emailed the lawyers to see if I'm eligible to be part of the class action (I'm guessing not)

</comment><comment><USER35> Does anyone know what alternatives we should be looking at? Have a single 4tb Red (non SMR) running in a Synology box and I need to add another drive.

<comment><USER36> I just overhauled my entire synology array and my original purchase was two reds and two seagate ironwolves. I ended up returning the reds because they were disconcertingly loud and performed poorly, which it turns out was probably because they were SMR drives!

I'm using four of the seagate ironwolf drives now and they have been fine so far. Equivalent price point and capacity, slightly quieter than the WD. Just make sure to check whether you're getting SMR or not - the ironwolf NAS drive line is not SMR according to Seagate's docs that I read but definitely verify for yoruself.

</comment></comment><comment><USER37> Is there any similar action for those who live in EU?

<comment><USER38> Consumer protection agencies and similar can potential force some "free exchange" program on them.

But here is the think: From the iXsystems blog post you can learn that not all SMT drivers so lead to errors on rebuild. Just some of the FW versions do. Other drivers might still lead to big slow downs but it's not clear if all SMT drivers slow down to a unacceptable degree. Weather it not a newly added drive is fresh/was cleaned seems to also affect this. Lastly while the drives are marketed as NAS usable they have a list of supported NAS systems. And don't give any guarantee for performance on other systems.

Given all this my guess is that after fixing faulty firmware version they will at most provide some form of we update the firmware for you service if you can show that you are using a supported NAS system. ...

And then if any consumer protection agency or similar acts in the EU that program might also be available there.

Through that just my sold guess. Thinks can be very different, e.g. not just a firmware bug.

</comment></comment><comment><USER39> Are these disk stable? That's the only thing I care about. Not interested in performance, as HDDs are used as archives.

<comment><USER40> If you use them as JBOD, they should be perfectly stable, just a little slower at writing than at reading. But as said by sibling, not stable in a RAID.

<comment><USER17> SMR isn't "a little slower" depending on your workload, but massively slower (RAID rebuilds are just one example).

Do not buy SMR if you have any kind of write-heavy workload, or if you rely on consistent performance (e.g. any kind of streaming / latency sensitive usage).

</comment></comment></comment><comment><USER41> [https://www.youtube.com/watch?v=nGcwVYbkePs](https://www.youtube.com/watch?v=nGcwVYbkePs) is very informative around the reasons for SMR and the problems around them.

</comment><comment><USER42> I put together a NAS a few months ago, apparently with two of the SMR 4TB WD Red drives configured in SHR-1.

Does anybody know if that's going to be a problem? Or am I fine as long as the next drive I add is CMR?

<comment><USER43> In the case of drive failure, the RAID rebuild will probably take days, not hours. If failure isn't something you're concerned with, or you only ever read and never write, it's not an issue.

Otherwise, you will probably be interested in replacing them sooner rather than later.

<comment><USER42> I would have expected that for a 2-drive system, a RAID rebuild would only be writing to the replacement drive. What data would be written to the old one?

Under that assumption, my strategy is to isolate these drives in their own 2-drive RAID volume until they fail.

</comment></comment></comment><comment><USER44> I can't see any information about when they started doing this? The Red drives have been available for a long time, have they always been SMR or did WD switch them out at some point?

<comment><USER45> They switched them, quietly, but only for some products at some sizes. A subtle change in the model numbers is the only clue when you're ordering.

There was a lot of press coverage of this a few weeks ago when the story first broke, including here on HN. It looks like the lawsuit reported here is the first formal legal action in response.

<comment><USER38> That's why I have a dejavu.

</comment></comment></comment><comment><USER46> I was a long time loyal Red user until now. There's other NAS drives now I'll try</comment>


Trade Of Google+ "likes" Growing Into A Lucrative Business  - <AUTHOR> http://www.itproportal.com/2011/07/26/trade-google1-likes-growing-lucrative-business/

<comment><USER2> This happens with all social media and you cannot really prevent it. It's just people who want to beat the system. It works too, if you are careful (Google will try to detect it eventually and prevent it).</comment>


How Python implements super long integers? – Python Internals - <AUTHOR> https://arpitbhayani.me/blogs/super-long-integers <comment><USER2> The right way to make that comparison would be using libgmp or libmpfr to begin with. No? Not by using machine integers/floats. This blog just compared apples to oranges and concluded apples are tastier.</comment>


Should Startups Have Ping Pong Tables? - <AUTHOR> http://www.markevans.ca/2015/12/22/ping-pong/ <comment><USER2> maybe. if the group likes it why not as long as it doesn't become a major distraction. I'd probably have a budget and let the group decide.</comment>


Zlib in serious danger of becoming obsolete - <AUTHOR> http://richg42.blogspot.com/2016/01/zlib-in-serious-danger-of-becoming.html <comment><USER2> All a compression does is choose what will compress to less than the input size, and what will compress to greater or the same input size. Pigeon hole principle.. Whatever gains are supposedly had over zlib mean that these other compressions are assigning meaning to other aspects that might not deserve to be pigeon holed to smaller input sizes.

Theres no magic in compression, if I make unintelligable garbage artifacts compress, I lose that domain for compressing intelligible repeats or other reasonable patterns.

A good compression always values patterns OF intelligible deliberate meaning -- theres no holy grail. Zlib is very competent at this.

<comment><USER3> Modern compression has an entropy code step where you have a probability of seeing a symbol. And yet DEFLATE, the algorithm zlib is based on, uses Huffman coding, which means probabilities can only be integers. Arithmetic coders (like Brotli uses) and ANS-based coders (like BitKnit uses) have support for fractional probabilities. So already, the improved entropy encode step means that you get some gains. They're not perfect in any case, but they're a wide improvement on most data.

zlib, the library, isn't even perfect. You can easily get more out of DEFLATE by simply replacing the compressor with a smarter one, e.g. Zopfli.</comment></comment>


Overstock.com Rebrands itself as O.co. Smart or Dumb?? - <AUTHOR> http://ryanspoon.com/blog/2011/03/09/overstock-rebrands-as-o-co/

<comment><USER2> Maybe this is because I do not have an MBA but I'm completely confused why a well known (near household) name brand with a .com domain name would switch to o.co, which no common person would even recognize as a web address if they saw it without context.

</comment><comment><USER3> all i see when i look at that domain is this face:

O.o</comment>


Cuckoo Filters - <AUTHOR> http://mybiasedcoin.blogspot.com/2014/10/cuckoo-filters.html <comment><AUTHOR> The research paper has been recently discussed on HN:

[https://news.ycombinator.com/item?id=8489971](https://news.ycombinator.com/item?id=8489971)

I believe this post from one of the paper authors (Michael Mitzenmacher, one of the most prominent researchers on hash data structures) is a much clearer description of the idea.</comment>


Breaking the Law of Demeter is Like Looking for a Needle in the Haystack - <AUTHOR> http://googletesting.blogspot.com/2008/07/breaking-law-of-demeter-is-like-looking.html

<comment><USER2> It is easy to find problems in violations of the Law of Demeter, but difficult to create solutions.</comment>


Welcome to CRISPR's Gene-Modified Zoo - <AUTHOR> http://www.scientificamerican.com/article/welcome-to-crispr-s-gene-modified-zoo/ <comment><USER2> This is reprinted from Nature. What is Nature's relationship to Scientific American?</comment>


Dianne Feinstein Accidentally Confirms That NSA Tapped The Internet Backbone - <AUTHOR> https://www.techdirt.com/articles/20130927/13562624678/dianne-feinstein-accidentally-confirms-that-nsa-tapped-internet-backbone.shtml

<comment><USER2> The big Telcos would get reprimanded if they said a damn thing about anything. Forget about the whistle blowers and read this for a second.

I think there are a lot of people who forgot about CALEA

[http://en.wikipedia.org/wiki/Communications_Assistance_for_L...](http://en.wikipedia.org/wiki/Communications_Assistance_for_Law_Enforcement_Act)

[http://en.wikipedia.org/wiki/Room_641A](http://en.wikipedia.org/wiki/Room_641A)

FOR CRYING OUT LOUD IT WAS EXPOSED IN 2006.

</comment><comment><USER3> "Internet background"! This is coming from our second most senior elected official in charge of this area. Is she a fucking puppet? Yikes!</comment>