HNHacker News
TopNewBestAskShowJobs

luu

114,230 karma · joined October 23, 2009

danluu.com | mastodon.social/@danluu | twitter.com/danluu
submissionscomments
luu··on Confidential Microsoft brief: 'We're toast if we fight Google on price'
We all know from experience … with Google Apps you can often have to add a lot of different third party appliances just to get to parity with the experience and then all of a sudden you've got lots of vendors to manage and all of a sudden it's very different to that low cost price point that Google initially positioned to the customer.

This is an old story; shades of every high-end vedor that's ever been wiped out by a low-cost player. As a hardware guy, it reminds me of the response you'd hear from POWER, PA-RISC, Alpha, SPARC, etc. vendors when you mentioned x86 workstations.

At the time, my response was, sure, maybe you've got a better product now, but what fundamental advantage do you have that keeps Intel from using their large, and growing, userbase and economies of scale to crush your R&D spending and pull ahead?

Software doesn't have such high fixed costs, and MS has a ton of money to spend on R&D. But, this still sounds like a lame defense.

luu··on Study material for tech interviews
I recently did a batch of interviews at a handful of companies. The advice I got from the best programmers I know was that you shouldn't bother preparing for interviews, other than, perhaps, spending a few hours skimming an algorithms textbook to make sure that stuff is fresh. I wasn't sure about that advice at the time. In retrospect, I agree [1].

80% of the coding questions I got were really simple; things you'd expect any college kid who'd been through a basic CS curriculum to be able to answer cold. Not having just taken an algorithms class, stuff like that took a bit of thought. 20% were things like "implement coroutines in C using setjmp and longjmp" or "implement a regular expression matcher". How can you cram for that? Sure, you can cram for any specific question, but, given the breadth of the question space, your only hope is to understand things well and be able to reason out whatever comes up.

As far as I could tell, being better prepared was negatively correlated with getting an offer. I did well in interviews where I was totally clueless and had to reason things out from first principles. Conversely, I had an interview at Palantir where I heard the question I was being asked, so I said that. My interviewer asked me to quickly sketch the answer. When I did, he asked me another question. After repeating that process a few times he gave up and asked me a simple design question. Apparently, I failed that interview so badly that I got kicked out before lunch (interviews there are normally all day). In general, having heard the question before (and telling my interviewer), or having a flash of insight and being able to write down the answer without thinking about it seem to be taken as negative signals.

I was surprised by that until talking to a friend of mine who said "the interview process is this largely protocol driven song and dance where you're supposed to scratch your head and be wowed by the technical question and then slowly and painfully make incremental progress on a solution while the interviewer can feel smug about knowing it all along and maybe they can help you along the way. If you blurt out a good approximation in the first thirty seconds, that ruins the whole courtship." That's not true everywhere, but it seems to be true at most places.

There are, of course, non-coding questions. Those seem even less useful to cram for. You might be able to impress someone if you happen to know a lg(lg(n)) data structure you can use instead of a red-black tree, but most non-algorithms questions are about thinking on your feet; just having lots of knowledge won't help you there.

[1] This assumes that you have a solid background in CS fundamentals. If not, interview prep has a very high payoff.

luu··on Horses for courses: choosing Scala or Clojure
If you are going to work with concurrency ... I think you definitely want to be using Clojure.

Is it widely accepted that Clojure is better for concurrency? [1] I haven't used Clojure much, so I can't comment on their relative merits. But, I've played with actors in Scala some, and done a bit with STM, and they make concurrency relatively straightforward. It's plausible that Clojure has a better concurrency story (and this blog post has inspired me to try it out) but, concurrency is easy enough in Scala that I don't think of it as a weakness of the language, the way I would with something like C.

[1] This is not a rhetorical question.

luu··on The ARM server apocalypse
The business case for serving web content isn't as strong as you might think from a back of the envelope calculation about cost/power vs. performance. It's true that you'll find that you can get more throughput per cost with ARM/Atom (mostly due to the lower power, but also because the machines are cheaper), but, when you actually do it you'll find that latency is significantly higher, if you compare ARM/Atom boxes with low load vs. fast x86 machines with high utilization [1]. An argument people often make is that ARM is going to catch x86. Sure, possibly, but why wouldn't you expect x86 to catch ARM? [2]

A lesson that people seem to have to keep re-learning, over and over again, is that latency matters a lot on the web. A few ms increase in latency has a measurable effect on your income, as people just close the webpage and click elsewhere. A significant increase in latency is disastrous.

[1] http://users.ece.utexas.edu/~vjreddi/UT/Publications/Entries.... This paper describes a way you can use low-power boxes to get better results for the same cost, but it doesn't involve simply swapping your core i5s with Atoms or ARMs, which is what a lot of people seem to want to do.

[2] One of the major lessons computer architects learned perhaps 10-15 years ago is that the instruction set just doesn't matter that much, compared to the microarchitecture, the manufacturing process, and the quality of the circuit design. Intel has a decisive advantage in manufacturing that's been growing for approximately two decades, ARM doesn't even try to compete in circuit design with full-custom design or fancy circuit techniques, so that leaves the microarchitecture. Although I'd disagree, you might make a case that ARM simply has better architects, and that ARM would produce a better design than Intel if they targeted the exact same space. But, I doubt you'd try to make the case that you'd expect ARM's design to be so superior that it will obviously overcome Intel's other advantages.

Another case you might make is that Intel simply won't target the same space, to avoid cannibalizing their own market, but, in addition to obviously moving towards that space with Atom, they have a history of ruthlessness that makes that seem unlikely.

Intel used to be a dominant player in the DRAM industry, but they killed off their DRAM business when they were a leader in the field, because they recognized that it would become a commodity industry. After becoming a market leader in SRAMs, one of the competitors invented flash; they realized the significance and focused on flash and microprocessors, while, again, killing off what was (then) a major cash cow. It's very hard to imagine Intel just sitting and slowly losing their dominance of the microprocessor industry, ending up with a position like IBM or Sun. They've never done that in the past, so why would you expect them to start now?

luu··on Do Immigrant Engineers Depress Engineer Wages?
There's a large body of work from economists in this area. My impression is that the answer seems to be that the effect on high-skill workers is positive, and the debate is over the magnitude of the positive effect. But, even putting that aside, it seems to me that it's hard to make either a practical or a moral case for restricting immigration of engineers more tightly than we do now.

First, the practical case: when I was in college (2000-2003), none of the Indian or Chinese people wanted to get a job back home. And, they were some of the best people in school: the more advanced the class, the smaller the proportion of native born Americans; graduate level classes were mostly full of foreign-born students, and most of the top of the class consisted of foreign-born students. The U.S. didn't let most of them stay in the country, forcing them to go back home. If you take a bunch of smart people, and force them to live in their home country, they aren't going to go dig ditches; they're going to start industries. Those industries have done so well that many of my classmates (and others) who have spent time working in the U.S., and have a legal right to work here, want to go back home. They, naturally, want to be near their families. A decade ago, there wasn't enough industry to find a job that was both interesting and well paid. By forcing the people who wanted to stay here to go back home, we've forced them to create good companies, and hence, good jobs.

And then there's the moral case. This is less relevant for high-skilled workers now, due to what's happened above, but it still applies for many countries and most industries [1]. If we reduce the wages of engineers in the U.S., we're reducing the wages of a relatively well off group in one of the richest countries in the world. We're talking about reducing the wages of someone who is, on a worldwide scale, in the 99th percentile. If we let someone in from a poor country, we're increasing the income of someone who might be below the 50th percentile into the 99th percentile. It's awfully hard to make a case that we should be enriching the richest people in the world at the cost of the poorest.

[1] Total factor productivity [2] in the U.S. is so high that unskilled Mexican laborers become three times more productive when they cross the border, and, globally, Mexico is one of the richer countries in the world.

[2] http://en.wikipedia.org/wiki/Total_factor_productivity

luu··on Jeff Bezos’ new patent envisions tablets without processors, batteries
Isn't it odd that this is patentable? One day, long before this patent expires, all of the technology needed for this will be commonplace, and the idea will be obvious to any four year old.

I've heard that the point of patents is to incent innovation, but it's hard to see how that's happening here. It's not the case, as with pharmaceutical research, that R&D resources had to be spent to generate the idea, demonstrate its efficacy, and prove its safety. That will be needed for the technology required to implement this, but, this patent actually reduces the incentive to spend R&D resources on the technology necessary to implement it!

luu··on How Etsy Attracted 500% More Female Engineers
I wonder how long it will be before other companies start doing this.

At his confirmation hearing, when Alan Greenspan was asked why Townsend-Greenspan employed so many women (> 50%, compared to about 5% in finance at the time), he replied that since he valued women as much as men, but other firms didn't, he could get more work for the same amount money by hiring women. Now, of course, the difference has mostly been arbitraged away, but it took decades to get to this point.

At the time, people gave many reasons sexism couldn't possibly exist in finance; naturally, more men went into finance because women just didn't like finance, and more men had senior positions because simply didn't want senior positions, and so on and so forth (oddly enough, those same reasons are given today, in discussions of sexism in CS and engineering).

In 1987, Townsend-Greenspan shut down, after thirty successful years, because Greenspan became chairman of the Fed. Now, twenty-six years later, the gender gap among MBAs is much smaller than it used to be, but it hasn't disappeared. I hope it doesn't take fifty-six years from the founding of Etsy for someone to be able to make a comment like this about programmers.

I'm afraid it might be a while, though. In discussions about the topic here on HN, the top comment is often something along the lines of how there obviously isn't any sexism in the field, or if there is any, it's rare, and certainly not a systematic problem, and how it's simply impossible that the highly skewed male:female ratio in the field is due to sexism. That's usually followed by a paragraph on how any attempts to address the issue are an insidious cause of reverse sexism.

The top comment in the previous thread on this topic was a comment about how everything Etsy is doing applies equally to all people, not just women, despite a large body of research indicating that, on average, women are treated differently in the workplace [1], and how some simple changes can neutralize many serious problems [2].

[1] Perhaps someone else can supply a reference to a well-known study that I can't seem to look up. When men react with anger, or act authoritatively, that's seen neutrally or positively, but when women do the same, it's seen negatively.

[2] http://papers.nber.org/papers/w18511

luu··on Online comments hurt science understanding, study finds
I've often wondered how most people read comments. There's something funny you see in voting patterns if you make a comment, and then someone replies with refutation, and then the refutation is refuted, and so on.

Fist, you see your comment get upvoted. But, if someone replies with a refutation that uses the word because[1], or is otherwise convincing, and calls you an idiot, you'll start to get downvoted (downvotes are rarer if there's no invective). That happens even if the 'refutation' consists purely of blatant logical fallacies. I tend not to reply to those, because it seems like a waste of time, so I'll often get downvoted to or below 0 before someone replies to the reply, at which point my comment score will start climbing upwards again.

This is the only site I regularly comment on, because I don't know of any public forum that has a similarly high level of discussion. I'm not sure the level of reading is the same, though. Skimming is dangerous. I do it, too, unfortunately.

There's actually been a set of studies that have shown that people are more likely to be convinced by nonsense they've read if they're distracted. The dangerous part here is that once you've been convinced by something, you don't tag that information as being unreliable because you didn't think critically about it when you first saw it. I'll sometimes catch myself, in a friendly debate, repeating something I've read, and then immediately saying "nevermind; that doesn't make any sense", because I'd absorbed the information unconsciously without thinking about it, but the act of saying it reveals that it's not logically sound.

[1] http://bps-research-digest.blogspot.com/2009/01/would-you-gi...

luu··on What Turned Jaron Lanier Against the Web?
I wish a full transcript was available, because it's hard to tell if the writer has turned Lanier's views into an incoherent mess, or if his views actually are a mess, and the writer is doing the best he can to synthesize them.

Page 2 seems to imply that part of Lanier's dislike of digital culture stems from the fact that MIDIs can't represent saxophone music. Was that really such an important part of the interview that it deserves space in what's clearly a short summary of a long interview? It sounds more like an aside that's been taken out of context.

Later on that same page, the article seems to imply that automatic translation is bad because "by taking value off the books, you’re actually shrinking the economy." That is, because technology allows something to be done more cheaply, it's actually hurting the economy by shrinking nominal spending. But that's precisely why technology has been the primary driver of economic growth since the industrial revolution. You can make a case that it hurts some people while helping people in the aggregate, but, read as written, his criticism is an attack on pretty much any technology, ever.

And then there's all the straw men, like the idea that "Web 2.0 intellectuals" think that "we shouldn’t be self-critical and that we shouldn’t be hard on ourselves is irresponsible." Isn't every other non-tech article on HN a critical piece? If anything, the consensus here seems to be that criticism is given too much attention (e.g., the most upvoted comment in many HN threads is a comment telling people not to be so harsh, the criticism of 'middlebrow dismassal' [1], etc.)

[1] If my comment qualifies, I apologize. I'm writing this because I literally don't understand why Jaron Lanier believes what he does or what this article is trying to convey. The article is full of logical fallacies and contradictions that are so absurd that they're surely not his real views. Other people around here seem to be familiar with Lanier; perhaps someone with more background can make sense of this article.

EDIT: his wikipedia page is decent, although it's a bit light on content: http://en.wikipedia.org/wiki/Jaron_Lanier. I don't agree, but, unlike the article, wikipedia presents his opinions in a reasonable light.

EDIT2: Just as an aside, one of the biggest anti-features I find when I read HN is that there are often many comments expressing variants of the same opinion. They're not exactly redundant, because each presents a unique viewpoint, but it makes comment sections overly long.

I'll often delete my comments after other, similar, comments pop up, to reduce the reading load. I'd delete this, because there are now six other comments expressing the opinion that either Lanier's opinions aren't cogent or that the article isn't representative of Lanier's opinions (and only one dissenter), but it's bad form to delete a comment after someone's quoted it, so I'll leave it here for posterity.

luu··on The End of x86? An Update
Working in microprocessors, I hear this a lot, but, in the long run, Intel has a fundamental advantage over ARM, and ARM doesn't seem to have a fundamental advantage over Intel [1].

People talk about RISC vs. CISC, and how ARM can be lower power because RISC instructions are easier to decode, but I don't hear that from anyone who's actually implemented both an ARM and an x86 front-end [2]. Yes, it's a PITA to decode x86 instructions, but the ARM instruction set isn't very nice, either (e.g., look at how they ran out of opcode space, and overlayed some of their "new" NEON instructions on top of existing instructions by using unused condition codes for existing opcodes). If you want to decode ARM instructions, you'll have to deal with having register fields in different places for different opcodes (which uses extra logic, increasing size and power), decoding deprecated instructions which no one actually uses anymore (e.g., the "DSP" instructions which have mostly been superseded by NEON), etc. x86 is actually more consistent (although decoding variable length instructions isn't easy, either, and you're also stuck with a lot of legacy instructions) [X].

On the other hand, Intel has had a process (manufacturing) advantage since I was in high school (in the late 90s), and that advantage has only increased. Given a comparable design, historically, Intel has had much better performance on a process that's actually cheaper and more reliable [3]. Since Intel has started taking power seriously, they've made huge advances in their low power process. In a generation or two, if Intel turns out a design that's even in the same league as ARM, it's going to be much lower power.

This reminds me of when people thought Intel was too slow moving, and was going to be killed by AMD. In reality, they're huge and have many teams working a large variety of different projects. One of those projects paid off and now AMD is doomed.

ULV Haswell is supposed to have a TDP ~10W with superior performance to the current Core iX line [4]. Arm's A15 allegedly has a TDP of ~4W, but if you actually benchmark the parts, you'll find that the TDPs aren't measured the same way. A15 uses a ton of power under load, just like Haswell will [5]. When idle, it won't use much power, and will likely have worse leakage, because Intel's process is so good. And then there's Intel's real low power line, which keeps getting better with every generation. Will a ULV version of a high-end Intel part provide much better performance than ARM at the same power in a couple generations, or will a high performance version of a low-power low-cost Intel part provide lower power at the same level of performance and half the price? I don't know, but I bet either one of those two things will happen, or that new project will be unveiled that does something similar. Intel has a ton of resources, and a history of being resilient against the threat of disruption.

I'm not saying Intel is infallible, but unlike many big companies, they're agile. This is a company that was a dominant player in the DRAM and SRAM industry that made the conscious decision to drop out the DRAM industry and concentrate on SRAMs when DRAM became less profitable, and then did the same for SRAMs in order to concentrate on microprocessors. And, by the way, they created the first commercially available microprocessor. They're not a Kodak or Polaroid; they're not going to stand idle while their market is disrupted. When Toshiba invented flash memory, Intel actually realized the advantage and quickly became the leading player in flash, leaving Toshiba with the unprofitable DRAM market.

If you're going to claim that someone is going to disrupt Intel, you not only have to show that there's an existing advantage, you have to explain why, unlike in other instances, Intel isn't going to respond and use their superior resources to pull ahead.

[1] I'm downplaying the advantage of ARM's licensing model, which may be significant. We'll see. Due to economies of scale, there doesn't seem to be room for more than one high performance microprocessor company [6], and yet, there are four companies with ARM architecture licences that design their own processors rather than just licensing IP. TI recently dropped out, and it remains to be seen if it's sustainable for everyone else (or anyone at all).

[2] Ex-Transmeta folks, who mostly when to Nvidia, and some other people whose project is not yet public.

[3] Remember when IBM was bragging about SOI? Intel's bulk process had comparable power and better performance, not to mention much lower cost and defect rates.

[4] http://www.anandtech.com/show/6355/intels-haswell-architectu...

[5] Haswell hasn't been released yet, but Intel parts that I've looked at have much more conservative TDP estimates than ARM parts, and I don't see any reason to believe that's changed.

[6] IBM seems to be losing more money on processors every year, and the people I know at IBM have their resumes polished, because they don't expect POWER development to continue seriously (at least in the U.S.) for more than another generation or two, if that. Oracle is pouring money into SPARC, but it's not clear why, because SPARC has been basically dead for years. MIPS recently disappeared. AMD is in serious trouble. Every other major vendor was wiped out ages ago. The economies of scale are unbelievably large.

[X] Sorry, I'm editing this and not renumbering my footnotes. ARMv8 is supposed to address some of this, by creating a large, compatibility breaking, change to the ISA, and having the processor switch modes to maintain compatibility. It's a good idea, but it's not without disadvantages. The good news is, you don't have to deal with all this baggage in the new mode. The bad news is, you still have the legacy decoder sitting there taking up space. And space = speed. Wires are slow, and now you're making everything else travel farther.

luu··on “How Do TSA Employees Feel About Working For a Despised Agency?”
Objection. Assumes facts not in evidence [1]. I don't like the TSA, and I'm not friends with anyone who does, but that's because I live in a strange bubble, surrounded by academics and engineers. Most people don't have a problem with the TSA.

Here's what happened to me the last time I went through a TSA checkpoint:

I opted out. The TSA agent made a snide remark about about me being separated from my belongings, which I'd already put on the X-ray conveyor belt [2]. Then, I was forced to wait about half an hour until an agent was free [3]. There were TSA agents standing around, not doing anything, but, those people, apparently, can't do pat downs.

When an approved agent was finally free, instead of cordially walking me over to the pat down area, he shoved and body checked me to get me to move. After the perfunctory patdown, he pointed to my luggage and said I could go get it. He then stepped in front of me as I started walking towards it and gave me one last shove, away from my luggage.

So, do I like the TSA? Of course not. I have practical and philosophical objections to their process, and perhaps 20% of the time when I opt out, I'm treated like human garbage [4]. But, most people don't have any weirdo academic objections, so they go through the regular process and everything is fine, 99% of the time. Sure, they have to to the airport half an hour earlier now, but that's a small price to pay for what they see as protection from terrorists.

[1] http://www.forbes.com/sites/tedreed/2012/08/09/surprise-gall...

[2] It's a bit like being threatened by the mafia: those are some nice things you have there. It would be such a shame if anything happened to them while you're away. This was sufficient to keep two couples, who initially decided to opt-out, from actually opting out.

[3] https://twitter.com/someben/status/274976070271377409

[4] It's like walking into a random replication of the Stanford Prison experimenter [5]. Will the guards be aggressively unpleasant? Maybe!

[5] http://www.lucifereffect.com/about_content_extensions.htm

luu··on Why we still love board games
What's interesting to me is new board games aren't just variants on existing games; there's noticable innovation in board game "technology". If you ever play board games from the 80s and 90s, they often feel dated and clunky, even more so than video games from the same era.

I recently went back and played some classic Avalon Hill games that were popular when I was a kid. I can't believe me and my friends spent so much time playing them when we were younger. Depending on the game, a full game might take 5 or 10 hours. For many games, the majority of the time is spent rolling dice, looking things up in tables, and moving stacks of counters around. And that's when you're lucky enough to have a chance to do anything -- there's often half an hour or more of dead time when you're waiting for other players to make their moves. By contrast, if you play a game of Dominion, it's possible to finish a game in 15 minutes. You'll have to make a larger number of important tactical and strategic decisions than you would in most six hour long games from the 80s and there's zero idle time [1].

Even with games that use modern game technology, you can see a noticeable improvement over time. Puerto Rico introduced a move selection system that allowed for serious tactical planning (10+ moves ahead) in a lightweight [2] game that could be finished in half an hour (with experienced players). But, the game wasn't perfect. One weakness was that the player turn order was fixed and very important. If you play a game with one weak player and three strong players, whoever goes after the weak player is almost guaranteed to win. Conversely, if you have one strong player, whoever sits down to the left of that player is going to get crushed.

Caylus fixed that by building a mechanism to change turn order into the game itself. Caylus was wildly popular for a year or two, but it's rare to see people play it now. Ironically, the game designer was too good at removing the element of luck for the game to be popular. If you ever played on BSW (an online board game service), you probably ran into 'Alexfrog', who had a record of something like 431 wins and 2 losses. You can predict, with very high probability, the outcome of the game based solely on who's playing, and most people don't like being crushed by the same players over and over again. Another issue the game had was that the gameplay was almost purely tactical. There were only a few viable strategies, so games all had a similar feel to them.

Agricola and Dominion fixed the problems Caylus had by adding significant randomization. Not only does that add strategic variety to the games [2], it also means that anyone can win any given game.

It would be fun to sit down and draw out a board game tech tree. It might hard to make a decent visualization, though, because of the huge span, plus a high degree of multiple inheritance.

[1] There may be some idle time with certain strategies on some of the newer expansions, due to the incredible amount of shuffling required. You can avoid this by playing here: http://dominion.isotropic.org/. I tend to play on isotropic even when playing face-to-face games because it's 2x faster normally, and there are some pathological cases where it's over an order of magnitude faster.

[2] I'm using 'light' to refer to how cumbersome and complex the game mechanics are. Examples of 'heavy' games are Enemy at the Gates (which has over 1000 counters) and ASL (which has something like 500 pages of rules).

[3] Both games do this by strongly randomizing the initial state of the game, and adding a small degree of randomization throughout the game. Technically, Caylus also randomized the initial state, but the initial random state in Caylus was minor; it was just barely enough keep you from pre-computing an opening book, the way you can in chess. Even in Dominion tournament games, where most players have played thousands of games, it's common to see wildly divergent strategies, because neither player has played on a board with a similar starting state, so they both have to figure out the best strategy in real time. I always cringe when that happens, and I realize I'm playing an inferior strategy. It doesn't really help that you can see what they other player is doing, because if you realize that her strategy is superior and try to switch, you'll be doing the same thing, but N turns behind, which is pretty much a guaranteed loss [4]. Your only hope, at that point, is some combination of superior tactical play and luck.

[4] Well, not always. A hybrid strategy can work in some cases. It depends on the strategies and the stage of the game. It depends is a safe answer to pretty much any strategy question, which is what makes it interesting.

luu··on Here’s why other countries beat the U.S. in reading and math
I'm never sure what to think about these articles. I've been seeing these since I was a kid (20 years ago), and yet, U.S. adults seem to do fine; the U.S. continues to be a hotbed of innovation. Not only is SV an unrivaled center of gravity for CS/EE type innovation, the U.S. also has world class ME, ChemE, biotech, etc. innovation.

Furthermore, U.S. students seem to do fine on exams that require creativity (IMO, Putnam, etc.).

If you want to dig into the data itself, there's a passable interface to it here: http://nces.ed.gov/surveys/international/ide/

A large part of the "problem" seems to be because we're comparing a very large country to much smaller nation-states. Massachusetts outperforms almost the entire world [1]. Ignoring variance and how it relates to group size is a well-known problem. It is, for example, the reason the Gates Foundation erroneously spent $1 billion funding small schools [2]. It's a reasonable thing to think about doing, because small schools outperform large schools. But, small schools aren't only at the top, they're at the bottom, too! Small schools have higher variance. Small countries do, too.

[1] http://nces.ed.gov/timss/pdf/results11_Massachusetts_Math.pd...

[2] http://marginalrevolution.com/marginalrevolution/2010/09/the...

luu··on Responsible Disclosure Can Be Anything But
Don't we have a good idea how they would have responded from how they've actually responded? It took four months and a huge public backlash before they acquiesced to demands for replacements.[1]

[1] http://www.forbes.com/sites/andygreenberg/2012/12/06/lock-fi...

luu··on "Smart and Gets Things Done" is necessary, but not sufficient
I pretty much agree, but I'd like to point out that, as a field, programming emphasizes the importance of "Smart and Gets Things Done" more than pretty much any other field does.

I've been interviewing lately, both at hardware and software companies. At microprocessor startups, I ask about the pedigree (past experience, not educational credentials) of pretty much everyone I meet. I don't do that at software companies. The reason is, you pretty much never hear about a new team successfully making a high-performance microprocessor. Apple bought PA Semi, which had a moderately successful exit, but PA Semi was basically the SiByte team, which left after SiByte was acquired by Broadcom, and SiByte was composed of key people from DEC who had been working together for over a decade. When you hear about a new team where most of the people are smart new grads, they usually spend ~ $100M over five or six years years, find that they don't have a competitive product (or, more likely, don't even have anything that's close to working). If they have funding left to burn they may pivot a couple times over the course of a couple years before they burn through their cash and implode.

And that's despite microprocessor design being close to pure reason, in the grand scheme of things. Experience and wisdom matter a lot more in most endeavors. Something you see a lot, even here on HN, when non-CS/programming/engineering topics make it to the front page, are people who try to extrapolate from a few "obvious" facts and then come up with a conclusion that's completely and totally wrong.

In software, you hear about successful companies founded by people just out of school, or even people who have dropped out of school, all the time. "Smart and Gets Things Done" can be good enough to make a decent product. But, something you'd never want to hear from a plumber or a carpenter is "well, I've read some books on the topic, and tried out some tools at home depot, plus I'm smart and good at hacking".

Things like carpentry, manufacturing, etc. are hard. They're done so well here (in developed countries) that it's easy to forget an idea of how hard they really are. If you want to get an idea of how hard they are to learn from scratch, consider South Korea after WII. Its GDP per capita was lower than Ghana, Kenya, and just barely above the Congo[1]. For various reasons, the new regime didn't have much baggage, and they wanted Korea to become a first-world nation. The story I've heard is that the government started by subsidizing concrete. After many years making concrete, they wanted to move up the manufacturing chain and start making ships (among other things). They pulled some of their best people who had experience in business (having learned skills like management, operations, etc.) from working in concrete to try to build ships. They knew they didn't have the expertise to do it themselves, so they contracted out the plans and got detailed instructions how to build ships. They got plans from Scotland, because Scotland has a long history of shipbuilding. Makes sense, right? But, when the Koreans tried to build ships with Scottish plans and detailed step-by-step directions, the result was two ship halves that didn't quite fit together and sunk when assembled. For historical and geographic reasons, Scotland's shipyards weren't full-sized, and they built their ships in two halves and then assembled them. Worked fine for them, because they'd be doing it at scale since the 1800s, and had world renowned expertise by the 1900s[2]. The Koreans eventually managed to start a shipbuilding industry by hiring foreign companies to come and, build ships locally, and show people how it's done. It took decades to what we would consider basic manufacturing working smoothly, even though all of the requisite knowledge existed in books, was taught in university courses, and could be had from experts for a small fee. "Smart and Gets Things Done" goes so much further in programming than it does in virtually any other non-academic field.

Today, anyone with a CS 101 background can take Geoffrey Hinton's course on neural networks and deep learning[3] and start applying state of the art machine learning techniques[4] to research grade problems within a couple months. But, if you want to build a ship, and you "only" have a decade of experience with carpentry, milling, metalworking, etc., well, good luck. You're going to need it.

[1] http://www.nationmaster.com/graph/eco_gdp_per_cap_in_195-eco...

[2] In 1913, 20% of the world's ships were built at Clyde.

[3] https://www.coursera.org/course/neuralnets

[4] About 1/3rd of the way through the course, he talks about a new technique that was published after the course actually started. The future of education is going to be awesome.

luu··on RMS: Apple has tightest digital handcuffs in history
There are three kinds: those that spy on the user, those that restrict the user, and back doors. Windows has all three. Microsoft can install software changes without asking permission

Don't most people consider automatic updates a feature? It's rare to hear someone say say "Boy, I really hate that chrome has automatic updates". And, if you don't like it, you can disable it. If he's referring to phones, my Linux (Android) phone automatically updates itself, and, if you recall the CarrierIQ debacle, the spyware features were disabled on iOS devices and enabled and some Android devices.

The term "back door" is misleading and deliberately inflammatory. The "back door" into windows that causes security updates to be installed by default saves people who don't obsessively download security updates from having actual back doors installed on their machines.

How does Windows spy on users? Is he talking about crash reporting or perhaps the malicious website tracking that some browsers now do, something that prevents actual spyware from being installed?

I use Ubuntu on two personal machines, and I really wish that it had a "back door" as nice as Windows Update. I've upgraded Ubuntu three times and it's broken software that I use daily every time. In one case, I had to recompile something from source, and in two other cases, I had to edit some obscure config file. I like free software, both philosophically and practically, but you're not going to win over users by telling them that features that make it possible for non-technical users to have a secure system are handcuffs.

I dislike this sort of demagoguery because it makes it harder to convince moderates. There's a guy like this at work; he makes it almost impossible to convince people of anything that's even similar to what he believes, because you have to first convince them that you're not a radical extremist before they'll listen at all.

luu··on The Organism Will Do What It Pleases
I'd be curious to hear an explanation of when you should or shouldn't do this. It's interesting to see stackoverflow as an example of bowing to community wants, because stackoverflow seems like the ultimate example of not doing that. The most upvoted topics are closed for being the wrong kind of content, and most of the questions that were, historically, the mosted upvoted would now be closed before they could pick up steam.

I can't be the only person who notices this; pretty much HN post that features SO includes a litany of complaints about them. Even if the original post isn't a complaint, the top thread in the post will probably be a complaint, regardless of how relevant that is to the topic.

My point isn't that what SO is doing is wrong. It's that what they're doing seems to go against the wishes of the vast majority of the community. Jeff even links to a post of his that basically says "you shouldn't always listen to the community". So, when do you listen and when do you ignore? Advice that consists of "sometimes you should do X and sometimes you shouldn't" seems trivially true for pretty much any real-world X.

luu··on Sales comes out of who you genuinely are
I mostly agree with your take over Mamet's, but that's how Mamet views capitalism.

Here's Mamet on the themes in the play: http://www.upstartfilmcollective.com/portfolios/jcharnick/ma...

The play concerns how business corrupts, how the hierarchical business system tends to corrupt. It becomes legitimate for those in power in the business world to act unethically. The effect on the little guy is that he turns to crime. And petty crime goes punished; major crimes go unpunished. If someone wants to destroy Manhattan for personal gain, they call him a great man. Look at Delorean. He completely raped everybody in Northern Ireland with that scheme ... a lot of business in this country is founded on the idea that if you don't exploit the possible opportunity, not only are you being silly, but in many cases you're being negligent, even legally negligent.

He seems to be of the opinion that it's a corrupt system, and that people in the system are inevitably corrupted: http://www.hanknuwer.com/writing/hankanddavid.html

This play is very much about work and about how one is altered by one's job. ... I felt he was doing his job--doing the job of a sales manager. The job of a sales manager is not to empathize. Irrespective of whether or not it's a "good" job or whether he likes his job is not the point; his job is to inspire, frighten, tempt, cajole, and do any other thing he can do to increase sales. When things fall apart he indulges in the very human propensity to play catch-up ball; because people have been abusing him throughout the play.

I like Mamet's work, but, in general, I try to avoid listening when authors and artists talk about politics, because they're usually not better informed than the average freshman in a poli-sci or econ class, and that colors my view of their work. I was pleasantly surprised to find that Mamet's view is nuanced. He specifically says "a lot of business", and I can't disagree there, though we would probably disagree on the precise meaning of "a lot".

I suspect a lot of that is a generational gap. When I look around and I see swombat-style salesmen competing with Mamet-style salesmen, I see Mamet-style businesses getting wiped out. CarMax is cleaning up by getting rid of high pressure sales tactics. It's so bad that around here, multiple car dealerships that used to employ armies of annoying sales people (which I know from firsthand experience) have taken out billboards saying they'll match CarMax's prices and that their sales people no longer work on commission. Barnes & Noble and Borders wiped out traditional booksellers by providing a better experience, and they're getting wiped out by amazon providing an even more convenient experience. I could go on for pages with examples off the top of my head, but I have to really think to come up with examples where a business with a 'traditional' sales model of conning people into something they don't want is eating the lunch of a business that's really trying to give people what they want.

luu··on Am I (Un)Hireable As A Coder?
Have you checked out the HN 'Who's Hiring' threads?

I, too, have an unorthodox background, and I also wonder if I can land a normal software job. This week, I got pulled into a slow IM conversation one night, so I read through the most recent hiring thread[1] to pass the time. There are 102 comments in that thread. I emailed five people who sounded like they had interesting offerings, and in each email included something like "I know I have an usual background, but . . ." along with a link to my github account. I had one phone interview already and I've got another one later this week and one next week.

That doesn't solve the problem of passing the interview, but if you include a candid note in your email, anyone who decides to interview you will be doing it knowing about your 'problems'; it helps to filter out companies that wouldn't be interested anyway.

If you want to pass a more traditional interviewing process, think of it as passing the final to some class. Here, I'm assuming that you've managed to pass at least one academic class in your life. This algorithms book[2] is free, and exactly what you want (it doesn't cover everything in the world; just in the important stuff, and it has good exercises that are approximately difficult as what you'll see in interviews). Pretend that's the textbook for a class you need to pass, and work through exercises until you can solve ones you haven't seen before fluently[3]. Just like cramming for an exam, you'll probably forget 90% of the material a week later, but you won't need that stuff for the vast majority of jobs anyway.

Good luck!

[1] http://news.ycombinator.com/item?id=4727241

[2] http://www.cs.berkeley.edu/~vazirani/algorithms.html

[3] If you get stuck, feel free to shoot me an email (see my profile). In theory, I ought to be able to answer your question cold. If I can't, that's a sign I need to do some review and I'd be happy to re-read the relevant material so I can explain it.

luu··on Graham’s Guide to Learning Scala
Another resource for learning Scala is Werner Hett's 99 problems in Scala: http://aperiodic.net/phil/scala/s-99/. I tried it after doing Odersky's Scala class (https://www.coursera.org/course/progfun). If you've done the class, it's not a bad way to get some practice with constructs that weren't particularly useful in the class.

If you haven't done the class, the problems are simple enough that you could probably learn scala by just working through the problems and googling for relevant syntax. They start to get more involved around problem 50, but, by that point, you'll have a good grasp of the syntax.

If you want to try them out, I have unit tests for the problems I've done (only up to 58, so far) here: https://github.com/danluu/ninety-nine-scala-problems. The tests are pretty rudimentary; I'm sure there's at least one github repo that has more comprehensive tests, but I looked around at tens of repos of other people's tests on github when I first started and I didn't find much.

P.S. If you're in Austin, there's a Scala group that gets together that isn't a meetup, and hence, isn't findable from Graham's link in step 9: https://groups.google.com/forum/#!forum/austin-scala-enthusi.... The majority of the folks there actually use Scala in real production code.

luu··on More in the series of bizarre UEFI bugs
This happens everywhere, unfortunately. I work for that other x86 CPU vendor that isn't Intel or AMD. Even though there are CPUID feature flags that identify which features a processor implements, many developers determine compatibility from the vendor ID. If we're lucky, we'll be treated as some generic 386 and we'll get to run some horribly unoptimized code [1]. In many cases, the driver, platform, or OS will error out and die [2].

[1] http://arstechnica.com/gadgets/2008/07/atom-nano-review/6/. Scroll down to the third graph, if you want the tl;dr.

[2] http://code.google.com/p/nativeclient/issues/detail?id=2508. I don't post that because it's a particularly egregious example. Even though I don't think the reply makes sense, it's actually more reasonable than most responses. It just happens to be public, because the exchange happened on a public bug tracker.

It's fairly easy to fix this sort of thing with a patch, à la Raymond Chen [3], but, for legal reasons, we can't just hand out patches to every program that incorrectly determines features from the vendor string. It often takes over a year to convince a vendor to issue a patch for its driver or OS, even when we have a benign patch we're using in lab to work around the issue, so we can do compatibility testing (we test pretty much everything) [4]. That's if we're lucky enough to get a vendor that wants to fix it; we often just get the runaround indefinitely. I can recall one case when no printer driver from a certain manufacturer would install on a machine with one of our CPUs, even though that same vendor was selling multiple models that used our CPU.

[3] http://blogs.msdn.com/b/oldnewthing/archive/2012/11/13/10367...

[4] I haven't done lab debug for a while, but the last bug I can recall hearing about was a case where, if you had two webcams recording and playing back to the screen while watching a Blu-ray DVD and running an obscure benchmark from the 90s that wasn't even used in the 90s, the machine would hang approximately once every three days. I don't know where we find the mandmen who come up with these tests.

The funny thing is, we had a feature in our part that we suspected was buggy, and disabling that feature caused the fail to go away (or at least occur incredibly infrequently), but you can't ship a part unless you're really absolutely sure it's not going to hang on real customers, so someone had to track down to the root cause and capture it simulation. Just because disabling that feature meant the bug didn't show up didn't mean that feature was the cause. It could have been that disabling the feature just changed the conditions so that bug became less likely, and only popped up once a year, or maybe needed five webcams to expose, or who knows what? IIRC, it took someone two months to find the exact issue.

luu··on Non-hiring Practices
Many years ago, I applied for a Google job that I was totally unqualified for. I didn't even get an interview, but they sent me a nice snail mail paper rejection letter anyway. I've heard mixed things about their interview process, but I still get a have a nebulous warm fuzzy feeling when I think about possibly sending a resume in again one day, because of one simple, probably automated, $.29[1] response.

Conversely, at a company I won't publicly name, I got the silent treatment [2], after getting an offer, for asking if I could take two months off between jobs. I can only imagine what would have happened if I tried to negotiate salary.

I understand and appreciate the blogger's comment that people should behave decently, by the simple virtue of being human. But, that's not going to convince anyone who doesn't already want to be a decent person. But what ever happened to unenlightened self-interest, naked greed, and pure avarice? Not only did they sour me on the company, they lost two other potential hires into the same group, when I told them how their potential future boss treated me when I didn't take the offer without negotiating, after being asked why I didn't take the job.

There's pretty much no benefit to treating people shoddily, and a huge potential downside, when the candidate pool you're trying to employ hears about it. Why do it?

[1] Probably less, since they doubtless qualify for bulk mail rates.

[2] I sent a couple of emails to follow-up, and tried calling and leaving a voicemail once. I had the hiring manager's number (and that's the person I would have been directly reporting to), because he gave it to me in case I had any questions. Months later, I asked a friend of mine at the company what happened, and he told me "Yeah, X is pretty busy". The funny thing is, it was a huge microprocessor project that was staffing about 40 circuit designers / logic implementers, and the hiring manager told me they were expecting to continue hiring for another six months. It actually took them longer than that to fill all the positions they wanted, and I would have started before they were finished with the arch/perf simulations and moved onto real logic work anyway, even with a two month delay. I would have saved them paying me two months salary without having any work for me to do!

EDIT: Sorry for adding something after there have been replies, but it's been a long time since this happened. After looking through old emails to jog my memory, I see that they sent me a standard form with a bunch of info they wanted filled out, before I interviewed. One of the fields was availability, which I listed as 2+ months out. It's a big bureaucratic company, so it's understandable that there are standard forms which get sent out that hiring managers never look at, but ignoring this particular thing this particular time is a bit funny, ex post.

luu··on Popularity in high school yields a 10% wage premium 40 years later
The scribd link is down for me, but there's a free version available here: http://privatewww.essex.ac.uk/~agaleo/wp_files/NewStuff/Popu...

If you don't want to read the whole paper, the interesting sections are, Table 2, sections 3.2 and 3.2 (including Table 3), and, of course, the intro and conclusion.

Frankly, I'm surprised the wage premium for popularity is so low. The wage premium for managers (and execs) is high, and folks who have good people skills are much more likely to become managers. So, why isn't the wage premium higher?

luu··on Fusion Drive: Apple jumps on the SSD cache bandwagon
Well you cant call it caching. By definition, that means data is written to both drives at the same time.

Writing data to both the cache and the main store is not a fundamental property of caches. Consider, for example, the caches on the microprocessor of an x86 chip. The only time both the cache and main memory will contain the same data is if the trait is set to 'WT', which is very rare.

It's true that (coherent) caches behave in such a way that you can't tell that the data isn't duplicated at each level, but that's achieved by writing back the data when, for example, an external device requests some particular cached data.

If the cache is persistent, and external devices can access the cache as easily as the main store, there's no particular reason to write data back, other than evictions [1], i.e., you should expect the cache to basically be "a software which moves files around"

[1] This isn't strictly true -- depending on the access patterns and the characteristics of the cache and the bus, you might want to opportunistically write data back to avoid having to write back on an eviction. Disclaimer: I've only worked on microprocessor caches and not disk caches, so I'm not intimately familiar with performance traces for disk caches. However, based on simple back-of-the envelope reasoning, it seems to make sense to make disk caches the type of cache you consider not to be a cache at all.

luu··on Suddenly everyone wants New Yorker style content. Who is going to write it?
Who's going to write it? How about the writers for The Atlantic, The Nation, The New Republic, The Wilson Quarterly, The Economist, The Paris Review, etc. I could fill up the length of a long-form article with names of publications that have long-form writing.

The real question is, who's going to pay for it? This is like when someone complains that there aren't any good programmers out there, and, P.S., they're paying $25k a year. The article talks about 2000-3000 word articles. At the rate Tumblr's paying, that's $80-$120 per article. Who are they kidding? At those rates, if you're an established writer, you're better off posting to a personal blog and relying on ad revenue.

There have been a few magazines (both online and print) that have recently managed to establish themselves as reputable publications that have good writing. What they've done is pay above-market rates to attract good writers. After all, why would you publish in some no name publication instead of The Atlantic? Tumblr seems to be using the opposite strategy.

luu··on Stack Computers: the new wave (1989)
Mini book review: On the off chance you're planning on implementing a stack machine, you must read this book. A few years ago I was working on a stack machine, and I didn't know what to read because virtually all of the references for fundamental material are decades old. Let me save you the trouble and tell you this is the one you want. There are newer papers you should read, of course, but if you're only going to read one thing, it should be this.

Why would you want a stack machine in this day and age? They're small. Really, really, small. The stack processor we made was so small that it fit in an empty space in the floorplan of our "real" (x86) processor.

luu··on The Programmers Before Us Were Better
There are a lot of mediocre and flat bad programmers out there because we’re knocking down the barriers and letting everyone in, plus they have all sorts of crutches they can lean on now.

This is an incredibly good sign. Jeremy's statement translates to two things.

1. Factor productivity in programming is so high that even "mediocre and bad programmers" can make a net positive contribution to the economy.

2. Barriers to entry are low.

Would we want to change either of these things? Surely no one is going to argue that we should prefer lower factor productivity.

So, what about barriers to entry? If you look at industries that have '1' but not '2', you have a small set of very rich people keeping people out of the industry in order to protect their riches. This makes everyone else in the world poorer, because the service is artificially expensive, and it's especially bad for the "bad and mediocre" people who could have otherwise made it in the industry. The main benefit of creating high barriers to entry would be to make people who are already rich by the standard of the one of the richest countries in the world, in the most prosperous time in human history, even richer. Why should we want that?

It's great that some people think of programming as a craft and continually do everything they can to improve their skills; I can completely understand the attitude, since it's one I have myself. But, not everyone is like that. Some people would rather spend time doing other things. What's really amazing is that we're so rich and productive that someone can put almost no effort into learning how to program and still be a productive member of society. I love it that we live in a country where people can work 1/100th as hard as an employee in a Foxconn factory and produce more value. I hope that my kids will be able to be ten times richer than me while working one-tenth as hard. I pray that they'll choose to work harder than that, but I want it to be a choice.

It is a wondrous and amazing thing that total factor productivity[1] is so high in the U.S. that unskilled Mexican laborers become three times more productive when they cross the border; keep in mind that Mexico is, on a global scale, one of the more productive nations in the world.

[1] http://en.wikipedia.org/wiki/Total_factor_productivity

luu··on Homebrew Cray-1A
One of the coolest aspects of this machine is that everything is fully pipelined. This machine was designed to be fast, so if you’re careful, you can actually get one (or more) instruction every cycle. This has some interesting implications – there’s no ‘divide’ instruction

That's actually a common optimization, e.g, Itanium doesn't have divide; just reciprocal.

I haven't spent time doing assembly optimization for a very long time, but it used to be the case that, even in x86, you were often better off using various tricks to avoid having to divide. I'd be interested in hearing if that's still the case, from someone who does that sort of thing today.

The actual design was implemented in a Xilinx Spartan-3E 1600 development board.

I love that hardware has gotten so cheap. When I was a teenager, I implemented a Sega on an FPGA, and it took Virtex II board (very high end, at the time) to handle everything. Now, an entire supercomputer fits on one of Xilinx's Spartan (i.e., budget) boards.

luu··on FBI renews broad Internet surveillance push
Even if we (dubiously) assume that the FBI's proposed solution is technically impeccable, and can't be comprised, what solutions exist to prevent people from social engineering their way to the data? Heck, what prevents corrupt FBI agents and federal IT staff from just accessing the data themselves?

Of course, the same worry exists for the data at each individual company, but at least those breaches are limited to a single company's data. And, from what we've seen, externally, it seems like at least some companies are more interested in protecting privacy than covering things up. When Google found that an engineer was using his access to stalk someone, he was fired, and the indecent wasn't covered up. It's not uncommon for companies to tell users about security breaches in their own product that would otherwise have gone completely unnoticed (e.g., Pinterest announced a security flaw they had rather than just silently fixing it).

Conversely, in most cases of police and government corruption I hear about, the news breaks after a failed cover-up. No doubt I don't even hear about most cases, because they're swept under the rug. I don't have a particular fondness for Google's employees or process, but, given their track record, I trust them with my data a lot more than I trust some random government employee.

Moreover, if this law gets passed, why would serious criminals continue to use any of these services? This strikes me as having the same impact as most anti-piracy measures: highly inconvenient to non-criminals (in this case, when data gets leaked to actual criminals), but completely ineffective against real criminals. Not to mention the effect on the companies themselves -- I'm certainly not going to use a Chinese email service, because I don't want the Chinese government reading my email. What's an EU citizen going to do if this law is passed?

luu··on Kaspersky researcher cracks Flame malware password
Do people still think this was created by the NSA? It seems extraordinarily unlikely that they would use such a weak password, one that you would expect to fall to a rules based engine. The only way I could even imagine that happening is as a bit of misdirection, and there must surely be misdirection you can do that doesn't compromise your security.
← PreviousPage 3 of 7Next →