Most of Europe Is a Lot Poorer Than Most of the United States (2016) - <AUTHOR> https://fee.org/articles/most-of-europe-is-a-lot-poorer-than-most-of-the-united-states/ <comment><USER2> This looks like a heavily opinionated article with a questionable use of data.

Others have mentioned the lacking focus on inequality already, so I want to add some other points:

While European countries have lower GDPs, their citizens work less hours than Americans[1] and spend less on health care[2] while having similar or longer life expectancies. Privatized education might similarly inflate GDP numbers without improving the actual quality of life.

The author - funnily enough a specialist for tax competition and board member of the Cayman Financial Review - is way too eager to draw political council from this apples to oranges comparison.

[1] [https://en.wikipedia.org/wiki/Working_time](https://en.wikipedia.org/wiki/Working_time) [2] [https://data.worldbank.org/indicator/SH.XPD.CHEX.GD.ZS](https://data.worldbank.org/indicator/SH.XPD.CHEX.GD.ZS)

<comment><USER3> Speaking in the very narrow view of tech, if you work in tech in the US you are likely to make anywhere from 2 to 5 times as much as in Europe, including taxes and healthcare costs.

There simply is no comparison. Switzerland comes second, with the UK or Canada next.

Europeans always mention free healthcare. But when your salary in the US is triple before taxes then the healthcare costs are irrelevant.

The absolute truth is that by choosing to work in Europe rather than the US, you're losing potentially millions of dollars by time you reach retirement (with compounding interest investments) -- as an average individual contributor. If you're a high performer, you might lose far more than that.

Entry level grads in the US can in some cases be paid more than _senior_ developers in the EU.

<comment><USER2> I agree the US provide a very high materialistic living standard if you are well-educated or rich - but as you said, focusing on the tech sectors is a very narrow view on societies as a whole.

As an European working in tech I really don't care about those millions of dollars. My income - very low on the SV-scale - is more than enough to live a comfortable life.

Compared to the Anglosphere this also means that there is a lot less pressure in regard to getting priced-out with a median salary. Public transport & infastructure is great, university education is cheap and housing is affordable (not just for me, but also my friends in other industries).

Personally, this feels more egalitarian and I prefer it to a society with higher GDP that comes with more inequality.

</comment></comment></comment><comment><USER4> I've lived and worked in Canada, USA, UK, Japan, and Germany. I've also done a fair bit of traveling.

Yes, on a per-capita GDP basis, the USA is technically "ahead", but when it comes to daily living, it's FAR behind. During my 6 years in the USA, I saw roads falling apart, terrible infrastructure, litter everywhere, crime and poverty the likes I've never seen outside of third world countries. The only thing even close to the USA was urban UK, which (other than parts of Southern Europe and Paris) is probably the dirtiest of the Western European countries. But even they weren't as bad as the USA. (Bear in mind I lived in the UK in the late 90s. Things may have changed since then)

Put simply, the quality of life in America was FAR worse than any other country I've lived in.

The consumption index is also not the greatest measure, since it has a lot to do with consumer attitudes & materialism, which are different in most of the world compared to America and Japan (I've never seen materialistic attitudes as strong as there).

After moving to Germany, I have no desire to live elsewhere.

<comment><USER5> As someone in tech who chose to grow their career in Canada instead of the US (where I could easily make double), I very much appreciate your comment.

I still haven't discarded the possibility to move to Europe, as there are aspects of the lifestyle here that I have a hard time getting used to. Comes to mind: the high amount of drug users and mentally ill people screaming on the streets, completely ignored by the state.

Are there any metrics for quality of life that take into account happiness?

<comment><USER4> Hmm, this site might help: [https://www.theearthawaits.com/](https://www.theearthawaits.com/)

Generally, you want to live in a place with a low disparity between rich and poor. They'll usually have lower crime, lower social problems, better maintained infrastructure, lower corruption, better culture. Scandinavia is probably the best you can get, if you don't mind the cold ;-)

</comment></comment></comment><comment><USER6> There is so much wrong with this article.

First of all, a lot of the "yellow" areas in the post-soviet block, that were catching up in the past 30 years. The standards of living are increasing there every year.

Secondly - GDP is the weirdest metric possible to measure the quality of life. Even purchasing power index is not as good, because it ignores the things that the government gives for semi-free. Growing in one of the poorest Polish regions, me and my friends' families could buy fewer iPhones, and cars were a distant dream, but we had free public education, free healthcare, cheap but decent housing, and the public transit.

I wonder if the post's author has actually been to any of the poor European regions - even comparing them with rich US, they look seriously decent.

</comment><comment><USER7> Yeah, looking at GDP per capita rather than median income totally disregards the inequality that makes $54k/person ludicrous to describe as typical in the US.

<comment><USER8> Usually rich and poor means net wealth, not income.

Median net wealth per adult, in US dollars is relatively good measure. US is ranked 22 globally. Source: "Global wealth databook 2019" (PDF). Credit Suisse. [https://www.credit- suisse.com/media/assets/corporate/docs/ab...](https://www.credit- suisse.com/media/assets/corporate/docs/about-us/research/publications/global- wealth-databook-2019.pdf)

European countries ahead of the US: Luxembourg, Belgium, Ireland, France, UK, Spain,Austria, Italy, Malta, Norway. Interesting how many countries (France for example) is ahead of Germany in both mean and median net wealth per adult.

In the US 34.5% of population has wealth between 100,000 USD and 1 million, In UK 44.8%, France: 46.3%. US has significantly more people with wealth over 1 million. German Gini index is 81.6, France 69.6. USA 85.2.

EDIT:

Table 3-3 is super interesting. Membership of top wealth groups for selected countries, 2019. (absolute number of people).

Over USD 100,000; Number of adults (thousands)

       China           113,410
       United States   103,198
       Japan            55,370
       Germany          26,012
       United Kingdom   25,388
       France           25,110
       Italy            23,284

China already has more people with wealth over 100,000 USD. (20.8% of total) than any other country. No wonder why US companies want to stay in Chinese markets.

<comment><USER7> And yet more than half of Americans don't have $400 to cover an emergency. I wonder how the US would stack up in 25th percentile wealth against European countries?

Also, there are measures like food insecurity that I suspect would be very telling.

<comment><USER9> Per the government, the median American household has >$1000 remaining every month after all ordinary expenses, far more than enough to cover a $400 emergency. The "can't cover $400" trope doesn't imply what you think it does, it is pulled out of context from a survey about _how_ people would cover an emergency, not whether they could. Many popular financial stats used in the media are misleading in service of a narrative.

As another example, you'll see many articles stating some large percentage of Americans don't have any savings, which is only true because they define "savings" as having a savings account, which many Americans with plenty of money don't even have (myself included). And then there is the one about Americans having no retirement savings, where "retirement savings" _excludes_ any real estate investments, taxable brokerage accounts, etc which is where many Americans have the majority of their retirement savings.

The "food insecurity" surveys are a similar story. Same with "food deserts". If you dig into the underlying studies none of them imply what the media tries to imply with them. It is a hazard to uncritically accept statistics from the media. They have an incentive to paint the most dire story possible.

<comment><USER10> > Per the government, the median American household has >$1000 remaining every > month after all ordinary expenses

Could you link the source? I'd like to see what is included in "ordinary expenses." Is it just CPI associated things?

<comment><USER9> The term of art for this is "discretionary income". I think it is a more informative than disposable income, but it is much harder to find for many countries. The US Bureau of Labor and Statistics (BLS) publishes surprisingly detailed statistics on consumer expenditure at decile resolution which allows it to be easily computed.

Discretionary income is defined as disposable income after you subtract housing, utilities, food, clothing, healthcare, and transportation costs based on actual survey data. Roughly speaking, discretionary income is the amount of money available for saving or spending on fun. If you want to know the mean and distribution of how much a person spends on eggs or fresh vegetables in each decile, the BLS can tell you that. It also tracks a lot of non-essential expenditures. It is a great resource.

Here is the combined report from BLS for 2018:

[https://www.bls.gov/cex/2018/combined/decile.pdf](https://www.bls.gov/cex/2018/combined/decile.pdf)

</comment></comment></comment></comment></comment></comment><comment><USER11> I have my doubts about some of the statistics in this article (Groningen the number 6 wealthiest place in Europe? I'm not so sure about that) but I can't deny that wages and freely expendable income in the US are much higher than most of Europe.

However, with the work ethic and the hours many US workers pull to maintain those standards, I'm not so sure if I'd want Europe to move towards the rich American standard.

From a rich man's perspective, which many of HN's readers are very likely to know because this crowd is seemingly highly educated or intelligent through their own pursuit, the US does allow for a better standard of living than most of Europe. The wages are higher, the taxes are often loert and there's better access to luxury items.

However, in pursuit of happiness, I'd prefer less work and more free time to enjoy the fruits of my labour over amassing wealth. Having access to expensive laptops instead of needing to cheap out is nice, but what's the point if you barely have time to enjoy your purchase?

There's also the perspective of poor, uneducated people. In a lot of cases I'd much rather be jobless or stuck in uneducated labour in Europe than in the US with the Labour rights situation in a lot of states. The right to work system means you have a lot more power if your boss depends on your skill, but if you don't have any unique skills or can't sell them, the same power can be turned against you to limit your options. The employee-oriented labour protection a large part of Europe enjoys is worth more to me than he ability to get a raise or leave for another employee tomorrow.

I wonder what this article would look like if it weren't written by an economist, but rather by someone researching general happiness. I'll take poor and happy over being rich and unhappy any time, and wealth can only add so much to your hapiness.

</comment><comment><USER12> The argument in this article is double stupid. The obvious reason why it's stupid (economic metrics vs quality of life metrics) is already pointed out by other comments. The not so obvious one is that the article compares current metrics but to really compare effect of the policies on the economics you need a long term measures of change because European countries and USA obviously had a very different starting places cos WW2 and USSR collapse.

</comment><comment><USER13> What about health care costs? A big difference in much of the eu is that a health emergency won't bankrupt you.

<comment><USER14> I fully agree that we need to fix health care for the uninsured and underinsured in the United States.

However, do you ever wonder why so many Americans aren't voting for socialized healthcare? In reality, most of us aren't at risk of going bankrupt from a health care emergency. Again, I fully agree that _too many_ people are at risk of going bankrupt from a healthcare emergency, but it's not the norm for the average American like you might read online.

The United States does actually have government health care programs for low income and disable people (Medicaid, covers approximately 23% of the US population) and for elderly (Medicare, covers people 65 and over). We also have government subsidies for lower income people (up to 400% of the federal poverty level) who need to buy their own health care plans through the marketplace.

Again, it's not perfect and I agree that improvements are necessary, but the reality of the situation is a bit different than many of the reductionist comments you read online.

When you're earning 2x or even 3x as much as European counterparts (using my real-world experience managing international remote teams), paying the health insurance premiums doesn't feel like as much of an inconvenience. In my case, my employer pays my premiums and my out of pocket maximum spending is capped at $1000 per year, worst case.

<comment><USER15> But most of Europe aren't spending 20-30% of their income on healthcare. If you take that into account I wonder how these numbers stack up

<comment><USER14> Neither are Americans. I think you have some flawed numbers: [https://www.cnbc.com/2019/10/09/americans-spend-twice-as- muc...](https://www.cnbc.com/2019/10/09/americans-spend-twice-as-much-on- health-care-today-as-in-the-1980s.html)

The average American spends about $5000 on healthcare per year. That's only 20-30% if your income is $15,000 per year.

If you're making $100K per year or more (median SWE compensation) or even $200K or more (upper end SWE compensation) then it's really not a big deal.

EDIT: This is why I loathe discussions about politics ok HN. Would appreciate some responses rather than downvotes for citing the corrected numbers.

<comment><USER16> Most people aren't on that kind of wage though..

<comment><USER14> Your 20-30% claim is still way too high for even the median wages, ignoring typical SWE comp. it's not clear where you got your numbers, but they're not supported by the data.

The median US wages are covered by the subsidies above. Again, I want to emphasize that I support health care reform to improve coverage at the lower wages, but I'm trying to explain the discrepancy between the dire picture painted online and the seemingly irrational voting patterns of most Americans. The idea that you can move to a median European country and come out ahead financially due to government healthcare doesn't really add up.

<comment><USER16> I wasn't the grandfather poster you're responding to. But I'll give you my perspective as a Brit. It seems to me a conflation of two separate things. The pro-business environment over the pond allows a lucky minority to capitalise and have a higher standard of living than most places in the world. That is a plus for people who can make it in the U.S. for sure. Glossing over the unlucky majority for the sake of the argument; this state of affairs doesn't seem entirely dependent on the lack of a national healthcare system. It just so happens that a slice of those lucky few don't want to lose their various golden geese, so they have been campaigning to keep the status quo.

Socialised healthcare is cheaper but my understanding. You could have your cake and eat it. I'm open to reading data pointing to the contrary.

</comment></comment></comment></comment></comment></comment></comment><comment><USER17> Having lived all over Europe and US for varying amounts of time, this is true. Yet, the subjective quality of life is higher in most of Europe than in most of the US.

Funnily, this is true within Europe as well. Most of Northern Europe is richer than most of Southern Europe. Yet, the subjective quality of life is by and large higher in the south. (This last part is my opinion, take it with a grain of salt.)

<comment><USER18> And if you read the comments here, you'd think the subjective quality of life in the US is lower than in Europe.

<comment><USER19> I think it really depends on what you appreciate in your life.

Europe is better for a stroll down to the pub to grab a pint with friends and then going to a museum .

America is better for using some snow-mobiles with friends and driving around in a fancy car.

As an American, there's some things that I just couldn't do in Europe: I'm making my own aluminum plane and learning to fly it. That's basically impossible in Europe.

<comment><USER17> More so in Eastern Europe -- the other day there was an article about an entire bootleg helicopter factory in Moldova.

</comment></comment></comment></comment><comment><USER20> If you said to me: you are gonna die and reborn, no guarantees about what your life will be in terms of health, education, personal wealth or personality traits, in which country do you want to be born? Most probably not the US for me.

</comment><comment><USER21> Most people in my village are making around E500/month and they are pretty happy ; is that possible anywhere in the US? I think that would explain something; it's basically that people can afford to live happily because the things that _really_ matter are from the gov. Public transport, healthcare and food if you really cannot pay for it (500 is enough actually to get to restaurants here a few time per month and a drink at the bar daily). But if something goes wrong (fridge breaks etc), you don't end up under a bridge.

</comment><comment><USER22> It is no news that average income is higher in the US, compared to Europe. The point of social safety nets is not to improve your gross national product, but to reduce poverty.

</comment><comment><USER23> This is a highly opinionated piece that selectively uses a tiny bit of data while ignoring a _ton_ of inconvenient data to make a persuasive argument that does not stand up even to mild scrutiny. It is cleverly disguised as objective research.

In other words, this is political propaganda of the highest quality. I mean that as a compliment.

It doesn't belong on HN. I flagged it.

<comment><USER24> It might be flawed, wrong, stupid, etc. but that's not a reason to flag it. Argue against, bring more light into the discussion. Censoring it brings no good.

Censorship should be rarely and carefully used.

<comment><USER23> It was NOT intended as "censorship." According to the HN guidelines, as I understand them, this kind of writing simply does not belong on HN. As I wrote above, that's why I flagged it. Please don't attack a straw-man. For reference, see [https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html)

</comment></comment></comment><comment><USER25> Average is a difficult measure to use in isolation. Gini also has to be considered. While the average income (even figuring in PPP) in say, Czech Republic, is far lower than in the U.S., the poorest people in the U.S. are far poorer.

</comment><comment><USER26> Sweden and South Korea are poorer than Mississippi? This article really bad.

</comment><comment><USER27> Here's a well known site that promotes free-market ideals. Unlike the other one, fee.org has not been shadow-banned.

</comment><comment><USER28> A comparison of GDP per capita _per hour worked_ :

* [https://en.wikipedia.org/wiki/List_of_countries_by_GDP_(PPP)...](https://en.wikipedia.org/wiki/List_of_countries_by_GDP_\(PPP\)_per_hour_worked)

Many EU countries are with-in 80-90% of the US by this measure. Also, the US, nationally- / federally-speaking, has no mandatory annual leave; countries in the EU have many days, and people tend take them:

* [https://en.wikipedia.org/wiki/List_of_minimum_annual_leave_b...](https://en.wikipedia.org/wiki/List_of_minimum_annual_leave_by_country)

Further, using OECD data on labour productivity, the US is down the list, so it seems that when Europeans are working, they get more done:

> _GDP per hour worked is a measure of labour productivity. It measures how > efficiently labour input is combined with other factors of production and > used in the production process._

* [https://data.oecd.org/lprdty/gdp-per-hour-worked.htm](https://data.oecd.org/lprdty/gdp-per-hour-worked.htm)

And let's not forget that these per capita numbers are averages:

* [https://en.wikipedia.org/wiki/List_of_countries_by_income_eq...](https://en.wikipedia.org/wiki/List_of_countries_by_income_equality)

And from the article:

> _I'm simply making the modest — yet important — argument that Europeans > would be more prosperous if the fiscal burden of government wasn't so > onerous._

That does not necessarily follow. Given that in capitalism the 'excess' value created goes to Capital and not Labour, it is debatable whether Joe the Plumber or Jacques the Baker would see more money in their pockets.

<comment><USER29> I searched the page for "health" and "med" and could not find any mention. Then I looked up "Foundation for Economic Education" on wikipedia, and understood why: it's a libertarian think tank. To factor in healthcare would weaken their message.

</comment></comment><comment><USER30> It's almost as if you don't need to be filthy rich, standing on the shoulders of the poor like in America to have an acceptable quality of life in Europe due to social programs that make sure everyone has what they need.

<comment><USER31> When i was living in italy, most of my local friends were "poor" (no money) but they had everything they need - they were not even trying to become richer. A different idea of "personal success", i guessed.</comment></comment>


iPhone 5s launched in Brazil: Costs as much as a Retina Macbook Pro in the US - <AUTHOR> http://store.apple.com/br/buy-iphone/iphone5s https://www.google.com/search?q=brl+1999+in+usd#q=brl+2799+in+usd
Search Results

    2799 Brazilian Real equals
    1212.11 US Dollar
 <comment><AUTHOR> [https://www.google.com/search?q=brl+1999+in+usd#q=brl+2799+i...](https://www.google.com/search?q=brl+1999+in+usd#q=brl+2799+in+usd)

Search Results

        2799 Brazilian Real equals
        1212.11 US Dollar

That's for the cheapest, 16Gb version.

The 64Gb one is about USD 1558

</comment><comment><USER2> Another in a long line of examples that reinforce why the world should be so excited to have the Olympics in Rio.</comment>


Deep-copying in JavaScript - <AUTHOR> https://dassur.ma/things/deep-copy/ <comment><USER2> If you find yourself deep copying then you're about to level up your JavaScript career.

The actual answer is not to find out how to deep copy reliably.

The actual answer is don't deep copy - instead you should be using immutable data structure - check out immutablejs. This will solve the problems that you are trying to address by deep copying.

Sticking with deep copying will only increase your pain and decrease your software reliability.

<comment><USER3> Doesn't immutablejs do the deep copying itself?

Even better would be a language (could be plain JS) that enforces immutability. How about a new keyword in Typescript?

<comment><USER4> There's Object.freeze[1] for that. Of course that's checked only at runtime, because js is a dynamic language …

[1] [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze)

</comment></comment></comment><comment><USER5> "Deep copy" and "structured clone" are not synonymous. A structured clone is one specific type of deep copy, and it has a variety of quirks. It's not clear to me why anyone wants structured clone as opposed to some other kind of deep copy, except if you were polyfilling some API that demands it like I did here [https://github.com/dumbmatter/fakeIndexedDB](https://github.com/dumbmatter/fakeIndexedDB)

There are plenty of more reasonable deep clone functions available, for instance the Lodash one someone posted in another comment [https://lodash.com/docs/4.17.4#cloneDeep](https://lodash.com/docs/4.17.4#cloneDeep)

<comment><USER6> I'd like to see the benchmark in the article include the lodash cloneDeep function.

</comment></comment><comment><USER7> The solutions presented fail if one of the values in obj is a function. E.g., JSON.parse(JSON.stringify({foo:x=>x})) returns {}.

It's not intuitively obvious what the "correct" solution ought to be. If cloner is a deep-cloning function, and f is a function, which of the following should be true?

1\. cloner(f) === f?

2\. For all ...args, cloner(f)(...args) === f(...args)?

3\. For all ...args, cloner(f)(...args) === cloner(f(...args))?

4\. For all ...args, cloner(f)(...args) === f(...args.map(cloner))?

5\. For all ...args, cloner(f)(...args) === cloner(f(...args.map(cloner)))?

6\. Something else entirely?

<comment><USER8> Ohai. Author here. That's indeed one of the trip-wires. So is that any kind of prototype is lost.

The point of the structured clone algorithm is to make values transferable to other realms, so functions are actively ignored. Most of the time, I think that is "good enough".

<comment><USER9> Can you fix your first statement: "JavaScript passes everything by reference" which is incorrect?

see: [https://jsfiddle.net/t73ykuj0/](https://jsfiddle.net/t73ykuj0/)

<comment><USER10> Can you please explain why this behavior is happening in this jsfiddle, or point me to a link that can help me understand this better?

<comment><USER9> The term for what Javascript does is pass-reference-by-value or pass-by- sharing:

[https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_sh...](https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_sharing)

</comment></comment></comment></comment></comment><comment><USER11> "Deep copy" is a code smell and attempts to implement it will lead to pernicious bugs. Either you're copying data, in which case it should be serializable to and unseriazable from JSON, or you're copying objects, in which case you should think about what you're really trying to achieve. There is usually a better solution.

</comment><comment><USER12> I use lodash.cloneDeep for this. [https://lodash.com/docs/4.17.4#cloneDeep](https://lodash.com/docs/4.17.4#cloneDeep). It has variants to munge the object while copying.

</comment><comment><USER13> Missing from the benchmarks is simple deep copying:

        function deepClone (obj) {
            var clone = {}
            for (var key in obj) {
                if (obj.hasOwnProperty(key)) {
                    var value = obj[key]
                    switch (Object.prototype.toString.call(value)) {
                        case '[object Object]': clone[key] = deepClone(obj[key]); break
                        case '[object Array]' : clone[key] = value.slice(0); break
                        default               : clone[key] = value
                    }
                }
            }
            return clone
        }

This is 5-10x faster than the JSON trick in WebKit: [http://jsben.ch/W0ciO](http://jsben.ch/W0ciO)

(naive implementation, but covers 90% of uses, see lodash for the full mess: [https://github.com/lodash/lodash/blob/master/.internal/baseC...](https://github.com/lodash/lodash/blob/master/.internal/baseClone.js))

<comment><USER14> I believe that it's faster, but only because it's not actually deep-cloning.

This:

        value.slice(0);

is a shallow clone; it makes a new array, but doesn't clone it's contents.

<comment><USER13> Hence being a 'naive' implementation. You can replace that with something like `deepClone(value)` + implement copying for different types, ultimately you'll end up with code like lodash's.

<comment><USER14> It's not just naive though, it's wrong; it won't even give you new objects although it seems like it's meant-to:

        a = [1, {foo: "bar"}];
        b = a.slice(0);

        b[1].foo = "baz";

        console.log(a)
        > [1, {foo: "baz"}]

        console.log(b)
        > [1, {foo: "baz"}]

A naive implementation would do this:

        case '[object Array]' : clone[key] = value.map((item) => deepClone(item)); break

And would thus be slower.

<comment><USER13> We are in agreement here. My suggestion was to make the deepClone method also take arrays, and walk through them copying values in the for loop (significantly faster than map).

Again, I linked to a full implementation at the end; was more commenting on the lack of this particular approach, wrote this on the spot as an example.

</comment></comment></comment></comment></comment><comment><USER15> Because JS doesn't clone natively and library behavior varies somewhat, our team has started to consider deep-copying and cloning to be a smell. It forces the maintainer to figure out how exactly the copying/cloning is going to work, and it also creates nasty bugs when modifying a class without knowing it'll be copied or cloned somewhere.

We instead only use immutable, plain ("POCO" or "POJO" in other languages) objects for data. If you want to copy an object, you have to call the same functions to change it that you called on the original. If the functions are deterministic (as they should be), then you get identical objects at the end.

Our code base is effectively functional, even though we still use objects as our syntactic sugar (addOwner(car, user) becomes car.addOwner(user), etc.)

</comment><comment><USER16> I think it is almost unbelievable that the ESxx train continues to expand the language with ever more features, while at the same time there is still no native method to deep-copy an object..

Almost everything in JS is an object, but there is no reliable way to copy one.. Feels like an epic failure to me. Would it not be an idea for the ESxx team to finally fix this core issue for the first upcoming release?

<comment><USER17> Why is deep copy so essential? Deep copy is the wrong solution to your problem 99% of the time, IMO.

<comment><USER16> I think spamming mutable objects around in your codebase is asking for trouble. I'd be really happy to be able to do something like this:

      foo( Object.copy(barObj) );

I mean, why would you send your state's mutable object as argument if you're 100% sure you don't want it to be changed?

<comment><USER17> Because copying is expensive. If mutability is the issue, use Object.freeze(), or define properties with Object.defineProperty() setting _writable_ to false.

</comment></comment></comment></comment><comment><USER18> I would never deep copy using any of those methods. Can't you just write your own recursive version? I remember plenty of examples on jsPerf (site not working at the moment) including my own that significantly outperformed JSON parse/stringify.

<comment><USER19> Yeah I'm confused as most of those methods, like postMessage, stringifies things anyway. I simply iterate other object properties to make a copy of a full object.

I've never run performance tests but surely that's faster than parsing an object into its string representation then parsing it back into the language, no?

<comment><USER8> As I explain in the article, postMessage does not stringify. It runs the structural clone algorithm, as per spec. Otherwise things like ArrayBuffers, Sets et al. would not make it to the other side.

</comment></comment></comment><comment><USER20> Tackling the toughest challenges of our generation.

</comment><comment><USER21> For fun and games, try deep copying event objects. Spoiler alert: it doesn't work in ways that are not immediately obvious. Hours of my life I will never get back...

</comment><comment><USER22> Is the `await` used in the last two examples a typo? They're not asynchronous are they?

<comment><USER8> So, it's me being lazy and copy-pasting, but you can use await on synchronous functions, too. It's a no-op :D

<comment><USER23> Not a no-op, it wraps the awaited value in `Promise.resolve()`:

       async function foo() {
          const a = await {then(resolve) { resolve(123); }};
          console.log(a);
        }
        foo();

<comment><USER24> Indeed, you don't use `await` on functions either, it's used on promises. In fact, when used on a non-promise, it still waits an extra loop cycle before resolving and continuing the async function.

</comment></comment></comment></comment><comment><USER25> JavaScript is absolutely _not_ pass by reference.

        let a = 1;

        function foo( a ) {
          a = 2;
        }

        foo( a );

        console.log( a ); // 1

<comment><USER26> Nowadays, everything is pass-by-value. The only question is whether a reference or a pointer is one of the things that can be passed by value, or if everything passed is always a copy.

An exception to pass-by-value would be Forth; in the case of stack-based languages there really isn't a "pass" going on at all. But everything copies _something_ for every non-inlined function call nowadays. Another instance where it's less obvious what is going on is a truly immutable language like Erlang or Haskell, where the "value" is quite likely still being passed via a pointer, but that's only relevant from the point of view of considering garbage collection behavior.

This makes the old "pass-by-value vs pass-by-reference" terminology vestigial to the modern software engineer, which is why the only place you'll encounter it is in school courses. A better way of understanding the modern issues is to ask what powers a passed-in value has and just ignore the old question.

<comment><USER27> Off the top of my head, here are languages in use that have a feature for pass-by-reference semantics: C#, Ada, C++ (though in this language you can get ahold of the reference as a value if you want).

Of course, to implement pass by reference, you tend to have to pass pointers around, but the point is that the language gives the illusion that the identifiers within a function's scope _are_ locations specified by the caller.

I guess a takeaway is that in designing a language, one has to consider the relationship between an identifier, the mutable cell associated with the identifier, and the value stored in that cell. It seem that in common languages the identifier refers to the cell, but if the identifier is used in a value context, it evaluates to the value in the cell. Languages with pass- by-reference semantics let you make your own & function, so to speak.

(A weird example in C of this relationship is that an identifier for an array refers to a cell that contains the whole array, but, if you use the identifier in a value context, it becomes a pointer to the first element. One aspect of it not actually being a pointer is that you cannot replace its value with the pointer to another array.)

Anyway, an everything-must-be-a-first-class-object hard-liner would insist that pass-by-reference is the way of the past. But, sometimes it is not economical to get everything to be a first-class object. For instance, you might decide it is not worth trying to create a pointer type for referring to members of a packed struct, but it is not too hard to make a pass-by-reference feature for this (via copying).

<comment><USER28> Pascal "var" parameters. Pascal is rarely used any more, but I suppose it's no more obscure than Ada.

</comment></comment></comment></comment><comment><USER29> How does inmutable-js fit into this discussion? My limited understanding is it defers the copy decision and then can limit it to the area needed. Wouldn't that lead in most cases to a better performance?

<comment><USER30> If you have immutable objects (doesn't even have to be ImmutableJS, you can just decide to never mutate object properties), then there's really not even a need for cloning at that point. The reason you would clone an object is to avoid mutating the original object, which you don't need to worry about when everything is immutable.

<comment><USER31> Except that you need to copy _something_ at some point to modify values (or more precisely, having another object that is the same but with X change). In theory everything is re-created with a change, but in practice only the changed objects are copied.

</comment></comment></comment><comment><USER32> Somewhat OT:

If you click through, you can find the original Twitter conversation that prompted this posting [1]. In that conversation, an interesting point about "optimizing away" string representations was brought up: [2, 3]

> _Interesting! How is this better or worse than the usual trick of > `JSON.parse(JSON.stringify(obj))` ?

(...)

My idea was that the browser could detect that the string is immediately parsed anyway and just interpret the two function calls as "deep copy this object for me"._

I had thought about somethig like this in the context of innerHTML a whole ago. Generally, there are a lot of places in the DOM where can modify an object not by setting properties, but by _getting a string representation of the object, modifying that string, then feeding the new string back to the browser for reparsing_. Examples are document.cookie, css properties and of course innerHTML.

In those cases, an optimisation like the above sounds like it could actually make sense.

E.g., if someone abused innerHTML like this:

      for (let i = 0; i < data.length; i++) {
        myList.innerHTML = myList.innerHTML + "<li>" + data[i] + "</li>";
        doSomethingWith(myList.lastChild);
      }

a naive implementation would have to serialize, parse and recreate the whole object tree for each iteration of the list. However you could probably optimize it by having innerHTML return some special object that only "looks" like a string but somehow keeps track of its mutations internally. When the object is fed back to innerHTML later, the browser could use the internal properties to mutate the DOM instead of recreating it.

I'm curious, does anyone know if optimisations like this are actually used?

[1] [https://twitter.com/DasSurma/status/955484341358022657](https://twitter.com/DasSurma/status/955484341358022657)

[2] [https://twitter.com/sergiomdgomes/status/955484966313488384](https://twitter.com/sergiomdgomes/status/955484966313488384)

[3] [https://twitter.com/moritz_kn/status/956444334970343424](https://twitter.com/moritz_kn/status/956444334970343424)

</comment><comment><USER33> > If you don't expect cyclic objects and don't need to preserve built-in > types, you get the fastest clone across all browsers by using > JSON.parse(JSON.stringify()), which I found quite surprising.

I wonder if that's because browser devs know by now that this is a widely used technique and hence optimise for it.

<comment><USER34> I suspect it is because JSON.parse and JSON.stringify are more commonly used methods and therefore see more optimization than methods use less.

</comment></comment><comment><USER35> I was surprised how difficult it was to make a deep copy with javascript, (I did try JSON.parse) but finally decided to rewrite the logic without deep copy. Its a great article, shed some light on an interesting programming question

</comment><comment><USER36> In some cases you can assign the object you want to copy as the [[prototype]] of another object, this way you delegate what you don't want to change and change what you want in the "copy" via assignments

</comment><comment><USER37> On the "pass by value" vs. "pass by reference" controversy, I see two issues here:

First, these terms have specific meaning in other languages such as C++, but JavaScript's behavior does not match either of their definitions.

Second, there is a widespread myth that JavaScript passes primitive values and objects in two different ways. It doesn't. They work exactly the same, and making an artificial distinction between them is not useful.

I find it helpful to make up some new terminology, so my thinking isn't led astray by implied comparisons with other languages. I like to talk about _names_ and _things_.

A _name_ is a variable name or a parameter name.

A _thing_ is any object or primitive value: anything that you can pass as a function argument or use on the right side of an assignment operator.

A name always refers to one thing. A thing can have multiple names.

When you pass an argument into a function, or when you use the assignment operator, you are giving a new name to an existing thing. If the name already referred to some other thing, that connection is lost. The name now refers to the new thing, and only to the new thing.

Everything works this way, primitives and objects alike.

The reason it's often claimed that objects are passed into a function by reference, while primitives are passed by value, is that we instinctively write _different code_ for the two cases. That different code is what leads to the notion that objects and primitives are treated differently.

If you pass an object into a function and you want to add or change a property of that object, you'll naturally write:

      function foo( obj ) {
          obj.myprop = 42;
      }

But if you know the function is going to receive a primitive value, you won't write this:

      function foo( val ) {
          val.myprop = 42;
      }

If you do, you'll find out soon enough that it won't work. It will throw an exception in strict mode, or fail silently in non-strict mode.

Instead you may write:

      function foo( val ) {
          // Do stuff here with val
          val = 42;
          // Do stuff here with the *new* val, which isn't the old val
      }

The reason the functions behave differently is not because JavaScript passes primitives and objects differently. It doesn't; they are all treated the same.

But primitives are _immutable_. They have no properties that we can change. We know that, or we find out if we try, so we simply don't write code that tries to change a property of a primitive value.

It isn't the JavaScript language that treats objects vs. primitives differently when passed into a function or when used in an assignment statement. We programmers do, by writing different code for the two.

(Edited for clarity)

<comment><USER9> > The reason the functions behave differently is not because JavaScript passes > primitives and objects differently. It doesn't; they are all treated the > same.

>The reason is that primitives are immutable

This is incorrect. See: [https://jsfiddle.net/t73ykuj0/](https://jsfiddle.net/t73ykuj0/)

The reason is that javascript uses "pass-reference-by-value" not "pass-by- reference"

edit: The immutability of primitives is why the "pass-reference-by-value" behavior of javascript works like "pass-by-value" for primitives (and for immutable objects).

<comment><USER37> I think we are saying the same thing. Your term "pass reference by value" is the same as what I called "give a new name to an existing thing".

I simply like to avoid the terms "pass by reference" and "pass by value" to avoid comparison with other languages. But if you want to use "reference" and "value", then your term "pass a reference by value" is a good description of how it works - both for objects and primitives.

Coincidentally, just before I saw your comment I changed what I said about "The reason is that primitives are immutable" to make it more clear.

The real reason is that we instinctively write different code for the two. If a function parameter named 'val' is a primitive, we're not going to try to change a property on it. If we do, it won't work, because the primitive is immutable. (That's the point I was trying to get at with my original comment.) The same would be true, of course, with an immutable object.

And when we pass an object into a function, we _may_ reassign the name completely inside the function, as in the mutatePassByReference() function in your fiddle, but more likely we will write code that manipulates its properties, as in your mutatePassReferenceByValue().

So the immutability of primitives isn't the direct cause of what is sometimes thought of as different behavior for objects and primitives. It's an indirect cause, because it leads us to naturally write different code for the two.

That's what I was really trying to get at (in my usual long-winded way): JavaScript doesn't treat objects and primitives differently, we programmers do.

<comment><USER9> > I think we are saying the same thing. Your term "pass reference by value" is > the same as what I called "give a new name to an existing thing".

>I simply like to avoid the terms "pass by reference" and "pass by value" to avoid comparison with other languages.

The terms mean the same thing in every language. Some people (as shown in the article and this thread) don't understand what "pass-by-reference" means and incorrectly use it to apply to javascript.

The pass-reference-by-value behavior is shared by a lot of languages, I'm not sure why you want to avoid comparison with them.

<comment><USER37> > The pass-reference-by-value behavior is shared by a lot of languages, I'm > not sure why you want to avoid comparison with them.

That's a fair point. I just think a lot of JavaScript programmers are confused about this, and end up thinking that primitives and objects are passed in two different ways. Even MDN makes this mistake:

[https://developer.mozilla.org/en- US/docs/Web/JavaScript/Guid...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Guide/Functions)

My use of "things" and "names" is just an attempt to get away from this confusion.

</comment></comment></comment></comment></comment><comment><USER38> This is why JavaScript is the biggest joke of web development. And error handling.

Can we please stop using it

</comment><comment><USER39> JavaScript is pass-by-reference for all Objects and Arrays. Value types are pass-by-value.

        let obj = {a: 1}

        function foo(arg) {
          return obj === arg;
        }

        foo(obj) // true

The === operator operates on object not by comparing their value, but by comparing their memory reference [1]. A function argument variable can be reassigned using = in the function body, but that changes which location in memory the reference points to and isn't somehow "proof" of pass-by-value.

[1] [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators#Equality_operators)

<comment><USER9> Javascript is pass-reference-by-value for Objects and Arrays, see: [https://jsfiddle.net/t73ykuj0/](https://jsfiddle.net/t73ykuj0/)

If javascript was pass-by-reference for Objects, your code could read: arg = {a: 2}; return obj === arg;

and still behave the same.</comment></comment>


Edward Snowden and Joe Rogan – 2nd round [video] - <AUTHOR> https://www.youtube.com/watch?v=_Rl82OQDoOc&t=5816s <comment><AUTHOR> Their first discussion was [https://www.youtube.com/watch?v=efs3QRr8LWw](https://www.youtube.com/watch?v=efs3QRr8LWw).

The HN discussion at that time (10 months ago) generated a lot of interest: [https://news.ycombinator.com/item?id=21333063](https://news.ycombinator.com/item?id=21333063)</comment>


Ask HN: Where can I sell the software of a failed startup? - <AUTHOR> I was involved in a startup that failed. The startup was supposed to be a solution to ridesharing, let's say similar to Uber. We never launched but we developed a lot of code that represented at least a solid portion of the product.<p>Is there any marketplace where we can sell this code, and/or can anyone provide a ballpark range of what it might be worth? <comment><USER2> You'll have a very hard time selling early-stage software. People tend to buy revenue streams and customer relationships, not web software.

Specifically, there are lots of companies selling customizable Uber clones right now.

<comment><USER3> While the conversation gets traction, that seems a point well worth exploring.

Do you have any stories of valuable software that got a second life after startup death?

<comment><USER2> > _Do you have any stories of valuable software that got a second life after > startup death?_

No, I don't. That's kind of my point. The only tech companies that get decent prices are high-tech (often technological breakthroughs). I've never heard of or seen a web app have a value above maybe $2k when it had no customer base, and even then, that $2,000 was tiny compared to the $100k+ that was invested to build it.

</comment></comment></comment><comment><USER4> [https://flippa.com/](https://flippa.com/) is in that space.

P.S. prefixing the title with 'Ask HN:' gets you more exposure, the question will then go to [https://news.ycombinator.com/ask](https://news.ycombinator.com/ask)

<comment><AUTHOR> Thank for the link! I've updated the title but it doesn't seem to be getting picked up by /ask. I guess it has to say "Ask HN:" from the outset

<comment><USER5> It is now</comment></comment></comment>


Here's New Yahoo CEO's First Note to Troops - <AUTHOR> http://allthingsd.com/20120513/heres-new-yahoo-ceos-first-note-to-troops-the-leaking-internal-memos-to-atd-policy-remains-in-place

<comment><USER2> I really wish Yahoo would get their act together. Their technical work is brilliant. Shame they have so many distractions.</comment>


U.S. May Eliminate Per-Country Caps on Employment Visas - <AUTHOR> https://www.natlawreview.com/article/us-may-eliminate-country-caps-employment-visas <comment><AUTHOR> Approval of the Fairness for High-Skilled Immigrants Act would basically mean that recruiting and retaining foreign nationals from countries other than India and China might be impossible for another 10 years as the entire quota (140k/year) of green cards would be fully dedicated to India and China.

Way to go USA! Way to go...</comment>


Where to get free PHP reservation scripts? - <AUTHOR>

Hi guys, I need to create PHP reservation form similar to this one: http://goo.gl/EhcsX9<p>Can anyone tell how to create such a PHP without PHP knowledge? <comment><USER2> no. you have to learn it, or use any other language that you know.</comment>


"If there's gold in them hills..." - <AUTHOR> http://one.valeski.org/2008/10/if-theres-gold-in-them-hills.html <comment><USER2> Thats why you build these things before you build your product.</comment>


Voat needs an Angel or will be forced to shut down - <AUTHOR> https://voat.co/v/announcements/1866053 <comment><USER2> I have tried voat multiples times as a reddit substitute, but every time I was appaled at how hateful the community was.

Unrelated, but I find hosting a site like voat on Microsoft Azure very ... strange.

<comment><USER3> I remember when it was first launched and I was surprised to see C# on their Github. They could probably save cost today by running in .NET Core docker containers, and there is an official SQL Server docker container for Linux, but yes I agree, putting the original implementation on an MS platform was probably not the best idea.

On your second point, yes Voat is a cesspool of hate. It's like a more organized 4chan .. or like 4chan and Reddit had a kid that had its brains beat out by Digg 4.0.

I still like to go through it because I think there is value listening to those opinions and trying to understand where these people are coming from. I also stopped using Reddit have the warrant canary removal and after the commenting editing craziness.

Also reading all the threads about saving Voat, it's interesting how few technical people there are (devs, sysadmins, etc.) compared to Reddit. Most of the users commenting don't seem to understand tech stacks, development costs or how web applications are developed.

</comment></comment><comment><USER4> Good luck goats.</comment>


Looking for programmers for Y Combinator idea - <AUTHOR>

Hello,
I am looking for a programmer(s) for an existing idea that I could also provide to Y Combinator for Summer 2012.
I (we) have already provided an application with an idea, however, I may continue with this venture. The focus is media distribution (made easier) and I'm looking for a programmer to help with the technical requirements of the idea.
The person (s) needs to be a very capable, however, the idea could see mainstream use (become very popular).
I am also available at firstname.lastname@example.com
Thank you,
Jehns <comment><USER2> It sounds like you are looking for a 'Cofounder', not a programmer.</comment>


Hollywood fights Internet protests with... TV ad, billboard, radio spot - <AUTHOR> http://arstechnica.com/tech-policy/news/2012/01/hollywood-fights-internet-protest-with-tv-ad-billboard.ars <comment><USER2> It really bothers me that their lobbying organization is called "Creative America". Creative America is me and other people who make things. It's not corporate parasites who form insidious symbiotic relationships with corrupt congressmen to pass laws that strangle free expression.

"Creative America" does not represent artists and intellectual property producers. It represents the interests of the predators who feed off out what we produce while adding nothing of value, and the interests of those who want more power and control over the populace, including the ability to stiffle dissent.

I think Ars Technica should either put "Creative America" in quotes, abbreviate it CA, or place it in italics. Appearing many times in the article in plain typography is confusing and misleading.

<comment><USER3> Has kind of the same ring to it as "Peoples Democratic Republic of Korea", doesn't it? If you have to put it in your name, you're not really it...

<comment><USER4>
       United States of America

That's interesting. We are still united, but I think most people would look on the US as a single entity, not co-operating states anymore. States have lost most of their sovereignty. But then again, at the time we came up with the name, it was more fitting.

I wondered if North Korea had a similar history, but it appears they were always a communist dictatorship (since 1949, just after Korea split). [<http://en.wikipedia.org/wiki/History_of_North_Korea>]

</comment></comment></comment><comment><USER5> What's stopping us from raising money on Kickstarter to buy up tons of billboard inventory on AdStruc.com? (the Airbnb of billboards - kind of awesome btw)

<comment><USER6> Really awesome idea. Use democratic ideas to save information freedom. You really should propose this on Reddit as well.

</comment></comment><comment><USER6> I love how the TV ad plays on people's patriotism. Or, at least it tries to. It really just reflects their oldschool ways beautifully.

This isn't the baby-boom generation anymore. You can't just control young minds by saying "if you don't do (whatever), you aren't patriotic."

<comment><USER7> When one appeals to patriotism, one is basically saying "I have no logical or credible argument, suspend your brain and do as we damn well tell you" "Patriotism" is nothing more than a device to control the brainless.

<comment><USER4> Well, not always. There are legitimate reasons to ring the "patriotism" bell: Pearl Harbor, 9/11 (spare the theories please). Drumming up patriotism to join the forces to defend the country is the original reason for patriotism and it can still be applicable. Just not in most of the cases you may hear on TV.

<comment><USER7> Logic and compassion should be more than enough. Think about it, the whole world was shocked by such events. Were the shocked, say, Danish, US patriots? Were the Aussies who helped with rendition US patriots? We the MI6 interrogators US patriots? No, they all reasoned that they were doing the right thing. (OK, some could have been just sadists!!!)

Patriotism to me means follow the country or its leader regardless of logic or sense, or any other reasonable form of reasoning. Patriotism can only be used to persuade people against the better logical judgement. Other wise, what is it there for? If the argument stands then no need. Patriotism only gets trotted out when a leader wants to go against the people or majority. Its a big club to bash opposition with.

If the Chinese invade the US, or my home the UK, I don't need to be instantly patriotic to fight them off. I just need to decide who I'd rather run my country. Just logic. Or reason.

There seems to me to be something very engrained in to Americans about being a patriot. I don't know why, but it does seem a very American disease. Bush used it a hell of a lot. Any one disagreeing was called unpatriotic or un-american. I'm sorry, but if that alone does not damage the concept of patriotism, then logic has left the building.

I actually fear seeing or hearing the word patriot. The second I hear or read it I know there is no logic or reasoning to the attached point, argument or issue.

</comment></comment></comment></comment><comment><USER8> Fun fact: the 7 consolidated media companies (all media there is in the US basically), are intimately interconnected with Pharmaceutical and Insurance companies. Link: <http://www.fair.org/index.php?page=3845>

(My original source: [http://divinecosmos.com/start-here/davids- blog/1023-financia...](http://divinecosmos.com/start-here/davids- blog/1023-financial-tyranny))

</comment><comment><USER9> I find it somewhat ironic that the only way I knew that "Creative America" even existed and that it was running TV and billboard ads was through the Web.

Also, it's not just "foreign criminals" who are pirating content. People right here in the US are making money doing it. See <http://theoatmeal.com/blog/funnyjunk> for an example. (I did a whois on funnyjunk.com and they appear to be US based).

<comment><USER10> 35 minutes of reading the oatmeal later...

One thing the guy definitely has going for him is that even if they strip the label off, the sense of humour and the style is still recognisable as Oatmeal.

</comment></comment><comment><USER11> They also fought it today with minimal, biased coverage. I compared the Google trends search volume of the headline stories that were shown today on the major news sites. SOPA was easily 2-3x more searched than any other headline, yet it barely showed up as a blip on sites like FOX News.

<comment><USER10> Fox, my daily dose of US Corporatist Christian bias, had the blackout as the main article on their site. The coverage was not particularly unreasonable.

<comment><USER12> If you think Fox is the most biased news network, you clearly aren't watching any of the others. I say this not in defense of Fox, but because news coverage with slant in _some_ direction is positively ubiquitous.

If you think you're looking at something that's unbiased, it's only because that news outlet matches your own world view more closely.

In fact, I'd go so far as to say that it's impossible to produce news that's entirely without bias. So I wish they'd stop pretending to be even-handed, and just come clean with what their editorial views are. It would make our job of filtering a lot easier.

<comment><USER10> Your last point is actually why Fox News is in the too-long list of news sites I read. I have a rough idea of their biases, like Al Jazeera.

</comment></comment></comment></comment><comment><USER13> What an unsubstantial TV ad. The resistance from the anti-SOPA side comes with factual arguments. However they've chosen to go with their usual favorites: meaningless symbolic imagery and biased, baseless statements. They're trying to push their way through this with brute force. Idiots.

<comment><USER14> They're not idiots. They're very good at making emotional appeals that will reach people who are not like us.

<comment><USER4> Right, we are not the target audience. Actually we probably aren't part of the target audience for most TV/radio ads and billboards.

</comment></comment></comment><comment> daniel-cussen I for one am going to 1) stop buying newspaper 2) not listen to radio, and 3) not watch TV (ok, I was doing this already)

because I'm a little tired of old media and wouldn't mind if it went out of business a little faster.

<comment><USER15> Each of those has the most tiny effect. You would do much better to 1) Stop hiring/buying DVDs 2) Stop going to the cinema 3) Stop buying music

<comment> daniel-cussen OK, that too.

</comment></comment></comment><comment><USER16> We should have lobbyists pushing Congress to investigate Hollywood studios for massive fraud-

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

</comment><comment><USER17> People off the net and unaware that this was an issue are now aware that there's something that large swathes of the internet are kicking up a fuss over. How many will get curious and investigate? More than none, I imagine.

</comment><comment><USER18> You can joke around with this stuff but if your passion is the arts and real creativity (without profit motive) it's sickening.

In Ireland when senior fat cat state servants are threatened with any kind of reprimand the media and unions are mobilized for operation 'blue collar' shield. Police, nurses and teachers are wheeled out to protect the cabal at the top. It always works.

So Newscorp, Hollywood and the Label's are protecting the creative people now, the little guy? As brazen as you would expect from the axis of (creative) evil.

</comment><comment><USER7> Let me get this straight. The advert in Times Square has News Corp and Sony _surrounding_ America's creative community.

Does that not perfectly show exactly what the whole damn problem is?

</comment><comment><USER19> So sad. All this effort because they spent years ignoring technology and trying to do innovation via outsourcing and customer dis-servicing business development.

I know first hand :)

</comment><comment><USER20> If ever a billboard needed some C 'n' B work done to it it is these billboards.

Arise the gorilla C 'n' B army of the new millennium.

But seriously it just makes me want to get into politics just to kick these fuckers out and I'm not even a yank, I'm Australian, so I couldn't directly help the people in the US.

</comment><comment><USER21> Sometimes I wonder if the biggest reason media companies are pissed off about piracy, is because they can't add their own free political messages to any content they want. they are loosing the power of distribution, which is fundamentally more important that loosing a revenue stream.

</comment><comment><USER22> Hi Hollywood: I like movies and stuff, but how about I stop watching them altogether?

I'm happy to pay for cable, netflix and more but you really need to stop punishing the majority of honest people, it's just not cool.

The internet gives me a lot more than the predictable formula plots that you do lately.</comment>


Paul Carr resigns from TechCrunch, hilarity ensues - <AUTHOR> http://twitter.com/#!/search/%23techcrunch <comment><USER2> There's so much crap at that link, what exactly is the hilarity?

<comment><USER3> This probably

[http://shortformblog.tumblr.com/post/10294229930/paul- carr-t...](http://shortformblog.tumblr.com/post/10294229930/paul-carr- techcrunch-infighting)

But it's not funny, more like shitty behavior.</comment></comment>


How I Was Able to Ace Exams Without Studying - <AUTHOR> http://zenhabits.net/2010/02/ace-exams/

<comment><USER2> The blog post would have been a lot more compelling if it was from someone not out to make money selling his "concepts". I'd be much more interested to read about learning habits from someone with a "real job". For example, how person who accomplished _______ got the skills s/he needed to get to that point.

<comment><USER3> I would usually agree, but the techniques of rapid learning that he introduced make a lot of sense. I've been studying neuroscience recently, and it is well known that the brain learns by linking new information with existing (metaphors and analogies) which is what the article is basically pointing out.

<comment><USER2> Those paragraphs about being out of the country and acing an exam with just an hour of prep is Tucker Max-esque sensationalism. It probably says a lot more about the author's college than his amazing methodology.

</comment></comment></comment><comment><USER4> I think ultimately you can use the techniques suggested (and many others) to improve your learning. But speed learning is, I think, really hard to _develop_ if your not natural at it.

Im a natural speed learner and always have been; _but this comes with some serious side effects too_.

My rote learning is pretty poor and I sometimes pass over minutiae. Also while I can quickly learn a topic and sound fairly expert I tend to struggle to fill out the rest of the detail: as a result I know a _lot of stuff_ \- but much is in no real depth (that's only partly problematic now; in my fields of interest I have developed the deep knowledge but it was not easy).

Focus is a problem too. I cant concentrate on learning anything for long periods. And hour at most - and if it isnt gone in by then I will move on. A couple of physics text books I bought months ago are still sat on my desk 50% finished because I lost interest in the ending.

These are _not_ techniques you should really try to employ to pass exams. I can do it because it's a natural process for me (scan text books for a few hrs before exam etc.) but friends that have tried the same (and are natural rote learners) struggled to connect information together in the exam.

And a fun anecdote: one of my best final year university exam results was in a class I ignored after the first lecture (Opto electronics, my god it was boring). I skimmed the text book the morning of the exam with a friend and he suggested we go grab a drink because _"we really need to go to an exam drunk at least once. and as were going to fail this anyway...."_. 4 pints and another skim read later we both aced the exam (top marks of the year). It's no proof of course but I think it's interesting evidence that this is a) a skill you either have or not and b) a lot of luck is involved. :)

<comment><USER5> * A couple of physics text books I bought months ago are still sat on my desk 50% finished because I lost interest in the ending.*

eh, you didn't miss much. turns out the zirconium did it.

<comment><USER6> Hey, I was just on my way to rent the movie.

In the future, please preface this kind of message with _SPOILER ALERT_.

</comment></comment></comment><comment><USER7> This is somewhat misleading. You still have to "study", ie do homework, read the book, and spend time with the material, you just don't expressively stare at notes and solutions for hours the day before the exam, which generally doesn't work too well.

Anybody who does a fantastic job taking in the ideas from material, and connecting it to what they know, and fully understanding homework, etc, will do great in any class without "studying [for the exam]".

<comment><USER8> Your interpretation is at odds to how I understood the article. From what I read he appears to say he does absolutely nothing for a course that is based on a final exam - maybe _attending_ lectures, not sure - and then with merely a couple of hours of study of a textbook is able to ace the exam.

This rather suggest that the exams are badly written if they rely merely on retention of knowledge.

<comment><USER9> But how do you read a textbook in one hour?

</comment></comment></comment><comment><USER9> "I got an A after just one hour of review on the plane."

Even with the best techniques, this can't be the whole story. presumably he had already studied the stuff before (however effectively). I would think in one hour one could not even read all the material.

Also creating those mental hooks also is work and takes time. Not sure if it comes easier after a lot of practice (probably).

<comment><USER10> I'm one of the "lucky ones". I never studied, hardly went to lectures during my courses and had A's all through school to postgraduate level.

It's not a good thing.

I had no work ethic. Everything came too easy, and never having to work for anything made me lazy.

Luckily I found things that I loved and became experts at them (outside of my course) to keep me from boredom. Then I decided to start my own business, and I've never looked back. I work because I love it, I research because I love it, and know more now than I ever thought possible.

Oh how I wish someone had of introduced me to a challenge ten years earlier and the amazing things that happen when you work hard at something you love.

<comment><USER9> How did it work - you just read the book once and you knew the material? What subjects?

I also never studied hard for, say, maths at school. But the fact is, I always voluntarily did my maths homework. Not that it took me long, but still.

<comment><USER10> I didn't read textbooks back then - it was mainly osmosis due to assignments that had to be done and compulsory labs/tutes I think that got me through. I do have a very good memory for important things, and a terrible memory for unimportant things - perhaps it's a filtering mechanism. Years later I learned about memory techniques that I tend to do naturally (e.g memory palaces et al).

I fondly remember purposefully going into an exam completely blind, not a minute of prep and acing it. The year following was exceptionally lazy :(

Regardless I look back and wonder what could have been if only I had actually studied those topics and found things I enjoyed. Since I skipped so much of it (spent a lot of time in the sun at university and went clubbing most nights) I never knew what I was missing. I've since gone back and revisited the materials and really enjoyed it.

My lesson is that the goal isn't an exam result, it's finding things you find interesting enough to work hard at. Grades are beside the point entirely. If I had of gone to lectures and perhaps picked up some research assistant jobs back then I would have found my calling much earlier.

<comment><USER11> In essence, you were studying by doing the assignments. I don't see this as that much different than actually "studying", i.e. sitting in front of the book and learning the material. You just did it an earlier stage in a piecemeal way. Most classes are designed so that if you do the work (or whatever prep) during the course of the semester, you will need little review by the time the exam comes around. Maybe you are better at not forgetting, but it doesn't seem like your learning was any better than anyone elses (except maybe about going to lecture, although I assume many people dont go to lecture if it was anything like my school).

</comment></comment></comment></comment></comment><comment><USER12> Learning should focus on understanding how you learn and retain information verses memorizing facts.

I spent my entire time in K-12 thinking I was average/below average because as a very process oriented learner I needed to make connections with concepts and thoughts in my brain and have those concepts validated. This validation usually comes from the teacher either affirming or denying my assertions but to do this properly would have involved asking 20-30 questions per class (which I certainly wasn't going to do).

Fast forward to college where freedom is aplenty and I started "experimenting" with among other things my learning style. It wasn't easy for me but I finally discovered the method in which my brain best retains information and received high marks.

I'd like to see more of an effort made to help students discover how to learn before actually engaging in the process of learning. It was a life changing experience for me.

</comment><comment><USER13> Unfortunately this ideas doesn't apply for maths related exams.

<comment><AUTHOR> I think math is actually one area where you can apply similar techniques. Not sure if it can be compared to the author's technique, but take a look at this [http://betterexplained.com/articles/how-to-develop-a- mindset...](http://betterexplained.com/articles/how-to-develop-a-mindset-for- math/)

<comment><USER14> Unfortunately it applies only to below-highschool math

> Math provides models; understand their relationships and apply them to real- > world objects.

Advanced Math like analysis or algebra can be _very_ abstract and sharp, you can't easily find any real-world reference or grab your existing experience. To me, math is like twisting your ideas, blend your thoughts and blow your mind. It's painful but fun :)

</comment></comment></comment><comment><USER15> "study for an hour and ace the exam"

When you're paying to learn what you'll need to know for your career (at some schools $50,000 per year), this attitude toward learning is completely pathetic. It's not smart to do well on tests if that doesn't reflect concrete learning that will stay with you for years.

I hope noone serious about taking advantage of schooling reads this and gives it any consideration.

<comment><USER16> People that spend inordinate sums of money to go to college and then spend all their time there figuring out how to only memorize what is absolutely necessary for the tests, and nothing else, are misguided.

That said, in my experience people that are interested in actually learning the material above and beyond doing well on the tests, learn it during the semester, not one night for the test. An hour refresher before the exam if you've been hitting the books all along is great if you already know the material. it reminds you of minor things that can trip you up on an exam, like some notation or some other minor detail.

Cramming tends to be the symptom of very temporarily obtained information for the sole purpose of grades.

</comment></comment><comment><USER17> Not 100% on-topic, but still :

Does anyone else think mind mapping is more hype than substance? It seems to be an incredible waste of space, for starters, which itself is a put-off for me.

<comment><USER6> Waste of space??? If you're doing it right, you should be able to take notes in much less space and your notes should be far easier to review, especially if you use colours and doodles to turn them into a real "map of your mind". However, I do think mind mapping on a computer is worse than useless.

<comment><USER16> I don't specifically "mind map" and tend to take more outline-ish structured notes, but then as different things are discussed, or something harkens back to something mentioned earlier, I get scrawl in the margins, arrows pointing back and forth, etc.

I just write down the connections I make while I'm listening to things, without really trying to. I suppose that has a lot of similarities with mind maps. Some subjects have more arrows and lend themselves well to that. Others essentially remain in pure outline formats. There's no one true way to do these things.

</comment></comment></comment><comment><USER18> idk where he want to school or what he majored in, but if he could study for an hour and ace the exam, it seems that he didn't really need to be taking that course in the first place. (Why not just be self taught?)

There are a lot of reasons for getting straight A's, and if you are reasonably smart it is easy to game the system at a university and take courses where you will only have to study for an hour or two (either looking for easy professors, easy subjects or both).

But if you look beyond the grade, it probably isn't worth it to take those courses. I personally measure my intellectual growth in terms of how painful something was for me to learn. If something is really hard and I am struggling, I know that I am working at the appropriate level of difficulty.

I can see how (if these techniques actually work), they would be nice to apply to stuff like foreign language.</comment>


'Patches don't have gender': What is not open in open source software - <AUTHOR> https://journals.sagepub.com/doi/10.1177/1461444811422887 <comment><USER2> The paper is from 2011 and does not seem to be freely accessible.

The abstract is smooth and pompous, but all the authors are really observing, I think, is that more men than women are attracted to the asocial way in which free software is usually developed; "de-legitimize" is rather overstating it.</comment>


Show HN: Npm module that makes easy to convert JSON to CSV - <AUTHOR> https://www.npmjs.com/package/jsonexport <comment><USER2> Off topic rant I need to get off my chest. Yesterday I troubleshooted a bizarre problem. New versions of Excel don't necessarily understand the simplest CSV files. Reason: They forgot that the C in CSV stands for comma, and instead expect whatever character happens to be set as the 'delimiter' character in the Windows regional preferences. Here in New Zealand, it seems that character is semicolon instead of comma. For some reason. I think Excel was finished circa 2000 and now they focus mainly on making it worse.

<comment><USER3> I'm curious why New Zealand would have a semi-colon as the default. Is there a historical or cultural reason?

<comment><USER4> I checked and New Zealand actually uses a comma as the separator, not a semi- colon. You can verify this by going to Control Panel -> Region -> Change to: English (New Zealand) -> Additional settings... -> List separator

A semi-colon is generally used as the default list separator when the region/locale uses a comma as the decimal separator for numbers. For example Dutch (Netherlands) uses a comma for the decimal separator (ex. 3,14) whereas in English (US) we use a decimal point (ex 3.14). If comma were used as the default list separator in such a region then all floating point numbers would need to be quoted (ex. "3,14") which would make the size of the CSV file larger and also make the file less human-readable

<comment><USER2> Interesting. Certainly it was only a subset of customers who were complaining, and in the office it was a subset of Excel installations which could reproduce the problem. There's no doubt what the problem was and how to fix it. There is a doubt about exactly which Excel and Windows combinations are problematic, and how prevalent that combination is amongst New Zealand installations.

</comment></comment></comment></comment><comment><USER5> For a <5Kb library, I recommend removing the underscore dependency. You should make this as lightweight as possible if you want a lot of adoption.

<comment><AUTHOR> Thanks for the tip, you are welcome to submit a PR if you want to =)

<comment><USER6> Not OP, but I just submitted a PR removing underscore as a dep. :)

<comment><AUTHOR> Thats awesome! thanks!

PR: [https://github.com/kauegimenes/jsonexport/pull/27](https://github.com/kauegimenes/jsonexport/pull/27)

<comment><AUTHOR> This is now avaliable in v2.0.7 =)

Dependencies

None

</comment></comment></comment></comment></comment><comment><USER7> The most popular NPM module for JSON to CSV conversion is json2csv: [https://www.npmjs.com/package/json2csv](https://www.npmjs.com/package/json2csv) [https://github.com/zemirco/json2csv](https://github.com/zemirco/json2csv)

<comment><USER8> Here's a graphical comparison of downloads of popular json to csv conversion libraries -

[http://npmcharts.com/compare/json2csv,jsonexport,csv,fast- cs...](http://npmcharts.com/compare/json2csv,jsonexport,csv,fast- csv,xlsx,papaparse,json-2-csv)

/shameless plug

</comment></comment><comment><USER9> Cool, I immediately wondered if you handled a lot of the tricky CSV things like quotes and internal commas, it looks like it does a good job.

Comparing against Numbers (probably a bad comparison?) I am seeing one slightly different result:

If I have a field that is "hehe"

It's encoded as ""hehe""

It looks like Numbers adds the enclosing quotes:

"""hehe"""

I only see enclosing quotes if there's a comma:

"hehe,hehe" -> """hehe,hehe"""

Anyhow, I'm not sure what the "correct" thing to do here is, if there is one, just a heads up!

<comment><USER10> CSV is pretty poorly standardized, but if you're going by RFC-4180, Numbers is definitely right, due to the interaction of two rules:

* double quotes aren't allowed inside a field that isn't double-quoted

* double-quotes that do appear in a field have to be escaped by preceding them with another double quote.

So by RFC-4180, I'm pretty sure ""hehe"" shouldn't be possible, and the way to represent "hehe" with the quotes is """hehe""".

<comment><USER9> Cool, yep, thanks for pointing out the RFC. I don't envy anyone making CSV parsers and basically assume they won't work when I need to use them :)

</comment></comment></comment><comment><USER11> In the complex object example, what's the usecase for turning that nested object into a multi-column CSV? I guess the overarching question is, why turn a single object at all into a CSV? It's just as machine/human readable as the JSON version of it, and there's no particular benefit in using either structure as it's not data meant to be processed in bulk.

The complex array usecase is where an opinionated-type of conversion tool is particularly needed, but I wonder why it behaves like this:

       name: 'Robert',
       lastname: 'Miller',
       family: null,
       location: [1231,3214,4214]

lastname,name,family.type,family.name,nickname,location Miller,Robert,,,,1231,3214,4214

Why not have `location_1, location_2, location_3`, instead of having a single location column? The latter implementation makes the data difficult to quickly use in a program (like a spreadsheet).

<comment><AUTHOR> It's possible to implement the `location_1, location_2, location_3` as a optional feature.

But i am not sure what name to use for this option.

<comment><USER12> Maybe some variant on "Extract array elements to separate columns"? or did you mean what to name the command line option? Maybe a "\--list-treatment=" option, which can be "concat" or "separate"?

</comment></comment></comment><comment><USER13> From a Python developer point of view, design is a bit surprising - why isn't it created as two separate libraries:

1) csv writer (and reader?) which takes care of all csv dialects crazyness; 2) a library which "flattens" nested objects/arrays?

(1) is not opinionated (besides a few API choices), it just has to be correct; it doesn't make much sense to re-implement (1) everywhere.

(2) can be more opinionated, it is easy to disagree with design choices, there is more room for personal preferences.

For example, in Python there is CSV stdlib module, and for (2) there are libraries like [https://github.com/scrapinghub/flatson](https://github.com/scrapinghub/flatson). Why put both to the same library? Is it something ideomatic in node.js world, with a deeper reason to design libraries this way (e.g. download size), or is it just an oversight?

<comment><USER14> It could be. The question is: why should it be?

Everything you said makes sense if those are the goals, but if they aren't... well, why should they be?

The design you suggest would be done by some module authors for sure, but there's no reason it _needs_ to be that design.

</comment></comment><comment><USER15> Converting JSON to CSV is a usable/good way when analysing NoSQL data. However I'm trying try find since a while a data analysis/query tool for JSON data itself. I saw that mixpanel made a query tool/language called JQL (JavaScript query language) which seems nice. Also RQL (rethink query language) seems nice too. But I can't find a simple tool in which I can import my JSON data and query it. It should be similar to SQLite-browser. Simply import your CSV/JSON file, and query it.

<comment><USER16> (I work at Mixpanel)

Honestly you could probably write a quick pipeline to dump your json data into Mixpanel and then use JQL -- it would be a little hacky but if you have less than a few million rows it shouldn't be too much work (and would still be free at that volume).

</comment></comment><comment><USER17> There's a similar command in pandas called json_normalize ([http://pandas.pydata.org/pandas- docs/stable/generated/pandas...](http://pandas.pydata.org/pandas- docs/stable/generated/pandas.io.json.json_normalize.html))

</comment><comment><USER18> Nice! If you want to do something similar with Excel xlsx this works: [https://www.npmjs.com/package/jsonexcel](https://www.npmjs.com/package/jsonexcel) Not sure how it handles huge arrays though...

<comment><AUTHOR> Thanks for sharing, you can also use jsonexport with rowDelimiter: '\t' for a xls compatible output.

</comment></comment><comment><USER19> This is a new one. Most people want to go the opposite way.

Either way, neat addition.

<comment><USER20> > Most people want to go the opposite way.

When you want to easily provide something excel/gsuite/... Will take in without using an heavier excel compatible library, CSV can be quite decent.

</comment></comment><comment><USER21> Just yesterday I was looking for the other way around, CVS->JSON

<comment><USER22> \- Wrap the entire file with { and }

\- Wrap each line with [ and ]

\- eval the file

;).

<comment><USER21> It wasn't neatly quoted, which I assume is a must for JSON, but yeah, I ended up going on a different path.</comment></comment></comment>


RPGs to Expect on Linux in 2015 - <AUTHOR> http://boilingsteam.com/rpgs-to-expect-in-2015/

<comment><USER2> It will be nice if they really run under Linux. It would be sad if they run only on Ubuntu.</comment>


Results for Y Combinator 2018S Batch - <AUTHOR> I haven't receive any acceptance or rejection mail for my application for 2018 Summer batch. Do they send us even a rejection mail? <comment><USER2> Did you apply late? I did and that is why we are still waiting. That is understandable though.

</comment><comment><USER3> They would inform us, in both cases.

</comment><comment><USER4> You should receive a call if successful, and an email if you're not (unless things have changed, this has been standard in the past)

<comment><AUTHOR> Neither I have receive any call nor any email. What should i do now? Should i contact YCombinator for application status ?

</comment></comment><comment><USER5> Rejection emails went out on the 17th, most people got them or an invite.</comment>


Ask HN: Please help me understand why my iPhone game violates the copyright? - <AUTHOR>

The game in question is http://itunes.apple.com/us/app/stack-stack-attack/id350818179?mt=8 and the company claiming copyright is http://www.laigames.com/. The game is very simple and very popular too, with multiple online and iphone versions. I have following questions :-
1) Can such simple popular games be copyrighted ? Can ludo, tetris be copy righted ? If yes, where can I verify that (for. eg we can verify patents online).
2) The company manufactures booth games. Can it also claim a copyright on the online version of it ? 3) Will small modifications in the game make it escape the claim. For example http://itunes.apple.com/in/app/top-stacker/id388862228?mt=8 is a little different.
Please help me understand my various options. Should I simply take it down, ask for the proof of copyright or let them sue me ? <comment><USER2> First of all, you're asking a legal question, so you really should be asking a lawyer.

But in answer to your questions:

1a) The issue here isn't copyright. Copyright applies to text. The source code of a game is copyrighted, but I assume you didn't copy that.

1b) Yes, simple games can be protected-- but the nature of this protection would be in the form of trademarks or patents. I assume that the "Cease and Desist" letter they sent you will have the details of what kind of a claim they are making.

2) Depending on how a patent or trademark is written, it certainly could apply to online versions as well as booth versions.

3) How large or small the modifications would need to be will also depend on the specifics.

In other words, without more details, there's not much we (or a lawyer) can do to help you.

However: I'd be willing to bet dollars to doughnuts that your problem stems from the fact that you use the name of their game ("Stacker") in the description of yours. That's how they found it, and they're going to argue that it would cause confusion in the minds of the consumers.

If it were me in your shoes, the question I'd be asking myself is: is the revenue being generated from this game worth the hassle of talking to a lawyer? If not, I'd take down the game, and move on. If so, I'd call a lawyer.</comment>


Wimbledon: Game, Sexism, Match - <AUTHOR> http://kevinjohngallagher.com/2013/07/wimbledon-game-sexism-match/ <comment><USER2> Actually, no woman has ever won Wimbledon. To win Wimbledon you must be the best tennis player in tournament, and tennis is not a sport at which women can compete at the top level. This is why a separate tournament was created specifically for women.

Some of the criticism in the article is spot on, and properly decries real sexism.

But ultimately, most sporting tournaments are won by men for reasons of dimorphism.</comment>


Inside the Windows Messaging System (1993) - <AUTHOR> http://www.drdobbs.com/windows/inside-the-windows-messaging-system/184408943 <comment><USER2> Fun thought, that I never see anyone bring up. A Windows "window" is (and has been, since Windows 3.1) pretty much the same thing as an Erlang actor- process: a light pseudo-execution-thread that carries its own state and can send/receive arbitrary messages from peer windows, and—while normally only "doing" something when it receives a messsage— is conventionally driven to tick at regular intervals by timer messages it asks the system to schedule to send back to it.

It just-so-happens that unlike an actor-process, a Windows window _usually_ has a GUI element attached to it. But not always! "Hidden windows"—i.e. plain actor-processes without the extra GUI bits—were the design pattern for doing background stuff for a long time before Windows introduced background services.

I bet some Windows developer here has a story of "that time I built an actor- modelled system just using Windows primitives."

<comment><USER3> >"Hidden windows"—i.e. plain actor-processes without the extra GUI bits—were the design pattern for doing background stuff back then.

Isn't it still the same? cmd can't be hidden and this is the advice I found looking to do something around 5 years ago. Unless you want services but those have certain limitations. No idea why they found it appropriate to prevent services from interacting with the desktop post-XP.

<comment><USER4> It's a huge security risk. Background service typically runs at higher level of privilege. Letting it expose a UI element opens up a huge attack surface. Other much less privileged processes can send messages to its window. An old trick was to send SetWinEventHook message to a service's window to hook an event callback in a dll. The dll is run in the service window's process and thus with its privilege. Privilege elevation achieved!

<comment><AUTHOR> They could simply check that only processes with the same privilege could communicate this way... not to mention the desktop user on Windows is usually the owner and has administrator privileges anyway.

<comment><USER4> Security context is not passed with Windows massage passing. Message passing is mainly for UI and requires all of the performance it can get. Checking access for every single message is too expensive. Just like TCP connection doesn't carry security context, you don't know what privilege the caller has.

Named pipe carries security context. That's why newer Windows requires background services to close off all outside contacts except named pipe, so the service can control the access level.

</comment></comment></comment></comment></comment><comment><USER5> > A quirk in the messaging system rears its head when you try to write a > Windows-hosted debugger (also called a "GUI debugger"). A GUI debugger is a > debugger for Windows programs that itself uses the Windows display > mechanisms. What's the problem with that? Well, imagine the following > scenario: A GUI debugger places a breakpoint inside of a Window procedure. > Eventually, the debuggee program hits the breakpoint, and stops--and cannot > call GetMessage() to yield control to other tasks! That means no other tasks > --including the GUI debugger--can get their messages. The debugger can't > even respond the mouse clicks that tell the debuggee to run again.

That's unfortunate

<comment><USER6> Keep in mind this is describing windows 3.x. Win95 and NT had preemptive multitasking and did not rely on calling GetMessage to yield.

<comment><USER7> The effect still exists in some way in later version windows like the Windows Volume Mixer will freeze up or won't open if you have an application stopped at a breakpoint. I think it gets stuck waiting for a reply from something like WM_GETICON that it would have to send to top-level windows.

<comment><USER6> A single application blocked on a reply is very different from all applications halting because someone won't yield in a cooperative multitasking environment.

I would also say that anyone who sends a message to all top-level windows should use SendMessageCallback or similar so they can handle a reply asynchronously.

</comment></comment></comment></comment><comment><USER8> Nice historical perspective:

> Say your database program gets a WM_COMMAND message, which it interprets to > mean, "Go sort this database of 300,000 records," and dutifully conducts > this 45-minute operation;

<comment><USER4> It was done on floppy disk.

</comment></comment><comment><USER9> Is the page broken? Random paragraphs look like links but you can't click them.

<comment><USER10> Yes, it is. A lot of old Dr Dobbs articles are like that; we're rather lucky they still exist and haven't vanished into the ether.

</comment></comment><comment><USER11> Ha, reminds me of the days I used WINAPI programming. The message pump would be done with a simple while loop that has GetMessage(), TranslateMessage() and DispatchMessage().

<comment><USER12> That knowledge is still valuable for example in figuring out why a WPF app doesn't update its Ui. We have more abstractions today but under the hood it's still the same.

</comment></comment><comment><USER13> I enjoyed this article very much. I still use SendMessage and heavily rely on pinvoke.net mainly for automating other programs. I have to take this opportunity to ask the crowd are there better resources or better tools for automation? Being retired, I mainly automate for my own amusement, websites and games on Bluestacks are my primary targets.

</comment><comment><USER14> I really miss Dr Dobbs (when it was a thicker physical magazine). As a budding programmer, I learned so much from it

</comment><comment><USER15> Reminds me of react.

<comment><USER16> I've yet to see anything touted as groundbreaking on web front-ends that wasn't thoroughly explored by unix forty years ago or Windows twenty-five years ago.

<comment><USER17> Isn't it the same for hardware too ? Most of the "innovations" in PCs were explored decades before in mainframes/supercomputers.</comment></comment></comment>


Offer HN: Free Front-End Development Work - <AUTHOR>

For the past six months, I've been hard at work at both my day job and with a few large clients. I've decided to take a couple months off of "real" work, and want to work with some new blood, meet new folks, and work on some personal projects. A big portion of my 2011 income has come from HN-originated work, so I've decided to give back to the community a bit.
What I'm willing to do: I'll happily help build splash and landing pages to get your startup off the ground. I'll take a design, slice it, and return excellent, semantic, valid markup. I'll complete the work in a reasonable amount of time. I'll also build WordPress themes, and take care of general simple page buildout. Also happy to work on more "involved" projects as long as they're interesting and give me a chance to learn. I'm an experienced developer with PHP, Joomla (you better be Sofia Vergara if you want me to touch Joomla again, free or not!), WordPress, custom CMS, Javascript (and many frameworks and libraries), and general front-end HTML + CSS.
What I'm not willing to do: Respond to 75 emails or phone calls a day asking where your gratis product is. I'm doing this to give back to the community and to remove stress, I don't need any more!
What I expect in return: Nothing! A pleasant testimonial would be enough for me! Maybe a referral or two, but really, nothing is expected at all. I'd be VERY happy to help folks that are financially unable to help themselves right now get off the ground, the satisfaction is all I really need.
My email is in my profile. <comment><USER2> That's some generous offer.

However, my very first though was, "when you can't beat the price of developers from India, do it for free!". For me, more work would probably not relief stress, quite the opposite.

Having said that, good luck with your portfolio building, and take care.

</comment><comment><USER3> Wow! This could really help me, Thank you so much for the offer, I have sent an email to you :-D

</comment><comment><USER4> This is really cool man. I've sent you an e-mail too

</comment><comment><USER5> That's great! That's a generous offer!

</comment><comment><USER6> Thats quite generous, thanks!</comment>


Show HN: SciFi Logic Puzzle Mystery - <AUTHOR> https://www.braingle.com/spacemystery/ <comment><AUTHOR> I created an interactive sci-fi mystery with 25 original puzzles that you can solve as you go along. It has a variety of puzzles (crossword, sudoku, kakuro, etc) to keep readers entertained. Some of the puzzles involve ciphers. The first puzzle is pretty easy, but they get much harder as you progress. Id love some feedback so I can improve it for my next puzzle experience.</comment>