Safety, liveness and fault tolerance—the consensus choices - <AUTHOR> https://www.stellar.org/blog/safety_liveness_and_fault_tolerance_consensus_choice/

<comment><USER2> The Ripple / Stellar protocol is bad, so this is not a surprise. Ripple was invented before Bitcoin. Ripple/Stellar requires explicit trust, where Bitcoin does not. Also the distribution was widely known to be gameable (I know many people involved who managed to get free stellar). The only surprising thing is that Stripe and Ravikant invested in a technology which is obviously inferior to Bitcoin. Prof. Mazieré and JedMcCaleb have no significant background in economic research and it shows.

<comment><USER3> I don't agree that Stellar is an "obviously inferior" technology. Stellar just makes different tradeoffs.

I particularly enjoy this quote from [http://adamierymenko.com/decentralization-i-want-to- believe/](http://adamierymenko.com/decentralization-i-want-to-believe/):

 _A centralized alternative to Bitcoin would be a simple SQL database with a schema representing standard double-entry accounting and some meta-data fields. The entire transaction volume of the Bitcoin network could be handled by a Raspberry Pi in a shoebox._

 _Instead, we have a transaction volume of a few hundred thousand database entries a day being handled by a compute cluster comparable to those used to simulate atomic bomb blasts with physically realistic voxel models or probabilistically describe a complete relationship graph for the human proteome._

<comment><USER4> I agree that stellar-like systems might have a role to play in the future, but surely a coin with an incident of corrupted transaction logs is inferior to one without such an incident, all else being equal.

EDIT:

To those pointing out the 2013 Bitcoin fork, good point.

However, in cryptocurrency land, 2013 is ancient history, and I'd argue standards are higher already.

<comment><USER5> Yes, but note that Bitcoin had a blockchain fork in 2013 [http://bitcoinmagazine.com/3668/bitcoin-network-shaken-by- bl...](http://bitcoinmagazine.com/3668/bitcoin-network-shaken-by-blockchain- fork/). Without knowing the details of Stellar's fork I make no comment on the relative severities/merits.

</comment></comment></comment></comment><comment><USER6> " Any distributed consensus system on the Internet must sacrifice one of these features."

is incomplete: a distributed consensus system (which is, at heart, a distributed database) _can not_ have all three features... but there is no guarantee that a distributed database has _any_ of those features.

As with everything else, execution matters.

If you're going to be recording history for financial transactions, you need to put immutability as your first goal. This is not compatible with unlimited space-time separation of trusted inputs, so the second thing you need is to decide how you're going to resolve inconsistent histories. Doing so _always_ involves a centralized trusted system, even if it is fed from a distributed system: someone needs to decide what transactions really happened. You can claim that you have a distributed algorithm to do so (consensus) but that itself will always fall into the same distribution problem.

And that's what seems to have happened here.

<comment><USER4> > ...how you're going to resolve inconsistent histories. Doing so always > involves a centralized trusted system

False, the Bitcoin system resolves inconsistent histories in a completely decentralized manner.

<comment><USER7> One could argue that a block chain fork could invalidate an arbitrary number of blocks at any time, and therefore the Bitcoin protocol does not by itself have this property of being able to tell which transactions really happened.

To limit the number of blocks that could be invalidated in this way, the bitcoin reference implementation contains checkpoint hashes. These are indeed decided centrally.

If you accept the core assumption in bitcoin that an attacker will never control a majority of the hashing power, then there probably isn't a problem and the checkpoint s aren't needed.

<comment><USER8> "One could argue that a block chain fork could invalidate an arbitrary number of blocks at any time, and therefore the Bitcoin protocol does not by itself have this property of being able to tell which transactions really happened."

No, one could not argue that. The economic majority will decide which fork is valid. That's the opposite of centralization.

"To limit the number of blocks that could be invalidated in this way, the bitcoin reference implementation contains checkpoint hashes. These are indeed decided centrally.

If you accept the core assumption in bitcoin that an attacker will never control a majority of the hashing power, then there probably isn't a problem and the checkpoint s aren't needed."

You fail to realize you are not forced to download anything you don't want to. And the checkpoints are hundreds of blocks deep. They don't decide anything the network hasn't already decided (6 blocks deep transactions are considered practically irreversible). The checkpoints ARE needed as an anti-DOS measure (they protect the storage of full nodes from being flooded by forks that could suddenly start to appear at low block numbers). I don't know why people are so eager to spit opinions on things they don't know anything about.

</comment></comment></comment></comment><comment><USER9> I don't know what Stellar is. I had a look at their website. It's a decentralised [1] currency something or other. But this blog post states:

> We were able to replay most of these rolled back transactions on chain B to > minimize the impact

And

> To ensure no ledger forks going forward in Stellar, we have decided to > temporarily only run one validating node until the new consensus algorithm > is live

I don't see the decentralisation here?

[1] [https://www.stellar.org/learn/#Decentralized_network](https://www.stellar.org/learn/#Decentralized_network) "This means that the Stellar network does not depend on any single entity"

<comment><USER10> They have de-decentralized so that there are no more ledger splits. Sort of embarrassing but understandable. It is understood that they will re- decentralize once they get a new consensus algorithm I guess.

<comment><USER11> Joyce from Stellar here. Yes, that is correct. When given the choice between temporary centralization and guaranteeing the security of the protocol and therefore user funds, the choice is obvious. Once the new consensus algorithm is complete, it will be safe to run with more than one node again.

<comment><USER9> How'd you centralize your decentralized system? It sounds like something that shouldn't be possible unless it's actually centralized to begin with.

I'm a layperson when it comes to crypto currencies, but my impression is that most people would consider the fact that you can centralize a bug (separate to the hiccup you had in the article).

<comment><USER12> I'm just guessing here, and I hope that Joyce or someone from Stellar could correct me if I'm wrong. It could be as simple as announcing that you're going to make this change to de-decentralize, describing what that process entails, and asking all the invested parties (in this case validating nodes) to follow suit. I imagine that the process is similar to when bitcoin has done a hard fork in the past. The bitcoin core developers see the need for a hard fork, announce the hard fork, and ask everyone to update. If the majority of nodes agree than the hard fork was successful. So in Stellar's case, they could be asking people who run validating nodes to update their software, or to simply modify their UNL to point to only a single node (similar to seeding your bitcoin client with only a single peer). I think (and hope) that the Stellar Foundation doesn't have the ability to actually force people to de- decentralize.

<comment><USER11> Howdy - so at the time of the ledger fork, the Foundation was running all 5 of the validating nodes and there were other parties not associated with us that were running non-validating nodes.

We do not have the ability nor do we want the ability to control other people's nodes.

Since Stellar only launched 4 months ago, the number nodes in the network was still small. In the future, when the network is on the new consensus system and able to run safely in a truly decentralized, then it would be up to individual nodes to decide what to do.

Hope that clarifies things.

<comment><USER13> Why wasn't anyone else running a validating node? Where is the code for the validating node?

</comment></comment></comment></comment></comment></comment></comment><comment><USER14>
      "Prof. Mazières's research indicated some risk that consensus could fail, though we were nor certain if the required circumstances for such a failure were realistic."

I'm surprised to see the above statement in a press release; maybe it was not worded quite right. At the scale of 100s of thousands, or a millions of transactions a day, "some risk" will manifest itself on operation timescales itself. So when one is "not certain" it's always best to assume that problems will show up and it will take less time than expected.

      "We are still investigating the triggers for this consensus failure, but believe it is caused by the innate weaknesses of the Ripple/Stellar consensus system outlined above compounded by the number of accounts in the network."

Also not great wording. Saying the system had "innate weaknesses" and we "believe" kind of implies engineers are still guessing on the trigger. Your building a financial corporation and if you lose you loose everything

</comment><comment><USER15> Ripple Labs' response:

[https://ripple.com/why-the-stellar-forking-issue-does-not- af...](https://ripple.com/why-the-stellar-forking-issue-does-not-affect- ripple/)

(Ripple Labs develops the software that Stellar modifies for their own use, and the original Ripple network still runs on unmodified Ripple Labs software. Stellar was started by Jed McCaleb, who founded Ripple Labs, but broke with the CEO last year.)

The Ripple consensus protocol puts certain requirements on the topology of the network of transaction-validating nodes in order to work properly. They are still investigating, but it's possible Stellar's network fell outside the workable range. Ripple Labs manages their network topology more carefully than Stellar, and this incident may validate their approach. We'll have to see what actually happened.

</comment><comment><USER16> I'm somewhat familiar with Bitcoin, and I've heard of Stellar, and my sense is they are related - both a decentralized consensus based ledger system. I'm wondering if the problem that Stellar encountered is something that Bitcoin has some resistance to. Anybody have some insight?

<comment><USER2> Stellar is not decentralized. If problems like this occur, there is the Stellar organization /corporation, to enforce consenus. Whenever there is a legal entity behind it, it's not de-central. Bitcoin has solved all these problems. Ripple was invented before Bitcoin. Stellar is a Ripple fork.

<comment><AUTHOR> Stellar is not _currently_ decentralized. The use of a single validating node is a temporary measure while they rewrite their consensus algorithm. This is obviously far from ideal, but the Stellar foundation has been transparent that this is a temporary measure. In the original design, and in their stated mission that they've never wavered from, this will be a open protocol where anyone can join as a validating node. But they needed a stop gap measure while they fixed this ledger fork issue. Again, far from ideal, but let's not jump to harsh conclusions either.

</comment></comment></comment><comment><USER17> Well it was to be expected, Ripple scammed thousands of users with similar promises

They re-branded as "Stellar" \+ somehow got Stripe to give them a mention and the scam repeats

</comment><comment><USER18> Scary! I just pulled my money out of ripple.</comment>


Ask HN: Why I can't upvote on a comment? - <AUTHOR>

I asked this question yesterday in a comment and someone pointed me to read FAQ.
Well, I did. There's something about 'preventing from abuse'. How come all of my up-votes considered as abuse? I mean, I can't upvote any comment here. <comment><USER2> I had this on occasion (one reason I now only upvote and downvote very rarely now) in the past - and know a large number of regulars have too.

Im guessing the formula is just throwing a false positive; you will get it back in a few days.

pg has never explicitly commented on what constitutes "abuse" in the mind of the system - I assume to avoid gaming/avoidance :)

<comment><AUTHOR> I guess, in the past I upvoted too often, since I've been waiting a month.

I was wondering that it may be so because I gave away too much upvotes compared to my karma.

I say 'Thanks' to you, instead of an upvote :)

<comment><USER2> I cant recall how long it took for mine to come back.. it could have been a month or two.

(this was on about 2500 Karma I think too; so I dont know if that does affect it).

It turned me into a "mostly reader" anyway :(</comment></comment></comment>


Microbenchmarking Mono's new GC - <AUTHOR> http://gonzalo.name/blog/archive/2010/Jul-17.html

<comment><USER3> why are so many benchmarks done so badly statistically?

the benchmark was run once: we have no idea if this was a fluke or not. hopefully the author didn't repeat and pick the best.

at best the numbers reported can be considered some mean. the mean is not a robust estimator: [http://en.wikipedia.org/wiki/Robust_statistics#Examples_of_r...](http://en.wikipedia.org/wiki/Robust_statistics#Examples_of_robust_and_non- robust_statistics)

one sample is enough to distort the mean. furthmore we've no idea how typical this run was: there should be some measure of spread.

<comment><USER4> Zed, is that you? :)

<http://zedshaw.com/essays/programmer_stats.html>

I think we've seen that already. Mean is "good enough" for most programmers apparently. And to be honest in many cases, it's ok. It was a microbenchmark, not a big evaluation of latency of both algorithms.

<comment><USER3> you only know the mean is good enough if you examine the spread and/or use a robust estimator.

spikes happen in performance (for better and for worse) all the time. one spike is enough to totally distort the mean, no matter how often you repeat.

it might be a microbenchmark but to paraphrase: if it's not done well, it's not worth doing. the complete opposite of what the microbenchmark purports to show could be true most of the time.

<comment><USER4> I agree with you from the point of view of people doing proper statistics. Mean is not good enough.

Then again - let's say I'm a user of some library and I trust the developers to do the right thing and test the new implementation against the old one. The thing that is of interest to me is whether on average on my random test I still see the difference. He did. Sure - the whole test is flawed, may be incorrect, etc. In reality - he just verified something he already knew/expected against his random data. No matter how much we care about correctness, he's still right on some level. There's a visible improvement even on this random test and if he tried it at least 3 times we can assume that the new GC is worth looking at if you had issues with the previous one.

"if it's not done well, it's not worth doing"? I'd say - if it answers your question, it's worth doing. If you assume the question was - "can I verify that the new GC is better in my random not-scientific test on a specific dataset", then everything's all right.

And I do hope that the person writing the new GC will publish some better stats.

<comment><USER3> 1\. the point of doing statistics properly is to try to remove your bias about what you think the results are: every developer who has worked hard enough on a problem, probably thinks they made an improvement. it's a good idea to test this, statistically, as you might be surprised.

2\. the article didn't repeat anything, at all. it's not even on average (at least, as it's reported). as far as i can tell, he ran a test once and reported the result.

3\. the point is that judging from one sample or a mean on a small sample does not answer any reasonable question because the (unrepresented) uncertainty in the answer could actually mean the result goes either way in general.

btw, what i'm suggesting isn't some deep, complicated statistics! i'm suggesting the most basic, elementary statistics. this is super, super basic stuff. high school kids here know about the mean and standard deviation here.

if you want to be more principled about things kind of thing, you could either do some kind of hypothesis test (e.g., a two-sample t-test adjusting for variance would be appropriate here) or use a Bayes factor to compare the two hypothese (better, not better).

</comment></comment></comment></comment></comment><comment><USER5> It looks like a promising improvement. From the sound of it, this seems like the same sort of GC methodology that Java used the last few revs (1.5; 1.6): putting objects in "recent" and "old" pools.

That said, I would like to see a benchmark that _uses_ a bit more memory, not just temporary stuff to be discarded ASAP. Many of the Java promotion benchmarks do that too (focus on use of transient data only). What happens if you actually need to hold on to some state, rather than merely concatenating somebody's account info into a dynamic index.html page in a web app?

Oh well, there's always memcached, I suppose. It would be nice to have languages that support app types other than stateless-as-possible web apps.

<comment><USER6> Generational GC's are what almost every high-performance VM uses and this approach is well-tested in many practical systems. Almost all aplications tend to allocate large amounts of temporary objects, while having large amounts of memory consumed by long-living objects (I would assume that at least one half of used memory in this case are long-living objects). Also, because generational GC is almost invariably copying GC (it is possible to make non- moving generational GC, but that is more of academic interest) it tends to improve caching behavior, which is even more important with each new generation of CPUs.

Main reason why copying and generational GCs are not used everywhere is that they tend to generally complicate matters when you want to seamlessly interface with C code (non-managed code in .NET terms), because objects then tend to be moved around by GC, which has to see and be able to update every reference to it's heap.

In most applications and runtimes, there are a lot more behind the stages objects allocated by VM and or library routines than objects that you allocate directly in your code.

Edit: and I think that Sun's JVM uses generational GC at least since 1.3, if not 1.2.

<comment><USER7> as a side note, bohem's gc is also generational <http://www.hpl.hp.com/personal/Hans_Boehm/gc/#details>

<comment><USER6> But generational collection has to be explicitly enabled by GC_enable_incremental() and whole thing looks especially experimental. Main problem is that you cannot reasonably maintain remembered set(or grey set for incremental GC) without write barriers and write barriers are not practical when you cannot modify compiler.

</comment></comment></comment></comment><comment><USER8> Looks good but one bit triggered WTF:

> Mostly precise scanning (stacks and registers are scanned conservatively).

Why would you code a conservative garbage collector for .NET?

<comment><USER6> Because of i386. i386 has not enough registers to be able to efficiently divide them into pointer-only and non-pointer-only. For stack case it is often worthwhile to use calling convention reasonably similar to what C/OS uses, but examining that mess is not practical for GC, so it's better to just scan stack conservatively (which is by the way done by many other generational GCs).

Edit: also you can implement conservative scan of stack and registers on Unix without writing single line of assembly code by scanning result of getcontext(), or even almost completely portably by scanning result of setjmp() + some heuristics for finding stack in memory.

<comment><USER9> .NET is statically typed though, so it's possible to make a static determination at each GC point which registers and stack locations contain pointers.

<comment><USER6> Possible, but probably not practical.

And especially in case of .NET which offers pretty tight integration with unmanaged code, you can have various stack frames with layout completely out of your control on stack (I'm not sure whenever such stack frames must be scanned for pointers, but they will certainly complicate any attempts to analyze stack structure).

<comment><USER9> _Possible, but probably not practical._

It has certainly been done in various Java implementations. HotSpot I'm pretty sure does precise garbage collection.

Native stacks don't need to be scanned for pointers, but the VM must of course keep track of which parts of the stack are native.

<comment><USER10> What you do is stop the world for a moment, set a GC due flag, and then wait for threads to come to GC-safe points. At GC safe points, the set of live registers and stack locations is definitely known.

<comment><USER6> This does not work when you can have threads executing arbitrary native code, that can do some non-GC related work for essentially unbounded time, which is certainly case with .NET. In JVM any native code tends to be prepared to cope with this somehow, but .NET is explicitly designed to be able to seamlessly interoperate with random COM and legacy native libraries, so you cannot guarantee that such native code will get back to GC safe point in any bounded amount of time.

Edit: you can do stop-the-world GC at any point of program whan you scan stack conservatively, GC-safe points are only needed for precise scanning of stack and registers, so this is problem only when you want to be fully precise. Fully precise GC is certainly better when it is possible, but conservative scan works mostly well enough.

<comment><USER10> Arbitrary native code is just fine - all you need to do is catch it when it returns back into the CLR. Native code can't (legally) have access to any managed memory that isn't already pinned. Since you (by you, I mean the CLR) control the call point to native code, you control the return point too - <USER2> can patch the instructions after the call if necessary.

<comment><USER11> What happens if the native code enters, say, an infinite loop?</comment></comment></comment></comment></comment></comment></comment></comment></comment>


Aaron Swartz Documentary – The Internet's Own Boy - <AUTHOR> http://www.kickstarter.com/projects/26788492/aaron-swartz-documentary-the-internets-own-boy-0 <comment><USER2> I find the blurb on this Kickstarter very off putting. It describes Swartz as both an "Internet pioneer" and "programming pioneer". Both seem exaggerated.

Also, I find the whole 'first name terms' thing where the director calls him "Aaron" all the time annoying. I saw the same thing when I was involved with Alan Turing-related events where people would refer to him as "Alan". They did not know him (in either case).

Note to future people: when I'm dead don't refer to me as "John" as if I was your friend or property.

<comment><USER3> > when I'm dead don't refer to me as "John" as if I was your friend or > property

What do you want people to call you -- "Mr. Graham-Cumming"? I wonder if that preference is based on your age or based on British culture (or maybe a little of both?). I think it's common to refer to virtually everyone in our society by their first name -- Bill Gates, Steve Jobs, Warren Buffet, etc. You never hear them referred to as anything except their first names. Maybe I'm misunderstanding your point...

<comment><USER2> I guess if someone were writing a hagiography of me I'd prefer that they use "Graham-Cumming", e.g. "Graham-Cumming was best known for knowing too much about GNU make and..."

Could be age or culture related; could also be that it's almost midnight and I'm patching another fucking WordPress vulnerability.

<comment><USER4> I agree that using someone's first name can be overly personal and insincere. OTOH last name comes across as formal and stuffy.

How about using their internet handle?

<comment><USER5> That depends on whether it's a personal handle or a public alias. eg an IRC nick on a private channel would be no different to their first name or a real life nickname amongst their friends. However a public handle like _dmr_ (in the case of _Dennis Richie_ ) is -in my opinion at least- little different to how recording artists and actors often choose a pseudonym (eg _David Robert_ Jones uses the stage name _David Bowie_ )

</comment></comment></comment></comment></comment><comment><USER6> My armchair criticism is that a good documentary is both embracing of AND skeptical of its subject. Can this project, given its angle and backing, possibly resist canonization?

<comment><USER7> I think the "avoiding canonization" ship has long since sailed.

<comment><USER8> Slate and the New Yorker both did a great job avoiding canonization in their Aaron Swartz profiles. But those two publications have been the exception.

</comment></comment></comment><comment><USER9> All I needed to hear was: "My last feature documentary was We Are Legion: The Story of the Hacktivists." It was an outstanding documentary that managed to accurately describe anonymous --a feat in and of itself given how many entities in the news seemed incapable of doing so-- and didn't shy away from calling out its negative antics and highlighting the negative aspects of decentralized action, in addition to mentioning the positive effects.

Given Knappenberger's proven track record thus far, I have every reason to believe this would be an outstanding documentary if funded.

</comment><comment><USER10> > we have decided in the spirit of open access to release the film digitally > through a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported > License

I do not believe that Aaron would have agreed with the use of this non- freeculture license.

<comment><USER11> Explain? Is this some offshoot from the original Creative Commons licenses that Aaron co-invented?

<comment><USER12> A licence like that, applied to software, would not count as Open Source, nor as Free Software. Hence it is not Free in spirit.

<comment><USER13> On the other hand, even if you remove the NonCommercial provision it is still not equivalent to Open Source or Free Software, as the _actual_ source is not being distributed, merely the end result.

Sure, it's easier to mashup video than compiled executables or libraries, but even CC is not quite equivalent to a software license.

<comment><USER14> Well, it says in the campaign text:

WE HAVE ALSO DECIDED AFTER THE FILM IS COMPLETED TO RELEASE THE RAW INTERVIEW FOOTAGE AND POST IT TO THE INTERNET ARCHIVE IN SAN FRANCISCO THROUGH A SIMILAR CREATIVE COMMONS LICENSE.

(caps in original)

</comment></comment></comment></comment></comment><comment><USER15> Is not a little too much? This young person was unfortunately very ill with depression and that was the primary reason of his death. There are currently dozens of persons unfairly facing prison and they do not kill themselves and they face his destiny even if that means years of prison. I think it's better to honor those persons, they stay alive and fight. Idolizing a suicide victim is wrong. Suicide is a mistake, is a disease.

<comment><USER16> I don't think he's being idolized because he committed suicide. He's idolized because of who he was and what he accomplished. He still deserves recognition even though he committed suicide and his recognition isn't based on his suicide.

<comment><USER17> Looking at the general reaction around HN to Swartz before and after his death, I find it very hard to ascribe his recent idolization to anything but his suicide.

He was certainly deserving of praise, but his post-suicide lionization (and subsequent Carmen Ortiz bashing) does send some icky messages regarding suicide and its effect on one's legacy.

<comment><USER18> I'm inclined to agree with this view. Regardless of how he died, I think there would have been a bit of idolization, but I have trouble imagining someone making this documentary had he died in a car accident.

</comment></comment></comment></comment><comment><USER19> Do his parents / Taren support this? The title could easily cause some (likely unintended) grief. The internet wasn't too kind to Aaron when he turned there for help when he was down, why he'd be its 'own boy' now is a bit weird.

</comment><comment><USER20> I personally would find a documentary about weev/Auernheimer much more interesting. I'd throw some decent money at that, just because listening to his mixture of genius and craziness is utterly entertaining.

<comment><USER21> I'm guessing you're probably referring to this, which is, as of now, $8k from its goal: [http://www.kickstarter.com/projects/2120630809/the- hedgehog-...](http://www.kickstarter.com/projects/2120630809/the-hedgehog-and- the-hare-documentary-project-on-t)

<comment><USER20> Thanks for pointing that out! Didn't really know about that. Going to pitch in. Would love to see it more focusing on trolling and the culture of lulz. But if it has to be on the serious side, that's good enough for me to support them.

</comment></comment></comment><comment><USER22> There is also a Kickstarter for a documentary in progress entitled The Hedgehog & The Hare, about Aaron, Weev, and the CFAA that they were both charged under. I was interviewed for it on Friday. The guys making it are really cool and talented, it's shot really well, and they're only looking to raise $15k (vs the $75k the OP is seeking).

       http://www.kickstarter.com/projects/2120630809/the-hedgehog-and-the-hare-documentary-project-on-t

</comment><comment><USER23> This doesn't say much about what they've actually done so far. They say it's "currently in production", but don't specify what that means. Have they interviewed anyone? Who? Who's agreed to be interviewed? It's going to be a very different documentary if they interview Taren Stinebrickner-Kauffman and Carmen Ortiz.

<comment><USER24> The trailer that they have there seems to show that they've interviewed quite a few people. But yes, they did not mention who they will interview as a result of the funding and what the funding will allow them to do. They should definitely touch on that.

It would be good if they can get both sides and views in the same documentary.

<comment><USER25> _It would be good if they can get both sides and views in the same documentary._

Not necessarily. It depends on what the story in documentary is about. Absolutely nothing wrong with one POV in documentaries. Real devil is editing and narration which isn't structural in its function. By structural narration I mean narration written only to shorten some prologues to sequences in the story structure itself. With narration and editing you can distort your story in any way possible. I found out, through experience, that with sensitive subjects it's best to avoid narration altogether and tell story only through editing. Careful editing, where you weave story only through what you've been told by carefully selected interviewees.

</comment></comment></comment><comment><USER26> I very much wish I would've had the chance to be more involved with and affected by Aaron and his life. As the events have unfolded, I've felt like a bystander in a kingdom who lost a prince I never knew. I didn't know Aaron personally, only being connected by occasionally reading his blog posts and using software he affected.

The Kickstarter video for this campaign has given me a depth of knowledge, understanding, and connection when it comes to Aaron and his affect on the world and technology. I haven't come across a source, yet, that was able to illustrate his importance, humanity, and influence. Unfortunately, I don't see an external source for the video.

I would invite anyone wishing to know a bit more about Aaron, and the whole debacle, to watch the video.

</comment><comment><USER27> This morning it was <http://www.atotaldisruption.com>, now it's this. Such amazing projects. So easy to spend lots of money....

</comment><comment><USER28> I have high hopes from the project and I will most likely back it, but I found the last document by the director: "We Are Legion: The Story of the Hacktivists" some what lacking.

I guess it was more about trying to bring the story to your average Joe rather than dive in super deep, I get that they have to cover the basics for larger audience.

</comment><comment><USER29> I'm in. I'd like to see a documentary about Aaron Swartz.

</comment><comment><USER30> Internet pionner? Common! This has gone to far, a movie just for that kid? No way! At most he is an entrepreneur with great ideas that had a lame death.

</comment><comment><USER31> Kickstarter is staring to suck. I used to donate just like that. No. account etc.. Button click donate. Now I'm forced to create an account. Forced to use Amazon. I have a Paypall account. Not possible anymore. It sucks. I wanted to donate 50 dollar. I still might because I find it important to support all those people that care. There is NO need for Kickstarter at all to create barriers.

</comment><comment><USER32> Isn't he playing a lot with the music in his documentary to make the watchers feel like what they're watching is bigger than what it seems? I really like the audio but I feel it's a little too much play on the emotion. It's no different than any other TV Show, Movie, Documentary,etc., yet it just seems more obvious in this case.

</comment><comment><USER33> Made me ill to see Carmen Ortiz being made a prosecutor for Boston last week and her making public statements again.

</comment><comment><USER34> The more I read about Swartz, the more I feel awful what happened to him.

</comment><comment><USER35> It's a shame they do not accept bitcoin..</comment>


BZFlag: open-source, portable, online multi-player game - <AUTHOR> http://bzflag.org/ <comment><USER2> Man, I remember playing BZFlag in college, over 10 years ago. Fun to see it's still running...

<comment><USER3> Me too, but I remember I didn't like when the rules allowed jumping. :)

<comment><AUTHOR> There are maps that don't allow jumping. Ducati maps, for example. All sorts of variations are possible.

</comment></comment></comment><comment><USER4> Every few years I check in with BZFlag again and have a few moments play .. and get absolutely trounced by .. whoever/whatever .. is playing on the server I join. It's been very rare that I play for longer than 10 minutes .. just because its so darned frenetic and chaotic that its hard to get into the flow. I wonder if that has changed this year .. time to go find out. ;)

(I used to love playing Spectre VR [[http://en.wikipedia.org/wiki/Spectre_(video_game)](http://en.wikipedia.org/wiki/Spectre_\(video_game\))] back in the day, multiplayer.. if BZFlag is too crazy, I may just try to rig up a Spectre VR network locally for my kids and me to have a few bashes...)

<comment><USER5> There is also ZeroBallistics: [http://www.zeroballistics.com/downloads.php](http://www.zeroballistics.com/downloads.php)

<comment><USER4> Thanks for that, looks fun! There's something very appealing about tank games, it seems - both from the 'hmm, I'll write my own' angle as well as the 'spend hours in a virtual tank blowing things up' side of things. I guess it really appeals to some primal instinct .. at least, in my case I know its true. :)

</comment></comment></comment><comment><USER6> Probably my favourite game ever. Played mainly by die-hard experienced players. There's always talk of the game dying off, but still, here it is alive and reasonably well! The graphics would not impress anybody who is used to modern multiplayer games, but the gameplay is second to none. Easy to learn, difficult to master. And great fun to boot. Give it a try!

<comment><USER7> Actually the graphics are way past obsolescence and now in thoroughly classic territory - I believe they are now an asset to this game !

</comment></comment><comment><USER8> Somehow the red icon on the homepage instantly reminded me of the tank view of Bolo. I remember wasting hours playing it on the university network many many years ago...

[http://en.wikipedia.org/wiki/Bolo_(1987_video_game)](http://en.wikipedia.org/wiki/Bolo_\(1987_video_game\))

</comment><comment><USER7> Still rocking and the highly stylized graphics makes it great family fun with my daughters !

</comment><comment><AUTHOR> It's a 3D tank game, with user-designed maps.

There's roughly two types of play: league play, and not. The former are either CTF or 1vs1. The latter are any of free-for-all, CTF, or rabbit hunt.

Head on over. It's fun.

</comment><comment><USER9> This is a thoroughly enjoyable game, especially with laser beams and the invisible cloak.

</comment><comment><AUTHOR> We need more league players... It's really fun folks, come on in!

</comment><comment><USER10> Its in Arch's [extra] repo, which is convenient.

</comment><comment><USER11> So basically this is Quake but with tanks?</comment>


How Goodyear Hid Evidence of 'Worst Tire in History' Linked to at Least 9 Deaths - <AUTHOR> https://jalopnik.com/how-goodyear-hid-evidence-of-the-worst-tire-made-in-his-1822200424 <comment><USER2> This being the 'Worst Tire in History' will come as big news to the Firestone 500 (7+ million recalled). Yay, hyperbole.</comment>


Habits Are The New Viral: Why Startups Must Be Behavior Experts - <AUTHOR> http://techcrunch.com/2012/02/26/habits-are-the-new-viral-why-startups-must-be-behavior-experts/?grcc=33333Z98 <comment><AUTHOR> This is a bit old but it's a very interesting way of looking at startups.</comment>


A Soviet Pilot's Defection to Japan Benefitted MiG – Russia Beyond - <AUTHOR> https://www.rbth.com/blogs/continental_drift/2016/09/27/how-a-soviet-pilots-defection-to-japan-benefitted-mig_633575 <comment><USER2> A geopolitical example for why keeping your startup in stealth generally hurts more than it helps.</comment>


Ask HN: Are Herman Miller chairs worth the money? - <AUTHOR> They seem to be priced at 10x the commodity price, anyone have one? If not, anyone have a chair they still love after 5 years? <comment><USER2> I still use a HM Aeron that's about 12 years old. Surprisingly it has held up well. They aren't super comfortable but I like the fact that it breaths. My kids have Aerons also and sit in them way too much. They love them. My wife likes Humanscale (she has one at the office). The Steelcase Leap is popular also.

Everyone has their preference. I have heard 24 hour chairs are the most comfortable but have never tried one. They are typically used in environments where someone will be sitting in it 24/7/365 ( [http://endura- gsa.com/](http://endura-gsa.com/) )

Here's a site that might save you some money if you're looking to buy a task chair. I think they might be refurbished but I'm not sure. The prices seem good.

[https://www.madisonseating.com/](https://www.madisonseating.com/)

You can always try FB Marketplace or Craigslist for a used one and save a few $$$.

<comment><USER3> I have seen HN comments saying madison seating refurbish using cheap non- genuine parts: [https://news.ycombinator.com/item?id=22553667](https://news.ycombinator.com/item?id=22553667)

What's the verdict?

</comment></comment><comment><USER4> Potentially. There's still a significant difference in quality between inexpensive and expensive chairs, so the expensive chair should last you longer in addition to being more comfortable. I bought a really nice leather chair about 6 years ago that is still in very good shape. The leather is still perfect, the cushions aren't deformed, and the mechanism is in good shape. It only needs to last another 14+ years before I break even :) The real reason I bought it is comfort though; my back was starting to hurt after sitting in my old chair for an hour or two, and this chair doesn't cause that problem at all.

Good furniture is usually worth spending real money on.

</comment><comment><USER5> I like my ergohuman chair a lot. Pretty sure it's over 5 years old now. Can hardly sit in most chairs due to discomfort. Never a problem with this one. Unlike most chairs, it has very pronounced lumbar support, I believe that's the biggest factor making it comfortable for me.

Never used an Aeron so can't compare. But the standard version looks like it has rather poor lumbar support. So I'm guessing I'd find it uncomfortable.

</comment><comment><USER6> Definitely buy a used one from an office surplus warehouse, they're a great buy!

</comment><comment><USER7> They're totally worth it.

</comment><comment><USER8> I have 2. They are great. Buy them used. If you do the the math they are pennies a day.

I got bigger wheels to make them easier to roll on carpet.

</comment><comment><USER9> Worth it, finally got an Aeron in April for home use having been used to them for years in offices and it's just awesome, no more pain and not sore.

</comment><comment><USER10> I got a used Aeron for $240. Best chair ever.

</comment><comment><USER11> I use a HAG Capisco and pretty happy with it. 800€ well invested...

<comment><USER12> Can confirm that. During WFH / COVID-19 my HÅG Capisco 8106 is a life (back) saver.</comment></comment>


Google develops prototype mirror for solar energy - <AUTHOR> http://news.cnet.com/8301-11128_3-10460913-54.html?part=rss&subj=news&tag=2547-1_3-0-20

<comment><USER2> I feel bad. I was distracted when I opened the article... so my eyes went like this:

1: headline: "Google develops prototype mirror for solar energy"

2: picture of rather bald man with some mild reflection going on <http://i.i.com.com/cnwk.1d/i/bto/20090910/Bill_Weihl.jpg>

unbidden, my mind connected the two and decided google's new mirror technology was bald men.

I'm so sorry.</comment>


Ask HN: What should I build an iOS API in? - <AUTHOR>

The system will be a CRUD back end for an iOS app, later offering a web app, then otehr clients, etc. I'm outsourcing it, so the choice of language/appserver will be up to the lucky (!) programmer.
Will be RESTful with JSON data exchange. Linux on EC2.
Other than that - what would you say would be the best route for:
- Low system overhead - Fast performance - Low resource usage - Scalability to multiple appservers (eventually)
Ruby on Rails? Pyton / Django? PHP on a framework?
Or doesn't it matter? <comment><USER2> I wish I could provide a strong opinion on a solution good for I/O. I'd need to do research and it's probably what you've already covered, from the sounds of the conversation already here. If I were faced with the decision knowing what I know today, I'd use some queuing system RabbitMQ or other AMQP protocol with a pool of DB servers sucking up requests and processing them. You can maintain a synchronous response with the requesting server via some frontend code (Python w/ Django or Node).

With this setup, you can easily throw more DB instances in the pool to grow with your needs. The frontend should be able to handle as many requests as needed (especially Node which has VERY lightweight threads, I hear). You'll just need to reduce the turnaround time via the queue.

<comment><AUTHOR> Mike this is great, thank you. Good angle for me to think on.

</comment></comment><comment><USER3> Doesn't matter what you use for front end. Ruby used to be a POS VM in terms of performance, but who knows now a'days, but just about anything can return json, so just grab what you can.

Your real pain point is going to be your back end. If immediate consistency isn't important, run a job queue with works in the back end hitting some kind of fast access nosql and have a worker whose job it is to write to a mysql or postgress store. raid the ebs volumes and keep a monolithic volume sister box to take snapshots off. you can have the entire environment scripted and repeatable.

<comment><USER2> I asked ravaa to stop by and give his .02. He's well versed in the world of infrastructure and I highly value his opinion.

</comment></comment><comment><USER4> There is no right answer here. It really depends on what kind of purpose your backend serves. Is it processor bound or I/O bound? How frequently is your app going to hit the backend? How fast do you expect to grow?

<comment><AUTHOR> I/O Bound - very little other than db write/read operations.

Going to hit the backend every transaction as its very stateful so minimal caching can be possible.

Unknown on growth! Hope for the best, I want to take 1000 r/sec on an EC2 instance.

<comment><USER4> If it's write heavy, more than the app server, it will be the DB that will be more important to you. If it's purely I/O bound, node.js might work out fairly well for you. Perhaps you could hook it up with mongodb and it will be pretty. :)

<comment><AUTHOR> I had thought about MongoDB, but bit worried about its global write lock! Surely that can't be a good idea!?

[http://www.mongodb.org/display/DOCS/How+does+concurrency+wor...](http://www.mongodb.org/display/DOCS/How+does+concurrency+work#Howdoesconcurrencywork- Read%2FWriteLock)

Or does that only apply if "safe mode" is on, rather than fire-and-forget unverified writes?

<comment><USER5> The global write lock, while important, is probably the most over-written- about and misunderstood issue. The writelock is only held while the db is actually in the middle of an write and tends to only be held for a very brief period (about 10s-100s of microseconds or less) at a time. For example, it is never held across multiple user actions and therefore is closer to a latch than a lock in common RDBMS terminology. The main cases where this caused issues for users are when some data we needed wasn't already in memory so we went to disk to fetch it (~10ms rather than 10us). One of the major improvements to 2.0 was a framework to yield the lock to allow other work while going to disk that is used in the places where this was seen most frequently in production. 2.2 will plug this in more places with the goal to never hold the lock when going to disk. This work is of course in parallel to work to move to DB, collection, and possibly extent-level locking replacing the global lock in almost all cases.

As for safe-mode, the waiting that it does is always outside of the lock. It uses a cached datastructure that is protected by a secondary mutex so that it never has to interact with the global dbMutex. If you choose to wait for replication or journalling of your writes, that will block the connection and therefore your client thread so single-threaded tests will show much worse performance with the db mostly idle. If you use more client threads or asynchronous I/O connections you should see roughly identical throughput in aggregate (see mongostat) although much higher latencies compared with not waiting.

If you have any questions about this feel free to shoot me an email. Replace the _ with an @ and add a .com to my user name.

<comment><AUTHOR> Thanks Mathias, great advice.

</comment></comment></comment></comment></comment></comment><comment><USER6> It probably does not matter a lot. Find a programmer that has written a server back end to an iOS app before and use what she wants to use.

</comment><comment><USER7> Node.js</comment>


Twitter's Kafka adoption story - <AUTHOR> https://blog.twitter.com/engineering/en_us/topics/insights/2018/twitters-kafka-adoption-story.html <comment><USER2> Twitter loves migrations.

"We will continuously keep an eye on different messaging and streaming systems in the ecosystem and ensure that our team is making the right decision for our customers and Twitter, even if it's a hard decision"

Rather than setting industry direction, they are inclined to changing underlying platform every few years, which brings a lot of challenges. May be it creates work for platform teams. But, its not useful to do this often.

<comment><USER3> I'm curious if there's some conflicting, underlying motives from their senior level technology folks.

They had a game changing tool in Apache Storm...once Nathan Marz (creator of Storm) left twitter, another senior engineer took over that group and created his OWN variant of Twitter Storm called Heron. After much engineering PR and github fanfare [0], couple years later he leaves to start his own company to do 'enterprise heron' [1].

So is the goal here to use something that works well for their end-users? Or is it to create a shiny new tool that they can spin off into a new company?

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

1: [https://architecht.io/streamlio-founders-on-why-the-world- ne...](https://architecht.io/streamlio-founders-on-why-the-world-needs-a-new- streaming-data-platform-bdbb43c3f886?gi=ec98fbc31a6f)

<comment><USER4> The joke that I've heard is "performance (review) driven development".

If the way to get promoted is to launch a shiny new product, then your most senior people will be the best at finding shiny new products to launch, even if that's not the right technical decision to make.

<comment><USER5> "Oh but our senior engineers would _never_ make such a selfish choice to make themselves look better at the expense of the company, everyone here _believes_ in the mission."

</comment></comment></comment></comment><comment><USER6> I submitted a question in previous discussion link[0] but I didn't get an answer by author. But hopefully someone will answer here:

How did you solve producer fencing mechanism which was built into Bookkeeper with Kafka (Assume I need to limit only one client to be able to write to a topic)?

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

<comment><USER7> Sorry for that I didn't understand your question fully, I suggest you to ask question in the slack[link] of BookKeeper community. [link][http://bookkeeper.apache.org/community/slack/](http://bookkeeper.apache.org/community/slack/)

<comment><USER6> Sorry for my bad English. Here is a better explanation:

In Bookkeeper, one producer can fence the current active producer from appending to log. If majority of Bookkeeper nodes respond with OK to a FENCE request, then the current producer can not append to the log. This helps implementing master-slave database replication quiet trivial. Master keeps appending to log, and slaves keep reading from log. In case master fails, one of the slaves sends a FENCE request to Bookkeeper nodes which reliably blocks current Mal-functioning master from appending to db log.

However in Kafka, this isn't a native operation. Any client can push to a topic. There is no easy way to safely do this.

I was looking forward to see how Twitter team actually handled this specific use case.

</comment></comment></comment><comment><USER8> Did they review other Pub/Sub solutions? I'm thinking of NATS in particular.

<comment><USER9> It would be very interesting to see a comparison of Pulsar or LogDevice on Twitter scale workloads.

<comment><USER6> Both Pulsar and LogDevice solve the problem of far-away-consumers with kind of segmenting the log and storing each segment in separate machine to reduce disk seeks and page cache pollution (when c1 reads head of the log and c2 reads tail).

So technically they are better than Kafka. But as the article mentions, they just used SSDs to get around this issue in Kafka. By looking at article the only valid reason to switch to Kafka seems to be KStream.

<comment><USER10> Pulsar has a much better storage system that scales independently so latency stays low regardless of consumer offset. It can also now tier to S3/cloud storage natively and it has many other features like supporting millions of topics and per-message acknowledgements.

</comment></comment></comment></comment><comment><USER10> Why didn't they just run EventBus storage and serving layers on the same machine if they wanted to get better resource utilization?

<comment><USER11> There seems to be a fundamental technical misunderstanding of these systems in the blog post. Unless you're running in the (generally quite dangerous) scenario where replication factor = 1, both EventBus and Kafka have a network hop (Kafka to the replica and EventBus to the storage layer) and JVM traversal, so the argument that Kafka is more efficient there doesn't make sense.

As you say, it would be trivial to run EventBus storage and serving on the same nodes if the network hop were an issue.

The argument that a decoupled storage layer costs more than co-locating storage and serving also seems dubious. The cluster is basically doing the same amount of work when you decouple those layers, it's just separating them into components that can be optimized for specific roles. So if you pick the right hardware/instances for each layer and tune for that, you really shouldn't need more hardware. Otherwise we'd all still be running full-stack applications on mainframes to minimize the number of servers. :)

<comment><USER10> Yes, agreed. It seemed odd because Kafka isn't split into layers so there's no other option, and it confuses resource utilization for number of servers.

</comment></comment></comment><comment><USER12> Slightly off topic, but I feel that when naming one's technical creation it's best to avoid using the last names of famous people especially when that person has become so famous it's become standard to refer to him/her simply by last name. Just google "Kafka" and check out the first page of search results and you'll see what I mean. (No, googling "Franz Kafka" isn't the same)

<comment><USER13> I agree completely. Similarly, I have no idea why the creators of GIMP and CockroachDB (Spencer Kimball and Peter Mattis, and Ben Darnell for the latter) thought those names were the best possible options.

<comment><USER14> CockroachDB at least refers to their marketing line of "almost impossible to kill/take down" and the way it scales to many servers. There are few less gross insects they could have used though like Bees or Ants.

<comment><USER15> Bees and ants don't have anywhere near the same rep for invincibility. Only one of those animals is a stereotypical nuclear apocalypse survivor.

<comment><USER14> They should have went with Water Bears. It can survive even in space. Plus they sound cute (but look scary).

<comment><USER16> We have a conference room named Tardigrade.

<comment><USER11> But any of those are infinitely better than naming something after a letter of the alphabet. That would be a crazy idea, wouldn't it?

(Sorry to all the users of 'R' and 'C' and 'S' and ...) :(</comment></comment></comment></comment></comment></comment></comment>


Ask HN: What's your simple but favourite coding trick? - <AUTHOR> When I started programming, 5-6 months into it, I was introduced to a very interesting trick/pattern by one of my mentors.
func(){

    if() {

    } else {

    }
 }
can be beautifully converted to
func(){

    if() {

        return;
    }

    // Write the else code here.

 }
The reduced indentation gave a weird sense of relaxation. It was such a neat little trick.
What about you guys. Any common tricks which everyone can use. <comment><USER2> From your example, an even more concise way can be written using ternary operations in any C-style language:

        int i = 10;
        bool is_10 = (i === 10) ? TRUE : FALSE;</comment>


Never made a bad decision? May be you avoided all the big decisions | Mini Saga - <AUTHOR> http://www.rajeshsetty.com/2011/06/18/mini-saga-92-action/

<comment><USER2> I'm really not sure at whom this is aimed. Are there really people out there who think they've never made a bad decision?

I've probably made at least sixteen bad decisions already today, and it's not even sunset.

<comment><USER3> Check the poster's submission history and you will understand.</comment></comment>


California bans private prisons and immigration detention centers (2019) - <AUTHOR> https://www.reuters.com/article/us-california-prisons-idUSKBN1WQ2Q9 <comment><USER2> I guess this is nice, but I think the question of "private prisons" can become a bit of a distraction. Maybe they make things worse, but they're not the root of our problems. Consider that California _state_ prisons were trying to save money by illegally sterilizing inmates as recently as 2010.

Here's a great headline to consider: "California Bans Sterilization of Female Inmates Without Consent". 2013. In the United States. Two thousand and god damn thirteen. [https://www.nbcnews.com/health/womens-health/california- bans...](https://www.nbcnews.com/health/womens-health/california-bans- sterilization-female-inmates-without-consent-n212256)

other links. [https://www.npr.org/sections/thetwo- way/2013/07/09/200444613...](https://www.npr.org/sections/thetwo- way/2013/07/09/200444613/californias-prison-sterilizations-reportedly-echoes- eugenics-era) [https://www.theguardian.com/commentisfree/2013/nov/08/califo...](https://www.theguardian.com/commentisfree/2013/nov/08/california- female-prisoner-sterilization)

<comment><USER3> Private prisons have a financial incentive to detain inmates for as long as possible. The prison has some input into when a detainee is released (good behavior, etc) and private prisons have been observed abusing this power. Private prisons also have incentives to find ways to cut costs and often do so in ways which harm detainees. Private prisons also have incentive to lobby for longer mandatory prison terms regardless of whether it makes sense for the crime or not.

Tons of conflict of interest in private prisons which are in addition to the potential abuses associated with public prisons.

<comment><USER4> It doesnt have to be. Why don't they do something like pay private prisons the bare minimum per diem but then offer a trailing commission for every year an ex-con is out of jail past a certain date.

Do the statistics for average time to return to prison, and pay them a bonus every year a prisoner is over that average date for 10 years type thing.

So jails make little money for the incarceration but earn profits from the rehabilitation.

<comment><USER5> What could also make sense is paying the prison a lump sum for the convict instead of a per diem. This changes the incentive structure from keeping people locked up as long as possible to rehabilitating and releasing them as fast as possible.

<comment><USER6> Just skip the rehab step entirely and just release them - it's cheaper for the prison and the increased chance of re-offending means they'll get another lump sum next go around too!

<comment><USER5> That's not up to the prison. The only way for a convict to leave prison early is to convince the State that they are worth paroling.

Therefore, the prison would be incentivized to work with the prisoners to encourage good behavior and to show the parole board that a prisoner is worth paroling.

</comment></comment></comment></comment></comment></comment><comment><USER7> This isn't about protecting prisoners or their rights, this is about protecting the jobs that the California Correctional Peace Officers Association controls and insuring no one else performs this task. Private prisons were forced into accepting CCPOA members but he union set forth in campaign after campaign to rid the state of private prisons.

Back in May Newsom announced he was trying to reduce some of the in excess of thirteen billion dollar prison budget and between allowing more prisoners out, reducing chances more got in, and considering the role of private prisons. However the CCPOA basically went to the legislature which it effectively owns and here is the result. More money instead of less.

It gets wrapped up and sold under a different banner to hide the real move. California state government is under the boot of the CSSA and both are responsible for that the high incarceration rates. go look at any state approaching those numbers and you will find a similar police related organization behind it all.

This all synchronizes neatly with the problems all the recent rallies brought forth. The public sector employee unions that run our police, fire, prison, and education, have so much power that any attempt at reform instead usually ends up with more money going to the very organizations causing the problem. Besides the front facing public relations problem the back end that will soak the public is the largess in the pension and health retirement programs, the very same gold plated programs that resulted in the ACA being hampered from day one.

<comment><USER5> > The measure, which passed the California legislature last month, does not > apply to privately owned prisons operated and staffed by the state > corrections agency.

It does seeem suspicious...

<comment><USER8> Is a "privately owned prison operated and staffed by the state corrections agency" just a rented building?

<comment><USER5> Technically? But a prison is not just any old building. If the inmate population decreases, the owner's couldn't easily turn it into a strip mall, for example. It still means private investment in the continued growth of the prison population.

</comment></comment></comment></comment><comment><USER9> @dang can you add 2019 to the title so people know this is an old article?

<comment><USER10> Emailing them at firstname.lastname@example.com is a better way to get this done, as they see it faster and it avoids meta-conversations like this one lowering the signal-to-noise ratio of the comments.

<comment><USER11> But this way people know that this has already been requested and don't need to keep on spamming emails

<comment><USER12> That's a minor problem. In that case we just say thank you to more than one person.

The real problem is not knowing about the issue in the first place, so it's definitely best to email. Even if you see me replying in the thread, such as [https://news.ycombinator.com/item?id=23501998](https://news.ycombinator.com/item?id=23501998), that's usually because someone called our attention to it by email.

<comment><USER11> Good to know thanks for clarifying, and also great job on moderating, this place is a pleasure to have discussions on thanks to efforts of people like you.

<comment><USER12> Thank you!

</comment></comment></comment></comment></comment></comment><comment><USER13> Would love to see California ban sales of goods made at private prisons as well. Or at least disclose it on the packaging so consumers can make a decision.

<comment><USER14> Wildland firefighting is another thorny issue, where prisoners who choose to fight fires are summarily banned from working as firefighters after release. I'm not sure I'd advocate for removing that choice from prisoners, but the extremely low wage seems unethical.

</comment></comment><comment><USER15> Private prisons have an obligation through shareholders and ownership to maximize earnings/profit. They also have inherently less oversight than an institution that is controlled by the state. Given statement #1 they have a perverse incentive to acquire more inmates and keep inmates longer confined due to receiving govt. funding for their operations every day an inmate is housed. This also includes serving the cheapest possible food and providing little to no benefits. That being said state prisons are no shining beacon of enlightenment and prisoner reform.

</comment><comment><USER16> There seem to be plenty of comments that are OK with private prisons. I highly recommend watching this documentary: [https://youtu.be/krfcq5pF8u8](https://youtu.be/krfcq5pF8u8)

It will most likely change your mind.

<comment><USER17> >There seem to be plenty of comments that are OK with private prisons

Can anyone help me understand their stance? I can see being pro-prison in general, but why pro-private prison? It's not like this specific ask is for removing all prisons.

<comment><USER2> The premise is that government is bad at doing things — like, really really bad, with terribly wasteful spending and little ability to correct it. If the government pays $1B for a service and the private company can do it for $500M then they should be able to offer the services to the government for $750M, and both they and the taxpayers are better off.

Sometimes this works better than others, particularly when the government group who makes the contract are held politically accountable for the quality of the services — e.g. private sanitation services are only going to get so bad before someone runs for office on a "fix the trash" platform. The UK has likewise managed to do a not-entirely-trash-fire job with train franchises, where there are several operators who bid on the rights to operate; if the trains don't run, you can replace one operator with another at the end of the contract. The Southern debacle of recent years is a bit of an outlier (the contract design there was quite unfortunate) and the year of strikes and service outages led to political pressure to do something about the state of affairs.

Accountability is unfortunately rather absent for treatment-of-prisoner politics, though, so it's pretty much hit-or-miss just as regards the basic human dignity.

</comment></comment></comment><comment><USER18> Actual bill:

AB-32 Detention facilities: private, for-profit administration services.(2019-2020)

[http://leginfo.legislature.ca.gov/faces/billTextClient.xhtml...](http://leginfo.legislature.ca.gov/faces/billTextClient.xhtml?bill_id=201920200AB32)

Rant: Why are the medias constitutionally incapable of linking to the actual bill? Third millennium. It's all online. Cite and link your sources. Unbelievable.

Edit: Somehow The Guardian is capable of using links. Maybe it's a British thing. Here's their version of the same story. [https://www.theguardian.com/us- news/2019/sep/12/california-p...](https://www.theguardian.com/us- news/2019/sep/12/california-private-prison-ban-immigration-ice)

</comment><comment><USER19> I can understand private prisons (which make up a small percentage of overall prisons).

However, what will be the solution for people that come into the US illegally, if not temporary detainment?

<comment><USER20> hospitality

<comment><USER21> If we're going to have free movement it should probably be via a proper agreement, like in the EU. Not a mishmash of contradictory state and federal policies. And it should be mutual - if Mexicans and Canadians can live in the US, Americans should be freely allowed to live in Mexico and Canada.

<comment><USER22> We should also have standards like the European Union. And one of those standards should be that any country participating should not be run by warlords.

<comment><USER23> At risk of godwinning, by this logic the US should never have taken in all those Jewish scientists fleeing Nazi Germany... Or any of the many, many incredible Iranians I've known and worked with in my life. Often the best people are fleeing intolerable conditions.

btw, the Open Borders graphic novel is fantastic: [https://www.smbc- comics.com/openborders/](https://www.smbc-comics.com/openborders/)

<comment><USER22> Oh no, we can take mexicans in of course, we just should't have open borders. I would hope that, when the US took in Jewish scientists, there was a mechanism in place to make sure they didn't take nazis disguised as jewish scientists.

<comment><USER24> We took Nazi scientists too, and they didn't have to disguise themselves. They built our rockets and put us in space.

</comment></comment></comment></comment></comment></comment></comment><comment><USER25> Seems to me like increasing the use of house arrest is so much preferable to prison, for everyone involved. Just have it monitored properly. Maybe ankle bracelet, an GPS monitoring. With meal delivery, and health checkups, it could be cheaper too than housing someone in a prison. Have them take online classes and possibly let them work online to offset the costs of the monitoring. Or some sort of program to trade time served for working in nursing homes taking care of the elderly.

<comment><USER26> Where this is actually being tested, f.ex. some Scandinavian countries, the "inmate" is allowed to leave their apartment for work and necessary errands like grocery shopping or doctor visits. It's much better for everyone to let the inmate work than sitting on his arse all day watching netflix.

</comment></comment><comment><USER27> Shouldn't the date be included in the title? [October 11, 2019]

</comment><comment><USER28> They should just pay the prisoners to not repeat the crime

<comment><USER29> Then you have to pay everyone. Otherwise you will radically increase crime, because people will want that free cash.

</comment></comment><comment><USER30> Ban JPay next.

</comment><comment><USER31> The concentration camps and child prisons the US is operating presently are mostly in Texas and the southwest, so this won't have much meaningful effect on the situation.

<comment><USER32> Isn't California southwest? I mean it borders on Mexico and the Pacific ocean.

Or is "southwest" in American usage synonymous with Texas?

<comment><USER33> many of us consider southern califoria part of the southwest, but not so much the central and northern parts. similarly with texas, the southwestern parts, less so with the rest.

that's because that's what borders mexico, and we have a politico-cultural fascination with that border in particular.

<comment><USER34> To me, "southwest" is sand and cactuses. San Francisco isn't the southwest because it doesn't have that sort of climate. Also because 37°N doesn't seem meaningfully "south" relative to the continental US as a whole.

I don't think it has much to do with Mexico. Nevada (well, Las Vegas anyway) seems the "southwest" to me, and Nevada has no border with Mexico.

<comment><USER33> sure, that might be the picture that pops into our heads, but the reason we think about the southwest as a thing at all is not because we all love the desert.

<comment><USER34> I'd say we think of the "Midwest" because it's flat and the "South West" because it's sandy and hot. These clearly are geographic regions, like Pacific Northwest, (which has evergreen forests and mountains). If your point is these regions would have different cardinal names if borders looked different, that might be true, but that's not exactly profound and it's certainly not a matter of a _" politico-cultural fascination with that border in particular."_</comment></comment></comment></comment></comment></comment>


Solving Artificial Intelligence's Problem with Gender and Racial Bias - <AUTHOR> http://time.com/5520558/artificial-intelligence-racial-gender-bias/ <comment><USER2> This doesn't really sound like _bias_ to my ears. Rather, it's more like the many tales we've all heard of someone implementing a system in one context, and having it produce surprising results in a different context.</comment>


Building a Scrabble MMO in 48 hours - <AUTHOR> http://www.startupmonkeys.com/2010/09/building-a-scrabble-mmo-in-48-hours/

<comment><USER2> It's really interesting to see what went into this before the competition. I'm on one of the other teams that'd doing pretty well in the voting (we built Drawbridge: <http://team-hyphen.no.de/>), so it's especially interesting for me to see what other teams did.

Much as I'd love to win, Drawbridge isn't near the level of polish that Scrabb.ly and a few of the other top apps are, and I think a lack of preparation is the main culprit. We had a general idea of what we were going to build and how it was going to be designed, but we had to scramble several times to redesign and rearchitect essential components. (We did our server- side API design without accounting for the fact that we were going to be using websockets, completely overlooked the fact that we'd have to come up with an API for our DAO or anything on the client side, had to completely redo how variations and their UI worked, and had to come up with a homepage design all within the span of the competition.)

Still, it's been an incredibly fun ride. In the absolute worst case I built a tool I've been wanting for a long time but haven't been able to find the time to build. In the best case, other people find it useful too--having other people liking and using things I've built is one of my biggest motivators.

I've also learned a ton about making a successful app for one of these competitions. If I could do it again there are a lot of things I'd do differently. (Luckily, Rails Rumble is coming up, so I can!) I've been meaning to write up summary of what went right and what went wrong for us, and how we could improve. Would anyone else be interested if I turned it into a blog post?

<comment><USER3> And in case the upvotes dont' convey the sentiment, yes, I think we would be interested.

</comment></comment><comment><USER4> Semi offtopic:

Can anybody tell me about an appropriate data structure for computing Scrabble (or any crossword) short of full-out walking a 2d grid? I've read a bit about Tries and Directed Acyclic Word Graphs, but those seem to just be for optimizing dictionary matching, and don't seem to account at all for the actual structure of the board (especially not the possibility of colliding with other branches when adding new words).

I'm 90% certain it'll come back right back to needing a global and explicit a 2d grid when I try to build in a board with static score multipliers, but ignoring this for now and just trying to lay out letters: is there a masochistically-functional way to compute Scrabble/crosswords without working on an explicit 2d grid?

<comment><USER5> Have to ask... what would the motivation be to use anything other than a 2d grid to represent something that, in the real world, is a 2d grid?

<comment><USER4> Well, finding the best word for a given tile rack played on a given position can be expressed staggeringly simply in Haskell. I'm just wondering if there's some clever way to store and search a whole board without getting into something messy and halfway-imperative. Something that can be expressed as mostly a composition of simple library functions.

Plus, I've always had issues with multidimensional structures -- I can never quite settle on what's the most intuitive way to express them.

</comment></comment></comment><comment><USER6> Really interesting and (should the authors read this) thanks a ton for sharing it. I am curious about one thing. I sort-of already know the answer, but will ask anyway: I saw in the post that you used Pusher for handling your realtime updates across clients (looks like a very cool service, btw). Isn't part of the strength of node.js and socket.io that things like push-based client/server apps are/should be trivial to implement without resorting to a third party service? If so, did you try? And do you know if other node knockout apps use pusher? (I assume that a: it saved a little time and b: was an easy way to get around Heroku's current connection limits, but want to know if there was more to it than that).

<comment><AUTHOR> Using heroku in pre-alpha meant we couldn't use websockets. Since we were very used to Heroku, we figured we'd just accept this limitation and work around it (with PusherApp). Turned out to be a great decision since we never would have had time to implement websockets I don;t think. It's definitely not hard with Node, but it does take some thought and configuration.

For server->client event triggering, PusherApp has got to be the easiest possible solution out there. Also had really nice documentation with a quick getting started example.

<comment><USER7> FYI we used Socket.IO-Node for our NodeKO app. It didn't require any time or configuration at all - and I had zero experience with node.js prior to the first day of the competition.

Most of all, it comes with a client library socket.io.js which has nice fallbacks for browsers that don't support websockets yet. I highly recommend it!

</comment></comment></comment><comment><USER8> So far the only thing that I don't like about it is that I can't find the "edge" of the damn board to place a tile. I'd recommend adding a button that takes you to a spot with some available space on the edge of the board.

<comment><USER9> He mentions at the bottom they'll do this after the judging ends on Friday.

</comment></comment><comment><USER10> (Caveat: IANAL) He says in the article they're expecting a C&D from Hasbro, but I think the chances of that are less than they think. Games like "Words with Friends" and "Lexulous" haven't had many problems, and they are blatant rip offs with minor variations.

<comment><USER11> It's the use of the word "scrabble" that's the problem.

<comment><AUTHOR> Haha. Yeah, Scrabb.ly is just about the closest you can get to Scrabble. I seem to recall Scrabulous getting sued out of existence for much less.

But you're right, once we change the name, url, and drop the Scrabble references, I think it should be fine going forward.

</comment></comment></comment><comment><USER12> Insane use of tons of reusable parts. I was hoping he would go more into if he went comet or websocketd and the kind of latency people were seeing when hundreds of users were connected to node.js

<comment><AUTHOR> Yeah, sorry. If we had tried to do that ourselves, we never would have been able to release anything. PusherApp was incredible to work with though. Why reinvent the wheel?

<comment><USER12> Oh all your front end communication was with pusherapp? so thats how jquery was communicating with your server?

<comment><AUTHOR> We just did client->server communication through traditional ajax requests. PusherApp just helped us easily provide the server->client event triggers.

</comment></comment></comment></comment><comment><USER13> No disrespect intended. The app looks fabulous, but the 48 hours limitation is not so bad if you have lots of time to prepare. For me the tough part about programming has been the architectural design and the research put into the tools and apis. Everything else is just typing. Having said all that the developers are still super talented to have pulled that off.

</comment><comment><USER14> How was the infinite 2D scrolling implemented? Is it available as a library somewhere? Thanks.

<comment><AUTHOR> It was custom built. However here's a good component you might like: <http://ianli.com/infinitedrag/>

</comment></comment><comment><USER15> Aw, no 50 point bonus for using all 7? ([http://skitch.com/dasil003/dw9q4/scrabb.ly-a-massively- multi...](http://skitch.com/dasil003/dw9q4/scrabb.ly-a-massively-multiplayer- online-crossword-puzzle))

<comment><AUTHOR> Fixed now! :-)

<comment><USER15> aw yeah!

I supposed I may need to refresh to get the new app.js? (I still have the same game going).

Also, what about blanks not registering double/triple word scores?

</comment></comment></comment><comment><USER16> Offline Site: www.startupmonkeys.com

</comment><comment><USER17> These kinds of events are insanely fun. We had a student-run 24 hour game programming competition at my school for the past three years. This year my grad school friends are finally making it a bit more legit, with a website and support from the school: <http://osgcc.org/>

We're primarily coders, so the design suffers a bit, but the line about "By the end of the third day, I was barely coherent enough to spell the swear words" made me smile.

If you've never been to an event like this, you should.

</comment><comment><USER18> This is so awesome.</comment>


Teal and Orange - Hollywood, Please Stop the Madness - <AUTHOR> http://theabyssgazes.blogspot.com/2010/03/teal-and-orange-hollywood-please-stop.html

<comment><USER2> Here's an alternate explanation for the phenomenon (linked to from the blog post): <http://prolost.com/blog/2010/2/15/memory-colors.html>

The origin of the idea is to preserve skin tones and other "memory colors" (stop signs, taxi cabs), regardless of how the rest of the scene is rendered (bright or drab).

So it's not that film colorists are intentionally making everything teal and orange (or actually maybe the lazy ones are now that's it's become something of a cliche.)

<comment><USER3> That post links to this one: [http://www.squarefree.com/2004/03/05/color- constancy-illusio...](http://www.squarefree.com/2004/03/05/color-constancy- illusion/)

I knew the gray-tone checkerboard but this is a very surprising illusion. I opened the image in Photoshop and had a hard time believing the effect: <http://screenjel.ly/oHDkBcDFnoQ> (video, no sound)

</comment></comment><comment><USER4> It's interesting that the vast majority of us would have seen all those films and never noticed... I get the feeling that now every time I watch a recent movie I'm going to be thinking of this post.

<comment><USER5> As a photographer, this post is way full of crap - look at famous photographs, and you will see the _exact_ same thing even _before_ the days of Photoshop.

These colors are used because they _work_ , and they project a certain effect on your images. Blaming this on the advent of computers is disingenuous - photographers have been shooting at Golden Hour for generations to capture the contrasty orangeness since God knows when.

<comment> cool-RR He said that computers have caused this _in movies_ , because now every frame can be manipulated separately.

<comment><USER5> Right, but I fail to see how a valid artistic theme in photography suddenly becomes lazy me-too-ism when applied to film.

Art goes through phases - maybe there was _that guy_ back during the Renaissance complaining about how all the sculptures looked the same, etc etc. This is simply the way art goes.

<comment><USER6> Sometimes technology makes it easier to do something, and then people do that thing more than they did before, to the point where they're doing it too much.

It's like AutoTune in music: people have always tried to sing in tune, but now they can sing _even more_ in tune, and so current pop music has almost lost the naturalism and emotional effects produced by subtle variance in pitch.

<comment><USER5> Isn't that simply a matter of aesthetics though? I don't much like autotune either, but I'm willing to admit the possibility that it's simply because I grew up listening to a different aesthetic.

We've certainly lost a lot of aesthetics as art styles changed over time - when's the last time you saw a good tapestry? I don't see this as particularly bad, though, it's simply "the way it is" in art. Periodically we will exchange one thing for another, and life goes on.

<comment><USER7> No, it's not an opinion, autotune is evil :)

</comment></comment></comment></comment></comment></comment></comment><comment><USER8> Akin to color compression, various recent popular music is clipped into a fairly narrow range of frequencies, and with Auto-Tune filters applied to the voices.

Listening to music with a (larger) dynamic range and with little or no Auto- Tune can make the differences apparent; you start noticing similarities to the flanging effect used with the voices of the Goa'uld in Stargate series.

Like reel-change marks in the old days, once you notice this sort of stuff, you're doomed.

<comment><USER4> I still see reel-change marks ('cigarette burns') fairly often these days! I guess most of the cinemas you're going have digital projectors?

<comment><USER9> What really will get to you is that quite often during the reel change they'll stop the audio. Rarely does the music or sound remain continuous through the change. Quite often the new reel starts with dead silence. And just like the marks, once you notice this you'll never stop noticing it again.

</comment></comment></comment><comment><USER10> I believe this trend started with "The Fifth Element", one of the first movies to use a lot of orange. That film was visually striking at the time, because Orange was such an eye-catching color. It was also avant-garde, because Orange was considered very tacky mid-ninties.

The Fifth Element came out several years before the millenium. If you'll recall, Orange was hailed by the fashion world as the color of the millenium.

Fifth Element was styled by Jean Paul Gaultier, who is one of the few avant- garde designers to reach the highest echelon of respect in the fashion world. It is because of his rare ability to combine costume and high fashion.

Disappointingly, the visual effect of The Fifth Element is now lost. Much of its shocking visual palette is now standard. Such is fashion.

</comment><comment><USER11> So, nearly limitless freedom gives everyone the option of looking the same.

<comment><USER12> "When people are free to do as they please, they usually imitate each other." <http://despair.com/connot.html>

<comment><USER13> I like your quote, but why does it end with a link to the '90s?

<comment><USER12> Just the first thing that came to mind.

</comment></comment></comment></comment><comment><USER14> He's complaining about hacky techniques in a Michael Bay movie? Outlandish! When have you ever been able to look at Hollywood blockbusters as serious art?

This whole thing smells like confirmation bias. There are plenty of movies being made with broader/different color palettes. If you chose to watch Transformers 2, that's nobody's fault but your own.

</comment><comment><USER15> This is the visual equivalent of destructively loud mastering on popular music. It's interesting to see that the same tradeoff applies to both formats: postproduction techniques add generic excitement and "pop" to an entertainment experience, at the cost of making everything look (and sound) alike, which reduces the dynamic range of the experience.

(Edit: <http://en.wikipedia.org/wiki/Loudness_war>)

</comment><comment><USER16> As part of trying to become better (through necessity) at web design, I've been discovering the best way to learn about design is to find pet-peeve rants by good designers.

This one is going to give me something to chew on.

<comment><USER17> I don't like pet-peeve rants because they rarely tell you how to find something original that works. They're very quick to tell you what doesn't work, and perhaps a little bit of why, but they don't really give much insight into how to find good alternatives.

For example, if you have a lot of faces in your film, how do you make them "pop" and stand out without using lots of teal?

<comment><USER16> I should have been more clear. The rants are interesting because they highlight things that have been subtly bugging me, but I don't know why.

In this case, I scroll through and look at all of those pictures, and I know something is wrong. It takes someone with talent and experience to talk about the color balance. That gives me something concrete I can look for when I try to put together designs -- don't just go and get yourself complementary colors and then just go nuts with the contrast.

<comment><USER18> in honesty, as a designer, you should refine _your own_ taste. Know what you like, what you don't. Be unashamed of this: it's what separates your work from others'. Once you do, you'll have 'the angry years' where you go off and rail against this or that to everyone you know (blah blah lucida blah blah poor attempt at contrast harmony blah blah composition not dynamic blah blah).

But all the while, this is developing your internal taste barometer, things you love and things you won't stand for. This will influence your work in every way possible, from things like stroke width (looks too constructivist!) to decisions about texture (halftone again?!, what is this, the 50s?)

I'll agree that it's good to keep up with what other people bitch about (gotta keep up with the zeitgeist!) but it's often funnier than informational, and more often, their posts lack substance or rally around some shallow point that you no longer care about. I mean, yes, i've seen the golden rectangle, i studied maths, but _i_ don't buy the whole "look! look! the golden ratio is EVERYWHERE!" argument that is basically what this webpage boiled down to. But that's my own taste talking.

</comment></comment></comment></comment><comment><USER19> They won't stop. Warm-cool color combos (orange/yellow vs blue, teal vs orange, cyan vs red, steel vs red etc.) provide the most color contrast, so the picture always looks "bright" and "vivid" to a casual viewer.

BTW, the trick is far from new. Some examples that come to mind are Aliens and Terminator 2 (blue/gray vs red/orange, done via lighting) and Empire Strikes Back (again, blues vs reds/oranges -- very well nuanced across the entire movie except the Yoda swamp scenes).

See also: "Superstimulus": <http://wiki.lesswrong.com/wiki/Superstimulus>

</comment><comment><USER20> I'm surprised nobody has mentioned Colour Psychology or Colour Symbolism yet and how these two colours are used to illicit a desired emotional response from the viewers.

<http://en.wikipedia.org/wiki/Color_psychology>

<http://en.wikipedia.org/wiki/Color_symbolism>

I would suggest that these colours are used rather deliberately for that very reason.

I've reposted some meanings of the two colours below for reference.

 _Orange combines the energy of red and the happiness of yellow. It is associated with joy, sunshine, and the tropics. Orange represents enthusiasm, fascination, happiness, creativity, determination, attraction, success, encouragement, and stimulation._

 _Blue is the color of the sky and sea. It is often associated with depth and stability. It symbolizes trust, loyalty, wisdom, confidence, intelligence, faith, truth, and heaven._

</comment><comment><AUTHOR> I'm gratified many of you liked this submission.

You can see this effect a lot on TV too. I think CSI began with a conscious act of manipulating the color palette via computer. Contrast that sort of color bias to rendering true colors via photography in a series such as Miami Vice (made well before there was this possibility).

<comment><USER21> The Matrix did the same thing--all the scenes that took place in the matrix were tinted green.

</comment></comment><comment><USER22> It is true, colour grading has gone crazy in today's movies. I find it so amazingly distracting. Fortunately there are still some tastefully graded films being made. Even Avatar was pretty nicely coloured.

Like all fashions, this will change with time.

</comment><comment><USER23> Complementary. Complimentary is something else altogether.

</comment><comment><USER24> END THE MADNESS!

Bring back Black and White...

</comment><comment><USER25> I dunno, the CSS color scheme of this site is definitely orange (and almost teal in the background, at least on my monitor). I think this is a bigger conspiracy than we imagined.

<comment><USER26> And when I got the ability to color the top nav at some N karma, I unthinkingly set it to teal (or cyan, in my words.) Now that I think about or, it really does make the Y "pop"...

<comment><USER27> Eep. I had mine set to #00bbdd until 10 seconds ago...

<comment><USER28> Argh. #00aaaa here, and I've even seen this rant before. Just didn't think about it.

<comment><USER29> Mine's green #66ff00. I copied it from the color of old greenscreen CRTs.

I still like that color best for coding, my shell, etc.

</comment></comment></comment></comment></comment><comment><USER30> I saw this post a few days ago, and then today noticed the trailer for Repo Men is almost EXCLUSIVELY teal and orange.

</comment><comment><USER31> I find it ironic that this is posted here on HN, where the top color is orange. (Of course, I like teal and orange and once had a wardrobe with a lot of those two colors in it.)

<comment><USER32> Of course, I long ago personalised my top colour away from Orange. Alas, I changed it to Teal.</comment></comment>


Demystifying C++ lambdas - <AUTHOR> http://blog.feabhas.com/2014/03/demystifying-c-lambdas/ <comment><USER2> > _Basically, lambdas are syntactic sugar, designed to reduce a lot of the > work required in creating ad-hoc functor classes._

Abstraction inversion. Lambda is a much simpler idea than all this C++ stuff used to explain it. Languages should have lambda first, and bullshit like "functor classes" second, if at all.

<comment><USER3> Lambdas are not particularly complicated, but the way to make them simple is to compare to other language's implementation, not other C++ features.

<comment><USER4> It depends on who are you explaining it to.

If you are explaining it to a seasoned C++-only programmer it makes sense to explain lambdas in terms of other C++ features. Even more if lambdas are based internally on said features.

<comment><USER5> I'd disagree there. If you explain it only in terms of what is already there, then the question "So why bother?" comes up.

If I were to explain classes as "Suppose you have a struct, and a set of functions that were required to have that struct as their first argument", then classes wouldn't seem to have a point.

If I were to explain polymorphism as "Suppose you have a table of function pointers in each struct, and whenever you want to call a function, you first look it up", then virtual function pointers wouldn't seem to have a purpose.

<comment><USER6> OTOH if you only explain why you add this feature and not how it is done, then 1) the 'magic' sense of the feature may bother developers who likes to know how things work 2) you don't understand the limitations of the feature linked to the implementation. So both how and why are needed, me I prefer an explanation of 'how works X' before 'why use X', a short 'why' followed by 'how it is implemented' and a more detailed 'why' is best but YMMV..

<comment><USER2> I agree that users of a programming language should understand the implementations and costs of its abstractions. That said, I think lambda is an important enough abstraction that it should just work as the math says, without arbitrary limitations. Anything less than that is a point against the language. This paragraph from "History of T" [1] is interesting:

> _Good Scheme compilers use a range of implementations for the lambdas in the > program, depending upon what they can determine about the lambdas at compile > time -- how they 're used, to where they are passed, the relationship > between the uses and the definition points, etc. Some lambdas just evaporate > into nothing. Some lambdas turn into control-flow join points with > associated register/variable bindings. Some lambdas turn into stack frames. > But some lambdas cause heap allocation to produce general closures._

[1] [http://www.paulgraham.com/thist.html](http://www.paulgraham.com/thist.html)

</comment></comment></comment></comment></comment></comment><comment><USER7> In most cases, lambdas are rvalues. That can have an impact on its scope and lifetime.</comment>