Why suburbia sucks - <AUTHOR> http://qz.com/698928/why-suburbia-sucks/?utm_source=qzfb <comment><USER2> It might be unpopular here, and I feel slightly guilty saying it, but I like suburbia.

Mine has wide streets, plenty of tall trees, it is quiet. I like flowers in my yard, etc. I like my neighbors, but they are not within literally an arms length on each side of me every day.

Unlike probably most people here who grew up in suburbs, then perhaps started to hate it and moved to one of the coasts, to a city, I grew up in a city in an apartment. Proximity to stores, public transport and being able to walk is nice. But crime, full public transport during rush hour, noisy neighbors, or simply being flooded by neighbors from the top, crowding, dirty streets, etc. Even grocery shopping was annoying, yeah could walk to the store, but couldn't bring home a car trunk's worth and not worry about for another week.

So rationally, on a general scale, I can understand why suburbia sucks. But as an individual, I don't plan on moving to a city, the trade-offs are not adding up for me.

<comment><USER3> I agree. I have lived in cities and in the suburbs, and I greatly prefer the suburbs. I also feel that many of the points in the article make unwarranted assumptions about priorities, or are based on opinion. _European cities feel "cozy" and "charming" is because they provide a feeling of enclosure, which humans want because it gives them with a coherent sense of place, like rooms in a house._ You may want the feeling of enclosure, but I don't. Again, I've lived in both. I don't feel more "cozy" or comfortable in an urban setting. This is just one of several examples.

My biggest frustration about articles on this topic is how much they assume we all want the same thing, or agree on what is good and bad. Fact-based arguments like environmental impacts are great. But treating "ugly," "soul crushing" and "isolating" as absolutes isn't very productive.

<comment><USER4> "My biggest frustration about articles on this topic is how much they assume we all want the same thing"

It could be clearer but the opening paragraphs talk about how nearly everything in America is suburban. There is no choice for people that want to live in a city. That's because it's illegal to build anything except suburbia.

We'd all like a choice. Developers could build suburbia for you and a city for me. But that's not legal and that is what causes the problem.

A few older areas exist from before New Deal development laws mandated suburbia in the 1930s. And places like San Francisco and New York are insanely expensive because about half of us want to live there and they haven't been allowed to build any more of it for seventy years while the population tripled.

<comment><USER5> Author here - you nailed it. There's no useful discussing to be had about personal preferences when practically the entire country, notwithstanding a very small handful of places, is built as described in the artifice.

And as prevailing zoning laws, building rules and perverse government incentives currently stand, it is either outright illegal or massively uneconomical (thanks to the distortions) to build anything but Los Angeles.

When we have the option for urban living, then we can talk about who wants to live where. As it stands, the usual highway schlock is all the vast majority of us get.

</comment></comment></comment></comment><comment><USER6> The author does a decent job describing the suburbian plight, but doesn't delve into the reasons _why_ deep enough. An older article ascribes suburbian development to peculiarities of US economic policy:

[http://www.theamericanconservative.com/urbs/the- conservative...](http://www.theamericanconservative.com/urbs/the-conservative- case-against-the-suburbs/)

"The sad reality is that, despite the marketing, the suburbs were never about creating household wealth; they were about creating growth on the cheap. They were born under a Keynesian regime that counted growth from government spending as equivalent to that coming from private investment. Aggressive horizontal expansion of our cities allowed us to consistently hit federal GDP and unemployment targets with little sophistication and few difficult choices.

That we were pawning off the enormous long-term liabilities for serving and maintaining all of these widely dispersed systems onto local taxpayers–after plying municipalities with all the subsidies, pork spending, and ribbon cuttings needed to make it happen–didn't seem to enter our collective consciousness. When all those miles of frontage roads, sewer and water pipes, and sidewalks fall into disrepair–as they inevitably will in every suburb–very little of it will be fixed. The wealth necessary to do so just isn't there."

<comment><USER7> Whenever you see conservatives complaining about anything related to the Keynesian regime, you can bet you're reading a bunch of horse-shit with little if any basis in fact.

Government policies didn't create suburbs, people trying to get out of cities did, not everyone likes city life and it's cheaper to live further out than it is in the city. Suburbs are the natural result of a car culture and plentiful land to build on. No Keynesian conspiracies required.

<comment><USER8> Gotta disagree. The easiest example to look at is the Interstate Highway System. They busted up downtowns and put giant highways through them so people could get to and from the suburbs and the cities. Baltimore, Atlanta, LA, DC, Boston, DFW, NO, etc. all have peculiarly similar interstate structures.

<comment><USER7> I think you're confusing highways and freeways, the Interstate Highway System has nothing to do with suburbs, it connects cities to each other. And cities build freeways because locals demand them, because they don't want to live in the city. That's not government creating suburbs, that's government responding to the desire for suburbs. Suburban sprawl tends to happen first, and then freeways are built to connect them to the city faster.

<comment><USER9> Cities don't build freeways, the feds build freeways (sometimes the state will build a highway, but it's mostly feds).

<comment><USER7> Correction noted, but the funding source doesn't change my point. Demand drives the building of city freeways, the freeways don't create the sprawl, the sprawl creates the demand for freeways.

</comment></comment></comment></comment></comment></comment><comment><USER10> To each their own. I've lived in cities and suburbs, and I personally greatly prefer the latter. I'm not alone - I promise.

It's fine if some, or even most, think that suburbia is hell on earth. Criticize suburbia all you like. Don't live there. Go someplace you enjoy. Also, try not to assume that your feeling on this matter is objectively correct.

<comment><USER11> My biggest problem is that I like neither very dense urban living, nor low- density, car-dependent suburbia. Thanks to poorly-designed zoning, the US doesn't have much "in-between" housing or density, and that's a shame. See: [http://missingmiddlehousing.com/](http://missingmiddlehousing.com/)

</comment></comment><comment><USER12> Suburbia is popular because people enjoy living in suburbia. It's annoying when people write articles like this and don't bother to talk to people who live there and find out why.

<comment><USER13> Whether they enjoy it or not, I don't think many people have had an actual real choice about whether or not to live in suburbia.

For one thing in most North American cities it is the default and inescapable urban planning norm. There's no alternative. If someone cloned a dense and walkable European town nearby I'd choose to live there, but most towns around me are the same generic strip mall suburbs.

There are a handful of North American cities with vibrant residential cores or inner neighbourhoods that one could choose to live in, but ultimately for most it's not sustainable. In cities such as SF and Vancouver, attainable housing is in the multi-unit condo form which is not often suitable for growing families. What ground oriented housing exists is for multi-millionaires. Inevitably if one chooses to have a family the suburb is a forced choice.

</comment></comment><comment><USER14> Classic suburbia was desirable because it promised living in a newer house with a private yard and a garage, on a low-traffic street, in an ethnically and socioeconomically homogenous neighborhood zoned to a well-performing school. Automobile dependence was a feature to empower the car-owning suburbanite and to restrict the casual exfiltration of people from the city into the suburbs. (These fears, that good-for-nothings will take public transit to cause trouble in the suburbs crop up to this day.)

As suburbs age, their advantages decline. The houses are no longer new, traffic (on all but the leaf-node cul-de-sacs) has increased. When one suburb is built out, the urban area spreads outward, and newer suburbs and exurbs are created. Those that can afford to move do so, slowly decreasing the average income of the neighborhood, which correlates strongly with school performance. Desirability keeps declining in turn.

Some suburbs can avoid this fate by becoming large employment centers, and then we call them edge cities instead (e.g. Irvine, Tysons, Bloomington).

</comment><comment><USER15> As someone who lives, and prefers to live, a car-centric lifestyle (as opposed to walking or taking public transportation), most of the points in this article don't bother me. I think this is just another rehash of the "cars are bad" argument that keeps making the rounds.

<comment><USER16> I don't think he's saying cars are bad, he's pointing out lots of flaws in the design of roads and living areas. He's bringing up the inefficiencies that lifestyle has, suburbia he argues brings a lot of inefficiencies.

I LOVE driving. But Los Angeles is complete shit due to the suburban sprawl, lack of a well designed connectors and ramps, lack of well designed roadways for the throughput, etc. Los Angeles is a prime example of why Suburbia sucks. This article hits all the right points.

There's a lot of artificial inefficiencies we've imposed on ourselves due to lack of forethought, stubbornness, resistance to change, or many other reasons. Sadly, it's impossible to fix anything in a quick manner.

</comment></comment><comment><USER17> When I was single-ish, I loved living in the heart of Seattle.

Now that I have a family, I really love living in the burbs, for pretty much all the reasons that irritated me about living in the heart of a big city. Having a young infant really changed my priorities.

</comment><comment><USER18> Sorry, but I prefer suburbia over everything else, and I can't stand to live in a city.

I like wide-open spaces, a lack of noise, and cheap spacious housing. Cities just make me claustrophobic, and I can't stand it. I absolutely cannot tolerate having anyone else live above or below me, and noise drives me up the wall like nothing else. I've got a big-ass house for considerably less than $1 per square foot per month, I have no noise, and I like the aesthetics of the area around me. Also, the crime rate is very low, and I don't have homeless people constantly demanding I give them money and then shouting epithets at me when they find out I don't carry cash (that happened multiple times a day back when I used to work downtown; it hasn't happened even once since I started working in the suburbs again).

All in all, cities are nice places to play tourist and visit in small doses, but I'd rather live in the suburbs.

Edit: I'll also add that I'm openly LGBT, and I've heard horror stories from other LGBT people, even those who live in very liberal cities, about some of the things that get shouted at them on the street in urban environments. Even in a liberal place like Boston, you're going to have punks shouting slurs at you on the street if you're openly LGBT, yet I live in suburban Texas and nobody has shouted a single homophobic or transphobic epithet at me in the suburbs. Everyone is polite and friendly to me. I feel safe here. I don't care if it's just an act and they're just being polite to my face because they're taught to be polite to everyone even though they're going to talk about me behind my back; just as long as I don't have to hear the abuse, I'm fine.

</comment><comment><USER19> Suburbia represents a few trillion dollars worth of malinvestment, IMHO. You can even trace the spread of suburbs back to the subsidies and incentives that created them. The tax deduction on mortgages, along with Fannie Mae et al, were explicitly designed to increase home ownership. Extraneous housing will get built in that environment, and the only question is where. Undeveloped areas have a much easier time giving concessions to developers, so that's where they're going to build.

Overall, the fix is some combination of a land-value tax, anti-NIMBY ordinances, subsidy removal, and infrastructure downgrades. Explanations for each:

Land-value tax: the unimproved value of land is approximately equal to the value created by building infrastructure and creating valuable economic areas. This aligns incentives better than existing tax structures, and has various other benefits that economists really like.

Anti-NIMBY: the overall effect of NIMBY policies is two-fold - it makes undeveloped areas relatively more attractive, and it enriches current residents of an area at the expense of society as a whole.

Subsidy removal: often, when silly things are happening, it's because there's a subsidy or tax reason that boils down to "we are willing to pay you to do silly things". It's just as true for building suburbs as it is for removing windows from vans, shipping them from Germany to the US, and then re- installing those windows.

Infrastructure downgrades: a certain intensity of land use makes only so much infrastructure make sense. If there's not enough people benefiting from a road to pay for asphalt, it needs to be gravel. Sucks for the people there, but it's even less fair for everyone else to pay for their asphalt privileges.

</comment><comment><USER20> "Reasons that this particular author hates cars" is a bit more like it.

Of course, if you pick the worst of everything of suburbia, you can "prove" that it sucks. But the author utterly fails on a large number of points, such as proving that humans like to feel enclosed by buildings on both sides such as on Saint-Germain, and that they utterly hate being able to actually see the sky like in the "middle of nowhere". And hey, he hates GarageHouses because they worship at the altar of the car. How terrible. Tsk, tsk. Of course he hates that ugly house's façade, but he's unable to prove that tacky design is a necessary consequence of suburbs.

I live in a suburb. The houses are not all the same. I love cars and motorcycles; we've got 4 motorized vehicles at the moment. None of them fit in the garage because we don't have some absurd cookie cutter house. We don't have an absurd cookie cutter house, because that doesn't fit our aesthetic.

We live in a relatively quiet neighborhood that is, yes, zoned residential, but we're also a block from restaurants and a bar and a grocery store. We don't have winding meandering streets that get you lost; we're literally 2 blocks from the freeway.

Oh, and I can and do bike a few miles to work despite the fact that public transit sucks.

I love visiting cities, but could never live in one. Guess what? I don't want shared walls. I don't want to have to worry about where I'm going to park my cars or whether the windows will be intact when I return, or whether I'll be kept awake by the sounds of mixed-use blissful commerce happening beneath me.

He's right about so many things but just falls victim to boring old tropes. I also lived almost-spitting-distance to a grocery store in an apartment once. Thanks to a 10ft high brick wall, I had to walk 5 minutes out of the complex, 5 minutes around, and 5 minutes back in the direction of the store; 15 minutes to go what was really a few hundred feet as the crow flies. Of course it's absurd, so I didn't keep living there. But this does not make suburbs hell. It makes poor design choices hell.

<comment><USER18> I agree with you on all points.

> "Reasons that this particular author hates cars" is a bit more like it.

Yep. Reading the article, every time I read one of his numbered points, I just thought "But that's a good thing". They only make sense as negatives if you already have an irrational hate for cars.

> And hey, he hates GarageHouses because they worship at the altar of the car. > How terrible. Tsk, tsk.

On a related note, I found the author's rant about alleys utterly nonsensical.

I live in the suburbs of Dallas, where alleys are everywhere. Most suburban neighborhoods here have large networks of alleys where trash cans are located and garages empty out.

</comment></comment><comment><USER21> Suburbs are personal space for the home.

If, out in public, you feel uncomfortable when someone you don't know stands close enough that you could touch elbows with them, you may prefer suburbs to density.

If, when you hear someone unexpectedly yelling nearby, your first reaction is "let's see what the trouble is" rather than "let's see what the excitement is", you may prefer suburbs to density.

If you would prefer scheduling to spontaneity in interactions with people you don't live with, you may prefer suburbs to density.

If you would like to avoid learning to sleep through sirens and yelling, you may prefer suburbs to density.

If you laughed when you read "People feel vulnerable and uncomfortable in open areas with ill-defined margins.", you may prefer suburbs. ;)

On that last: I think it really sums up the whole article that they present those two images in section 6 and then try to explain why "people" feel more at ease with the Saint-Germain photo. They don't try to explain why some people prefer wide open spaces, and I get the impression it's because they don't really believe anyone does. All these people are really seeking out homes to buy in places they know they'll be unhappy? But maybe that isn't it.

Oh, wait, they do consider that people actually say they like having more space, in 7. They don't seem to believe it, though, remarking that it's important how usable the space is. But it really isn't: in fact, for those of us who like lots of personal space, having large nearby areas which are clearly unsuitable for most human activity helps put us at ease. If you see an adult in a drainage ditch, there is a short list of reasons why they'd be there, and any of those reasons justifies becoming involved to see if they need help, or whatever. If you live in a dense city and someone is hanging out next to your window, which is an arm's length from the sidewalk, they could be trying to open it, or... it could be any hour of any day. If you live in the pictured suburbs and someone is hanging out next to your window, there's less uncertainty.

> useless frontages, pointless greenspace between compatible land uses, as > well as chain-link fences, concrete barriers, and drainage pits

Complaining that the moat isn't chlorinated and has smelly monsters in it misses the actual purpose of the moat.

There's a lot to like about cities, but a lot to dislike as well, and those things push a lot of people to the suburbs.

</comment><comment><USER22> His last point about regional planning can't be emphasized enough. The city I live in is entirely independent of its surrounding county, which itself is a patchwork of incorporated and unincorporated municipalities (and where the vast majority of people choose to live). This bifurcation causes all sorts of fundamental planning issues that harm the region.

</comment><comment><USER23> You know, I've never liked articles which take the position that X sucks, or tries to say that X sucks. There are some things that don't really have any redeeming qualities, but those things are few and far between. Most of the time it's just that this person doesn't like it. I'm not much of a fan of suburbia either, but there are plenty of others who do like what suburbia offers, and don't like densely urban areas.

<comment><USER24> Everything that people "like" about American suburbia, rural Germany (for example) is better at. Big houses with big yards, but just a quick trip from an actual town, and not much further from some kind of city.

It's a garbage design in just about every way. A huge mistake.

<comment><USER25> I visited rural Holland as a teenager and my mind was blown by the fact that you could live somewhere rural yet get around by bicycle. Most Americans don't know what they're missing.

<comment><USER26> I love the netherlands! It's a lovely country, full of fantastic people and tasty treats. I lived there more than 30 years ago, and I still miss poffertjes and lament to all and sundry the lack of fresh stroopwafels in the US.

But it's roughly the size of the Front Range in Colorado. It's _tiny_. Serious question: how many places in .nl are > 10km from a city of moderate size? I'm going out on a limb here and suggesting "not many".

</comment></comment></comment></comment><comment><USER27> Accusing suburbs of being lassez-faire is quite a miss, I think. There is quite a bit of subsidy, there are lobby groups for it, the very act of zoning itself is extremely political and the rents exploitation arrangement is quite...vivid. Throw in HOAs ( which are written into deed contracts ) and it's significantly less than free.

The George Romney inspired expansion away from the 20% down, 30 year mortgage to what ended in 2008 was an effort to tie people down to a mortgage for reasons of, roughly, social control. If you read Haber & Calomiris "Fragile By Design" \- they're quite conservative - you get a better picture of it.

I love the suburbs. Because if I play my cards right, I get to be a beneficiary to much of all that.

</comment><comment><USER28> This almost exactly mirrors the points made by _Suburban Nation_ in 2000. If you're truly interested in this topic, I highly recommend reading the original instead of the online Cliff Notes.

<comment><USER29> The unfortunate part is that building the kinds of cities in which many people would like to live is illegal in much of the U.S.: [http://www.amazon.com/TheRent-Too-Damn-High-Matters- ebook/dp...](http://www.amazon.com/TheRent-Too-Damn-High-Matters- ebook/dp/B0078XGJXO) or see Edward Glaeser's _The Triumph of the City_.

</comment></comment><comment><USER30> Suburbia is a defensive design. Big houses & lots, and lack of public transport, means that it tends to be more expensive and requires reliable access to a car. Low density means that blight doesn't spread as quickly, and geographically-selected organizations (in particular school districts) don't change as quickly, and they're also selecting membership from the same groups that can afford the real estate and transport. HOAs explicitly prioritize maintaining property values.

This all selects for higher-quality neighbors.

There are ways to achieve this in urban settings, but it tends to require more direct, onerous, and legally iffy regulation.

<comment><USER31> Wealthier neighbors. You meant to say wealthier.

<comment><USER30> No, I didn't. The salient aspect is "nice" neighbors; people like poor teachers, or unemployed kids of existing residents, are just fine. Things like HOAs are particularly brutally enforced in poorer neighborhoods attempting to become or stay "nice" (eg, in black but predominantly middle class neighborhoods).

</comment></comment></comment><comment><USER32> It "sucks", stated as a fact. But so many people voluntarily choose to live there.

<comment><USER33> "Choose" is an interesting word. School funding is largely based on district property values in the US, so when you build enclaves of $400k homes that ends up being where the only good schools in the area are. Hard not to choose that if you have kids. Mortgage interest deductions also encourage the choice. The development model for suburbs also passes along the cost of infrastructure, so that it isn't necessary for buyers to pay for it in the form of property taxes. Local governments just approve more suburbs to pay off old infrastructure debt, until they eventually default and leave the state with the debt. It's easy to choose infrastructure someone else pays for. Roads into and through suburbs are paid for out of states' general funds to the tune of 70+%, again, easy to choose that.

<comment><USER34> I grew up in the suburbs and have as an adult lived in everything from traditional suburbs to a dense inner city. If I had the choice, I'd happily move back to the suburbs. Suburbs are easy to get around (assuming you have a car) and there's plenty of privacy. There's little of the cheek-by-jowl cramming together of people that you find in dense cities.

I don't really know what people mean when they say suburbs are dull. There always seemed to be plenty of options everywhere I lived, conveniently accessible by car. Are the people who complain about this stuff real oddballs who need weird stuff you can only find in the biggest of cities, or are they congenitally hostile to driving?

<comment><USER18> > There always seemed to be plenty of options everywhere I lived, conveniently > accessible by car. Are the people who complain about this stuff real > oddballs who need weird stuff you can only find in the biggest of cities, or > are they congenitally hostile to driving?

What's funny is that, in Dallas, all the interesting restaurants in the suburbs.

Want an authentic Sichuanese restaurant? Looking for a Cantonese barbecue joint? Or maybe an Indian place that serves real chaat? Or how about a nice steaming bowl of pho? In Dallas, you'll find all of these in strip malls in the suburbs (in fact, we have a pho joint on almost every street corner in some parts of the burbs), while food in the city core consists of a mixture of yuppie bars, restaurants that only appeal to white hipsters, and fast-food joints aimed at the people who commute to downtown.

Every single Asian demographic in the Dallas area has chosen the suburbs over the city, leaving Downtown and Uptown to white yuppies and hipsters.

</comment></comment></comment></comment><comment><USER35> I must sound like an alien, but what is suburbia? How do I know if I live there?

<comment><USER34> To a first approximation, if you are living in an area where most people live in separate single-family homes, but you are not surrounded by fields or orchards, you are living in a suburb.

If you are surrounded by fields, you're in a rural environment. If people around you live in multi-family structures, you are in an urban environment.

I'm sure there are more formal definitions, too.

<comment><USER35> Ok I am in them, and it doesn't suck that much. Sometimes I wish there were more fields though, and other times I'm glad to have a grocery store nearby.

</comment></comment></comment><comment><USER36> James Howard Kunstler gave an incredibly sharp, funny talk called "The ghastly tragedy of the suburbs" on both the history and design problems of the suburbs. [https://www.ted.com/talks/james_howard_kunstler_dissects_sub...](https://www.ted.com/talks/james_howard_kunstler_dissects_suburbia?language=en)

</comment><comment><USER37> Pretty sure this is copied from another article. Remember seeing this exact same post a month ago or so on here.

<comment><USER15> [https://likewise.am/2016/05/08/why-suburbia- sucks/](https://likewise.am/2016/05/08/why-suburbia-sucks/)

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

</comment></comment><comment><USER38> Suburbia is too broad a category for meaningful conversations to happen around. I assure you the low crime/good school stereotype for instance is not universal.

</comment><comment><USER39> Why do I prefer suburbia? Because I found out that my family life was more peaceful when each child had their own bedroom. I can't afford that downtown.

<comment><USER5> Does being unable to afford downtown equate to preferring suburbia?

</comment></comment><comment><USER40> I'm not usually a fan of articles about "Why X Sucks", because almost invariably I think X doesn't suck as much as the author thinks. It's like I'm hard-wired to disagree with any headline that tries to make an assertion. But this is one case where I think we can all unequivocally agree that suburbia _sucks_ in a way so profound that it escapes description.

</comment><comment><USER41> This reminds me of one of Paul Graham's essays, "Made in USA," [http://paulgraham.com/usa.html](http://paulgraham.com/usa.html), where a friend visiting from Italy remarks that American cities are so ugly. He goes on to explore what America is good at and what it is not so good at.

</comment><comment><USER42> As I ponder the suburban/urban/rural matter, I come to a pretty blunt conclusion - in order to have a functioning society over the next 150 years, we need to effectively outlaw exurbs and suburbs or make them _prohibitively_ expensive.

We need to prioritize solving climate change; prioritize effective resource distribution; prioritize central management at the provincial/federal level; prioritize integrations of humanity into high-density regions. This will boost effectiveness of the tax dollar per square mile, as well as collocating more tax dollars in census zones, so having _more_ dollars per mile. Vast amounts of functionally unsustainable infrastructure - from roads, to schools, to governmental structures have been built that is not fundable at the level we are asking it to perform at.

This needs to change at the federal level, and aggressively.

Fundamentally there are repeated precedents in US history for this kind of centralized planning: the two big waves previously are homesteading and suburban funding via Fannie/Freddie and post-WW2 home loans. The US needs to do it again.

Having lived in the suburb and rural worlds, I understand their viewpoint - and it is valid, but doesn't have the mathmatics to sustain it - but my perspective is that a profound slow-moving crisis is upon us; the only real solution is to start shutting down the suburbs and urbanize as hard as possible.

We're not in the 1890s or the 1950s anymore; our housing policy needs to address the functioning reality of 2016 and the challenges we face today.

<comment><USER14> I don't believe the free market is the solution to everything, but in this case the market already solve this. As suburbs age and become crowded people move further out, or back into the urban core. If a particular local government jurisdiction doesn't have enough revenue to maintain or expand roads, schools, water and sewer service, it will try to annex more land, or change its zoning and offer incentives stimulate higher-revenue uses than residential. If the concern is about agricultural or forest land being taken for development, perhaps our economic system doesn't sufficiently reward those land uses (yet).

<comment><USER11> You're right that the suburban unsustainability will eventually solve the issue, but it'll cause a lot of misery in the meantime. Better to have avoided the problem in the first place.

</comment></comment></comment><comment><USER43> I think one reason that suburbia exists in America in its present form is that local politics is corrupt everywhere. The two-party system degenerates into a one-party system in any city where local public opinion is strongly left (most coastal cities) or right (Deep South) of the American body politic. There are some advantages to two-party systems, but the consensus opinion among political scientists is that one-party democracy is a lie. The result is balkanization, as dissatisfaction with local politics causes large municipalities to decline as wealthy individuals move to smaller municipalities with more responsive governments. You can watch this happen in real-time if you pay attention to discussions on NextDoor or participate in local politics in most other ways.

For an example I'm familiar with, let's look at San Jose. It starts with this unelected guy:

[https://en.wikipedia.org/wiki/A._P._Hamann](https://en.wikipedia.org/wiki/A._P._Hamann)

"They say San José is going to become another Los Angeles. Believe me, I'm going to do everything in my power to make that come true."

This led to a huge backlash in 1962 and the eventual election of anti- development mayor Norman Y. Mineta. As people fled San Jose, revenues declined; in 1983, the San Jose School District went bankrupt.

If you go to any city in the country -- San Francisco, Boston, Chicago, Miami, New York, Austin, whatever -- you'll hear constant complaints about corruption and a lack of effective political participation. It's everywhere, and it's been getting steadily worse since the Southern Strategy created the modern two-party miasma.</comment>


Ask HN: What CI do you use in your team? - <AUTHOR> Hi all,
My team of about 30 devs has been using Codeship since I came onboard ca. 2yrs ago. For a variety of reasons we've been talking about moving unto a different solution and while our DevOps guy (yeah we sadly only have 1 DevOps guy) has been talking about Jenkins (which is already used by our testing team), some of us are daunted by the prospect of having 1 overworked person having to additionally manage a Jenkins installation.
While the previous team I've worked in used Jenkins, the DevOps/dev ratio was far more favourable (startup, 2 DevOps people and 5 devs), and even so our Jenkins installation would still leak and require a lot of love.
Thus, I was wondering what solution y'all might be using in a professional environment in mid-sized teams.
Some context: - All our repos are in private GitHub repos (so GitLab/GitLab-CI ain't an option). - We're working with over 100 CI'ed projects and have 2-3 concurrent builds (I believe increasing that number without breaking the bank is one of the reasons we're moving but I'm not 100%) - We primarily work in Python/JS/Java. - All our stuff runs on Google App Engine. <comment><USER2> We use Jenkins [1] for CI. Every team runs its own Jenkins instance and has an individually configured CI pipeline. The more we grow, the higher raises the wish to unify the Jenkins CI/CD flow.

[1] [https://jenkins.io/](https://jenkins.io/)

<comment><AUTHOR> Have y'all had any maintenance/upkeep issues operating multiple instances?

<comment><USER2> Initially, this approach had many advantages, because every team could individually configure its Jenkins instance and toolchain without being at risk to break each other's pipeline. This was just fine.

After some while, when CI is running well, the focus goes away from CI to other fancy development things. So, updating and maintaining the CI pipeline becomes a more dull job and we think about replacing the individual CI pipelines by a unified one.

</comment></comment></comment><comment><USER3> Hey, there -

Writing here from CodeShip -- I'd love to hear your feedback on the issues you're having and why you're looking at moving to another tool.

Let me know if you're open to a non-sales call so that we can be sure to get your input document and understand your issues. Feel free to contact firstname.lastname@example.com if you'd like to set something up or send us some notes.

<comment><USER4> This isn't what the author was asking about, but a different observation... I find it to be a put-off to ask people to create an account to review pricing and configuration options.

You do give a range (free to $50), which is nice, but hiding more details behind the requirement to sign up made me not even want to try the service.</comment></comment>


Creating a full REST Application back-end automatically from a Schema Definition - <AUTHOR> My blog article shows how you can directly deploy a schema definition and automatically have CRUD endpoints exposed over JSON REST services.
https://scottsinclairblog.wordpress.com/2017/04/07/creating-a-json-rest-crud-application-backend-in-30-minutes/
The CRUD services respect the application domain model.

  * Cascading operations across entities.
  * Optimistic locking (freshness checks).
  * Orphan removal of entities which are no longer referenced.
 A lot of time is saved because all the business logic to manage these relationships does not have to manually coded.
Audit logging and Access-Control can also be easily plugged in. <comment><USER2> Clickable: [https://scottsinclairblog.wordpress.com/2017/04/07/creating-...](https://scottsinclairblog.wordpress.com/2017/04/07/creating- a-json-rest-crud-application-backend-in-30-minutes/)

To post a link from the |submit| page, leave the |text| field empty. Otherwise the |text| content will be posted instead of the |url|.

After your story appears on the |new| page, you can add a comment.</comment>


Ask HN: Mac users, do you get AppleCare for your Macs? - <AUTHOR>

If so, do you find that it's usually worth it or is it just peace of mind? <comment><USER3> No.

My thoughts are warranties/insurance are the following:

* If having to repurchase/cover the item would seriously hurt my financials, then I buy it (car insurance, rental insurance, etc are good examples).

* For everything else, I skip it.

I figure that by self-insuring, I come out ahead in the end. Sure, there's always some gadgets that fail past the end date of the manufacturers warranty. However, replacing those items tends to cost less than buying warranties for everything. Besides, if they fail past the manufacturer's warranty, there's usually some improved version of it I've been eying anyways.

<comment><USER4> I agree with you on all other warranties. I've seen Applecare, especially for students, turn out very well though.

<comment><USER3> Warranties seem to have a lot of parallels with gambling. People love to tell the stories about how they bought a $2000 television and the warranty saved them when it broke 1 year later. However, they rarely mention all the warranties they purchased and never used.

That said, warranties are not always bad. In the specific case of students, I suspect the answer to "If having to repurchase/cover the item would seriously hurt my financials" is different for their situation than it is for mine. As such, it might make perfect sense for them to buy the warranty.

<comment><USER5> Maybe I'm cynical, but paying $80 for 3 years of coverage is a no-brainer for me.

I mean, heck, my battery died after 2 years of usage and they replaced it for free. As a result, I've already "made" $20 off of it, and that's without any major repairs (which I've _definitely_ had them do under AppleCare before).

Of course, my machine and maybe my TV ($50 for 3 years) are the only warranties I've purchased. I think I agree with your philosophy, but I don't think that's ever stopped me from buying a warranty on nearly anything.

<comment><USER6> Applecare is like 250/300 is this a third party insurance?

</comment></comment></comment></comment></comment><comment><USER7> No. Assuming the seller isn't stupid, insurance has a negative expected value. You should still buy it if the loss you're protecting against would catastrophic, which is the case for health and homeowner's insurance, and is absolutely not the case for a Mac.

I've owned around 10 Macs in the last 15 years. Foregoing AppleCare has "saved" me over $2000, and the damage that would have been covered had I bought it is less than $500.

<comment><USER8> I mostly agree, but would say, "Assuming the seller isn't stupid _or you have information they do not_...", which is sometimes the case. E.g., you know you'll be subjecting the device to conditions that contribute to failure but don't void the warranty.

For example, I recently bought a comprehensive SquareTrade warranty for my Roomba because they priced it as a "vacuum cleaner", when in fact I know that the Roomba (a) an immature technology compared to most vacuums and (b) more likely to fall or be knocked down the stairs. I did the math and decided the odds of this thing dying or being killed in the first three years were greater than the warranty/purchase price ratio.

</comment></comment><comment><USER9> I'm not making this up. Intern of mine spilled 32oz of soda on his mbp. He dumped as much out of his keyboard as he could but it wouldn't come back on the next day. You're not hiding that from Apple. His machine was on year 3 and had a few screen issues too. He figured he'd send it in under applecare and see what they said.

They fixed it. Replaced the keyboard, replaced the screen, replaced the trackpad. No questions asked and he had it back in less than a week.

I buy AppleCare because of that.

<comment><USER10> Someone spilled wine on my 4-month-old, AppleCare-covered MacBook while it was being used for a live show. It stayed alive to the end of the show, then immediately died. Apple charged me $800 to have it fixed. I had to have it repaired twice again after that (both of those were free, since the previous two repairs had been wrong.) During and after that, the battery failed and needed replacement four times. The last time, the Apple Genius told me that batteries are not covered after the first year, so I would have to pay for it myself. He looked at the repair history on the laptop and had sympathy, and replaced it for free.

To this day, the laptop does not work correctly, even though every individual component has been replaced at least once. Also, they made a typo when setting the serial number on the motherboard, which I had to tell Apple each time I had it serviced, since it didn't match the one on my AppleCare plan (replaced a B with an 8.)

Of course, the laptop had been working fine until a drunk hipster dumped box wine all over it. I wish the repairs had been perfect and free, but they weren't. I've gone through a lot of Apple products over the years, and this is the only one where I've had problems. All of the ones before and after have been fine, and this one had been fine until the wine.

Anyway, this is just an anecdote. Don't expect your own fuckups to be covered under AppleCare. It's an extended warranty, _not_ insurance. If the parent is telling the truth, then he's an exception, not the rule.

<comment><USER9> I figured that my story was the exception. But I just went in to get a new ipad replaced due to a bad rotation switch and I watched as they replaced a macbook that had water on it (they tested it and said they could tell) and they also replaced a little girl's ipod that she dropped in the bathtub.

I think it largely depends on who handles the call. I agree that it's not an insurance policy. I was just sharing my experience. I know from past experience that with my bad luck, they would never replace my macbook if I dumped stuff all over it :)

</comment></comment></comment><comment><USER11> Yes. I buy AppleCare on eBay (at the moment 130€ vs. 350€ from Apple for a MacBook Pro). It's not a scam, it worked twice for me already.

I probably wouldn't buy it for Apple's price, but considering my screen was replaced twice, my mainboard once, my battery three times and my keyboard once it would have been worth it even for 350€.

(Would be nice if someone could explain how those eBay sellers can sell AppleCare so cheaply. Buying it in the US would bring down the price only to a bit more than 260€. Even if they manage to get a educational discount the price only goes down to 180€.)

<comment><AUTHOR> Thanks for the awesome suggestion. At that price, AppleCare seems like a no brainer.

</comment></comment><comment><USER12> Most people don't realize that you can buy AppleCare any time during the first year of ownership. I always wait until the 1-year standard warranty is about to expire before deciding. At that point you have a better idea if the machine is prone to having problems or not.

Also, you can gauge how your hardware is holding up against new technologies that have popped up since you bought it. Perhaps you want to ensure the machine lasts at least 2 more years... perhaps you have your eye on something a little shinier.

</comment><comment><USER13> Absolutely, here's my story: Macbook always had some minor overheating issues, it would act erratically or shutdown, I think this only happened two or three times in three years. I took it in to the Apple Store once, they returned it two days later and said there were no issues. Flash forward to a week after the Apple Care Warranty expires, full on overheating issues, keyboard stopped working, Finder was running incredibly slow, to the point where all the animations where in slowmo. I bring the laptop in, even though the warranty was over a week expired and Apple was legally in the clear to charge me ~$800 for replacement, they replace the entire innards of the laptop and overnight it back to my apt the next day. I have never been more impressed with customer service like that before.

</comment><comment><USER14> absolutely. And it has paid off royally. I've gotten my power plug thingy replaced twice and my hard drive replaced once and they also replaced the cracked keyboard surround thingy. Not a bad return for $250.

Personally, the peace of mind that things will be handled when something goes wrong is worth the extra $50 for two additional years. Thats just $2.50 a week, even if nothing were fixed.

When they fixed my hard drive, they installed the OS and I restored my data from time machine and I was back in business.

Figure out what your time is worth after taxes and then figure out how much time you would spend just trying to assess what the best course is to handle a problem. That cost is gone when you can just hand it to Apple and they return it to you whole.

<comment><USER14> mine has a problem with a plug that costs $80 to replace. and it happened twice and may even happen once more before apple care expires in 2 months

<comment><USER15> The mag-safe connector? Mine is going bad. Intermittent LED, and the cord is starting to fray at the connector. I had to tape it up.

Seems like a bad design. I notice they use a completely different mag-safe connector on the 24" cinema display and on the macbook air.

bad: <http://imgur.com/TmRbu.jpg>

good: <http://imgur.com/9ciyo.jpg>

<comment><USER14> yep. $80 each. a known problem, they said.

yeah, that new design looks a lot more robust

<comment><USER16> There's a newer design that they're using on the new laptops, similar to (but sleeker than) the air adapter pictured above.

<http://www.notebookcheck.net/typo3temp/pics/d4598c4081.jpg>

<comment><USER14> awesome, thanks.

</comment></comment></comment></comment></comment></comment><comment><USER17> You can get completely valid warranties for half price on eBay, which makes it a pretty unambiguously good idea, in my opinion.

</comment><comment><USER4> It's the only warranty program I think is worth anything.

</comment><comment><USER18> Yes. Got fan replaced twice, battery once, keyboard components once because of weird sound. Also, I check it in every month for general cleaning and service.

Fan, keyboard and logic board failures are very common with Macs. Just google and see. I'd suggest you get AppleCare. But don't buy it at the time of purchase, you can wait 11 months and buy, sometimes you might end up changing the machine in less than a year, then AppleCare would be worthless.

<comment><USER19> Still doesn't necessarily make sense economically... most of those things are a cinch to replace yourself with a $10 electronics screwdriver set from Radioshack.

From iFixit.com, my model MBP: Fan - $50 Battery - $100. Keyboard - $85.

The logic board is probably a bit trickier, but I don't know how common those failures are (a Google search on any mass market device will show a lot of failures... .1% of a million is still 1000.)

For comparison, AppleCare on a MBP is currently $350, and covers an extra 2 years on the end of your complimentary 1 year.

EDIT: Looking at the absurd prices for replacement parts for a newer Unibody 17" (motherboard - $1000), I think it definitely makes sense there, unless you're the type to replace often.

<comment><USER18> Those replacements would be around $315 compared to $249 I paid for it. Also, more things can break. It also saved time.

If one has to do dollar-to-dollar comparison for $10/mo service, they aren't ready to buy a $1200 laptop.

Just because I can rip apart my laptop and can reapair it myself doesn't mean I shouldn't buy service which cover failure of it's components. That's like saying a doctor shouldn't buy medical insurance for his family.

<comment><USER19> Eh? $250 is a 20% premium on 1200. $10-15 per month is not insignificant for a service you are likely not to need.

Also, I was stating a case where 3 parts go bad on the laptop, which I think is pretty pessimistic - I've only had a fan go on my MBP, and that was under exceptional circumstances (my apartment was filled with very fine abrasive stone dust). It paid off for you, but as with all insurance plans, the odds were against it paying off for you, unless you are much riskier to insure than average.

Furthermore, I don't believe normal battery wear and tear is covered under applecare.

<comment><USER18> You're right. In my case, my battery was defective, it just blanked out one fine morning. :)

But I'd still press that some replacements for MacBooks are really out of proportion in terms of cost and one might regret not getting it. Namely - <USER2> logic board failures.

</comment></comment></comment></comment></comment><comment><USER20> We're an all Mac shop, and we buy roughly one machine every month of the year. We skip AppleCare.

However, several years ago, before Matasano, we bought Erin a G3 iBook which went on the fritz, and AppleCare got her machine not only replaced, but replaced with a G4. So, I've had good experiences with it.

</comment><comment><USER21> No. Laptops are replaced every 18-24 months. AppleCare and any other warranty for laptops is completely worthless. When I went to buy my current MacBook the salesman actually refused to sell me one after I told him I wasn't going to buy the warranty since I'd just be replacing it again next year.

</comment><comment><USER22> I've never gotten it and haven't needed it, but I'm the type to not buy any insurance if I can help it.

</comment><comment><USER23> Usually, I don't. But my brother a year ago purchased a MacBook Pro, and, thanks to a somewhat paranoid mother, was pushed to purchase AppleCare. A year later, we were typing away at some cafe, and his screen turned white and the machine let out a long constant beep. We tried restarting, clearing various types of RAMs, etc, nothing worked. We took it in to the Apple store and they told us something had randomly given out, and that it could've been some sort of manufacturer's defect. The repair costs would've have added up to something around $800, but because of AppleCare, there was no charge. It was definitely worth it in that case.

Edit: Reading arihant's comment, I now remember that it was his logic board that gave out.

<comment><USER24> I was going to guess it was the logic board. The 2007/2008 MBP's are notorious for that. Same thing happened to me and my friend, but we both had to pay $330 to get it fixed.

</comment></comment><comment><USER25> No, I haven't because I don't like to pay a premium for something that should come with the product. In the EU, in my case the Netherlands, anyone who sells a product is responsible for its reliability during the time a customer can reasonably expect it to work. When it breaks after more than two years I will have replaced it anyway.

In my case they have covered the repair of an iMac that broke a few months after their 'warranty' of one year expired. One of my interns, however, was refused support in a similar situation with a faulty PowerBook screen. His uncle, a lawyer, wrote some angry letters to Apple on his behalf, but if I remember correctly they decided that it wasn't worth the costs of going to court.

</comment><comment><USER26> Yes, totally get the AppleCare -- I've had to replace a main board in a PowerBook one too many times, and the total cost (without Applecare) would have been more than just buying a new one.

You should also get yourself an AmEx card and buy the hardware on it -- it extends the manufacturer's warranty (whether you get the AppleCare or not) by 1 year, i.e. with AppleCare you get 4 yrs total, without it you get 2 yrs total. And it doesn't cost anything extra. (Here'a a post I wrote about it a while ago: [http://ten7i.com/content/how-buy-mac-pro-right-way-and- save-...](http://ten7i.com/content/how-buy-mac-pro-right-way-and-save-money))

<comment><USER26> One more thing, don't buy the AppleCare from Apple: there is actually a company in CA that sells the real deal AppleCare for less than Apple does by miles. See here: [http://www.lacomputercompany.com/cgi- bin/rpcart/featured.cgi...](http://www.lacomputercompany.com/cgi- bin/rpcart/featured.cgi?group=appcare) (they are an actual company that I've bought all my AppleCare from and it works)

You can also have the person in the Apple Store match the AppleCare price that they have if you're sceptical: I've done that without a problem as well.

</comment></comment><comment><USER27> I do, yes. I have used it a couple of times, it's worth it (to me) to have the simple peace of mind.

<comment><USER28> I used to be one of those who didn't. Now it is my policy to get AppleCare and a case for everything I buy from Apple. Why? Because items from Apple protected with a case and still under warranty have _much_ higher resale value.

<comment><USER19> Ditto on the case. I once tried to sell a Powerbook G4 that had a big dent on one of the corners, when the going rate on Craigslist was ~$500. I couldn't find a buyer for more than 300.

The MBP that replaced it has lived its entire life in a case.

</comment></comment></comment><comment><USER29> The motherboard on my MacBook just fried. I don't have AppleCare, but Apple fixed it for free, well outside of any warranty.

</comment><comment><USER30> 10% is my limit for any warranty.

If you're worried it'll die, and you won't be able to afford to replace it, scale back. you can add ram later, you can improve the hd later.

I think you'll get more peace of mind by doing some math. Computers are the tools i use for work, so i tend to buy new ones fairly frequently. The odds of me using any given computer for more that 2 years are pretty low. So, how much of a hardship would it be to replace that earlier?

If it's really a budget stretch, you might think about moving to the cheaper end of the spectrum. What if it gets stolen? applecare is no help.

Also, the first 30 days come with applecare. Usually if hardware is going to die, it'll die quick. Flexing the motherboard for years will kill a laptop eventually, but meh.

</comment><comment><USER31> Yes. My macbook is the single most important device that I need to do my job. It goes pretty much everywhere I go, and I will use it every day until its untimely demise / upgrade.

It's worth paying a little extra to help ensure my source of income doesn't go up in smoke (literally?).

</comment><comment><USER32> All my Mac laptops have been covered for 3 years under a different agreement so I've never purchased AppleCare for them. I won't have this option with my next machine so I will be purchasing AppleCare — why? My Apple laptop history is as follows:

* replacement logic board on a 15" PowerBook

* replacement top-housing and fan on a black MacBook

* replacement logic board on a 15" MacBook Pro

2 of the above cropped up after the initial warranty period and would no doubt have cost more than AppleCare. If it's a laptop and you intend to keep it well beyond a year, in my experience AppleCare is worth considering.

EDIT: Also had a power brick replaced on the 15" MacBook Pro due to a frayed cord outside warranty period.

</comment><comment><USER33> I got AppleCare on my 1st-gen MacBook Pro for peace of mind. Although I haven't really needed it since I bought it, I don't regret buying it: I didn't have a lot of money at the time, and if something had happened to the MBP I couldn't have afforded to replace it.

</comment><comment><USER34> AppleCare is the only kind of extended warranty I have ever bought. I'm glad I did -- my Macbook Pro needed multiple repairs within the last few years, including logic board replacement. I'll buy AppleCare again for my upcoming MBP update.

<comment><USER14> have never bought any other warrantee either. but had a bad experience with my last pc laptop that could have been a black hole of wasted time and money if I'd decided to fix it.

Not to mention the lost time. If you enjoy tinkering, though, I guess you might just handle the problem yourself.

</comment></comment><comment><USER35> I've gotten it for my last two laptops. It's a little spendy, but I find the peace of mind more than worth it, particularly after my partner's experience with her iBook some years back. That particular model had some notorious hardware problems, which in her case didn't pop up until her laptop was (just barely) out of warranty. She ended up needing to use her AppleCare several times before everything was finally resolved. If she hadn't had it, it would have ended up being quite expensive. Apple's QA has improved quite a bit since then, but still...

</comment><comment><USER36> As a rule of thumb, you are better off buying your Mac with a credit card that extends warranty by a year such as American Express. I've had a smooth experience dealing an expired warranty repair with my macbook - all I had to do was get an estimate from Apple, then fax it to my cc company. I received the money in no time.

This should be good enough for 2 years (1 Apple + 1 cc company). That's all you need anyways.

As about other stuff like tv, get third party warranty.

</comment><comment><USER37> I've had the Mac Genius replace my first generation Intel Macbook Pro battery for free, 3 years later without Applecare. However, I also have this video problem that could have been solved had I purchased Applecare: [http://discussions.apple.com/thread.jspa?threadID=1697470...](http://discussions.apple.com/thread.jspa?threadID=1697470&start=0&tstart=0)

</comment><comment><USER38> I did buy it for mine. I am curious about the plan though. Lately, the temperature of my mbp has been going higher than I'm used to and I'd like to get it cleaned. Does anyone know if apple care covers that? Normally I'd do it myself but since I have the first gen of the non-replaceable battery, I don't know if the the warrantee terms will allow it.

</comment><comment><USER39> For RevA products: yes. Everything else, no.

RevA Apple products are guaranteed to die right after year 1, in my (limited && anecdotal) experience. I had to take in my Rev A Macbook when they just switched to intel 5 times, got the bezel & mother board replaced. So, if you're getting an iPad now or new gen macbooks, then yes.

</comment><comment><USER40> Repair rate is ~17% over three years. MacBookPro cost is $2000. Apple Care is $350. Simple math: statistically you're better off replacing entire laptop each time something goes wrong and selling the old one for parts.

The only exception is if you got cashflow problems, then yes you have to pay extra for being poor.

</comment><comment><USER41> I got it for my iMac. I like the fact that they'll come here and repair the machine on-site if necessary.

</comment><comment><USER42> Yes. Bonus points for increasing its resale value when I buy a new laptop 18-24 months later.

If you still have your student ID, bring it along and get the educational discount on the Apple Care. 15" MBP Apple Care for $239 instead of $349 retail price.

</comment><comment><USER43> Have had 3 Macs, all laptops, and never bought the warranty. Had one laptop need in warranty service, but all mostly trouble-free.

Also if you buy with your American Express card, they cover up to an additional year of your original warranty.

</comment><comment><USER44> I have not, but that's probably because I tend to buy mac's used since I'm near a university and the prices are just too enticing. Plus, I suspect like most other HN readers, I don't mind doing repairs myself if need be.

</comment><comment><USER45> For my MacBook, yes. For my Mini, no.

My rationale is that laptops are more fragile than desktops so the extra protection is worth the expense. Its been 2 years now and I haven't needed it yet though :/

</comment><comment><USER46> No, never have. I've been blessed to not have had any major weird issues with my machines, and by the time they start getting a little iffy, that's about the time I am looking to buy a new one anyway.

</comment><comment><USER47> Especially useful for laptops, I've had mine fail after the first-year warranty period.

But afaik, you can purchase AppleCare anytime within the first year (and not just at the time of purchase).

</comment><comment><USER48> No, but I regret it after having my top cover replaced to resolve a dead trackpad. I never buy extended warranties, I'm probably ahead nonetheless.

</comment><comment><USER49> I got apple care for my macbook air (1st gen) and it was nearly worth it when the power transformer broke. I bough apple care for my laptops.

</comment><comment><USER50> Yep. Had a motherboard go wonky on a Mac Pro, and got it fixed for no additional charge, because I bought AppleCare. I'd do so again.

</comment><comment><USER51> For laptops, always. It's a certainty that something that would otherwise cost > $300 to repair will break in three years.

<comment><USER52> Come on, if it was really as certain as all that, Apple would be making a loss on AppleCare. (I guess it's possible that they are running it at a loss, but it seems unlikely.)

</comment></comment><comment><USER53> It's been a godsend for me. AppleCare is great support, and has absolutely paid off for me in the past.

</comment><comment><USER54> Absolutely — AppleCare has paid for itself multiple times over every time I've purchased it.</comment>


Ask HN: What are some examples of beautiful x86 assembly code? - <AUTHOR> I've been bumping into a lot of x86 assembly lately and, unrelated, recently read about the stellar reputation of SQLite's code base.<p>This got me thinking: what are some examples of high-quality and/or beautiful x86 assembly? In fact, what about for other processor families as well? <comment><USER3> I bought a nice little booklet of small x86 gems a few years back[1][2] and this one is my favorite:

      .loop:
          xadd     rax,rdx
          loop     .loop

Fibonacci with two instructions.

[1] [https://www.amazon.com/dp/1502958082](https://www.amazon.com/dp/1502958082)

[2] [https://www.xorpd.net/pages/xchg_rax/snip_00.html](https://www.xorpd.net/pages/xchg_rax/snip_00.html)

<comment><USER4> Can someone more versed in x86 explain to me how this works?

It's been a long time since I've done any assembly, and that was MIPS, but I don't see how there's any sort of exit condition or anything. I'm guessing there's more to xadd than `x + y = z`?

<comment><USER5> I don't know much Assembly, but at what point does Fibonacci end? Shouldn't it just keep going?

<comment><USER6> No, loop decrements rcx until it reaches zero and then stops

<comment><USER7> But rcx has not been initialised.

<comment><USER8> If _all_ functions took (rax, rbx, rcx, ...) and you had loop statement that defrements rcx and jumps unless zero, then how would _you_ write fib- function's body?

<comment><USER7> You raise a good question. At one time you would have only one loop running through the system as per my understanding. I am a little lost here.

<comment><USER9> I think this is the biggest problem with learning x86 assembly (or ARM or anything else) on modern systems (or more specifically modern operating systems).

It's sometimes difficult to think about the assembly code in situ when you start to think about the operating system doing a ton of context switching and paging etc. in the background, which can distract your thought process from what's right in front of you (as well as the operating system's software interrupts / system calls on top of the basic ISA, which is another abstraction!)

Older systems had the currently running program as the entire context of the system at that point in time - in a similar way to embedded programming, which is imho a much easier realm to learn assembly in once you've got a bit of basic electronics under your belt!

<comment><USER10> The whole point of how interrupt handling works is that it returns back to the same state of the program already in progress when finished. The abstraction is such that the interrupted program doesn't need to care.

Even in those "old" systems of single address spaces and no protection, you're constantly getting timer interrupts, interrupts for I/O, etc., which your application might not have installed its own handler for.

<comment><USER9> I agree - my main point is that an OS is 'just a program' as well

I suspect we're both making a similar point in a roundabout way - <USER2> operating system is both another layer of abstraction on top of the Instruction Set, while also making the programming process for that chipset somewhat easier (providing software interrupts etc. at the expense of bare metal understanding).

My argument is loosely that modern (x64) assembly is not so much targeting hardware as it is programming into a software abstraction (the operating system).

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER11> My interest, save for occasional tweak in ARM boot code, is mostly historical. Grew up on Z-80 assembly but really enjoy PDP-11 code for didactic purposes. You can easily see that the rise of optimising C compilers was helped by divergence from PDP instruction set. Not ever since C idioms map down so nicely.

strlen():

      LEN:   MOV #-1, R0
      1⊙     INC R0
             TSTB (R1)+
             BNE 1⊙

or take strcpy():

      COPY:  MOVB (R1)+, (R0)+
             BNE COPY

versus the C version:

      void strcpy(char *s, char *t)
      {
        while (*s++ = *t++)
          ;
      }

It translates to the optimal machine code verbatim. It does not require any smarts of the compiler, at the expense of understanding on the side of the programmer. This is made possible by orthogonality of the instruction set, which in less well thought out designs was hacked around with special instructions (like LDIR on Z80). The price for that is you have to make compiler optimize these situations.

<comment><USER12> That's remarkably close to 68k str-functions.

Page 133 [http://www.atarimania.com/documents/Asm_Lang_Prog_68K_Family...](http://www.atarimania.com/documents/Asm_Lang_Prog_68K_Family.pdf)

      * STRLEN - RETURNS LENGTH OP NULL TERMINATED STRING IN D0
      * A0 -> STRING
      STRLEN: MOVE.L A0,-(SP) SAVE REG
              CLR.L  D0       INITIALIZE
      STRLENI:TST.B  (A0)+    NULL?
              BEQ    STRLENR  YES, RETURN
              ADDQ.L #1, D0   BUMB COUNT
              BRA    STRLENI  LOOP
      STRLENR:MOVE.L (SP)+,A0 RESTORE REG
              RTS

      We might also want to copy a string:

      * STRCPY - COPY A NULL TERMINATED STRING
      * A0 -> SOURCE STRING
      * A1 -> DESTINATION STRING
      STRCPY: MOVEM.L A0-A1,-(SP) SAVE REGS
      STRCPY1:MOVE.B  (A0)+,(A1)+ MOVE A BYTE
              BNE     STRCPY1     GET ANOTHER IF NOT NULL
              MOVEM.L (SP)+/A0-A1 RESTORE REGS
              RTS

      Next, we will want to compare two strings:

      * STRCMP - COMPARE TWO NULL TERMINATED STRINGS
      * A0 -> STRING 1
      * A1 -> STRING 2
      STRCMP: MOVEM.L A0-A1,-(SP)  SAVE REGS
      STRCMP1:CMPM.B  (A0)+,(A1)+  COMPARE BYTES
              BNE     STRRET       RETURN IF DIFFERENT
              TST.B   -1(A0)       HAVE WE HIT A NULL?
              BNE     STRCMP1      NOW MORE BYTES LEFT
      STRRET: MOVEM.L (SP)+,A0-A1  RESTORE REGS
              RTS

Although I guess I'd implement strlen more like this (not sure if it works, been a _long_ time since I last wrote anything for 68k):

      strlen:   movem.l a0-a1,-(sp)
                move.l  a0, a1   ; copy a0 to a1
      slenloop: tst.b   (a0)+
                bne     slenloop
                addq.l  #1, a1
                sub.l   a0, a1
                move.l  a1, d0
                movem.l (sp)+,a0-a1
                rts

Just two instructions in the inner loop. But not sure whether address registers supported addq etc.

<comment><USER11> Wow it's close indeed, even stack manipulation looks the same. Would be

      MOV  R0, -(SP)
      ....
      MOV  (SP)+, R0

for the PDP code.

<comment><USER12> My faster (?, see [0]) strlen seems to compile (using MIT 68k syntax):

      > cat > test.asm
      strlen:   movem.l %a0-%a1,-(%sp)
                movl    %a0, %a1     ;# copy a0 to a1
      slenloop: tst.b   (%a0)+
                bne.b   slenloop
                addq.l  #1, %a1
                sub.l   %a0, %a1
                move.l  %a1, %d0
                movem.l (%sp)+,%a0-%a1
                rts
      ^D

      > m68k-linux-gnu-as test.asm && m68k-linux-gnu-objdump -d a.out
      a.out:     file format elf32-m68k

      Disassembly of section .text:

      00000000 <strlen>:
         0:	48e7 00c0      	moveml %a0-%a1,%sp@-
         4:	2248           	moveal %a0,%a1

      00000006 <slenloop>:
         6:	4a18           	tstb %a0@+
         8:	66fc           	bnes 6 <slenloop>
         a:	5289           	addql #1,%a1
         c:	93c8           	subal %a0,%a1
         e:	2009           	movel %a1,%d0
        10:	4cdf 0300      	moveml %sp@+,%a0-%a1
        14:	4e75           	rts

I wonder whether it actually works... I think same idea should be translatable to PDP-11 as well.

[0]: It runs slower for short strings, though. Not sure where the break even point is.

<comment><USER12> Previous one didn't work, because I mixed up a0 and a1 pointers when subtracting.

But that gave me a new idea: copy pointer to d0 and complement the difference instead of addq, saving a1 register (+stack operations) and a move- instruction:

      strlen:   move.l  %a0,-(%sp)
                movl    %a0, %d0   ;# d0 = a0;
      slenloop: tst.b   (%a0)+     ;# test *a0, post incr
                bneb    slenloop   ;# loop if non-zero
                sub.l   %a0, %d0   ;# d0 = d0 - a0;
                not.l   %d0        ;# d0 = ~d0;
                move.l  (%sp)+,%a0
                rts                ;# d0 is the return value

Equivalent C-code ([http://cpp.sh/2oecd](http://cpp.sh/2oecd)):

      #include <stdio.h>
      #include <stdint.h>

      size_t strlen68k(char* a0) {
          int zero_flag;
          uintptr_t d0 = (uintptr_t) a0;
          do {
              // tstb (%a0)+
              if (*a0 == 0)
                  zero_flag = 1;
              else
                  zero_flag = 0;
              a0++; // (%a0)+ (post increment)
          } while(!zero_flag); // bneb slenloop
          d0 = d0 - (uintptr_t) a0; // sub.l %a0, %d0
          d0 = ~d0;  // not.l %d0
          return d0;
      }

      void strlen_test(char* str) {
          printf("str \"%s\" length is %lu\n", str, strlen68k(str));
      }

      int main(void) {
          strlen_test("");
          strlen_test("a");
          strlen_test("abcd");
          return 0;
      }

Again, untested, but I think it probably works. I guess this is also faster for all string lengths >0 as well.

This idea _might_ not work on PDP-11 anymore, depending on how binary arithmetic is implemented.

</comment></comment></comment></comment></comment><comment><USER13> The source code of AGC (Apollo Guidance Computer) written by Margaret Hamilton and her team. Clean and obviously it worked well. Comments are also interesting to read. [https://github.com/chrislgarry/Apollo-11](https://github.com/chrislgarry/Apollo-11)

<comment><USER14> That's certainly not x86 code, but loved the link anyway, thanks.

</comment></comment><comment><USER15> Here's a wiki dedicated to very small x86 programs: [http://www.sizecoding.org/wiki/Main_Page](http://www.sizecoding.org/wiki/Main_Page)

Lots of fun stuff there, like a scrolling Matrix screen saver in 8 bytes (!!) that jumps into the middle of an instruction: [http://www.sizecoding.org/wiki/M8trix_8b](http://www.sizecoding.org/wiki/M8trix_8b)

<comment><USER16> That is a great resource. Another great example is a 16 byte paint program [http://www.sizecoding.org/wiki/Paint16b](http://www.sizecoding.org/wiki/Paint16b)

</comment></comment><comment><USER17> If you're interested in demoscene, this explains how to make x86 programs in 256b or less: [http://sizecoding.org/](http://sizecoding.org/)

...

and yes, I consider it beautiful x86 code :)

</comment><comment><USER18> Jones Forth: [http://git.annexia.org/?p=jonesforth.git;a=blob_plain;f=jone...](http://git.annexia.org/?p=jonesforth.git;a=blob_plain;f=jonesforth.S;hb=HEAD)

There was some discussion of it here a while ago: [https://news.ycombinator.com/item?id=942684](https://news.ycombinator.com/item?id=942684) (though unfortunately the site is now dead)

</comment><comment><USER19> In my work book club we've been reading the book "zero bugs" by Kate Thompson.

The first half is some fun writing with stock good advice for software development, and the second half is a bunch of code examples the author finds interesting, many of which are in various flavors of assembly.

(I have no affiliation with the author, publisher, nor any other ulterior motive. Office consensus is that this is the best book we've done a book club around - highly recommended as just plain fun to read, if you're already writing software.)

</comment><comment><USER20> It's out of date now, but back in the day Michael Abrash's 8-cycle per pixel texture mapper was considered a thing of magic:

[http://www.jagregory.com/abrash-black-book/#thats-nicebut- it...](http://www.jagregory.com/abrash-black-book/#thats-nicebut-it-sure-as- heck-aint-9-cycles)

</comment><comment><USER21> This injection thunk I wrote in order to do facilitate remote code _and_ context (file handles, event handles, shared memory maps etc) injection: [https://github.com/tpn/tracer/blob/master/Asm/InjectionThunk...](https://github.com/tpn/tracer/blob/master/Asm/InjectionThunk.asm#L357)

</comment><comment><USER22> IBM PC x86 BIOS code:

[https://github.com/kaneton/appendix- bios](https://github.com/kaneton/appendix-bios)

OT: This brings back memories of tinkering with the MS-DOS boot process. Back then, the BIOS would read the MBR and copy its contents to 0x7C00 and start execution from there. So you could assemble your own code (using no less than MS-DOS debug) and plonk it into the MBR. I remember doing things like fooling the boot loader into thinking there's less ram than there actually was (639kB instead of 640kB) and using the unaccounted 1kB for placing your own code that could be triggered by a captured interrupt... Fun times!

<comment><USER23> What was the advantage of this over 'Terminate and Stay Resident'?

<comment><USER22> So yes, this was a TSR, except that it resided in unaccounted for memory. Also, since you put it into the MBR, it would get loaded into ram automatically with every boot, and no fiddling with autoexec.bat or anything where it could be easily discovered. All this of course, in trying to understand the fascinating world of viruses.

</comment></comment></comment><comment><USER24> Well, not written in assembly but uses x86 intrinsics:

[https://github.com/leni536/fast_hilbert_curve](https://github.com/leni536/fast_hilbert_curve)

I'm pretty proud of it. It calculates the coordinates of the nth point on the hilbert curve. No loops, no branches. It uses the pext, pdep and popcount intrinsics creatively.

<comment><USER25> Interesting. Have you tried generalizing that for higher dimensions?

</comment></comment><comment><USER26> Duff's device, as emitted by GCC[0], is a bit on the verbose side but still quite neat. In particular the single-instruction computed goto that uses a look-up table made up of 8 quad-words, filled in by the linker.

Note the '.section .rodata' directive which actually places the quads pointers, seemingly interleaved with code, in a read-only data section.

Note also the dec/test/jle instructions implementing the while loop occur _before_ the last of the eight copy operations, and interleaved with the next- to-last copy operation.

      duff:
      .LFB0:
              .cfi_startproc
              lea     eax, [rdi+7]
              mov     r8d, 8
              mov     rcx, rdx
              cdq
              idiv    r8d
              mov     r9d, eax
              mov     eax, edi
              cdq
              idiv    r8d
              cmp     edx, 7
              ja      .L2
              mov     edx, edx
              jmp     [QWORD PTR .L4[0+rdx*8]]
              .section        .rodata
              .align 8
              .align 4
      .L4:
              .quad   .L3
              .quad   .L5
              .quad   .L6
              .quad   .L7
              .quad   .L8
              .quad   .L9
              .quad   .L10
              .quad   .L11
              .text
      .L11:
              mov     al, BYTE PTR [rsi]
              inc     rsi
              mov     BYTE PTR [rcx], al
      .L10:
              mov     al, BYTE PTR [rsi]
              inc     rsi
              mov     BYTE PTR [rcx], al
      .L9:
              mov     al, BYTE PTR [rsi]
              inc     rsi
              mov     BYTE PTR [rcx], al
      .L8:
              mov     al, BYTE PTR [rsi]
              inc     rsi
              mov     BYTE PTR [rcx], al
      .L7:
              mov     al, BYTE PTR [rsi]
              inc     rsi
              mov     BYTE PTR [rcx], al
      .L6:
              mov     al, BYTE PTR [rsi]
              inc     rsi
              mov     BYTE PTR [rcx], al
      .L5:
              mov     al, BYTE PTR [rsi]
              dec     r9d
              inc     rsi
              test    r9d, r9d
              mov     BYTE PTR [rcx], al
              jle     .L2
      .L3:
              mov     al, BYTE PTR [rsi]
              inc     rsi
              mov     BYTE PTR [rcx], al
              jmp     .L11
      .L2:
              ret
              .cfi_endproc

___

edit: formatting, _sigh_

[0] v 7.3.0 64bit; gcc -S -Os -masm=intel

<comment><USER27> > Note the '.section .rodata' directive which places ..., seemingly > interleaved with code, in a read-only data section.

It only specifies which section that part of "code" goes into, the linker pools it all up in a binary image and fills in the address for the tags when linking as directed by the linker script[0].

[0]: [https://sourceware.org/binutils/docs/ld/Simple- Example.html](https://sourceware.org/binutils/docs/ld/Simple-Example.html)

</comment></comment><comment><USER28> Come on, the movfuscator has to be the best x86 I've seen:

[https://github.com/xoreaxeaxeax/movfuscator](https://github.com/xoreaxeaxeax/movfuscator)

<comment><USER29> I was going to ask why? But then I read the single faq at the end: because I thought it would be funny...

<comment><USER30> In addition to being funny, it's appealing to me to have the option of generating assembly to perform a task in such a way that a human looking at the assembly would have enormous difficulty in determining what is performed. As suggested by its name, it serves as a nice obfuscator.

It also fully avoids all branches.

<comment><USER31> No movfuscator post is complete without mentioning the demovfuscator [1]

[https://github.com/kirschju/demovfuscator](https://github.com/kirschju/demovfuscator)

</comment></comment></comment></comment><comment> emily-c I've always found this 16 byte bubble sort implementation to be absolutely beautiful.

[https://gist.github.com/jibsen/8afc36995aadb896b649](https://gist.github.com/jibsen/8afc36995aadb896b649)

</comment><comment><USER32> Pokémon! GBA (ARM7) is even being used in some undergrad level OS classes. Although you may get more mileage out of RP3 development.

disassembly of Pokémon Red/Blue

[https://github.com/pret/pokered](https://github.com/pret/pokered)

TONC GBA Programming Principles

[https://www.coranac.com/tonc/text/toc.htm](https://www.coranac.com/tonc/text/toc.htm)

<comment><USER33> Red and blue are gbc (z80-like, not ARM).

<comment><USER15> Well, Z80 shares a common ancestor with x86 and resembles it quite a bit [1]. The assembly syntax is just different because Zilog was afraid of lawsuits…

[1]: [https://en.wikipedia.org/wiki/Zilog_Z80#Datapoint_2200_and_I...](https://en.wikipedia.org/wiki/Zilog_Z80#Datapoint_2200_and_Intel_8008)

</comment></comment></comment><comment><USER34> There's the ray-caster in 128 bytes.

[http://finalpatch.blogspot.com/2014/06/dissecting-128-byte-r...](http://finalpatch.blogspot.com/2014/06/dissecting-128-byte- raycaster.html)

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

</comment><comment><USER35> [https://2ton.com.au/HeavyThing/#appsources](https://2ton.com.au/HeavyThing/#appsources)

</comment><comment><USER36> [xchg rax,rax] has a collection of interesting snippets. You can either try to reason what they're doing yourself, or there are a variety of writeups out there for each of the snippets.

</comment><comment><USER37> This is not x86 but certainly an optimised code [https://www.pagetable.com/?p=774](https://www.pagetable.com/?p=774)

<comment><USER38> Pretty incredible that such world changing code fits on one page.

It's ineresting that when tools are new, like ASM in 1978, they give high leverage to the first to use them. Microsoft was able to leverage a small amount of code into a world changing platform. Now it would be nearly impossible to do the same with a team the same size.

But in 2018, the nascent state of ML tools looks similar to the nascent state of programming tools in 1978. And indeed we are seeing entire companies built around relatively basic AI in the scheme of things. As first movers these companies have the same kind of leverage with respect to AI that Microsoft did to Software in the 1980s.

Perhaps in 2058 someone will share a link to a Tensorflow script and we will all marvel at its terseness and apparent simplicity.

<comment><USER39> > Pretty incredible that such world changing code fits on one page.

What code are you looking at? I see "Microsoft BASIC for 6502 Original Source Code" which runs for 6955 lines. By my reasoning that is more than a hundred pages.

<comment><USER38> Ok, "one page" may not be a technically fair description (though it does fit on a web page). Still, I think most programmers would agree that nowadays, few world changing technologies can be expressed in 6955 lines of code. That's what I mean by high leverage.

</comment></comment></comment></comment><comment><USER40> The current time on the command line in words - inspired by the original by Jim Button. Nothing fancy, but I remember at the time it was a personal challenge to shave as many bytes from the code as possible:

[https://github.com/linker3000/Historic-code-PC-Pascal-and- AS...](https://github.com/linker3000/Historic-code-PC-Pascal-and- ASM-/blob/master/QT2.A86)

</comment><comment><USER41> The very first programming book I read was a programmed instruction text on Machine Language. This would have been in 1965, and the book probably dated from a few years earlier. It was another four years before I could actually run a program on a real computer (an Algol program on a Burroughs B5500, input via punched cards).

I tried to find the book a few years back, for nostalgic reasons, but couldn't.

</comment><comment><USER42> Here's a mix between C++ and asm. [https://www.codeproject.com/Articles/36907/How-to-develop- yo...](https://www.codeproject.com/Articles/36907/How-to-develop-your-own- Boot-Loader#_Toc231383177)

</comment><comment><USER43> Someone got the source code for Super Mario Bros and commented it up: [https://gist.github.com/1wErt3r/4048722](https://gist.github.com/1wErt3r/4048722) (not x86 though...)

</comment><comment><USER44> My favourite was a function to swap either a byte, word or dword with a single ret. The function would have three entry points, calling itself recursively like hanoi-towers.

</comment><comment><USER45> Isn't LuaJIT assembler DYNASM often referred to as poetry

[https://luajit.org/dynasm.html](https://luajit.org/dynasm.html)

</comment><comment><USER46> I remember I wrote a 6 bytes code to destroy information on the whole hard drive.

Kind of opposite of what you're asking for :)

</comment><comment><USER47> This Defcon 18 talk called 'Trolling with Math' about trying to defeat reverse engineering with assembly tricks [https://youtu.be/y124L75ZKAc](https://youtu.be/y124L75ZKAc)

<comment><USER48> Well what we were doing for pe encryptors (will try to dig out some code from tapes when I get back into civilization :D) was generating a code that was driving execution flow using SEH (structured exception handling), sometimes the code executed as intended, sometimes the exception was trigered (with faulty code, again generated) to continue at completely different part of code. This was the complete pain in the "neck" to debug (timing the code execution is a great way to tell if someone is debugging it, and you just continue into some other generated code that is missleading the reverser), and completely impossible to solve on paper (well, with huge amount of knowlidge and a lot of time, you could do it :D). That's why I am laughing with todays overuse of try/catch/throws, we were using it to obfuscate execution flow and today it is used in normal coding with same devastating effect :D

</comment></comment><comment><USER49> Check out these rather old examples for inspiration,

[http://www.win32assembly.programminghorizon.com/source.html](http://www.win32assembly.programminghorizon.com/source.html)

</comment><comment><USER50> The following snippet swaps two values (rax, rcx) only if they are out of order (i.e. rax > rcx). It does so without using any branches.

      mov rdx, rax
      cmp rax, rcx
      cmovg rax, rcx
      cmovg rcx, rdx

</comment><comment><USER51> not quite the assembly, but you may look at small intros at [https://www.pouet.net/prodlist.php](https://www.pouet.net/prodlist.php) of sizes 32 bytes and so on.

many intros are provided with source codes, and others could easily be viewed in disassemblers.

especially look at intros by such brilliant people like Digimind and Řrřola.

</comment><comment><USER52> I was quite impressed with the Wolf3D rendering engine when somebody released the code years back.

</comment><comment><USER53> Michael Abrash's assembly optimizations for the Quake engine.

</comment><comment><USER54> how du a hack

</comment><comment><USER48> I really love this one, boot sector chess :)

[https://gist.githubusercontent.com/jwieder/7e7e643cc71c81f63...](https://gist.githubusercontent.com/jwieder/7e7e643cc71c81f63958/raw/b965c343e18ce8bc04c6da047889b188de46f927/BootChess.asm)

</comment><comment><USER55> There were some pretty good Win32 API tutorials back in the day. It was similar to this, if not it:

[http://win32assembly.programminghorizon.com/](http://win32assembly.programminghorizon.com/)

It was quite enlightening to see common program constructs done only in assembly.

</comment><comment><USER48> What about something here: [http://z0mbie.daemonlab.org/](http://z0mbie.daemonlab.org/)

This guy was a genius (those were the times you didn't do it for profit, it was a game). Google for zmist...

</comment><comment><USER48> The coolest one liner is xor eax,eax :) 1 cycle for setting register to 0.

<comment><USER56> Yeah, but with the side effect of clearing the flag registers. So can't be used between operations that rely on flags. Alternatively it is great to break false flag dependency.

</comment></comment><comment><USER57> Linux boot.S</comment>


Fast, synchronous Objective-C wrapper around BSD sockets for iOS and OS X - <AUTHOR> https://github.com/dreese/fast-socket

<comment><USER2> Are you claiming that synchronous network IO is faster than async? Do you have benchmarks?

<comment><AUTHOR> No, though I do think a synchronous API is easier to work with. It isn't synchronicity that is slower. There are lots of socket-level options and buffer allocation options that need to be set up right for raw data transfer to go quickly. And the API needs to make it easy to avoid copying arrays of bytes. And I do have benchmarks for those.

When I first implemented this class, I was upgrading a file caching client that talked to a custom file server. It kept about 80,000 files (about 16GB) in sync with the set of files on the server. The unoptimized Mac process started out about 40% slower than the Windows equivalent client. Afterwards, the Mac client was about 15% faster than Windows with no changes on the server. They couldn't get the Windows client to transfer as quickly as the optimized Mac client.

Could these optimizations be done in an asynchronous API? Sure. But as far as I can tell, none do. Maybe because they don't work directly with sockets. Normally that isn't a problem, unless you really need to push things across the network as fast as possible.</comment></comment>


Facebook Questions Goes Where Quora Can't - <AUTHOR> http://www.readwriteweb.com/archives/facebook_questions_goes_where_quora_cant.php?sms_ss=hackernews&at_xt=4d8baf952db67db5%2C0 <comment><USER2> Unfortunately, I really think this is going to be a bust, just like the first time they tried to introduce Questions, for a few reasons.

First, some people have a very impersonal friend network, meaning that they probably don't care about the "favorite movie" (this was an example in the article, I'll use it here) of a lot of the people on their friends list. For example, people they met once, or people that they went to high school with 5 or 6 years ago, etc.

Secondly, Facebook is trying to have their cake and eat it too. Their entire basis for this new direction is that Quora and others are too impersonal, but then they add that you can query the network of your friends' friends. Friends' friends is a pretty wide net, and the original argument for Facebook Questions becomes invalid if you expand the question to that many people. Yes, I know that it's optional, but to me it shows that Facebook is trying for the shotgun method, trying to cover as much ground as possible instead of focusing on a feature that people actually want.

Finally, if I want to know what my friends' favorite movies are (again, using the cited example), there's already a place on Facebook for that: their info page. I don't know if people still fill that out, but I know they used to before Facebook mandated that everything on the info page be tied to Pages (which was another goof on FB's part, IMO).

They may prove me wrong, but this just seems like something Facebook won't quit pursuing because it's trying to be the Internet. Personally, I'm more interested, and optimistic in seeing how and if Deals is going to dethrone Groupon and its ilk.

<comment> T-R I'd take it a step further, as well - as wide as the friend's friends net may be, I'm still probably not learning anything new. If my group of friends is defined mostly by some common interest, and theirs is too, I'm probably not going to get a good answer to anything outside of that field of interest.

To take the example on the page of restaurants - I'm probably not going to learn about any new restaurants if my friends and I mostly go to the same restaurants, and they go to the same ones with their friends, too.

<comment><AUTHOR> I just moved to San Francisco not too long ago. Maybe I don't want to know about the best Mexican food in SF from someone from SF, maybe I want the opinion of my Texan pals, who share a similar taste in Mexican food....cuz damnit, I want that certain type of salsa (or something).

Of course, on the Internet, we are always in danger of ending up in an echo chamber.

And besides, there's still Yelp. And Foodspotting. And every other one of those apps out there to get outside my friends' opinions. I just think this makes it easier than ever to get friends' feedback.

Only thing I wonder is, will FB prioritize these entries? Because seeking friends' opinions on FB always seems to get answers from people you weren't looking for answers from.

<comment><USER2> >I just moved to San Francisco not too long ago. Maybe I don't want to know about the best Mexican food in SF from someone from SF, maybe I want the opinion of my Texan pals, who share a similar taste in Mexican food....cuz damnit, I want that certain type of salsa (or something).

I agree with the sentiment (DFW'er here!), but how are Texans supposed to know about restaurants in the Bay Area?

<comment><AUTHOR> I have plenty of Texan friends on Facebook that have either lived here or visited. The point is still the same, really - this seems to make it easy to poll your _friends_ for information. Quora is more about getting a community- approved answer.

</comment></comment></comment></comment></comment><comment><USER3> The question is, do you trust all your Facebook friends' tastes?

Perhaps I just want to ask a few people that I trust in <food/fashion/movies>.

Of course, the questions will be a great way for companies to get information about you.

</comment><comment><USER4> No matter how I look at this, it doesn't strike me as anything new or special.

Sure, it's sort of a useful feature, but it's also a clear admission that Facebook couldn't figure out how to leverage their user base to get good answers. Polling your friends? _Yawn_

Crowdsourcing is still a very young technology and it isn't well understood how to make the most of it. Personally, I'm really glad that Facebook didn't see the same opportunity for Questions that I do, now if only they stay clueless for another year...

<comment><USER2> >Personally, I'm really glad that Facebook didn't see the same opportunity for Questions that I do, now if only they stay clueless for another year...

We might have different ideas, but I thought the same thing. But if we have the same idea, I'm only giving you til September :)

<comment><USER4> September, huh? Well, if we get into YC, we'll definitely have something up by then. Good to know we have some real competition.

Hmm, now you got me wondering if there's another way to go about this because our strategy is pretty unique...

</comment></comment></comment><comment><AUTHOR> Maybe you can connect with friends on Quora and maybe you can ask specific people questions, but Facebook Questions is gonna far outpace Quora for asking your friends simple questions.</comment>