HNHacker News
TopNewBestAskShowJobs

alexgartrell

2,937 karma · joined March 25, 2009

SWE @ Thinking Machines Previously Operating Systems, etc @ Meta

Computers are cool

submissionscomments
alexgartrell··on Why do C++ folks make things so complicated?
The main thing that sucks about shared_ptr's is that they break C++'s limited support for covariance. For example

  class A { ... };
  class B : public A { ... };

  // Totally works
  class AFactory {
   public:
    virtual A* makeOne();
  }
  class BFactory : public AFactory {
   public:
    virtual B* makeOne();
  }

  // totally doesn't
  class SharedAFactory {
   public:
    virtual boost::shared_ptr<A> makeOne();
  };
  class SharedBFactory {
   public:
    virtual boost::shared_ptr<B> makeOne();
  };
Also, from a performance perspective, locking the memory bus to do atomic operations on a shared_ptr totally blows when you're expected to turn a request around in a few microseconds.
alexgartrell··on Lamest bug we ever encountered
I believe socket writes don't block until you've filled the internal socket buffer, so it's likely that the unaffected machines simply hadn't done this yet.
alexgartrell··on Forbes is wrong about “Developernomics”
I hope I don't sound rantish, but the author completely missed on his treatment of the Boehm/Beck curves

The Beck curve seems to (I'm not expert) describe the cost of making a change or adding a feature. With routine deployment in XP, it's not going to be that expensive to roll out a new one (although, the Facebook push is a process that requires the complete, undivided attention of lots of smart people, so you don't exactly get it "for free")

The Boehm curve describes the cost of finding a defect. If you find a defect in unit testing, you've wasted one person's time; in inspection, two; in systems testing, possibly many more than two; and in production, potentially 500 million people's time. Not just that, but the bugs are much harder to find.

Consider a hypothetical bug that leaks memory in the event of network flakiness. Your servers are humming along just fine, there's a transient network failure that you fix, and then you think you're fine. Meanwhile you've leaked a ton of memory, web servers start swapping, and the user experience goes to shit as most requests are delayed or timed out. You can fix this by restarting everything (but you should fear the cold roll in general [1]). So now you're fucked; you've got this weird bug that only shows up when the planets align while the microwave is on, no easy repro, and it's costing you real time and money.

[1]http://www.reddit.com/r/announcements/comments/n49rw/were_ba...

alexgartrell··on Facebook security hole allows viewing of private photos
I doubt it https://www.facebook.com/beast.the.dog
alexgartrell··on How Google makes Google(+) fast
That's because most distributed data stores are eventually consistent. This works fabulously in a world where data needs to exist in a handful of places (say, a user's email inbox, which should be replicated so it can be accessed quickly from different geographical areas and for the sake of disaster recovery) but need not necessarily all agree with each other at the same time (If I send you an email, it's OK if you don't get it for 5 or 10 minutes, in fact, it's generally expected).

The problem with social networking is that such silos don't exist anymore. You can't even group users into larger silos with their cliques, because most social circles are overlapping (for some reason people feel compelled to keep making friends throughout their lives). So instead of the trivial email case of caching, you're fighting this battle where you have to constantly trade off consistency (do we synchronously write to every cache in every cluster in every region?) with performance (obviously not, round trip time to sweden is like 200 ms).

And you're thinking "Well, a consistent user experience is the most important thing, so just block the user's notification until the data is available to them." Well how do you know the data is available to them? They might see the notification on their cell phone, which is routed to the east coast for DNS reasons, but the write hasn't made it over to the west coast for whatever reason yet, and they're accessing it on their PC. If you wait for it to appear everywhere, two users sitting beside each other in a dorm room think that Facebook sucks because one guy posted on the other's ten minutes ago and it's not there yet. This isn't a logical consequence to the end user of a backhoe cutting a fiber line somewhere in oregon.

To summarize, it's a super hard problem, which makes it incredibly interesting to work on :) https://www.facebook.com/careers

alexgartrell··on Facebook's "Open Compute" Server tested
Facebook's version of memcached has diverged significantly from the public version, to the point where pushing it upstream is at the very least unproductive and likely disruptive. It is our intention to eventually open source the entire stack, but as it's still very much in active development it's relatively low priority at the moment (note that this is the conservative viewpoint, people with significantly more seniority than myself want to see it released sooner rather than later, and no one above them disagrees).
alexgartrell··on Facebook's "Open Compute" Server tested
That the machines are capable of containing 384 GB of RAM does not imply that they contain 384 GB of RAM[1] :)

[1] I work on the memcached team at Facebook

alexgartrell··on Facebook sees 600,000 compromised logins per day&#8212;0.06% of all logins
> They only have 500-600 million accounts (and not all of those are active).

Nope, we have 800+ million monthly active users (logged in w/i the past month). On one day, we had 500+ million active users in a single day. Though I don't know the exact number, it's probably safe to assume that not every account was logged into in the past month (people pass away, etc.), so the number of accounts is probably larger than 800 million.

alexgartrell··on The Economics of Bike Lanes
I'd argue running red lights is stepping several feet over the line.
alexgartrell··on Facebook privacy fuckup reveals who has your number in their phone
Our user metrics are in terms of monthly and daily active users. More than 800 million people logged in last month with more than 500 million logging in on a single day.
alexgartrell··on 24 year old student lights match: Europe versus Facebook
Disclaimer, jack works with me at Facebook, so he's going to be biased (as will I). However, it is true that there appears to be a circular dependency between speculation and outrage here, and that probably isn't the greatest thing in the world. All I can do is tell you to keep looking for evidence (seriously, keep us honest), and we will earn your trust again some day.
alexgartrell··on The Great Tech War Of 2012
800M+ monthly active users, actually [0]

This isn't an argument for our continued relevance or anything, just fixing your figure :)

[0] http://www.scribbal.com/2011/09/facebook-now-has-800-million...

alexgartrell··on A regular expression matcher in 19 lines of Clojure
Ok, now I'm done

    matches :: String -> String -> Bool
    matches ('^':rs) = dm rs where
      cm r c = r == '.' || r == c
      dm (r:'*':rs) (c:cs) = (dm rs (c:cs)) || ((cm r c) && (dm (r:'*':rs) cs))
      dm (_:'*':"") "" = True
      dm (r:rs) (c:cs) = cm r c && dm rs cs
      dm "" _ = True
      dm "$" "" = True
      dm _ _ = False
    matches rs = matches ("^.*" ++ rs)
alexgartrell··on A regular expression matcher in 19 lines of Clojure
I'm no haskell hacker (by a long, long, long shot[0]), and I've played a lot more with Clojure than with Haskell, but I still found this easier to write and read in haskell than in clojure.

    matches :: String -> String -> Bool
    matches rs = dm ((fixHead . fixTail) rs) where
      fixHead ('^':rs) = rs
      fixHead rs = '.':'*':rs
      fixTail rs = case (reverse rs) of
        ('$':rrs) -> reverse rrs
        rrs -> reverse ('*':'.':rrs)
      dm "" "" = True
      dm ('.':'*':rs) (c:cs) = (dm ('.':'*':rs) cs) || (dm rs (c:cs))
      dm (r:'*':rs) (c:cs) = (dm rs (c:cs)) || (c == r && (dm (r:'*':rs) cs))
      dm ('.':rs) (c:cs) = dm rs cs
      dm (r:rs) (c:cs) = r == c && dm rs cs
      dm (_:'*':[]) "" = True
      dm _ _ = False
[0] I'm particularly ashamed of fixHead and fixTail and the way I special cased matching a star and nothing else against the empty string

edit: couldn't resist doing the golf thing

    matches :: String -> String -> Bool
    matches rs = dm (fixHead rs) where
      fixHead ('^':rs) = rs
      fixHead rs = '.':'*':rs
      cm r c = r == '.' || r == c
      dm (r:'*':rs) (c:cs) = (dm rs (c:cs)) || ((cm r c) && (dm (r:'*':rs) cs))
      dm (_:'*':"") "" = True
      dm (r:rs) (c:cs) = cm r c && dm rs cs
      dm "" _ = True
      dm "$" "" = True
      dm _ _ = False
alexgartrell··on Google+ traffic grew by 480% in one month so press reports a 60% decline.
> Ultimately they may have to give SmartPhone makers some incentive to stop bundling the Facebook app/integration on their devices.

Read: http://en.wikipedia.org/wiki/United_States_v._Microsoft

I'm not trying to be snide either, Microsoft leveraged its relationships with OEMs to incentivize them to stop bundling netscape. I don't think that Google would play that dirty, but it's certainly thin ice.

alexgartrell··on Facebook claims it does not track users, but files patent to do same
Last week, everyone lost their shit about Facebook's logged out cookies. Your traditional megacorp is going to say "oh well, so it goes, repeat the party line" and move on. Internally though, this spurred some engineers to actually investigate it, which lead to an audit, which lead to the discovery that we'd forgotten to delete the user id out of the cookies, which lead to a fix and a blog post and a clarification of our policies.

So, beyond understanding the skepticism, I actually think it's really important, and personally[0] encourage it. We're not going to get better at privacy if people don't jump our shit over every perceived misstep, because we've either failed to make the right decision, or we've failed to communicate our decision effectively.

All I'd ask is that we try to keep this communication as high signal as possible, and avoid going down roads with no plausible resolution[1]. I think that's best for Facebook, the internet, and discussion in general at HN.

[0] I speak for myself and not my employer, Facebook Inc, blah blah blah.

[1] If you think Zuckerberg is evil and that we're all just going to try to screw you, there's nothing I (or anyone else) can tell you that is going to change your mind.

alexgartrell··on Facebook claims it does not track users, but files patent to do same
Then why didn't you say that? You'd have cleanly communicated your point with minimal confusion, and it would have let us skip out on the snarky stuff.

Seriously, I'm not trying to be a Facebook PR drone here, I just want HN to not suck, and one of the reasons it didn't suck before was the lack of snarky crap.

alexgartrell··on Facebook claims it does not track users, but files patent to do same
All I was trying to say was that there are reasons beyond desire to implement a product that would make a company file for a patent. I don't know anything about any product designed to do this, but I also don't know everything about every product at Facebook (it'd be impossible to get my own work done if that were the case).
alexgartrell··on Facebook claims it does not track users, but files patent to do same
I'd like to try to respond to this, but I can't, because you've gone out of your way to obscure whatever point you have with three paragraphs of ultra-sarcastic nonsense.

Fundamentally though, I think your point is, "I don't trust Facebook because of statements and privacy mistakes they've made in the past." That's a fine opinion to have (even though I obviously don't agree with it), so please, for the sake of discussion, state it like that instead.

Edited to add that, in response to your first point (the non-sarcastic one), it doesn't necessarily imply an intent to track users. Filing defensive patents is nothing new at FB (Facebook patented the News Feed and hasn't yet sued anyone for infringement).

alexgartrell··on How Exercise Can Strengthen the Brain
This is pretty unrelated, but since you bring up rep ranges, I figured what the hell.

As I've gotten older (I'm only 22 now, but I started lifting weights when I was 12 so it semi-counts) I've found that I get way more benefit from a bodybuilder style workout. Specifically, rather than work my way up from 5's to triples to singles, I'll do 2-4 sets of 8-15 reps per exercise. I've found that it allows me to target the muscle and avoid strain on my joints.

The reason I bring that up is because I wonder how that compares neurologically to low volume high intensity workouts such as the ones you're doing.

alexgartrell··on Facebook Disconnect
People don't trust Facebook because they don't know what we (fellow Facebook Engineer[0]) know about what it's like on the inside. They don't believe that people are just legitimately interested in making stuff that people will like and use, that we obsess over the stats to make sure that we're making stuff that people and use (they think it's tracking them), and that ultimately, we just want to give people ads that they don't hate (for some reason this is called "selling data to advertisers").

Ultimately though, the opinions of Hacker Newsers (a group with which I've proudly associated for ~3 years now) are only a hint at how much we're helping (or hurting) the world, and while we should always keep it in mind, we need to recognize that this is a group which is accustomed to the IRC style of social networking.

I don't blame anyone at Hacker News for thinking "we" are evil, because we do a shitty job at communicating what we're actually doing and why[1] (and we can't really communicate everything anyway). Instead, we've just gotta try to address the problems that are legitimate and be as transparent as possible.

Shortly, if you call tin foil hat theories tin foil hat theories (even with sound logic as to why they are tin foil hat theories), all you're going to do is convince the tin foil hat theorists that it's yet another elaborate step in manipulating them into believing The Corporate Directive.

And, everyone else, for what it's worth, I'd much prefer it if we could just go back to hacker news on here. I'm a C Hacker first (before being assimilated, I contributed to open source projects like Chromium and Mongrel2, because I loved the problems (coincidentally the same reason I allowed myself to become assimilated into facebook -- I work on code that's hit my millions of users billions of times a day[2])

[0] Cache Infra in 1050 B2

[1] We've enabled applications to write to our network as they wish without introducing much friction or overhead (a single approval), but we've managed to communicate that in such a way that instead of leading people to believe that we've put the onus on developers (and users, as they must ultimately know which apps to trust), we've instead "put our tentacles" into yet another area and are again sharing without reason.

[2] memcache protocol stack stuff, we issue lots (and lots and lots) of requests per page load :)

alexgartrell··on How To Enable Facebook Timeline Right This Second
Everyone will be getting Timeline, but if you'd like to send me a more detailed email, I can file a bug for you.

[username]@gmail.com

alexgartrell··on The Perils of JavaSchools
An interesting semi-related follow up from the former Fog Creek VP of Eng (now at Khan Academy): http://bjk5.com/post/3340326040/in-any-language-you-want-kha...

Not understanding the underlying fundamentals when programming in high level languages can be really dangerous, but generally it's not. I kind of view the ongoing development of Compilers, VMs, JITs, etc. as being somewhat parallel to that of processors. At one point, optimizing with machine code was crucial to obtain performant code, but with crazy-ridiculous superscalar processors and all of the things that come with it, all you can really do is code C, compile with -O2, and then guess and check on optimizations. I wouldn't be surprised if this was the case in most high-level languages before long.

Don't get me wrong, I first read this in High School and this was the essay that made me love C, and made me want to try to get an internship at Fog Creek. I just think it's starting to show its age.

alexgartrell··on A hacker's guide to college
I work at Facebook on Cache infrastructure doing super low level C stuff that gets deployed to lots and lots of machines in a massive distributed system. At best, half of the knowledge I needed could have been gained hacking around on my own in my free time. The other half came directly from Systems courses at Carnegie Mellon and research I did there as an undergrad.

This is also true of my close friends from school (housemates my junior and senior year) who work at Apple on the jscore Javascript engine, at Pure Storage[1] on hardcore storage stuff, and at SpaceX on control systems.

Maybe the average coder doesn't really need a college degree, but if you want to be a badass and get there as quickly as possible, four years at a top CS University is about the quickest shortcut you can take[2].

[1] http://www.storagereview.com/pure_storage_comes_out_allflash...

[2] You still have to go WAY above and beyond, but the exposure to people in that realm is invaluable, and it's hard to get that exposure outside of these places.

alexgartrell··on Dell shares drop a like a rock
Spend a Ton of money on world class industrial designers and sell a rebranded high-end laptop that doesn't suck. I can only imagine that the market for people who want Apple-style hardware (in terms of construction/quality) with Windows baked in is huge.
alexgartrell··on IQ scores in relation to web browser choice
It's also potentially the case that intelligent people recognize that it's silly to be completely upset over ads and that few sides with really obnoxious ads have good content in the first place. Perhaps, to them, it's just not worth the trouble.

But neither is trying to convince anyone on the internet that you're smart in the first place.

alexgartrell··on LulzSec's 'Topiary' arrested
Any way we could get you to share more of your story?
alexgartrell··on What happened to all the female developers?
Can you explain what you mean by male posturing?
alexgartrell··on Ewww, You Use PHP?
If I had to choose I'd probably say C or Python, but language wasn't a very strong influence on my job choice (other than knowing that I wanted to avoid Java). That Fog Creek has done well with Wasabi [1] says to me that language is not the most important thing for most candidates.

[1] http://blog.fogcreek.com/the-origin-of-wasabi/

alexgartrell··on Unix V5, OpenBSD, Plan 9, FreeBSD, and GNU implementations of echo.c
IIRC faster, because variable-length arrays in c99 just bump down the stack pointer, while malloc can be pretty expensive.

But a single malloc is nothing compared to the cost of a context switch into kernel mode.

← PreviousPage 6 of 18Next →