The Zeigarnik Effect - <AUTHOR> http://blog.sandglaz.com/zeigarnik-effect-scientific-key-to-better-work/ <comment><USER2> Another interesting way to interpret this is that perhaps the Zeigarnik effect is a good description of the "psychological" cost of unpaid technical debt. For instance, during any project at my job I run into at least 5 things -- bugs, code improvements, components I could build to make this task easier -- and I jot them down. When I finish, I move on to the next feature, and that list grows to 10, then 15, then 30... the anxiety that "man I really need to fix this shitty codebase" actually affects me psychologically in tangible ways, and IMO is one of the under-talked about aspects of ignoring technical and design debt.

</comment><comment><USER3> What the article doesn't mention is to use this effect as a tactic to get going in the morning: Plan your day so that you stop in the middle of an interesting task at the end of the day. I find it's effortless for me to pick it up the next morning.

<comment><USER4> I used this technique for my lunch break -- with great results. Before I took the break, I was very motivated to finish the project I was working on. But I decided to leave it unfinished. After lunch, I started right back again without 'lost time' checking my email and such.

</comment></comment><comment><USER5> Given that the site is so engineered to make me click, share, and otherwise engage, I have a hard time trusting the content. Is it written for accuracy? Or for virality?

<comment><USER6> Hi there, I can assure you that a lot of research went into this article.

<comment><USER5> Hi, Alina. This is not a dig on your work, but mainly a comment about the site.

Sure, I believe you did a lot of research. But then the article could have been written to maximize accuracy or to maximize virality.

I write a lot, and there's a big difference between the styles. For some topics, that can translate into a big difference in the content of an article.

Productivity is definitely prone to that. There's a whole genre known as "productivity porn", so called because some people feel compelled to look at it far beyond actual utility.

Right from the title of the article, I was put on guard. The word "unlock" indicates minor action will bring great improvement, freeing me from possibly- unsuspected constraints. Who wouldn't want that? Then we get three awesome, hard-to-reach states in a row. Next a mysterious sciencey-sounding effect named after somebody I've never heard of but who has an intriguing name. It's a perfect productivity porn title.

When I clicked through, my skepticism was increased. On my phone, the first thing I saw was a bunch of share buttons with some needy, manipulative copy to get me to click them. There's a big stock photo of a pretty woman that conveys zero actual information. There were a modest number of short, upbeat paragraphs broken up with large titles. There are what I'm sure were links to other productivity articles in the body. There's relatively little subtlety, and a concluding paragraph that dubiously hates on the 8-hour work day. Then we get a paragraph trolling for comments, which increase stickiness. And then more share buttons with the same manipulative copy.

I understand that this is a popular way to build a profitable content business these days. But I also understand that "profitable content business" and "reliable source of high-integrity, low-drama journalism" are poorly correlated. No matter how solid your writing and how true your heart, the context and the constraints of written-for-virality prose make me skeptical. Too many other people writing for similar sites and with similar structures have written excessively upbeat, low-thought articles for me to trust ones on this site without doing a lot more due diligence than I normally will for a quick morning read.

<comment><USER7> there's a lot of cynicism here!

there's no great mystery to any of this, and what the article is saying is rather obvious (we remember the stuff we didn't finish yet - no shit!) but I just don't see all these cynical intent concerns you have.

<comment><USER5> That's not cynicism. That's just reverse engineering a content business.

I worked in publishing in the 90s, including doing some print design. I've done a fair bit of UI and information design since then. And I helped start a successful modern content business. Plus I write pretty much every day.

I'm not saying anybody there intends to be evil. I'm sure they're all very nice. I'm saying that they're embedded in a business context that shapes behavior. The incentives work strongly against thoughtful, sober journalism, and toward high-viral, high-click, high-engagement content that stimulates a need without ever really satisfying that.

</comment></comment></comment></comment></comment><comment><USER8> I definitely notice that effect personally. The problem is, I often find myself easily distracted (e.g. opening HN!) when faced with a hard problem or a "mental wall". It really hinders my ability to finish tasks sometimes. What do you do to help you focus on tasks, specifically hard ones?

<comment><USER4> There are a number of things you can do to stay focused and on task. Some of them you probably already do.

The first is to simply have a clearly defined goal. While this is obvious, it is also easy to miss. If we don't have a clearly defined task, we don't know whether or not we've completed it.

But even if you have a clearly defined goal, it can still be easy to get distracted. There are two primary reasons for this. The first: If you don't know what the next step is, it can be difficult to stay focused. The next time you get stuck, ask yourself how clearly you know what your next step is. If you're not sure what to do, then make sure you spend the time figuring that out.

But what if you have a clear goal, and you know exactly what you need to do, but you're still not staying focused?

Then you've probably got a motivation problem. The way to deal with this is pretty straight forward. Simply spend time thinking about the reasons it is important to complete the task, or achieve the goal. Don't try to trick yourself here. Be honest. If you can't find any good enough reasons to stay focused, then maybe you should be doing something else.

In summary: Have a clearly defined goal. Make sure you know exactly what you're next step is. And make sure you have the proper motivation.

If you're interested in this stuff, I recommend reading about the "mental contrasting" technique, as well as the book "Succeed" by Heidi Grant Halvorson.

</comment></comment><comment><USER9> Related, I like to leave non-working code or tests at the end of a day so I can easily find where I left off. For some reason when I try to build / test and the errors pop up I'm able to immediately pick up where I left off. A combination of a bookmark and the Zeigarnik Effect I guess?

</comment><comment><USER10> This probably explains "earworms" (songs that get stuck in your head) as well. Usually the hook that repeats doesn't have a musical resolution, and/or you can't remember how the song ends. Just hearing or imagining a single chord that sounds final can help get rid of them.

<comment><AUTHOR> I haven't thought of this; maybe that's why I get annoyed when a song I'm listening to gets interrupted.

</comment></comment><comment><USER11> Great article, except for the last paragraph. The duration that you work has little to do with your reward structure. If you had a _one_ hour workday, at any time of your choosing, but were then paid cash afterwards, you'd still nullify the effect.

If anything, I think the effect is an indictment of hourly wages, as opposed to salary or some other outcome-based compensation.

<comment><USER6> Great observation! It's not about the duration of the 8-hour work day though, but the concept of it. It's about doing something for a specific amount of time and then receiving a pre-established monetary reward. You're right, it could be a one-hour or five-hour workday. It just happens that in our days it's an 8-hour workday/40-hr. work-week.

</comment></comment><comment><USER12> I waited tables the whole time I was in college and I can say that these observations are 100% true.

Sometimes I even have nightmares about bad experiences I had.

</comment><comment><USER13> >The waiters seemed to remember complex orders that allowed them to deliver the right combination of food to the tables, yet the information vanished as the food was delivered.

That could use some elaboration. If she was just watching them, how did she know the information vanished?

</comment><comment><USER14> For those who understand German, you can read it up on wikipedia:

[http://de.wikipedia.org/wiki/Zeigarnik- Effekt](http://de.wikipedia.org/wiki/Zeigarnik-Effekt)

</comment><comment><USER15> This effect is also a good reason to let the other side talk themselves out during a contentious discussion (instead of objecting to every point).

<comment><USER6> Great insight! I wouldn't have thought about it this way, although I can think of quite a few instances where this approach would have been more than helpful!

</comment></comment><comment><USER16> This is just another word for stored state for humans!</comment>


Where are my flying... motorcycles? - <AUTHOR> http://www.telegraph.co.uk/technology/news/9494328/Aerofex-hover-bike-brings-Star-Wars-transport-closer-to-reality.html

<comment><AUTHOR> I remember seeing <http://hover-bike.com/> last year, but this one seems to be closer to production-ready.</comment>


Building a Better Train to Brooklyn - <AUTHOR> http://danshipper.com/building-a-better-train-to-brooklyn

<comment><USER2> Here's the better train to Queens, under construction.

Overview:

[https://www.youtube.com/watch?v=cdIq8EqRl_w](https://www.youtube.com/watch?v=cdIq8EqRl_w)

2014 update:

[https://www.youtube.com/watch?v=foE_mvdXDP8](https://www.youtube.com/watch?v=foE_mvdXDP8)

Miles of new tunnels. A giant cavern under Grand Central Station. New river tunnels. Most of the blasting and digging is done; now the MTA is building the railroad in the tunnels.

That's what it's like to really do that job.

</comment><comment><USER3> As someone who commutes on the L train daily, I was really disappointed to see that this was actually a metaphor. I want a literal better train to Brooklyn!

<comment><USER4> There's a source that I can't find that explains why the L in particular so bad. It's basically that most subway lines (e.g. the 2 and 3) have heavy traffic both ways at both rush hours, because they begin and end in residential areas. The L trip profile is lopsided, westbound in the morning and eastbound in the evening, so the marginal gain in capacity of adding another train to it is less than to another line and the MTA is broke enough they have to make those kinds of choices.

<comment><USER5> I think it's that the tunnel isn't wide enough to have an express. They already run a shitload of trains on the L track, but there's an upper limit to capacity.

<comment><USER6> Would an express help with the ludicrous crowding at Union Square? A few months ago I was heading to Brooklyn, and I had to catch it from Union Square to the 8th avenue terminal - otherwise, there was no chance of getting on an eastbound train. (The westbound train was full; when we arrived at 8th, maybe five people got off. Everyone else was just trying to take the long route to Brooklyn, because it was the only option.)

<comment><USER5> Express trains would help with volume. If an express traveling on another track was just hitting Manhattan stops plus Bedford, Morgan, Myrtle-Wyckoff, . . . That would take care of a lot of the volume that gets packed onto the always-local L.

</comment></comment></comment></comment></comment><comment><USER7> > How do I decide which features to include in my product and which ones to > leave out? How do I know if one of the new features I've come up with is a > good idea?

Here's a key difference between software engineering, and well, engineering. Engineers, in 2015, don't come up with an idea and start pounding on sheet metal. The 787 flew in simulation thousands of times before one existed in real life. Every significant feature was measured and justified with a trade- off analysis, backed up with simulations. When they built on, they had a very good idea of what they were going to get.

<comment><USER8> Typically in (non software) Engineering the problems are pretty well defined usually along the lines of: "Here is an X make it more efficient"

Where X is Engine/structure/Industrial Process etc...

And the defintion or at least the intent behind the meaning of "more efficent" is well understood i.e. Weighs Less, Consumes less Engergy, produces more torque etc.

In the software world there is a much looser definition of what an improvement is which complicates the issue.

"Engineers, in 2015, don't come up with an idea and start pounding on sheet metal"

There is a good quote from Tesla I was taught as an undergraduate Engineer:

"If Edison had a needle to find in a haystack, he would proceed at once with the diligence of the bee to examine straw after straw until he found the object of his search. I was a sorry witness of such doings, knowing that a little theory and calculation would have saved him ninety per cent of his labor."

Edison went through numerous protypes trying to design the light bulb. I guess that would be the equivalent of the pounding sheet metal approach.

As we were taught Edison was an inventor, Tesla an engineer.

The modern day equivalent of the inventor would be the achitects and industrial designers of the world, they come up with crazy ideas (by pounding the metaphorical sheet metal) and some poor engineer has to make it work. Maybe software needs the same thing a looser coupling between software designers and software engineers.

</comment></comment><comment><USER8> In materials engineering there is a similar technique to the articles "misfit analysis" used for materials selection. It is not uncommon to have competing constraints. For example to address a problem like designing a beam section optimally you want a beam thats as light as possible, meets the minimum stiffness requirements (usually with an added safety factor) and is still competitvely costed - depending on how the constraints are weighted (cost vs weight vs performance) it could mean the difference between aluminum, steel or carbon fibre for example. The real science lies in expressing the constraints and weighting them against one another correctly.</comment>


Artificial waiting with UX - <AUTHOR> http://www.fastcodesign.com/3061519/evidence/the-ux-secret-that-will-ruin-apps-for-you <comment><AUTHOR> Reminds me of the scene in Silicon Valley and the focus group wondering where their data is and why their storage is empty.</comment>


Affinity Designer 1.5 - <AUTHOR> https://affinity.serif.com/ui-design-software <comment><USER2> It took Serif 2 years to deliver a decent color picker tool.

How long will it take to have a group isolation mode?</comment>


Neural Magic: startup making deep learning possible without specialized hardware - <AUTHOR> https://www.technologyreview.com/2020/06/18/1003989/ai-deep-learning-startup-neural-magic-uses-cpu-not-gpu/ <comment><USER2> Unfortunately there are zero technical details in this article</comment>


Bone-driven image distortion in the open source 2D animation tool Synfig - <AUTHOR> http://www.youtube.com/watch?v=YD3aK9SySZo

<comment><USER2> i wonder why they chose to deviate from the 3D model terminology for this: rigging.</comment>


Neurolosit claims to find "where evil lurks" in the brain - <AUTHOR> http://www.independent.co.uk/life-style/health-and-families/health-news/its-where-evil-lurks-neurologist-discovers-dark-patch-he-believes-exists-in-the-brains-of-all-murderers-rapists-and-violent-criminals-8482804.html

<comment><AUTHOR> >>"There are cases where someone becomes criminal as a result of a tumour or an injury in that area, and after an operation to remove the tumour, that person was completely normal again"

I'd love to find out more about these cases. I know PFC injuries can result in lack of self control, but criminal behavior due to a brain deformity. That's a pretty bold claim. Can early detection lead to lower crime rates?</comment>


It's time to explore the Pebble appstore - <AUTHOR> https://blog.getpebble.com/2014/02/03/its-time-to-explore-the-pebble-appstore/

<comment><USER2> My Purr[1] watch face is available on there too. It replicates the functionality of the Durr[2] watch.

[1] [https://github.com/jbrooksuk/Purr](https://github.com/jbrooksuk/Purr)

[2] [http://skreksto.re/products/durr](http://skreksto.re/products/durr)

</comment><comment><USER3> The new Pebble app store seems to be pretty popular. Via server logs, I'm monitoring 1 game played per second in the new version of my moderately popular game ([http://www.mypebblefaces.com/apps/4736/4252/8720/](http://www.mypebblefaces.com/apps/4736/4252/8720/)).

</comment><comment><USER4> Even though it's time to explore the pebble app store, it seems impossible to do so without creating a pebble account. All I want is to see the apps, to decide if pebble is worth buying. Apple allows you to browse their App Store just fine. Oh well.

</comment><comment><USER5> iOS only for now. Although they did tweet an Android screenshot on Friday. Consistently failing every deadline since Kickstarter days :/ However, kudos to the team, they deserve it for all the hardwork. I'm an early KS backer and they've delivered far beyond my initial expectations. Can't wait to check out 2.0 and appstore!

<comment><USER6> As long as they deliver quality content I'm fine with companies delaying things. I'd rather have awesome stuff built compared to meeting every deadline.

<comment><USER7> Except they said it would be launched today. And never gave a hint the android would be delayed. It's like saying we're meeting steve for lunch at noon, and then I show up at noon and say you can't come, it's only me and steve.

<comment><USER8> Shit happens. They'll deliver.

</comment></comment></comment></comment><comment><USER9> Now if only Apple would approve apps to work with them. I have the integration done, it's approved and whitelisted by pebble for their MFI program, and Apple rejects it for not being in their MFI program. Thanks Apple.

</comment><comment><USER10> As the early adopter of Pebble in my group of non technical friends I was always the one that people came to asking how they could install more apps on their Pebbles, and I had to guide them through the process of downloading and installing from the website in Mobile Safari. Now that its a one touch process they'll be able to do it on their own.

</comment><comment><USER11> So does this mean that all purchases on the iOS Pebble App Store have to go through the iTunes App Store and thus Pebble pay a cut to Apple ? Because iTunes App Store T&C say all purchases go through them, right ?

<comment><USER12> All watch apps in the Pebble App Store are free. There are no purchases in the Pebble App Store.

However: It's common for a watch app to require a "companion app" that runs on the phone. The developer can charge for their companion app through the iTunes App Store and/or the Google Play store. Then Apple/Google take their usual cut (and Pebble is not involved in the sale at all).

Source: [http://developer.getpebble.com/2/distribute/publish-to- pebbl...](http://developer.getpebble.com/2/distribute/publish-to-pebble- appstore.html)

</comment></comment><comment><USER13> I bought 2 pebbles and a sony smartwatch 2 for android development. pebble is a pain in comparison. only 8 pebble apps installable at once? black and white, no touch, just 3 buttons with #4 being reserved for "back". SW2 is rather easy to program but also has severe limitations. nothing can have buttons and scroll at the same time. pebbles is programmed in C++.

Yeah, these smart accessories are nice but still just gimmicks. Galaxy gear working only with 4.3 Android phones from Samsung is the biggest joke of all but yeah, they try to pull of an Apple-scam.

<comment><USER14> "pebbles is programmed in C++."

Don't they have a new js api?

[http://developer.getpebble.com/2/guides/javascript- guide.htm...](http://developer.getpebble.com/2/guides/javascript-guide.html)

</comment></comment><comment><USER15> A little offtopic, but I love the mouse-over effect on the blog header. It makes the text immediately stick out and seem more real — in the sense that this presentation says about making games "juicy": [http://www.youtube.com/watch?v=Fy0aCDmgnxg](http://www.youtube.com/watch?v=Fy0aCDmgnxg)

It's a pity that it only links to a permalink of the blog, rather than being a call to action of some kind.

</comment><comment><USER16> How was Pebble on Android? I'm planning to buy Pebble and I'm on Android (Nexus 5). I first thought it was an iOS exclusive but then I saw in on Google Play [0].

[0] [https://play.google.com/store/apps/details?id=com.getpebble....](https://play.google.com/store/apps/details?id=com.getpebble.android&hl=en)

<comment><USER17> I used to have trouble with it dropping the connection a lot, but it hasn't been a problem lately. I recommend adding the 3rd-party Pebble Notifier app to limit which notifications get sent over. It even has Tasker integration.

Edit: there was one case where a Pebble update didn't work (maybe got interrupted) and was basically bricked until I connected it to a friend's iPhone. So I would say overall, the Android version is a second-class citizen, but generally usable.

</comment></comment><comment><USER18> I wonder what % of their users are on Android. Everyone I know who owns a Pebble is on Android. Perhaps that is the minority?

</comment><comment><USER19> If you play tennis, try out my Tennis scoring app, called Tennis Pro.

Would love some feedback!</comment>


Liberty Bridge could be the ultimate car-free span - <AUTHOR> http://www.bbc.com/autos/story/20151016-liberty-bridge-could-be-the-ultimate-pedestrian-walkway <comment><USER2> The proposed "box truss" is sometimes called a Vierendeel truss and has been used occasionally in modern architecture. The omission of diagonal members means that the joints must be rigid (not pinned), complicating the structural calculations because the structure is then statically overdetermined. It's a promising design I think, compared to the clunky garden bridge proposed for London.

</comment><comment><USER3> > How can a millennial 'trep with no lofty urban-design credentials even > consider proposing such a bold idea?

What is a "'trep"?

<comment><USER4> Entrepreneur? I've never seen this used before either.</comment></comment>


China Begins to Question Whether It's Ready for a Trade War - <AUTHOR> https://www.bloomberg.com/news/articles/2018-06-25/as-trade-war-looms-china-wonders-whether-it-s-up-for-the-fight <comment><USER2> An aspect of this is that with the effects of globalization and the reliance of business in both nations on those in the other we could see entire large companies vanish almost over night as their supply chains dry up.

If you cant build your product because a component you relied upon is now 25% more expensive, you're continued existence is predicated on having deep reserves. Many smaller companies don't and even the larger ones will have to implement deep layoffs relatively quickly to conserve resources as they won't know how long the trade war will last.

This in turn will have an effect on the political situations in both countries although primarily America as its the democracy. Globalization and the economic relationships amongst nations now has a direct effect on the internal politics of those same states.

<comment><USER3> Yep. My view on trade wars is basically: let's all chop off an arm. Last one standing wins. Whoever wins may discover that they didn't really need that arm to survive, but is life really better without it?

<comment><USER4> In some ways a trade war had already happened with China refusing to open markets and supporting theft of IP. ignored because it was convenient for both sides for a long time,but China is reach a level of power where their ambitions are threatening an established world order in the South China Sea,etc.

<comment><USER5> So true. China has been waging this quite war for over a decade. Pegging its currency, flooding us market with cheap (and unreliable) good (which are expensive when u consider tco and environment), stealing ip to leapfrog us without needing heavier investment, us loosing manufacturing knowhow, buying off local realestate causing jacked up prices in us. Its unfortunate that we took this lonv to react. Not sure if next administration will keep up this good work to keep china in check.

</comment></comment></comment></comment><comment><USER6> Like a lot of these article's about China... there's very little here to know what their actual leadership thinks or doesn't think.

<comment><USER7> Yesterday, Xi Tells CEOs He'll Strike Back at U.S. [https://www.wsj.com/articles/chinas-xi-tells-ceos-hell- strik...](https://www.wsj.com/articles/chinas-xi-tells-ceos-hell-strike-back- at-u-s-1529941334).

However, one can deduce that the dictator is running scared. The stock market has fallen 25% this year. Yuan has fallen 10%. There's a 400 billion tariff coming his way, and because of 'saving face', there's no way he will back down. He has to prop up the real estate bubble:

"price rose 31 percent to nearly $202 per square foot. That's 38 percent higher than the median price per square foot in the U.S., where per-capita income is more than 700 percent higher than in China." [https://www.bloomberg.com/view/articles/2018-06-24/why- china...](https://www.bloomberg.com/view/articles/2018-06-24/why-china-can-t- fix-its-housing-bubble)

and he has to also unwind China's 12-18T shadow banking, China's version of subprime loans similar to 2008 crisis (but way bigger). He has to figure out how to steal IP to move up the chain when US and the rest of the world has upped their defense, restricting Chinese tech investments and resisting hacking attempts. He also needs to deal with the tariffs encouraging manufacturers to leave China and go to southeast asia or back home via reshoring or automation. There is also the matter of a lack of consumer market in China, after it gets shut out of US and europe. Not much Chinese consumers can buy after $800/month income, after paying most of it to mortgage and inflated food prices.

<comment><USER4> One of the few policies of the current administration that I support has been its efforts with China trade and maybe North Korea. It is not healthy for the world to have an emerging world power that regularly abuses human rights and seeks true totalitarianism through electronic surveillance.

<comment><USER6> I'm not really sure the current administration is doing it for the human rights reasons you noted. I'm not sure they care much about that either way.

I think they could get what they want out of these deals and human rights would remain the same or worse and they wouldn't care.

<comment><USER4> Sorry for that unintended interpretation. I don't think that this administration gives a shit about human rights.

</comment></comment></comment></comment></comment><comment><USER8> Doesn't USA have some 10 trillion loan from China? How does that factor into all this? Or is that a parallel issue not directly related to this?

<comment><USER9> "If you owe the bank $100,000 the bank owns you. If you owe the bank $100,000,000 you own the bank." Not a perfect parallel to this situation, but a nice aphorism.

<comment><USER3> This is simply not true in when both countries can print currency, and the global markets are heavily reliant on the value of those currencies.

</comment></comment></comment><comment><USER10> What will this mean for all the Chinese purchased real-estate in America?

<comment><USER10> Also, it seems tough to fight a trade war with China, while simultaneously picking trade fights with the EU, MX, and CA.

</comment></comment><comment><USER11> I think the next step Trump takes is to offer to drop tariffs against Europe and Canada if they put tariffs on China.

<comment><USER12> Maybe, but why would the EU do that? China is a reliable trading partner.

<comment><USER13> Also, there are already tarrifs on steel from China and other sectors to protect our manufacturing.

</comment></comment></comment><comment><USER14> Off-topic

Doesn't Bloomberg identify that their users can click on play, when it's needed.

It's annoying and it's wasting my data.

</comment><comment><USER15> The US has played nicer than most countries were they to enjoy its economic might and pre-eminence[1]. Few countries would allow their workforce to endure economic self-inflicted hardship while maintaining an economic advantage in negotiating trade. But the US has, over the years, put up with unfair trade from Japan, SKorea, China, Some of Europe in the name of "free trade". I don't begrudge allowing some disadvantage with regard some developing nations --but not developed nations. For fair trade to work, it has to be bi-lateral. If you unilaterally do fair trade but your partner doesn't, you may do your principle good, but you're selling out your worker for principle.

Since Reagan, maybe before, the blue collar worker of America has seen their government give in and cower in the face of unfair trade saying, "we'll make it up in services" or "your goods will be cheaper". But what good does cheap do you when you have no job and no money? They never saw their lot get better. People wonder why people are now "working poor".

When I was in middle and HS, my bus drivers and janitors (they were not "cleaning engineers" just yet), were able to raise a family with decency. No way that happens now.

As Michael Moore poignantly, albeit ironically, said, finally, someone stood up to the corporations and said, "no more". I'll stop the hemorrhaging. One AFL-CIO in PA, the other day, endorsed a Repub. As an atheist, I have to say, Good God, what happened to the Dems? They sold out the American worker in favor of the multinational, transnational capitalists. If they don't watch out, they will lose labor to Repubs.

[1]Just look at how China manages its advantage in Africa, LatAM, etc. Japan in SEAsia, Russia with Former SU repubs., etc.

<comment><USER12> You, and most americans, seem to be fixed with deficit in goods, but at the same time do not even mention the massive trade surplus that the US has in services. By some measures, total deficit with the EU for example is fairly balanced.

I assume that you are in favour for a rebalancing in services trade too?

<comment><USER15> If we are trading in services unfairly, sure. But we're likely not. Others will put up many different barriers to impede fair trade. The US does less of that nonsense, on balance.

<comment><USER12> What about unfair technological lead due to government support? The internet is a DARPA spinoff.

What about unfair IP rules due to overwhelming control of international organizations and standards?

What about unfair tax dodging by US multinationals, not paying tax on profits in the corresponding countries by abusing an international tax system made by the US for the US?

<comment><USER16> More to the point, what about the "exorbitant privilege" the USA enjoys from having the worlds reserve currency? If other nations make a concerted effort to ditch this set up, the USA can no longer run massive deficits. Imagine the USA trying to run a balanced budget immediately.

<comment><USER15> That's over-stated. I don; think the US cares too much about that at all. In fact it encouraged the Euro.

<comment><USER12> That happened in the golden era of multilateralism, after the fall of the Berlin Wall and the Soviet Union. The US realized how unfair the situation was, and took some timid steps to start a rebalancing of the situation, allowing for the creation of a competing currency.

It is not that the Euro was not a threat to the dollar, it is simply that the threat was minor then, and that it was plain and simple the right thing to do: renounce to unfair advantages in order to move to a more just world.

The US continues to unfairly abuse the dollar as world currency, and dismissing this fact can be a costly misjudgment: fair for the world, but painful for the US.

</comment></comment></comment></comment></comment></comment></comment><comment> temp-dude-87844 It's interesting to hear Chinese academics take a pragmatic, realist view of potential impacts. A prolonged trade spat with a US strongman is hardly a desirable outcome. But even if China's export-oriented industries will suffer due to trade protection measures brewing in the US, EU, and Canada, Trump's domestic focus will likely allow many of China's global ambitions to continue unabated: in Africa, in Central Asia, and possibly in Oceania.

This approach mirrors what the US and Soviet Union pursued during the cold war by winning favors through a mix of economic assistance and direct foreign investment. It's a parallel game whose fruits will pay off in the long term, when China reaches its post-industrial stage, and has to use its network of connections to ensure continued prosperity for its people.

</comment><comment><USER17> I am no Trump supporter I will start with that. I disagree with almost the all of his policies/actions.

However, China has been playing behind the US back for too long. Tech espionage, hacking, trade to a certain extent as well. China is not a developing economy as most think. It is already a superpower.

This is actually pre-emptive war. No weapons, but at some point the US had to act while the odds were still in its favor.

IF you played Civilization, any strategy game - then you know what I am talking about (or history books).

>> Loans - But China has tons us US debt!?!?

-Yes they do - do you know the best part about an IOU? you guessed it I - O - U. its paper debt. So better not upset me.

-Both nations are interlocked in a dance. US spends China Makes. But China also has stolen tons of tech. Nuclear weapons, ballistic missiles. Hacking.

-Talk to anyone in the armed forces. The sentiment is bad. There is more going on in the background than we all know.

-Talk to anyone over beers in the armed forces. They will say its long over do.

What do I think? who cares what I think.

cheers.

<comment><USER18> If only there had been some kind of trade agreement with a lot of pacific nations that would have given the US a lot more clout with other countries in the region and maybe a common front for some of the real problems that are out there - as opposed to the ones that exist purely in Trump's mind.

(TPP)

<comment><USER19> The problem with the TPP was that it also snuck in too many distasteful things along with the useful policies.

<comment><USER20> [https://en.wikipedia.org/wiki/Policy_laundering](https://en.wikipedia.org/wiki/Policy_laundering)</comment></comment></comment></comment>


Richard Stallman on SaaS - <AUTHOR> http://autonomo.us/2010/03/richard-stallman-on-saas/

<comment><USER2> I'll call it first: BS.

Having worked in High Performance Computing, I can say that there is nothing worse than a heterogenous workload. If you've got image processing, data mining, number crunching, and simulations all running on the same hardware and OS, you miss out on a lot of optimization. If you are only doing one of those, then you can get quite a bit more performance out of the hardware by tuning it properly. SaaS, by it's specialized nature, allows that tuning to take place. Running everything on your own machines just slows them all down.

<comment><USER3> While I wouldn't go as far to call it BS. I agree with your argument.

I believe we need better laws that will ensure the freedom rather than modifying the system. In all other aspects of human life, we have relied on legal system to achieve economies of scale, while preserving our freedom. We dont grow our own food, or manufacture our own drugs, rather we rely on oversight of FDA etc. Sure the system isn't perfect but still its better than having a farm in your backyard and a chemical plant in your basement.

We need a legal revolution to address issues posed by rapidly evolving technology.

<comment><USER4> a.) Yes, there are some privacy and ownership/property problems that legislation could possibly solve, but… b.) more laws makes it harder and less fun to write, distribute, and profit from making software.

However, I do think that a legal recourse for users to be able to export all of their data from a service in some format makes sense, especially when said data are entrusted to software startups that have a proclivity for being bought, sold, and swiftly unsupported or end-of-life'd at the drop of a hat.

Or, simpler, and less encumbering: how about a developer-initiated consortium of companies who "won't screw you over" when it comes time to back-up or find a new home for your data? Something like a Better (Software) Business Bureau who promises not to leave you high and dry… but now I'm just having excessively utopian thoughts.

<comment><USER5> I don't think the practical risk here justifies any such thing, because all of this is occurring in a market with possibly one of the lowest barriers-to- entry of any market in human history. With the ubiquity of screen scrapers, the power of various programming languages and environments, and the interconnectedness of the web, any attempt to jail your data can usually be met, quickly, by a large number of people.

For example: back when Facebook was really irritating everyone, Diaspora came along. Now, Diaspora should probably be considered a failed project at this point, but along the way there was a not-small number of developers that came forward and said, "hey, I already did this, start with my code...", and if the anger over Facebook hadn't subsided, I have no doubt that at least one of those projects would have become successful.

Or, for another example: when word got leaked that Yahoo was going to "sunset" Delicious, it took me all of a few bucks and a couple of clicks to export every last one of my bookmarks to Pinboard. (Thanks Pinboard!)

Proprietary software, by contrast, carried much greater risk, because it often used secret data formats which were extremely difficult (or impossible) to reverse-engineer, and because it was much more difficult to scrape the data from the screen in a reliable way. I have direct experience with this: small grocery stores tend to use a product called NCR ScanMaster, which at least semi-recently was "powered" by a truly atrocious Btrieve database backend, which was unreadable without the schema files, which nobody would give you without lots of money. It was damned hard to reverse-engineer too; I have a proud history of that kind of thing, and it totally stumped me for all but the simplest of data extractions.

One of my clients needed to be able to make special sale-related changes to large numbers of products on a regular basis without paying someone to sit there and key it in all day (and make mistakes while they were at it). We eventually came up with using AutoHotKey to control the screen and data fields, but even that was rather challenging because of ScanMaster's variable time delays between screens and AutoHotKey's limitations.

Contrast that with _anything_ web-related, where I could use PHP or Javascript & Greasemonkey or one of any of a number of solutions to parse and scrape the content of any site within a matter of hours.

I can't read the article right now -- the site is down -- but the thing about Stallman is that he's a radical, and he will see his epic foe everywhere he looks. Cloud computing and SaaS have become popular, and are replacing many aspects of traditional desktop computing, but if he's making the claim that there is just as much danger, in terms of personal freedom, with cloud computing and SaaS as there was with proprietary desktop software or timesharing systems, well, he's just plain wrong.

He's also, in this context, probably completely irrelevant. I suspect that his opinions of cloud computing or SaaS will have epsilon impact on the industry, no matter how loudly or oft-stated.

</comment></comment></comment></comment><comment><USER6> Every day Stallman seems a little less unreasonable to me.

 _One reason you should not use web applications to do your computing is that you lose control. It's just as bad as using a proprietary program. Do your own computing on your own computer with your copy of a freedom-respecting program. If you use a proprietary program or somebody else's web server, you're defenceless. You're putty in the hands of whoever developed that software._

In the shadow of Facebook, who would disagree with this?

<comment><USER7> I am just not obsessed with total control. There are things I care about, and there are things I don't.

      If you use a proprietary program or somebody else's web
      server, you're defenceless

Uh, oh. I am there for convenience, not to fight.

</comment></comment><comment><USER8> Stallman's argument assumes there is an equivalent non-SaaS version of every service or that you should live without it if you can't get it as open source. I am giving up absolute control to use Google's search engine but it is not practical to build my own system to index the entire web with sub-second response times. If there was a distributed open source search engine project where a large number of people could pool resources to recreate something similar to Google that would be a different story.

<comment><USER9> my god, you may have inadvertently had a great idea. There's a lot of cool things that could open up. For instance, i believe right now it is not kosher to scrape google results. However an open source distributed engine would be totally kosher.

Search results could potentially be more relevant... there would be millions of computers instead of hundreds of thousands. people could play with ranking algorithms... this is a cool thought.

<comment><USER8> I thought it was a cool idea too. Lack of control means manipulation of rankings might be a problem to solve. You would need to ensure that spammers couldn't flood the system with fake information.

<comment><USER9> Maybe its possible to use that to the networks advantage? If manipulating the data means you need to provide additional computation power/storage... maybe its possible to find a balance?

<comment><USER8> I would be interesting to use multiple random parties to check each other. For example, have 3 independent nodes index the same site and verify that no one has tampered with the data.

</comment></comment></comment></comment></comment><comment><USER10> The link is dead for me, but googling what others quoted yields this Guardian article from 2008:

[http://www.guardian.co.uk/technology/2008/sep/29/cloud.compu...](http://www.guardian.co.uk/technology/2008/sep/29/cloud.computing.richard.stallman)

</comment><comment><USER11> Markets for targeted SaaS solutions exists. Nobody is going to develop these for free and the businesses who need them are more than willing to pay (the value gained is much, much higher than the subscription fee). There are enough different businesses with the same need, that economically combined (through fees) they can support a team that develops the necessary software. These businesses are not going to collaborate with their competitors to develop the same software in a million years, but through SaaS providers, they basically do. Most of the people I know who work in software are basically involved in this at some level. It's not going away, and in many cases, it is really the only reasonable model.</comment>


Ask HN: Where would you go to hire a Python and Django tutor? - <AUTHOR> I'm about two years removed from doing a bit of web development work with a tutor. We built an MVP for an idea I had at the time using Python + Django. The switch to Python 3 and the newer versions of Django are different enough that a tutor would help me a lot again.<p>I'm looking to hire a tutor for 2 hours a week at $30/hour. I'd like to prototype a web application that lets suppliers list themselves, let's users purchase a membership, then let's consumers select options for who they can speak with after they subscribe. <comment><USER2> Django has not drastically changed in the past two years. Have you worked through the Django tutorial? Even if you had a tutor for Django, you'd still need someone to help with the architecture and deployment. Django and Python seem like the least of your concerns.

Also, what happened to the tutor from a couple years ago?</comment>


Building Win16 GUI Applications in C (2014) - <AUTHOR> http://www.transmissionzero.co.uk/computing/win16-apps-in-c/ <comment><USER2> Some more interesting articles on the MakeProcInstance mechanism:

[https://blogs.msdn.microsoft.com/oldnewthing/20080207-00/?p=...](https://blogs.msdn.microsoft.com/oldnewthing/20080207-00/?p=23533)

[http://www.geary.com/fixds.html](http://www.geary.com/fixds.html)

...and if you think the 16-bit segmented architecture is annoying, you probably haven't worked with a bank-switched 8-bit system. ;-)

<comment><USER3> Thanks for the mention! Creating FixDS was definitely one of those "aha!" moments for me. Like every other Windows programmer of that era, I just assumed that all the rigmarole with EXPORTS and MakeProcInstance() was necessary. It was simply How Things Are Done.

So seeing that EXPORTS and MakeProcInstance() existed solely for the purpose of loading the DS register, and finding that in application code the correct value was already in the SS register and could simply be copied over into DS? That was quite a surprise. Why were we all going to so much work when it wasn't necessary at all?

Ever since then, I've had my eye out for places where the conventional wisdom tells us to write code we don't need.

One that I've seen a lot lately - especially in StackOverflow answers - is an unnecessarily complicated way of creating closures in JavaScript.

Many JavaScript programmers seem to believe that the way you create a closure is by writing a function that returns a function. That works, of course, but unless you really _need_ a function that returns a function, it's a complication you can do without. After all, a simple function call can create a closure all by itself.

For example, someone is writing a Google Maps API app that takes an array of data about different places, loops through the array with a for loop, and creates a marker for each of those places along with a click event handler for each marker.

Experienced JavaScript programmers can probably guess what the problem is going to be. I'll simplify the code a bit here to illustrate:

      var places = [
          { name: "One", lat: 34.1, lng: -80.7 },
          { name: "Two", lat: 35.2, lng: -81.8 }
      ];

      var infowindow = new google.maps.InfoWindow();

      for( var i = 0;  i < places.length;  i++ ) {
          var marker = new google.maps.Marker({
              position: new google.maps.LatLng(
                  places[i].lat,
                  places[i].lng
              ),
              map: map
          });

          google.maps.event.addListener( marker, 'click', function() {
              infowindow.setContent( places[i].name );
              infowindow.open( map, marker );
          });
      }

The problem here, of course, is that when the click callback function is called asynchronously, the for loop has already run to completion, and the _i_ and _marker_ variables no longer have the correct values for the marker that was clicked.

Inevitably, someone will now answer this question by suggesting a closure, and illustrating how you get a closure by using a function that returns a function:

      for( var i = 0;  i < places.length;  i++ ) {
          var marker = new google.maps.Marker({
              position: new google.maps.LatLng(
                  places[i].lat,
                  places[i].lng
              ),
              map: map
          });

          // Changes are below, using a function that returns a function
          google.maps.event.addListener( marker, 'click', (function( marker, i ) {
              return function() {
                  infowindow.setContent( places[i].name );
                  infowindow.open( map, marker );
              }
          })( marker, i );
      }

While that works, it's harder to understand than it needs to be. It's like using EXPORTS and MakeProcInstance() to load the DS register.

There is a simpler way:

      for( var i = 0;  i < places.length;  i++ ) {
          addMarker( places[i] );
      }

      function addMarker( place ) {
          var marker = new google.maps.Marker({
              position: new google.maps.LatLng(
                  place.lat,
                  place.lng
              ),
              map: map
          });

          google.maps.event.addListener( marker, 'click', function() {
              infowindow.setContent( place.name );
              infowindow.open( map, marker );
          });
      }

By simply _calling a function_ in the loop, we create the closure we need, and we get simpler and more readable code too.

Of course you can achieve the same effect by using array.forEach(), because that calls a function and gives you a closure automatically:

      places.forEach( function( place ) {
          var marker = new google.maps.Marker({
              position: new google.maps.LatLng(
                  place.lat,
                  place.lng
              ),
              map: map
          });

          google.maps.event.addListener( marker, 'click', function() {
              infowindow.setContent( place.name );
              infowindow.open( map, marker );
          });
      });

Here's a search that will show numerous StackOverflow answers that promote the complicated function-returning-a-function pattern:

[https://www.google.com/search?q=stackoverflow+maps+api+marke...](https://www.google.com/search?q=stackoverflow+maps+api+marker+closure+function+returns+function)

<comment><USER2> Awesome to see _the_ Michael Geary show up on HN! I believe MakeProcInstance was originally created in order to allow apps with multiple data or stack segments ('huge' memory model), but as you noted, is certainly not necessary for the majority of them. In fact, if you were careful or using Asm, even the 64K tiny model would've been sufficient for a lot of applications.

...and I never thought I'd see x86 segment registers and JavaScript closures mentioned in the same comment.

</comment></comment></comment><comment><USER4> Charles Petzold wrote a new 16 bit app for Windows 1.0 to celebrate the 20th anniversary of Windows. The source is at [http://www.charlespetzold.com/etc/Windows1/](http://www.charlespetzold.com/etc/Windows1/)

</comment><comment><USER5> That's pretty cool that the executable will run on Windows 10 today. I have respect for Windows, but that is really impressive.

<comment><USER6> While i sit here watching gvfs shit itself randomly because of a minor glib version bump. This kind of crap is why there is still no "year of the desktop".

<comment><USER7> WinAPI and glib are different things. Compare WinAPI to libc API and Xlib. And I'm sure, you can run X application from 1990 on current Linux. I've learned X programming in 2005, and many resources and mans were dated 1990-1995. They all worked.

Though OpenSource often tends to move forward without thinking much about compatibility, that's right. I guess, it's not an interesting topic for hackers, who work in their free time.

<comment> david-given It's an interesting exercise to pull up an old (but reasonably complex) Xlib app and run it on a modern machine; xfig, for example.

They never pause for breath. Like, you cannot see the application think. Ever. Whenever you ask it to do something, it responds instantly. You click the mouse, and by the next frame the app has updated and is waiting for your instructions.

It's astonishing how much nicer this makes them to use.

(And it's interesting that the Xaw classic design is... um... well, it's as ugly as hell, but it's a kind of functional ugliness which you stop seeing after a bit. Motif, on the other hand, remains awful. The really interesting one of the old widget sets is Open Look, which still looks elegant and polished today: [http://www.daylight.com/dayhtml/doc/thor/thor.sample3.gif](http://www.daylight.com/dayhtml/doc/thor/thor.sample3.gif))

I wonder if there's any mileage in resurrecting one of these old widget systems? Update it to work with modern languages and desktop environments, make sure the accessibility's up to scratch (Motif got this right; don't know about Xaw and Open Look), make sure that modern workflow menus-and-windows apps can be written using them...

</comment></comment></comment></comment><comment><USER8> Slightly off-topic: if I want to learn developing Win32 applications, what is be the best place to start and where do I find comprehensive reference material? I find the simplicity and responsiveness of Notepad2 and similar applications very impressive.

Should I get Visual Studio 6.0 or is a MinGW workflow [1] the way to go? Is MSDN still usable as a Win32 reference or is there some old go-to Win32 bible that I should look for?

[1] [http://www.transmissionzero.co.uk/computing/win32-apps- with-...](http://www.transmissionzero.co.uk/computing/win32-apps-with-mingw/)

<comment><USER9> Petzold's book that dom0 mentioned is/was the definitive Win32 reference albeit very dated now. It obviously will not cover anything in Windows 2000 and later(!).

MSDN is still the go to place for all Win32 documentation although it can be tricky to find exactly what you want as MS prefer to push you towards .NET related stuff. Even finding plain C++ can be a pain with them pushing you towards Android C++ development by default for some reason?!

For software you can go with MinGW-W64 or Visual Studio 2015 Community (you will need to do a custom install and select the VC++ tools as they are not included by default anymore).

I used theForger's Win32 tutorials back in the day to get started [http://winprog.org/tutorial/](http://winprog.org/tutorial/)

<comment><USER2> There's also "win32.hlp" if you want an older, yet offline reference; it's from the days of 95/NT 4, but surprisingly complete as most of the GUI functionality was already available back then.

The recent versions of VS are somewhat more difficult for generating single- file standalone executables which run on OSes older than Vista.

<comment><USER9> Just so others know you will need to install the Windows help system to open .hlp on Windows 10 (and maybe 8?) as they are deprecated.

If you want to build single exe for Windows XP you need to install the specific C++ tools for XP option in Visual Studio. Having not had to use it I do not know if this allows you to build an exe that does not rely on the latest VC++ redist though?

<comment><USER10> There's a command line compiler option to avoid reliance on VC++ redist: /MT (in release mode) or /MTd (in debug mode). Default is /MD (in release mode) or /MDd (in debug mode). With /MT or /MTd Microsoft libc will be linked statically to your application and VC++ redist DLLs won't be required to run the application in the end user environment.

Though there's a shortcoming: if your application consists of EXE file(s) calling into your own DLL(s), then in /MT or /MTd mode you have multiple instances of libc in the process address space, and so tricks like "malloc() in dll, free() in exe" or "open() in dll, close() in exe" will produce weird runtime errors. That won't be a problem if DLL interfaces are strictly C functions and structs, i.e. without classes, STL, smart pointers, exceptions, RTTI-related stuff etc.

<comment><USER2> Static linking can also make the executable a lot bigger, and if the statically linked library uses new APIs, won't run on older Windows versions (I know about the special XP support option, but I don't know if it'll let you create binaries that will run on Win95.)

The other option (which I believe MinGW uses) is to link with msvcrt.dll, something which MS doesn't officially support and rather strongly discourages but actually works very well in practice and enables the "one binary for Win95 to Win10" effect.

<comment><USER10> Minimum Windows runtime version depends on libc shipped with MSVC compiler, for Visual Studio 2008 it's Windows 2000 SP4; for VS2010 it's Windows XP SP3; for VS2013/VS2015 it's Windows 7 IIRC. There's also /Zl compiler option to omit libc entirely (e.g. for small programs using only Win32 API).

MSVCRT.DLL used to be default runtime library for code produced by Microsoft Visual Studio 6 compiler. This DLL is still shipped with Windows, albeit its sprintf() doesn't support %ll format specification, its time() function assumes that time_t is 32-bit, and in general it feels very 1998y. It required some redist on Win95 and NT4 IIRC.

</comment></comment></comment></comment></comment></comment></comment><comment><USER11> Heh, I always thought of Win16 as the Windows 3.x API. It never occurred to me that the "same" API was used for Windows 2.x and even 1.x. Makes sense though...

Really cool to see that Windows 1.0 application run on Windows 10!

<comment><USER12> With some minor (but annoying) changes, it was also the OS/2 Presentation Manager API.

</comment></comment><comment><USER13> been there, done that, never going back! :)

it was fun at the time, though information was limited and precious, you ended up being very dependent on books and magazines to find out about how to get things done.

<comment><USER14> It was very funny making Dialogs with a randomly moving "OK" button responding on WM_MOUSEOVER (or something like it). Make them bigger, toolboxes, always on-top, and disable the top-right "x" button. Fun times :P

<comment><USER2> On discovering that buttons and other controls were just different classes of windows, I wrote a few little games that took advantage of it to spawn moving buttons, checkboxes, and other widgets. Their sources and binaries are probably still somewhere, but not currently on this computer. Incidentally, I believe Minesweeper also does the same with its grid --- they're just buttons.

</comment></comment></comment><comment><USER15> Ahhh... the days... I remember fumbling through something very similar to this and the time I spent in MainWndProc once the application became significantly complex could be awfully frightening for a noob like me.

<comment><USER14> I "invented" a dispatcher library back then for that. Marking and matching callbacks with strings and looping through in the proc [ was very proud with it :-) ]

</comment></comment><comment><USER16> I'm a bit fascinated by the possibilities exposed in the simple demo.

Having right click system menu options that you could extend in what for me is a simple syntax is awesome :-)

</comment><comment><USER17> Does this mean we can write a single binary with GUI which is valid in ELF/COM/Mach-O ?

<comment><USER18> Hmm. ELF and Mach-O should support fat/multiarch binaries IIRC (Mach-O certainly does, it was used in the days of Apple PowerPC=>Intel transition, not sure if it's still supported though), and I think it should also be possible to create COM/COFF binary that can be interpreted and/or run by Linux/Darwin kernel.

</comment></comment><comment><USER19> For added fun, do this on a IBM AT with dual floppy drives. Bah.

</comment><comment><USER20> It feels like cutting a tree with a kitchen knife. Too complex to use directly</comment>


After the recent VPN fiasco, how many of you still have faith in VPN services? - <AUTHOR> So, recently a VPN provider shared its user's log with FBI, and it strictly claimed that it doesn't keep logs, but the opposite was the truth. How many of you would stop using VPNs? Would change their VPN provider? And for exactly what purpose you guys are using VPN now? Does it change anything for you? <comment><USER2> It really depends on what you use your VPN for. If it's for keeping your traffic secret and secure from local eavesdroppers (as in people sharing your wi-fi router), I guess any VPN service will do.

If, however, you are using a VPN service to prevent a government agency from identifying you, there are opsec things you practice before you even consider going online.

I use a VPN to get into my networks - both my personal and my office when I'm not in the office (using different computers for each one that are never connected to the same network). I suppose any government agency that wants to capture my traffic will be able to do so, but I'll not be the easiest target for the more casual criminals.</comment>


Wired: Putting a Writer and Readers to a Test - <AUTHOR> http://nytimes.com/2013/11/30/books/arnon-grunberg-is-writing-while-connected-to-electrodes.html

<comment><USER2> Link without a paywall?

<comment><USER3> Incognito mode.</comment></comment>


Why teach with Ruby? - <AUTHOR> http://blog.hackety-hack.com/post/1313406925/why-teach-with-ruby

<comment><USER2> I think Ruby is a beautiful language but you really got to consider it in the context that it was invented in. Matz originally created it kind of as a spiritual successor to Perl, and it's original incarnation was as an easy to write, easy to read, fun to use scripting language. Rails came along later, I don't think anyone was really expecting it before it showed up, and it changed the Ruby conversation entirely.

Ruby is excellent in many ways but I feel like Matz never took into account what is needed for a group of programmers to work on the same code base. I don't want to say he completely dropped the ball or anything like that but stuff like monkey patching and other shenanigans that make life easier if you are the sole programmer working on a code base become problematic if you are working in a largish team where not everyone might know everything that is going on.

What I am trying to say is, IMHO Ruby "feels" like it is a good language to teach in, but you can end up using it for a really long time without acquiring programming discipline and fundamentals. If you start in C, for example, and you have to mess with malloc and pointers and stuff like that, you are forced to get that discipline, because otherwise stuff goes south really fast. Someone who starts in Ruby might never really understand the performance cost of initializing an object, or what the stack and heap is, or why it matters. I think it would be better for a new programmer to start out in C or even assembly for a little while, just to understand how a computer really works, then it becomes so much easier to understand why languages like Ruby and Python (and my personal favorite, Clojure) were created and how to use the abstractions that these more modern languages provide.

<comment><USER3> I like your point about C, and I have a related point: When beginners see something that _looks_ or _reads_ like natural language, it activates the wrong part of their brain, and they start to wonder why the computer doesn't "understand" what they're telling it. The idea of a logical machine mindlessly executing symbolic instructions comes pretty naturally for some people, but for others, it's the first Big Idea in programming that they have to spend a lot of time getting used to. Every time they read a line of Ruby code that sounds kind of like stilted English, it causes a little regression in their brain back towards the mental model of the computer as something intelligent that understands the natural-language meanings of keywords and variable names.

Say what you want about BASIC, but programs like "10 ? "HELLO" 20 GOTO 10" never let you forget you were dealing with a brainless, inflexible automaton. Same thing with C.

With C, students are encouraged to ask the question, "What's really happening inside the machine?" There are simple, concrete answers based on a simplified view of the hardware. With Ruby, the answer to that question would be more complicated, and more importantly, it would be less concrete -- it's a long, long way to the hardware. C programmers start out grounded, at least grounded in a simplified model of the machine that is consistent and often helpful. How can beginners develop the habit of looking both up and down the ladder of abstraction, if they're looking down from the mountaintop into a shapeless gray cloudbank?

<comment><USER4> One thing I took away from my SICP experience was the idea that it is languages/abstractions all the way down. You can play in a super high level language like Lisp, or you can mold silicon. Somewhere you have to choose your level of abstraction.

If I am teaching somebody how to think about an algorithm like sorting an array, worrying about memory allocations is tangential, an inconvenient burden C delivers unto us. If I want to teach them about working with memory, pointers, and so forth, C is an excellent language for the job.

A crazy thing is happening here when we look down upon beginners who want something that feels like a natural language. Why CAN'T we simply say, "I want an app that opens two windows: one with a list of my music files, and the other with cassette controls. Make it so."? Someone could develop a language that does this; AppleTalk, for example, has some crazy high-level stuff similar to this.

We have been mentally shackled by our languages. We think in them. It is hubris to suggest that this the canonical way to think when programming, that, for example, "i = i + 1" is the idiom for incrementing a variable.

I do believe, to be truly effective in our line of work, that our beginners must eventually come to an understanding of the platform upon which they develop. They must understand memory concepts. They must understand timing concepts. They must understand multiprocessing concepts.

But there is no reason to ram C down some poor soul's throat as a first experience. What a terrible language for teaching beginners, full of syntax and slopped-together features. And what a great language to teach somebody in order to prepare them for the industry.

<comment><USER3> Ruby doesn't encourage you think in multiple layers of abstraction. The next step down from C is a simple machine model with instructions, a CPU, and memory, which is actually kind of helpful for writing code and understanding performance. That layer is visible in the design of C. (It's an oversimplification with no concept of caches, buses, instruction reordering, etc., but those can be added to your mental model when desired.) What's the next layer of abstraction down from Ruby? A byte machine and a garbage collector, neither of which are evident in the language design (to a beginner) and neither of which especially helpful to think about while writing Ruby code.

As an abstraction, Ruby just isn't leaky enough. It's _too good_. It provides no necessity and no reward for thinking about the next layer down. (Plus the next layer down is pretty sophisticated, and pretty abstract from the beginner's point of view. A beginner should know his computer has a CPU and memory and machine instructions, but byte machines and garbage collectors? They will be a mystery until later in the student's development.)

 _A crazy thing is happening here when we look down upon beginners who want something that feels like a natural language. Why CAN'T we simply say, "I want an app that opens two windows: one with a list of my music files, and the other with cassette controls. Make it so."? Someone could develop a language that does this; AppleTalk, for example, has some crazy high-level stuff similar to this._

Natural language promises are a lie. When you understand the rigid logical nature of a machine, it's fine. There's no disappointment or confusion when the natural language model breaks; you just fall back from your natural language mental model to your mental model of the machine as a logical computing machine. You can do that because you already _have_ that model of the computer as a mindless, mechanical machine.

What happens if you don't already have that mental model? What if your closest familiar model for writing a program is writing instructions for another person? When you don't yet understand the nature of the machine and the nature of programming, natural language-like functionality intentionally misleads you. It tries to hide the nature of the machine from you. It will occasionally fail, and the cumulative effect of dealing with the occasional failures _may_ be that you come to understand that the rigid, uncomprehending behavior that peeks through is the true nature of the machine, but why force a beginner to deal with this now-you-see-it, now-you-don't approach to learning how computers work?

Even worse, a beginner might continue to base his model of the computer on the "normal" humanistic behavior and just write the "failures" off as mysterious, uncharacteristic aberrations. When that happens, a programming language that mimics natural languages is actually much worse for beginners than it is for experienced programmers, because it encourages beginners to stick with a mental model by which the machine will always be mysterious and inscrutable.

Ruby isn't that close to natural language, of course, but I think it's close enough to occasionally revive a beginner's dominant, inappropriate mental model and hold back their learning. I see that phenomenon in myself with the "loop" macro in Common Lisp; lacking a precise understanding of loop, my first impulse is to say things that sound right, write them as code, and then see what happens. I would never actually get it right that way, of course -- it would just be an exercise in random frustration unless I strictly copied a known example -- but somehow it feels like the right thing to do, instead of developing a valid understanding. When syntax has no pretension to correspond to natural language syntax, it encourages a more appropriate mindset.

<comment><USER4>
       Ruby doesn't encourage you think in multiple layers of abstraction.  The
       next step down from C is a simple machine model with instructions, a CPU,
       and memory, which is actually kind of helpful for writing code and
       understanding performance.

Vaguely. The "C is close to hardware" point has been well put to rest by folks with better knowledge on the compiler intricacies than I. C gives you the illusion of knowing what you are doing. Your mental model does not help you much in C, at least not in modern C on modern architectures. The next step down from C is object code generated for a specific OS in a specific memory model with a spiderweb of links to other libraries. After that, the OS processes that object code, sending instructions to your hardware, a complicated machine model that includes instruction pipelining, memory pages, and so forth, all of which are difficult to handle by hand without a clear understanding of the interactions. You pointed that out, but you oversimplified the issue.

Fortunately, we are rescued from having to have that much understanding by the C language, which abstracts a lot of concepts nicely. I should point out that printf(), the first output anyone learns in C, has its own language for outputing in the form of format specifiers, far removed from direct machine code. Which instruction do you use for "i = i * 2"? a multiplier or a shift? Some developers rewrite malloc() because of various inefficiencies in the way it manages memory, but the beginner can understand malloc() on a very simple level and be successful.

The nice thing about ruby, python, perl, java, and many other languages is that you do not have to worry about the memory drudgery. In all likelihood, you are going to do it wrong anyway. If I am teaching beginners algorithms, well, we can focus on memory management techniques later. We can still understand that there is a computer with a CPU and some memory available to us.

My point is that you do not have to understand all these layers of abstraction. It is nice to know something of them later, and we are all better developers for it. In fact, knowing a little about garbage collection of your specific language can, for example, help you avoid circular reference memory leaks.

       When syntax has no pretension to correspond to natural language syntax, it
       encourages a more appropriate mindset.

This is what I mean about being shackled by our languages. We come to believe there is some "appropriate mindset". In fact, the language of choice creates the mindset, and your approach to an algorithm will depend on your ability to translate your will into that language's primitives, means of combination, and means of abstraction. Functional languages are the latest fad in part because programmers in general have rediscovered that method of thinking; as you put it, they have had a "dominant, inappropriate mental model [that holds] back their learning". Our beginners were shown the "i = i + 1" pattern and not shown the "for my $i (1 .. 8) {}" pattern.

Sure, natural languages may never be natural enough; two individuals in the same room do not necessarily speak the same English. You have to draw the line somewhere. It just does not have to be at rock bottom, and we have continued to evolve, making layer after layer on top of it. We are corresponding here on a medium that is many levels abstracted from the silicon, and many a beginner in web design can grasp plenty of HTML without understanding how a specific browser is rendering it.

I would argue more optimistically that this is not a matter of somebody's learning being held back. They learned and applied a method that is valid. When that method became insufficient, bug-ridden, poorly optimized, whatever, they learned or experimented with a new approach. This is not holding anyone back in any meaningful sense; they are evolving.

</comment></comment></comment></comment></comment><comment><USER5> The arguments are all very good, but I think I prefer Scheme as a first programming language just because the syntax is easy to teach and you can get to the good stuff much more quickly. Doesn't meet your 'real world' requirement though - although, I think a few months spent learning the basics in Scheme would make it easier to pick up subsequent languages rather than vice versa.

<comment><AUTHOR> I think Scheme is a fine language, especially when paired with SICP. But I see it as being something that's more of the leap from intermediate to master than total-beginner to literate. I could certainly be wrong about this, however!

</comment></comment><comment><USER6> Unrelated, but I often wonder why people insist on a program that prints a string to the screen as the universal best first program. It's very practical, but it's also _so_ tangential to what programming is.

Just delay compilation until the third week and you'll be able to start the dialogue at objects, "is a", "has a", actions, properties. This is the language we use to deal with the world already and though it's got funny syntax attached, it's not a foreign concept to anyone. Talk about the runtime system and it's expectations later.

(Edit: I think this is also why a lot of people hate the IO monad in Haskell so much. Side effects are actually an advanced topic in pure FP so much of the literature on IO is based around flaky metaphors and "don't worry about how this works" just to get people printing things ASAP. If you just use the REPL and don't worry about implementing it then you can build up to understanding the interaction between IO and the RTS in a sensible way.)

<comment><USER7> >Unrelated, but I often wonder why people insist on a program that prints a string to the screen as the universal best first program. It's very practical, but it's also so tangential to what programming is.

The point is that the first step is getting your environment set up so that you can write[, compile,] and execute code. Printing a string is just a conveniently trivial program.

<comment><USER6> It's true that that's the first step to programming as a craft, but it's _hardly_ the first step to programming as a way of thinking, managing complexity, and building abstraction.

That's like saying the first step to flying an airplane is turning the ignition. Yes, that's true, but without a firm idea of what's going to be happening after that point you're only going to hurt yourself by turning that key. It's something that comes to head when learning to fly a plane/program.

<comment><USER8> _It's true that that's the first step to programming as a craft, but it's hardly the first step to programming as a way of thinking, managing complexity, and building abstraction._

But programming _is_ a craft, so how is the first step tangential.

</comment></comment></comment></comment><comment><USER9> I'd like to highlight your mention of Scratch. I agree that Ruby is an excellent language for introducing older students to programming, but Scratch is truly exceptional for younger students. Scratch excels at introducing fundamental programming concepts,while hiding syntax and language subtleties for beginners. The puzzle/block metaphor of Scratch really works for "building" a fully-functional program. For those that have never worked with Scratch, the underlying Squeak(Smalltalk) implementation is completely hidden.

I guess the choice of language really comes down to the audience and age group. It's unlikely that colleges will ever utilize Scratch in their introduction to programming courses, thus Ruby is an excellent choice. But elementary and middle school students would benefit greatly from learning programming concepts such as logic, control structures, iteration, etc. from a tool like Scratch.

</comment><comment><USER10> I can't really ready your post because of the background. I'd recommend changing it

<comment><USER11> Safari Reader (or the Chrome/FF extensions like it, or the readability bookmarklet) fix it nicely (and many other sites like it).

</comment></comment><comment><USER12> Background/disclaimer: I learned Ruby first (largely thanks to _why's guide), but have been using Python at my job and in my personal projects for about a year and a half now, and have grown to prefer Python.

The main gripe that I have with using Ruby as a teaching language is that the whole magic thing. You address this really well, and I really like your passage on abstractions, but I don't agree that the magic is just limited to advanced usage of the language.

Here's my gripe in its most pure form: in Python, in order to figure out _all_ of my capabilities _right now_ (short of what things I can import), I can use dir(object_i_want_to_know_about) and see everything that object can do. I've got a friend who's learning Ruby, and we wanted to find a built-in String method to see if a string starts with a prefix. We found it after Googling, but I wanted to find out about it in the context of the REPL. I figured that Ruby must have similar functionality to Python's dir(), but as far as I can tell, the only way to achieve that is to hack the REPL in a very minor way (you can add a few lines to your .irbc that will achieve this). There doesn't seem to be anything like dir() built into the language, and so it's a lot harder to figure out what you can do at any given point in time without Googling.

I think that this difference speaks volumes about the difference in philosophies between the two languages, and is in large part why when I introduce friends to programming these days, I tend to do it via Python, in particular via Zed's book.

I haven't used Ruby much in the past year or two, though, so if I'm completely mistaken about my assertions here, I'd love to find out about ways in which I can reason about the options available to me when I'm hacking around in irb.

PS: I really liked the code example near the end of the article.

<comment><USER13> _I figured that Ruby must have similar functionality to Python's dir()_

Sounds like you wanted

       'x'.methods
        => [:<=>, :==, :===, :eql?, :hash, :casecmp, ... ]

or the more focused

       'x'.methods - Object.methods
        => [:casecmp, :+, :*, :%, :[], ... ]

    ?

<comment><USER12> Yup - that's exactly what I was looking for. Awesome.

<comment><USER14> The question is why Python calls it "dir" when you just want to see a list of the object's methods...

</comment></comment></comment></comment><comment><USER15> Ruby is awesome.

Please don't compare it with java, that makes me so sad.

Java is so bad, deal with it. The good thing about java is the JVM to use with another language like scala, clojure and so on.

Being a programmer is actually funny, you can stay all your life using 10 frameworks to do something for web in java with a lot of lines of code and bugs and think you are so good(like I did), but you're actually so bad.

I'm still trying to learn lisp and start doing some clojure too, can't wait!

<comment><AUTHOR> > Please don't compare it with java, that makes me so sad.

I only do because Java has been the go-to year one language for colleges for the past few years. I wouldn't even mention it otherwise.

> I'm still trying to learn lisp and start doing some clojure too, can't wait!

Enjoy! I don't have a ton of Clojure experience, but from what I've seen, it's pretty awesome.

</comment></comment><comment><AUTHOR> This post was a lot of work, and I'd love to hear your thoughts, HN. Please tear me apart. :)

<comment><USER16> It seems a lot of the "magic" with Ruby comes from Rails, and I would say that teaching a new language using a framework is probably going to be pretty overwhelming to any beginner.

One thing I would worry about with Ruby as a teaching language is that the syntax is somewhat unique. I don't think this is a terrible thing, the basic structure is similar once you get past the syntax, but I think it can trip people up if it's their first language, and then they move on to Java/C++/Perl/Python/PHP which seem to follow more of a continuity.

I think, from my experience, I actually think learning a couple different languages at once can be really advantageous. I pretty much learned Pascal, C and Assembly at the same time, working in the demoscene, and linking them all together.

The important part of programming isn't the syntax, it's the structure and the concepts. You can always look in the manual for syntax, but structure and concepts are the hardest parts to grok.

So maybe my suggestion is to have side-notes for the examples that say, "here's how you do this in PHP, here's how you do it in Java, here's a breakdown of the differences and similarities."

On the other hand, I may be completely wrong, because I'm biased based on how I learned programming, and not everyone learns that way.

With all that said, this is a pretty great piece.

<comment><USER17> As a TA for an intro to programming class taught using Java, I wish, wish, wish we were using Ruby instead. I spend 70% of my time teaching people Java's obtuse syntax, rather than teaching the underlying concepts. Once a programmer has developed the concepts, she can code in nearly any language, but she really has to learn the concepts. Ruby's syntax is straightforward enough that little kids get it down in days, so students can actually learn computer science rather than Java science.

<comment> mike-cardwell It depends what you're learning. If all you're learning is to memorise blocks of code, then Ruby is probably easier to learn because there's less of it. If you're trying to learn what a programming language is actually doing, I don't think Java is any more difficult than Ruby. If anything, most Java code is a lot more clear about exactly what is going on.

FWIW, I learnt and tutored Java at University and have recently been learning Ruby and Ruby on Rails for fun.

<comment><USER17> Learning what a programming language is actually doing is good, but arguably that is a different course than an intro to CS course.

One big advantage Ruby has over Java is that irb is simply a snap to use.

</comment></comment></comment></comment></comment><comment><USER18> I make a living with Ruby and Rails, but I'd stick with JavaScript if I were learning today. Server-side JS is a LOT of fun.</comment>


Software, fear and witchcraft - <AUTHOR> http://peternixey.com/post/41109124614/software-fear-and-witchcraft

<comment><USER2> Your comment had just resurfaced in my brain and I saw this new headline and came here and was pleasantly surprised to find exactly what I was looking for.

The original tribal shaman(plural) who used sleight of hand or small chemical reactions cultivated society and truly invented ritual and religion, creating a separation of power. Fear of the unknown and fear of power is precisely what our culture is based on.

It underpins our entire society and government. Ritualistic religion goes hand in hand with our culture, even if some of us are not part of it directly.

We can't escape it, and hacker culture will always be counterculture until some great cataclysmic event occurs in our society. Those in power fear the hacker, and the hacker (as we have tragically seen) fears those in power.

<comment><USER3> Sociologically, I would agree that religion is powerful stuff. I don't think it is the basis for _all_ culture, if by culture you mean the sum total of experience one is capable of experiencing with minimal effort.

However, just like one can experience religion without knowing how many angels can dance on the head of a pin, one can experience technology without understanding even the most basic layer below the UX level. In both cases, the uncurious have a world-view unfettered by the constrictions of cause and effect; so technology can seem like magic, and those outside the officially sanctioned boundaries are both wise and "unsanctioned", and thus witches.

<comment><USER4> I've long come to the conclusion that religion is a bootstrapping mechanism: it was something we needed in the past in order to jump over a threshold, and for the last thousand years or two, it's been obsolete and holding us back instead.

<comment><USER2> This is what I am trying to say, but a good point to the parent commenter. To clarify I would say that I was referring to how we got to where we are today. The current power structure of our society. As I said even without direct participation in religion there is a power structure evident in society vis a vis a teacher and a pupil, a slave and a master, a husband and a wife, to name a few controversial examples.

Not all of these are bad inherently, but some things about the world are changing. A hacker wields mystical power of mythical proportions that literally(don't we hate that word) scares the bejeesus out of the Power Elite. They respond with prejudice and who can blame them. Those in power will never willingly give it up.

Ethical or white hat hacking is just a foreign concept. They only see potential abuses, and threats to their power.

<comment><USER4> > As I said even without direct participation in religion there is a power > structure evident in society vis a vis a teacher and a pupil, a slave and a > master, a husband and a wife, to name a few controversial examples.

Don't forget white man and black man, cisgendered and trans, hetero and homosexual, sexual and asexual. I'm guessing you stand on the side of the powerful in at least one of these.

</comment></comment></comment></comment></comment><comment><USER5> 'Demystifying ourselves' meaning presenting our processes in a comprehensible manner so as to educate the audience? I don't think that'll work, because there are an awful lot of _them_ who have active disinterest in that learning process, and plenty whose positions of power are dependent on that. Look at Kansas, where it's not just WBC who're trying to forcibly simplify reality with mob tactics. Look at DOJ -- do you think they _want_ to be reined in by having the bright light of informed scrutiny shone on their methods?

It's already pitchfork o'clock, and has been for a very long time (see 'Copernicus'). Until that changes, it's not safe for any of us outside the broom closet.

</comment><comment><USER6> Unfortunately we can't make the modern technology-driven world simpler for people like Carmen Ortiz. The advice at the end by the author is that _we_ (the tech community) should demystify ourselves. But, there's nothing to demystify, the complexity is there and the only way to understand it is to actually put the time in and learn it. It's not too much to ask that those prosecuting computer crimes are deeply educated in the technical details.

</comment><comment><USER7> > Take the legend of a chosen redhead. Even as a child he cast a spell so > powerful it blanketed the entire world ....

Can anyone tell me what this is referring to? None of the web searches I tried give me anything that seems to be helpful (most of them give me this article as the first hit, and the only hit that is relevant).

<comment><AUTHOR> It was a reference to Zuck

</comment></comment><comment><USER8> What is happening in the comments section?

<comment><USER9> A schizophrenic (and arguably brilliant) programmer who posts on HN, among other places, from time to time: <http://qaa.ath.cx/LoseThos.html></comment></comment>


A CPU/RAM/battery stats chart bar for tmux - <AUTHOR> https://github.com/creaktive/rainbarf

<comment><AUTHOR> I ended up forking this and adding a couple of changes for OSX. The memory statistics weren't being displayed correctly. I also added the time remaining until empty/fully charged.

For the interested: <https://github.com/jh3/rainbarf>

</comment><comment><USER2> Would be nice if it integrated with byobu which displays similar information.</comment>


Horizon – 1977-1978: Now The Chips Are Down - <AUTHOR> http://www.bbc.co.uk/iplayer/episode/p01z4rrj/horizon-19771978-now-the-chips-are-down

<comment><AUTHOR> Totally amazing BBC documentary from back in 1978. Some really brilliant and prescient quotes. (NB You can use hola.org if you're outside UK)</comment>


Usability analysis of 23 enterprise portals. The Result. - <AUTHOR> http://www.useit.com/alertbox/portals.html

<comment><USER2> How'd this get on Hacker News?

I've worked with open-source and proprietary enterprise portals and I can safely say this: they all suck. They're a pain to install, customize, develop for, maintain, intergrate, and scale. If there ever was a software idea that reeked of enterprisey-ness, this is one of them.</comment>


How to block the Chrome Software Reporter Tool (2018) - <AUTHOR> https://www.ghacks.net/2018/01/20/how-to-block-the-chrome-software-reporter-tool-software_reporter_tool-exe/ <comment><USER2> This is a basic example of Google's treatment of its users. They could have offered this to users as an option to help their browsers run more smoothly, while informing the users of the extra CPU drain. Better yet, since what they're monitoring could increase user awareness of what their computers are doing, they could offer to "cc" the reports to the users. This transparency would also put a better face on Google.

But this is not what they did. I don't know what their reasoning was, but I'll perceive it as a callous disregard for the user at best.

And you gotta love the comments section. Within the first five comments, we have Google described as being a nefarious organization created by the US government, the Russians, and the Jews.

</comment><comment><USER3> I'm not defending the practice, but 'scanning for all executables', is false.

'Scans all folders related to chrome' is true. Title is flat out wrong.

</comment><comment><USER4> > A Google community specialist mentioned that the tool scans folders related > to Chrome only, but its scope is not exposed to the user in any way.

The title seems a bit of a leap.

<comment><USER5> Click bait indeed. It does in-fact not scan your PC for _all_ executables.

</comment></comment><comment><USER6> I usually use only Firefox, but when I need to launch Chrome to test something, this reporter tool creates a very significant load one the system in terms of SSD and CPU usage. For the last few times I have simply killed the process, but will see if any of permanent ways to disable this reporter tool really work.

<comment><USER7> Deleting it doesn't work since it is recreated on startup of chrome.

I modified the folder acl '\AppData\Local\Google\Chrome\User Data\SwReporter' to not be able to run the executable. That seems to stick (at least when run as a limited user).

</comment></comment><comment><USER8> Not a flag for me. As I have an old HDD, reading can be slow. And sevral times I found out that the software_reporter_tool was scanning everything (it was when it was reading all steam games folder)

Since then I stopped beliving what google said about it and I made a scheduled job to kill and delete SWRT folders every hours

Oh and the registry value doesn't disable it in any way

</comment><comment><USER9> The title is missing (2018) or (2019) - not sure if the title should have the created or the updated date actually. Anyway, nothing indicates this is current, so the title should have some year

Also the title is total clickbait and while the topic is interesting, it would be great to have a less biased/reaching submission on it.

</comment><comment><USER10> Related: about a month ago, Google auto updater which runs in the background, really started going crazy recently tripping up my little snitch many times a day. Previously, little snitch never mentioned it.

</comment><comment><USER11> Alternative title: every random binary still has full file system acces in Windows.

<comment><USER12> That is in fact incorrect.

Windows NTFS permissions are strictly enforced and depending on the identity the executable was launched under and that identity's group membership (and perhaps some additional "user rights assignments"), the executable can only access drives, files and folders where permissions are granted.

Now sure if you allow that executable to launch as SYSTEM then it's game over (much in the same way launching a binary as root is game over).

</comment></comment><comment><USER13> Is this a defense against malware and problematic chrome plugins?

<comment><USER14> I was wondering which executables is this hunting aswell. What else does chrome run besides itself? Is it flash and the likes of it?</comment></comment>


Backdoor injected to NPM express-cookies package - <AUTHOR> Remote code injection vulnerability wild in public npm package, plausible-sounding 'express-cookies' and its dependency 'getcookies'. >10K downloads during April.
Vulnerable code: https://npm.runkit.com/getcookies/test/harness.js?t=1525249320108
https://www.npmjs.com/package/express-cookies <comment><USER2> No links to git repo in the packages, big warning sign.

<comment><USER3> Suspiciously good looking profile pic for the developer too; [https://www.google.com/search?tbs=sbi:AMhZZite6RvKwDFjIobMX-...](https://www.google.com/search?tbs=sbi:AMhZZite6RvKwDFjIobMX- kFh9uYB5vV1g-iN63JdRUO-6A65UJx3I2bridaMp8pyyG5-RvL77Kcv9Kh692YTw_1Zmpa-l7oEbi39X2NDGE7aQQ0rRKYBmTmOAeeqpsNkusNH8LzWMCFr756Dn- qlbJgaWjEfyj1x_1eUJDvUCFv4f9dDapoKOc_1rRG06pBxaaxcMW14Rrgccz4PNTYmjxyt1EpkS8oVSY8EYaOqbDJoVX7zCAsPWCSWH_1hoPjF0h2ieBiGaslHh4uXo- ySbVxhqVjLZM2JeGw9HaRhHfpQAzBVqGmvYReRdE2IVQvAinapYZQokhM_1TprPgk52_1SSGoatnctN77pzPg)

<comment><USER4> Because it's a crop from a stock photo with a male model (in fact, see the first image result on the page).

</comment></comment></comment><comment><USER2> Can someone explain how the injection itself works? I assume it's the require doing the work, but its not so clear how that loads externally instead of from a path in filesystem?

<comment><AUTHOR> NPM guys explain it in the blog today: [https://news.ycombinator.com/item?id=16975025](https://news.ycombinator.com/item?id=16975025)

<comment><USER2> Corrected URL to blogpost is: [https://blog.npmjs.org/post/173526807575/reported- malicious-...](https://blog.npmjs.org/post/173526807575/reported-malicious- module-getcookies)

</comment></comment></comment><comment><USER5> I am curious to know whether you reported it to npm upon your findings. npm questioned me for who to credit on this matter, and they would like to know who the original finder was.

</comment><comment><AUTHOR> And NPM took it down quickly, whew.

<comment><USER6> did you report it to NPM?

<comment><USER5> I don't know how many reported it to npm, but when I initially saw the post on HN, I took the steps to report the packages.

I don't know who to credit on this, and neither does npm but OP seems to be the source of these findings, although it would baffle me if they didn't report it to npm.

</comment></comment></comment><comment><USER7> There is no reason to use "express-cookies" when "cookie-parser" exists.

<comment><USER8> Express just ejected a bunch of its functionality into "express-" modules.

</comment></comment><comment><USER9> Am I the only one that's only reading the comments after seeing the first two words of the title?</comment>


Show HN: Download Spotify Playlist - <AUTHOR> https://github.com/qrpike/spotify-playlist-downloader

<comment><AUTHOR> NodeJS Script to download an entire Spotify Playlist ( FROM SPOTIFY @ 160kbps ) to your local machine.

Also upon download it writes the ID3 data to the file.

</comment><comment><USER2> Any idea how to grab the login details for accounts setup for Facebook login?

<comment><USER3> You can create a username and password for "devices" under Account > Edit Profile, which works the same way an email/password login would.

Spotify will create a numbered user ID and send you an email with a verification link to create a password.

</comment></comment><comment><USER4> Getting `Error: spanw ENOENT` when trying it.

<comment><USER3> Also got this error after the first track finished downloading.</comment></comment>


Extreme low-carb diet may speed aging and dull cognition: Japanese mice study - <AUTHOR> https://www.japantimes.co.jp/news/2019/05/17/national/science-health/extreme-low-carb-diet-may-speed-aging-dull-cognition-japanese-teams-study-mice-finds/ <comment><USER2> Carb consumption of 20% of calories 8s hardly "extreme low carb". Assume 2000 kcal diet: that's 100g of carbs, which is five times the standard Atkins threshold, for one example.</comment>


Show HN: a new blog search engine - <AUTHOR> http://www.sotosearch.com/

<comment><USER2> Very nice, but the ranking algorithm could probably do with some work. I typed in "Netcraft", the name of the company I work for, and the top result was about a company I've never heard of that make fishing nets: [http://www.sotosearch.com/search?query=netcraft&ordering...](http://www.sotosearch.com/search?query=netcraft&ordering=best)</comment>