Show HN: Instant confirmation via Bitcoin payment protocol - <AUTHOR> https://greenaddress.it

<comment><AUTHOR> Hello:)

Author of the BIP draft for the Instant Confirmation Payment Protocol aka BIP70 extension and founder of GreenAddress.

You can find the draft here [https://github.com/greenaddress/bips/blob/bip- payment-reques...](https://github.com/greenaddress/bips/blob/bip-payment- request-instant-confirmations/bip-payment-request-instant- confirmations.mediawiki)

Bitcoin dev mailing list discussion [http://comments.gmane.org/gmane.comp.bitcoin.devel/5628](http://comments.gmane.org/gmane.comp.bitcoin.devel/5628)

Reddit discussion [http://www.reddit.com/r/Bitcoin/comments/284me8/instant_conf...](http://www.reddit.com/r/Bitcoin/comments/284me8/instant_confirmation_via_payment_protocol_bip70/)

The aim of this extension is to reduce risk by allowing, via a third party, instant confirmation of bitcoin transactions.

Questions, comments and in general any feedback is very welcome!

Cheers! Lawrence

<comment><USER2> It seems that much of the "bitcoin is great because it is feeless" stuff is going to get eaten up by the services/fraud reduction layer put on top of it, by stuff like this. Right now, including miner fees, it seems like the transaction cost of bitcoin is actually as high, if not higher, than most credit cards.

How do you see the fees finalizing? Will there still be a significant cost reduction for in person transactions once the industry has matured a bit more? (equivalent of CC transactions in terms of ease of use).

Either way, this is a cool idea, best of luck to you.

<comment><USER3> Some of those things are worth paying for. The revolutionary thing about Bitcoin (from a financial systems perspective) is that those things are optional. If I don't want or need instant confirms, I don't have to use them.

Another important thing to note is that you're likely a member of a very privileged class, by virtue of being on HN. You likely have a bank account and a credit card. Not everyone is so lucky, and Bitcoin serves many of the same needs you fulfill with the traditional financial system.

Then you have remittance. Imagine you are a Somali immigrant living in Michigan, and you'd like to send money to your brother in Xamar. How do you do that? It's legal, but to my knowledge no US Bank operates in the region. Bitcoin world's as easily to your brother as it does to anyone else.

<comment><USER4> Bitcoin users are an even more privileged class of the already privileged population. They have regular access to a private computer, and robust internet access. That is not the case for most people in the world.

<comment><AUTHOR> Do you think the banking industry will support the unbanked faster than a stable and accessible internet will reach them?

<comment><USER4> If the wild success of M-Pesa is any indication, then the traditional finance industry will reach the next billion consumers well before an obscure technology like Bitcoin will.

<comment><USER5> Given that M-PESA is run by a telephone company, is it the traditional financial industry or not? It can be argued both ways. SafariCom effectively runs a bank, but it is nonetheless primarily a technology company.

</comment></comment></comment></comment></comment></comment></comment><comment><USER6> Which merchants currently accept your key for instant confirmations? From the bitcoin wiki: [green addresses] are generally considered a bad idea and not advisable to implement.

<comment><AUTHOR> An ATM bitcoin to cash manufacturer is testing the functionality right now and another one is planning to integrate it when they implement the payment protocol.

There's also other users that can check either inside the GreenAddress wallet or at [https://greenaddress.it/instant](https://greenaddress.it/instant)

it's called GreenAddress because when I thought about the concept, end of 2012 beginning of 2013 it wasn't yet associated with the bad reputation or MtGox double spends and I felt anyhow that it could be improved (which I think we did).

The modus operandi of the platform is different from the original GreenAddress concept as the instant confirmation comes out of band and is based on multisignature allowing the system to prevent users double spends.

However, like the original GreenAddress concept, it is based on third party trust, there is no magic bullet.

<comment><USER6> How could you prevent somebody signing a transaction using your service, waiting until the nLockTime has expired, then creating a transaction that is not signed by you but valid due to the nLockTime expiry? They would then be in a position to double spend because they could use a transaction that is verified by you to buy something instantly (cash from an ATM for example) and redirect the same funds back to their own control using the single signature transaction with a high chance of success.

<comment><AUTHOR> We only provide instant confirmations for bitcoins we know that are going to get included in a block long before the nlocktime will expire allowing you to spend them.

<comment><USER6> How long before, because that would make it impossible for people to spend their coins at all during that period, which could be annoying.

Also, does this mean that to verify a transaction can be considered instant, the merchant has to check with your servers and there is no way of verifying this independently? Isn't this a serious privacy problem?

<comment><AUTHOR> We don't provide instant confirmation but that does not mean you can't spend your funds without it.

The minimum is 1 day or 144 blocks, default to 90 days, max is max block size.

<comment><USER7> Hi Lawrence,

probably that is the right step toward solving the transaction speed,albeit by a slightly more centralized workaround,it reminds me of a comment I made almost a year from now:

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

great job ;)

<comment><AUTHOR> cheers!

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> "...or analysing transaction network propagation."

Haven't we already agreed this is meaningless?

<comment><AUTHOR> I think we did, good point.

It should be removed imho. Especially since the instant confirmation with a monitor couldn't really be synchronous without .. wait for it, waiting.

good catch!

</comment></comment><comment><USER9> Yay, easy way to confirm false transactions :D

<comment><AUTHOR> Not really, the payment protocol gives you back the full transaction that can be checked by the merchant.

The 'instant' comes from trusting a third party that temporarily controls enough keys to block the funds before they can get double spent but long enough that the tx can be confirmed.

</comment></comment><comment><USER10> I hope to see it soon on my lovely iphone!

<comment><AUTHOR> For the record I know HostFat does not have an iPhone and he is a friend. I think.

</comment></comment><comment><USER4> I would be incredibly careful of trusting any new BTC trust protocols this week, with the ongoing 51% threat from GHash.

[http://arstechnica.com/security/2014/06/bitcoin-security- gua...](http://arstechnica.com/security/2014/06/bitcoin-security-guarantee- shattered-by-anonymous-miner-with-51-network-power/)

<comment><AUTHOR> reminds me of this comment on reddit

[http://www.reddit.com/r/Bitcoin/comments/284me8/instant_conf...](http://www.reddit.com/r/Bitcoin/comments/284me8/instant_confirmation_via_payment_protocol_bip70/ci7dsej)

Not to dismiss the 51% issue but that would affect all transactions, this -'instant protocol' is on top of bitcoin, not in replacement of.</comment></comment>


Apple promotes apps without in-app purchases via new category - <AUTHOR> http://www.macstories.net/news/apple-promoting-great-games-with-no-in-app-purchases-on-app-store-front-page/

<comment><USER2> Does anyone remember when the App Store was first launched and Steve Jobs bragged about how most developers would offer their apps for free?

My how times have changed.

It's like when Microsoft fixed the bugs, UI errors, etc. from Windows Vista and they became "features" in Windows 7.</comment>


Looking to Hire an Engineer? 3 Reasons to Forgo the Phone Screening - <AUTHOR> http://gigaom.com/2009/04/26/looking-to-hire-an-engineer-3-reasons-to-forgo-the-phone-screening/ <comment><USER2> The author seems to fundamentally misunderstand the point of a phone screen, you don't ask trivial questions to see how good the engineer is, but to filter out the really bad engineers.

If someone doesn't know what a hashtable or a pointer is then there's no point in wasting their time or yours in bringing them in for an in-house interview. Many companies reject as many as 70-90% of candidates at phone interviews due to candidates lacking basic skills.

<comment><USER3> I just finished an interview circuit for summer internships with six or seven different companies (Fog Creek, Google, some YC startups... other big names here).

The companies in my sampling space definitely were not "filter[ing] out the really bad engineers." It wasn't discussion about hashtables or pointers. They were basically asking me to write actual code over the phone. I was asked to explain how to sort four million items in linear time from a network stream, because there wasn't enough memory to hold the input. I was asked to prove a lower-bound on O-complexity for comparison sorts (over the phone). Several companies asked me to actually implement a hash table, including designing the associated hashing algorithm (really good ones involve some hard prime number math. It's the sort of thing you need math textbooks for).

This is all very interesting, of course, but not really very useful. For one thing, I was not being hired to foster interesting discussion over the lunch table, but rather to write good code--yet these sorts of questions were clearly normal lunch faire. Nobody asked me about how to properly document code, evaluate design patterns--and worst of all, very few companies actually had me write any code to speak of. It was assumed that if I could explain an algorithm, I could write it, which I don't think is strictly true.

In any case, there appears to be some sort of deadlock condition inside my head--the part of my brain that explains an algorithm cannot function at the precise same moment as the part that invents such an algorithm. So while I write great code, I often struggle with phone screens (either I sit in silence for a minute or two to think, or I start spouting off tautologies to give my mind a chance to work). In the real world, it's perfectly acceptable to think before you code, but it comes back to haunt you in phone interviews.

Even more troubling to me is that I have a pretty extensive list of projects on my resume (web stuff, OSS stuff, etc.) and nobody (NOBODY) actually looked at any of the published code I've written. If I was hiring someone who had put OSS code on his resume, the first thing I would do is checkout the source and poke around, but I guess asking constant-time-sort questions in rapid succession is more fun than doing actual work.

If the companies hadn't made me an offer after two or three phone interviews (maybe half?), I told them thanks but no thanks when they tried to schedule more. I looked the hardest at the companies who had me write and e-mail them actual code, which I had time to carefully contemplate, after which the "interview" was largely a formality.

<comment><USER4> Yes - this. I've been doing the same for the past couple months, and I've encountered several types.

Some companies just have me recite my resume - I feel these haven't done any legwork at all, and I usually don't bother.

Others seem to have looked over things, and have me describe in detail the problems I solved, the various alternatives I considered, and so on. This is a good thing!

Only two companies sent me coding assignments, which I completed rather well, I think - I imagine these companies got the best feedback of what I was capable of.

Aside: coding problems are a fine line to walk. One assignment I got had a trivial implementation of the spec, so I actually extended it to make not trivial (basically, they removed everything but the special cases). I extended the problem and wrote the general code.

Other companies have problems that require quite a lot of coding, or at least a lot of time to think and design "correctly". They are interesting problems, but when hiring interns, companies should remember that interns are also usually full-time students (and this one hold a part-time job as well). I just simply didn't have the time to devote to implementing your complex problem, especially when I'm only half-interested in your company.

In the end, perhaps my experience was slightly unusual, because I think my resume displays a lot of experience doing the things I am looking to do more of. Also, looking for an internship is much different than looking for a full- time job.

Hiring is difficult, yes: companies have a hard time finding good engineers, and good engineers have a hard time finding somewhere interesting to work (Social networks are cool and all, but if you're building one that simply targets a specific set of people, with no extra differentiation, I'm simply not interested.) This is why I'm so interested in entrepreneurship - you get to work at a great company, _and_ you only have the best engineers working for you! (Hopefully.)

</comment></comment></comment><comment><USER5> I'm not sure I've ever read an article that's more wrong.

First, refusing to an employer's criteria of hiring will never get you hired. There are more degrading things in this world than explaining technical, even trivial, things to a non-technical person.

Secondly, SAT or any other standardized scores aren't a test of intelligence. Even purporting so shows your level of intelligence. I know plenty of engineers and programmers who did poorly on standardized tests yet who are freaking geniuses compared to others who scored much higher.

Yeah, I agree that reviewing resumes more closely might be a better indicator of qualification than a phone interview, but I don't think they should be entirely forgone. They add an important level of inspection.

</comment><comment><USER6> Interesting point, but I think this post is attacking a certain kind of phone screening, rather than all phone screening.

If you get a (people-friendly) geek to do the phone screening instead, with a single question: "would you like to have a further 30 minute chat with this person?", I would hope you get better results.

I'll agree that getting HR to do your phone screening for technical people is pretty disastrous though.

<comment><USER7> Exactly. He starts with saying that Sergey Brin wouldn't pass Google's phone screening, but (at least when I interviewed with them for an internship) Google phone screens with engineers. The conversation was good, the problems were an interesting/fun challenge, and it would certainly have been effective in deciding whether I was cut out for the position.

I think that the argument should be rewritten to say that the only people that should be judging competence are the ones that work in the field. An HR person shouldn't be trying to decide whether an applicant has passed a screening. They should get an engineer to talk to them instead and decide.

<comment><USER8> Indeed, the first thing I thought after reading the article was 'Google has HR do their phone screens? Really?'- apparently not.

</comment></comment></comment><comment><USER9> I've found that aggressively filtering resumes does a better job than a phone screen. E.g. the presence of "Three years at Microsoft as an SDE" or "Avid reader of Joel On Software and Coding Horror" give you better people than just those who know what a pointer is.

</comment><comment><USER10> Here's the weirdest phone interview question I ever got, for a front-end webdev position: "How would you implement a thread scheduler?"

</comment><comment><USER11> _Evan Paull is a software engineer and a startup consultant._

So you know he knows what he is talking about.

</comment><comment><USER12> More reasons working for yourself is the only way to go.</comment>


Why You Should Quit Your Job and Travel around the World - onreact-com http://chrisguillebeau.com/3x5/why-you-should-quit-your-job-and-travel-around-the-world/ <comment><AUTHOR> * "I like staying at home." - This is another way of saying, "I'm afraid of change and different experiences."*

Bullshit. I find travel very stressful, and none of it is due to fear of change and different experiences. It comes from living out of a suitcase, having to re-buy all the toiletries and crap I have at home but forgot to bring, and being away from my wife and dogs who I enjoy spending time with.

Just remember: _don't like_ != _am afraid of_ I don't like buttermilk biscuits. That doesn't mean I wake up sweating in the night screaming that they're coming to get me.

<comment><USER2> I never found that buying forgotten toiletries and crap was a very stressful experience.

</comment></comment><comment><USER3> Meh. Travel is overrated. The chances of you actually learning anything of substance by running around from one exotic country to another are very slim indeed.

Staying in another country for a substantial amount of time, on the other hand, is of course an entirely different matter but travelling for the sake of travelling, while pleasurable in and of itself, does not teach you anything you couldn't have learned from a brochure about the places you're visiting.

<comment><USER4> Double Meh. Traveling is definitely overrated. Nonconformity != Traveling. The perks of travelling just to "see" new places is novel, but gets old fast. If you've travelled a lot, you get to see the hoards of backpackers and tourists that swarm to the usual (and usual unusual) destinations, and it starts to get lame, fast.

And I'd agree mtts that you don't "learn" much about just visiting a country. Sure, you may "see" what a town or city is like, but you're just reading the cover, not the book.

I moved to New Zealand just for the heck of it with my family, and lived there for almost 3 years. Everyone that visits there gives the same 'ol schpiel... "Oh, it's so beautiful there. It's where the Lord of the Rings was filmed! It's the greenest place I've ever been, and is so environmentally friendly". Everytime I heard that, I could only let out a hugh sigh. They visited and didn't "learn" anything. New Zealand dust crops their entire countryside with poison (1080, which is illegal in the US) quite often, and is "not" very environmentally progressive. Their marketing department, however, is quite progressive!

<comment><USER5> New Zealand not environmentally progressive? Oh come on. Who else spends so much money to protect a stupid parrot that lives on the ground and can't fight?

<comment><USER6> Is it fightless or flightless?

<comment><USER7> it's a pacifist pedestrian parrot.

</comment></comment></comment></comment></comment><comment><USER8> Doesn't really say why, or does it?

I am not a big traveler, so I am probably wrong, but in a way, traveling seems kind of passive to me. Sure, you get to see lots of things, but seeing (and learning) is passive. How am I going to change the world doing that? I would need some kind of spin to it, like at least being a successful travel writer or something. Otherwise, what are the USEFUL experiences to make?

Would be great if some travelers could share what useful experiences they made?

Although one thing in the article made me think: I'd really like to visit Sillicon Valley, experiencing the culture there might actually be useful to me.

<comment><USER9> For US citizens, Peace Corps is one way to meet both of those goals. For people from other countries, there are similar organizations in many countries, and some that accept volunteers from almost anywhere (such as VSO and UN Volunteers).

Volunteers spend a long time in their host country, and really get to see things in depth (not just the tourist view).

Volunteers also get a chance to "change the world". Usually not in a particularly grand way, but a little education and inspiration can have a lot of ripple effects.

Of course, being based overseas, and having a fair amount of vacation time, volunteers also have opportunities to visit other interesting places and countries near their host sites.

Getting a reasonable living allowance and government-sponsored benefits sweetens the deal, but of course it doesn't offer nearly as much freedom as simply quitting your job and hopping on a plane.

<comment><USER8> That is not traveling in my book, though - it is staying abroad. I have no problems with working in another country.

I certainly agree that it is worthwhile to experience another culture at least once. I am not so sure about more than once, though.

<comment><USER10> IMHO "staying abroad" is the _best_ form of traveling. You're not going to be steeped into the cultures of others until you live amongst them. Staying at the Hyatt and visiting all the mandatory sights by tour bus is probably the _worst_ and least rewarding traveling experience money can buy.

In college my internships took me all across Canada, staying in each place 4 months at a time. All of those experiences have been invaluable to me, and taught me far more than any sort of vacation I've ever taken.

</comment></comment></comment></comment><comment><USER11> I have plans in place to do exactly this beginning of next year. But let me clarify: I plan to backpack, living on the bare minimum and traveling mostly by foot and train and using a plane only when absolutely necessary (like when I visit my parents).

It's possible to travel and live in many countries around the world for <$300USD a month -- at least that's what I've gathered from my initial research. I don't have a family to support or a girlfriend so once I quite my job I'll be quite free of responsibilities.

How will I pay for it? Well, the little on-the-side web hosting company I started 5 years ago, which I haven't put any effort into growing, is already close to providing me enough monthly income to live comfortably in many third- world countries.

But I won't be a tourist. I want spend anywhere from 3 - 12 months in an area, learning the culture, the language, the local customs, and meeting and making new friends. I want share my knowledge (mostly technical) and use my skills (technical and carpentry) to help the community where I can. Since I enjoy writing, I plan to maintain a blog about my experiences with the hope that it will help others gain new insights and see that the world is a much bigger place than the 1500sq mile box that most of us live in.

Why? Because I just feel it's what I need to do next in my life to continue growing. I've been living in the same area (Northeastern United States, Boston, MA area) for the past 27 years. Science has proven that the best way to stimulate new growth in the brain is to expose it to new and unfamiliar things. My brain is entering the age where many brains begin to settle into a rut... and it feels like my brain is beginning to atrophy.

<comment><USER12> Definitely go for it.

FYI, my monthly expenses while living in a city outside Shanghai was about $400 per month. I think $300 would be pushing it in a lot of places. I would budget $500 just to be safe and to not have to restrict your lifestyle that much.

<comment><USER11> Thanks!

</comment></comment></comment><comment><USER13> His fiscal argument, that we could afford it if we reshuffled our priorities to buy fewer iPods and more plane tickets, is wrong because buying iPods doesn't require us to quit our job.

<comment><USER14> No. Buying fewer iPods _allows_ you to quit your job.

If you live like a college student for just a few years after leaving college (keep the shit car, live in a cheap studio, don't buy stuff you can't afford) you'll soon find you've got $50,000 sitting in the bank. I mean look at it, they're giving you $5,000 every week now to work at this job, when they used to be _charging_ you money to go to school. If you can't find the willpower to save a few pennies at that point, there's something seriously amiss.

Anyway, you'll find that your tolerance for a crap job goes _way_ down when you have $50k sitting around and no car payments or mortgage. Spending $10k of it hitching across Africa for a year starts to seem like a good idea.

So yes, by reshuffling our fiscal priorities, we can definitely make travel more doable. I know this because I've done it.

</comment></comment><comment><USER15> I did this recently. Just got back last month. I quit my job and went traveling for over 7 months, through South America, across by freighter to South Africa, and by land up through Africa to Egypt.

It was the best experience of my life.

I was hugely nervous about doing it, but it was something I had always thought about doing. Naively I didn't expect to learn much, just that I'd have an interesting time, but I ended up learning a lot about myself (on top of everything that I learned about the countries I traveled through.) Long term travel gives you the luxury of distance and time to think clearly, something you do not have very often in life. On returning I've readjusted my priorities and I think I know better now what _really_ makes me happy. I hope that everyone gets a chance to do something like this. It is a luxury (although it really doesn't cost as much as you'd think), but an amazing one that is well worth it.

I also have some excellent stories :) Let me tell you about the desert in North Sudan...

</comment><comment><USER16> Wow, this guy has a pretty aggressive modal popup that promotes his other articles: <http://img.skitch.com/20090902-kcw6ah5sr6mkpk786ny6sq95d.jpg>

Appears when you scroll down past the article to the comments area.

</comment><comment><USER17> _"I don't have money to travel."

Fair enough if it's true, but for many people who say this, it would be better to say, "I've chosen to spend money on a lot of other things, so now I don't have money to travel."_

Shall we never forget the lovely Victorian ethic that the poor have only themselves to blame.

<comment><USER18> I don't see how this Victorian ethic applies. He's not talking about the poor, but rather those who have "chosen to spend money on a lot of other things", i.e. the middle-class.

<comment><USER19> He assumes you make more than $2 a day. <http://chrisguillebeau.com/3x5/you- are-incredibly-rich/>

<comment><USER20> And given his audience is probably 80% American, he'd be right.

</comment></comment></comment></comment><comment><USER21> The question is not about "Why" but about "How". How would I get the money to travel around the world exactly?

<comment><USER22> By prioritising it higher than any other non-essential cost you have. I know people who have saved up for 6 month round the world trips while working in various menial low paying jobs. The question is, like for most things, is how badly do you want it.

Of course it helps if you don't have a family to support.

<comment><USER23> ..or I could work hard, get my startup to exit, and travel as much as I want for the many years in life afterward. Why does travel have to be done when I'm in my 20s/30s/etc.?

<comment><USER24> It doesn't, but it depends on what you want out of life. If you want to have a successful business, traveling all the time isn't for you. If you want to see the world though, putting it off until later isn't going to help you any. The longer you put of traveling, the less you'll be able to do, and the more entrenched you will be in your work.

</comment></comment></comment></comment><comment><USER25> I quit my great developer job in January to be a ski bum in Wyoming. I just got back from West Africa. It will be worth it if I don't end up living out of my car. Timing.

</comment><comment><USER26> That site nags for your email address with a modal full-page overlay, so you can receive more of these 'insights'. Avoid.

<comment><USER27> That's what noscript is for.

</comment></comment><comment><USER28> I know someone doing this. He worked for a software company in SF and quit a year ago. He's been an extra in a bollywood film, stayed with monks in some temple, volunteered at an orphanage outside of Kathmandu, etc. His pics and stories show up on facebook every couple weeks. For the record, he has no idea what he's going to do for money when he gets back. But maybe he won't come back.

<comment><USER29> Money is overrated, it is pretty easy to survive in the world. Consider that coming from a western country, you have command over the English language, an education more than half the world doesn't have, and a passport.

60% of the people the world alone would kill just to have your passport.

That's awesome your friend is doing that, I traveled through India myself. Money is easy.

</comment></comment><comment><USER30> Another option is getting a job (or inventing one) where you get to travel a lot. Traveling as a tourist can often feel uncomfortable and give you a wrong sense of the places you visit. Traveling in order to collaborate with people is a more complete experience, and you don't have to put life on hold to do it.

</comment><comment><USER31> Doesn't really sound like fun. What exactly am I supposed to do at theses places? Yay, I'm sitting alone in my hotel room in Shanghai, now what? Walk around mindlessly and take a look at the surroundings? Gets boring fast I guess. Go into a bar and try to talk to strangers in english? Hmmm.. don't know, maybe I am too uncreative for that.

</comment><comment><USER32> I guess I agree minus the quit your job part. Why not travel around the world several times a year without quitting your job? Or wait until you're between jobs anyway. Unless you have a crappy job you want to quit anyway, I see little reason to quit a job in order to travel.

</comment><comment><USER33> One problem with traveling he fails to address is the interruption to your career. What if leaving your job for a while means you miss promotion opportunities? What if by the time you get back someone else has picked up on your startup idea?

<comment><USER34> If interruption to your career is important to you, don't take a vacation at all. Spend all your time working so you'll get ahead and get promotion.

I used to worry about my career a lot and I ended up burning out easily. Traveling for me was a good way to take a break and get a new perspective on things.

I take a few months off to travel every 2-3 years and then I get re-energized and ready to get back to work.

Yes, when you travel, your career will be interrupted. But what is the trade off? For me, it was experiencing other cultures. Being in unfamiliar places took me out of my element and I believe has made me tougher. Adjusting to different social environments is not easy.

</comment></comment><comment><USER35> This guy has an interesting take on travel. [http://www.youtube.com/watch?v=ICrV68KIbg0&feature=PlayL...](http://www.youtube.com/watch?v=ICrV68KIbg0&feature=PlayList&p=9F5CBC529DCEF31E&index=1)

</comment><comment><USER36> So any reason for staying at home is a lie?

Many people get a sense of purpose from doing things that are done more easily by staying in one place: write a book, build a house, educate yourself, create a company, raise children, withdraw from society...

</comment><comment><USER37> i think the main excuse I use to not travel is that I have a very stable job currently (federal govt). Its a risk that I would have to accept that when I return I would have difficulty finding employment.

</comment><comment><USER38> I prefer to live and work for at-least 6 months instead of continuous travel. This way I can empathize with local culture, socio-economical and political conditions.

</comment><comment><USER39> I think you should get a job that pays to send you around the world. Has worked for me, YMMV.</comment>


Why Six Hours of Sleep Is as Bad as None at All - <AUTHOR> http://www.fastcompany.com/3057465/how-to-be-a-success-at-everything/why-six-hours-of-sleep-is-as-bad-as-none-at-all?utm_content=bufferb5975&utm_medium=social&utm_source=facebook.com&utm_campaign=buffer <comment><USER2> Title is misleading - should say: one night with 6 hours of sleep results in equivalent performance on certain tasks as someone who did not sleep the night before.

<comment><USER3> The point of the article is that the people who missed two days of sleep knew they didn't sleep enough and that they were not performing well. While the people who only slept 6 hours per night thought they got enough sleep, so they are more likely to continue this schedule.

<comment><USER4> But they are still performing better than had they had no sleep at all.

I know people who regularly sleep 6 hours a day and I've also seen them after an all nighter. Not the same thing at all.</comment></comment></comment>


Ask HN: Most stable Linux distro for desktop use - <AUTHOR> After years of stability using Linux I've run into many problems lately. Wifi crashes after suspend, LVM fails at boot, printer drivers failing, PulseAudio crashing... and this is on several different distros. Which distro has proven the most stable for you? <comment><USER3> Canonical puts a lot of time and effort into making Ubuntu "just work" for most non-corner cases. That's the one I recommend to people as a "baby's first linux" even though I personally run Debian.

Debian Stable is of course rock-solid but it's also often sporting fairly old versions of software (firefox, etc) which can be offputting to the novice. Sid is my daily driver but I'm comfortable with things not working for short periods of time.

<comment><USER4> Unfortunately Canonical has stopped putting that time and effort into the desktop OS and is instead concentrating on mobile/tablet "convergence".

<comment><USER5> Fortunately it's still a very stable desktop environment.

Source: It's my everyday OS.

<comment><USER4> Just wait until 16 is released and they switch over the desktop repos to their in house package system for phones: Snappy.

That said, existing Ubuntu releases that still use Debian style packages are what I'd recommend (and what I use) too.

<comment><USER6> Snappy is the shark that Fonzie is jumping over.

Happy days started to suck long before that point, but it was definitely the best time to jump ship if you hadn't already.

</comment></comment></comment></comment></comment><comment><USER6> Don't listen to these people; Ubuntu/Fedora/Etc are _garbage_ by default, and have been for years.

You're having issues with PulseAudio, systemd, and NetworkManager. Use a distribution that doesn't use these, or one that makes it easy to remove them.

Calculate Linux[0] is the easiest base with which to yank these tumors out of your life, because it has eudev and OpenRC installed by default. Easy to install, and simple to maintain. it's Gentoo, but without all that building of source, and only a 15-minute install. it's simple to install JACK[1], Cadence[2] and wpa_gui after you rip out NetworkManager and PulseAudio (or if you need skype, make PA the slave of JACK).

Second place goes to KXStudio[3], but only because it's an outdated (good) debian/ubuntu core, and uses JACK/Cadence by default. Third place is Void, which, while technically freer (and has LibreSSL!), is not as easy an install as KXStudio or Calculate. All are nice and stable, though.

After removing PulseAudio and NetworkManager from your computer, you'll be astounded at how stable linux is again.

0\. [http://www.calculate-linux.org/main/en/download](http://www.calculate- linux.org/main/en/download)

1\. [https://www.youtube.com/watch?v=GBD- wsMiZCk](https://www.youtube.com/watch?v=GBD-wsMiZCk)

2\. [http://gpo.zugaina.org/media-sound/cadence](http://gpo.zugaina.org/media- sound/cadence)

3\. [http://kxstudio.linuxaudio.org/](http://kxstudio.linuxaudio.org/)

</comment><comment><USER7> Fedora 21 through 23 has worked well so far. All of my peripherals work well on my ThinkPad X1 Carbon (3rd gen). The community is quite easy to join if you need to submit bugs or ask for help.

I've had zero PulseAudio issues even with creating multiple monitoring devices, a USB DAC and a USB webcam with audio support.

Which wifi cards are you using? Broadcom can be a bit of a pain, but the Intel chips are fairly easy to get working.

<comment><USER8> I've been using Fedora full time for the last 6 years (since 14 I think) and it has been pretty good. Haven't used any other distro much though so no real comparison.

Definitely agree that Broadcom wifi (what I have now) is a pain - <USER2> kernel upgrades kill wifi, when reinstalling I never remember which combination of kmod/akmod things I need. That is the only real complaint though.

</comment></comment><comment><USER9> I run Ubuntu on my 'not doing much other than youtube and paying my bills' computer. (I also choose to reinstall the whole OS every major release (+ 1 month for those 'day 0' issues to be fixed)).

I have debian on my NAS and 'stable' backup box. I keep this thing rock solid.

If I actually want to do anything crazy, I'll either whip up a VM or I have a clunker of a laptop I keep around for experimenting and other things (along with other single board computers).

My two cents in keeping something stable is don't do anything to it. Keep it as vanilla as possible unless you are 100% sure what you are doing.

</comment><comment><USER10> Ubuntu works pretty well. Debian is solid too. Buying a computer that is meant and certified for Linux use is probably a wise investment.

<comment><USER11> You touch an intersting point: Linux reliable computer maybe a stronger point than the distro. I had a toshiba that took weeks to find the actual way to make the soundcard works... and so the ATI graphics card... and the headphone jack did just mute the sound but didn't get music from it. On the other hand the thinkpad x200 and x220 I got need zero work to "just work" beside the trackpoint. My Asus ROG have also work without any extra work from my side. Maybe a good rule of right hand would be to stick to intel wireless/cpu/graphics (no nvidia, no ati). Dell and system76 also sell linux compliant machines. Last but not least; tangent but if you change the requirement to stable *nix machine you can get a mac.

</comment></comment><comment><USER12> Ive been using ubuntu nearly 10 years as my primary os on every my servers and desktops, they really came a long way. We hated eachother bigtime, however if you decide to get on well with each other somethings may be unseen. However ubuntu is a great os and still my number one, and i love unity(really). Also the ubuntu comunity definitely rocks. You can find nearly everything's .deb packages, you'll have apt which is one of the main reason why i still use this os. It's dead simple. But if you really need low hardware and high performance i think you really take a look BSDs. However you need an os that runs well, is sufficient for doing internet tasks, can handle your scripting things, can do developping stuff, etc... go debian derivatives (ubuntu, mint,...)

</comment><comment><USER13> Mint is pretty solid out of the box, better than Ubuntu imho.

You could also go the other route, install ubuntu server or something and install x, your preferred window manager and all that stuff yourself. Have been running a desktop setup like this for 3/4 years now and never had any issues other than having to reconfigure some *cked up X settings after dist- upgrade.

<comment><USER14> I second Mint. Been using it for the last 4 years.

</comment></comment><comment><USER15> I would actually suggest Kubuntu 15.04. I just actually tried it last night and its fantastic. [https://www.kde.org/workspaces/plasmadesktop/](https://www.kde.org/workspaces/plasmadesktop/)

although I can't really comment on stability, just commenting for desktop use.

</comment><comment><USER16> I use Debian on my old Thinkpad T61 beater. I use it for everything. Coding, browsing and multimedia. I am no power user so it kind of just works. My wife is using Debian on desktop as well and for years now has been no-fuss-it-just- works...so I recommend Debian.

</comment><comment><USER17> I need a very light OS to run my CAE program and Lubuntu is the best.

</comment><comment><USER11> Although I touch the point of a linux "known to work" machine below, what are the odds that is not linux but a problem with hardware? memory would be my first guess. Also, may you want to share more information about your set up? machine, specs? UEFI can play a big role on your problems.

</comment><comment><USER18> Archlinux isn't the most STABLE, but I've had less problems with it than any other distro. Rolling Release is a godsend, and the wiki provides excellent documentation. Just don't be put off if your told to RTFM when you ask a question.

</comment><comment><USER19> There hasn't been one of these for a long time.

I gave up and switched to OS X and BSD for my Unix needs.

</comment><comment><USER20> openSUSE Leap: [https://en.opensuse.org/Portal:Leap](https://en.opensuse.org/Portal:Leap)

Bonus: openSUSE Build Service (OBS): [http://openbuildservice.org/about/](http://openbuildservice.org/about/)

</comment><comment><USER21> Lubuntu if you want something lightweight

<comment><USER22> Second Lubuntu. Installed to breathe life into an old af Toshiba laptop. Stable, fast, no bloat.

</comment></comment><comment><USER23> Debian.

</comment><comment><USER24> OpenBSD

</comment><comment><USER25> CentOS</comment>


Dart in 2017 and beyond – How the Dart team pivoted - <AUTHOR> http://news.dartlang.org/2016/10/dart-in-2017-and-beyond.html <comment><USER2> Lots of exciting news. DevCompiler exceeds expectations. I'm sure already I won't miss Dartium.</comment>


Supreme Court Rules Trump Cannot Block Release of Financial Records - <AUTHOR> https://www.nytimes.com/2020/07/09/us/trump-taxes-supreme-court.html <comment><USER2> Timely as ever, he is almost out of office so don't think this really matters anymore. People will probably discover he isn't really that wealthy, but thats about it. People suing him will probably find that his assets are all controlled by trusts, so on paper there isn't much to go after.

<comment><USER3> He is the course correction. Don't let this place become an echo chamber, remember this: [https://imgur.com/a/k5lDfx4](https://imgur.com/a/k5lDfx4)</comment></comment>


WeWork Posts $264M Quarterly Loss, as It Expands Globally - <AUTHOR> https://www.bloomberg.com/news/articles/2019-05-15/wework-posts-264-million-quarterly-loss-as-it-expands-globally <comment><USER2> What really matters is growth to cost, if every dollar they spend results in 1.1 earned dollars tomorrow, that's great, that's what I want to see as an investor. If every dollar invested results in more negative dollars, well.... When does the bonfire stop, when money stops going in.

As surprised as I am, they seem to be on the right track from reading this article

Update: ok after selling junk bonds and losing almost $2b a year going for the IPO? Yeah that won't end well. They're another loser looking for public fund bag holders

<comment><USER3> That comment turned quickly!

</comment></comment><comment><USER4> Interesting to leave out "Revenue more than doubled to $728 million in the same period, as did membership."

</comment><comment><USER5> I mean, worst case they have to sell their assets, which have value.

Unlike Uber if it goes away there isn't much to sell besides their offices.

<comment><USER6> This incorrect. The vast majority of their properties are leased on long-term agreements. Which means whilst these leases might make them money if they can rent them out for a good price, they're actually a liability since they're obliged to pay the leases even if they can't rent out the space.

<comment><USER3> They will strategically default when the time comes. Their leasing structure lends itself to that sort of financial maneuver.</comment></comment></comment>


Dropbox tortured by Condoleezza Rice angst - <AUTHOR> http://blogs.computerworld.com/cloud-computing/23778/dropbox-tortured-condoleezza-rice-angst

<comment><USER2> Most opinion pieces on current controversies—as opposed to actual news—don't count as on-topic for HN. Aggregating them doesn't make them more on-topic.

<comment><AUTHOR> OK. Message received and understood :)

</comment></comment><comment><USER3> A press release and collection of reactions hardly rises to "torture," and it's especially bad reporting by Mr. Jennings to say that Drew Houston "is unapologetic," when what is quoted is the announcement, the first piece of information about the hiring. What, Richi, Pat dies and so now you get to phone it in?

Let's see how DB responds first.

<comment><USER4> Link bait, don't think this should have made it to the front page.</comment></comment>


Massacring C Pointers - <AUTHOR> https://wozniak.ca/blog/2018/06/25/Massacring-C-Pointers/index.html <comment><USER2> A few years ago, I saw a classroom video (I would guess ~8-10 year olds, in the American public school system) as a demonstration of a teacher's technique called "my favourite wrong answer". She would have them solve a problem (a math problem, in this particular case), collect the answers, show the distribution of the answers, and then pick out one answer (possibly with the student's name redacted) as her "favourite wrong answer". And then she would work through why she liked it so much with the students. In the examples, it was cases where the person was on the right track, but then made an incorrect, but justifiable by _some_ standard, step in solving it.

It seemed like a good way to really try to understand where someone's comprehension broke down. It felt like it added some legitimacy to the students who got the answer wrong, if others could look at it and go "oh, I see why you thought that!" instead of just "wow try to get it right next time". I believe it's part of what good teachers (not limited to school educators, mind you) are doing all the time: looking for the student's gaps and trying to correct those, instead of just repeating the lesson that has already failed to stick.

I guess this just makes me think of that teacher, trying to work out what her pupils were misunderstanding, by looking at their answers.

<comment><USER3> The issue with really learning computer science outside top well known schools is that you're basically on your own for education (or worse if taught wrong). Open source software somewhat teaches you things but usually by trial by fire.

<comment><USER4> Really? I went to a non-top school and putting aside the formal education component, I felt like I also had plenty of co-learning. That is, I remember many study groups where we helped each other learn, including for programming.

I certainly didn't feel like I was on my own.

<comment><USER5> Similar experience here, my university helped people form study groups near final exams and had a "homework club", where final year and grad students were paid to help first and second year students with their assignments for a couple hours a week, and people were encouraged to meet each other in that club and find "study buddies" (but no-one actually called it that, because ugh)

Covered everything from the programming to the multivariable calculus and data science (much harder to find students confident enough to teach others for those last two though)

</comment></comment></comment></comment><comment><USER6> When I started my CS degree the school was transitioning from teaching C++ to teaching Java, and the state of instruction in C++ was almost as bad as these examples. I had a professor who wanted us to use "new Foo()" everywhere in our code (even local / static variables) because it, "gets the students ready for Java." No matching delete, of course, or mention of RAII. We were supposed to "pretend" we had a garbage collector. By that logic one might prepare students for a course in Spanish by speaking English with a "-o" on the end of every word.

On one of the early homework assignments I realized my professor misunderstood how pointers work - he seemed to believe that (re)assigning pointers created chains rather than changing what the pointer points at. I.e. given "int x,y; int_pointer a,b,c; a=b=c=&x;" he seemed to believe that then executing "c=&y;" would also cause "a" and "b" to point at "y".

I spent the first page of my turned-in assignment excoriating his lack of understanding. Then I presented a class template that implemented a special smart pointer which _did_ behave in the unusual way he seemed to think C pointers work, so that I could write the code exactly as he presented in the assignment and make it actually work.

In retrospect I could have been nicer and considered other pedagogical factors beside technical correctness. I think he took it with more grace than I deserved.

<comment><USER7> Some of my professors also have ridiculous code standards or exam standards. One of them teaches "algorithms and data structures", but he's not allowing us to even use a break or continue in our loops because he thinks it's "bad practice". We end up with a nested hellhole. Another example from the same professor (correct me if I'm wrong on this as I'm not a C++ expert), but he's constantly inheriting from unique or shared pointers in his classes. Like why though? Why do you have to complicate your code like this? Why can't you just have a normal class with unique or shared pointers in it?

Lastly, and this is taught by another professor, is my class for Linux. It includes bash and C++ programming and focuses a bit on the POSIX API. Our exam was last week and we had 3 parts. The first part was a theory exam by the professor that taught the class. It was about bash/POSIX commands and very little Linux specific stuff. He expected us to know all of the options from all of the commands you can think of: cut, split... You had to know all of them and off the top of your head. It's ridiculous. I'm pretty sure I failed that one, but I absolutely nailed the next part which was about bash scripting (where you could use if statements and the like, the first part did not allow it, only redirection and piping). The man is mad (hah man, that's what I needed during that first exam part).

<comment><USER8> >Another example from the same professor (correct me if I'm wrong on this as I'm not a C++ expert), but he's constantly inheriting from unique or shared pointers in his classes. Like why though?

You are not wrong. This completely breaks my brain. I really would love to hear the professor's explanation for this.

<comment><USER9> The same thing as people inheriting from standard containers. It does not make sense!

It's like people see inheritance and then forget that containment is a thing.

</comment></comment></comment></comment><comment><USER10> This doesn't surprise me really. When I was at university the programming textbooks we had were vile nasty and plainly incorrect. And those of us who dared challenge it by writing correct, robust code were penalised as the staff teaching it didn't understand the domain of what they were teaching properly and didn't have any real experience and assumed we were doing it wrong. We learned quickly to approach education with a high level of scepticism and get your info from more than one source (textbook) and find out which ones were reputable and which ones were garbage.

Basically there was a monolith in the middle of the course, a crap textbook, and monkeys were praying to it as the authority on everything.

<comment><USER6> Along the lines of taking the authority of a book as a replacement for critical thinking... I was once hired to rewrite some assembly language spaghetti code a more-electronic-than-software engineer had worked on for two years. Ostensibly he was ordered to help me accomplish this, but he was more like what in court would be described as a "hostile witness"

I spent a couple of months "hacking", just familiarizing myself with the microcontroller and its instruction set, and the tooling. (In fact, I had no source code to look at during this time, as he would not surrender it!) When I finally got his source, I rewrote it to a 100% functional equivalent in two weeks, 1/5 the size without all the unnecessary control path duplication and without pointless register moves. At the time I found the way he had used register moves particularly puzzling because it resembled the way an un- optimized compiler might work.

Months later after I was no longer on that project, I got a call from him. He was very flustered and wanted to know where I "got" a particular sequence of instructions from. I was like, come again? He said, "It's not in the book. You used a sequence of instructions that's not in the Book." (The Microchip programming manual.) He asked about another block of 3 or 4 instructions - also not in the book (in the combination I used them in).

Slowly it dawned on me - I'm quite certain he didn't understand what any individual instruction "did". That whole level level of abstraction didn't exist for him. He programmed in assembly, yes, but only using blocks of example instructions from the Book. Suddenly the pointless register moves made sense - he was acting as a human compiler, without an optimization step.

Years later I realized I should have asked him, "and how do you think the example code in the book was written?"

<comment><USER9> That seriously sounds like someone that has only learnt through rote memorisation. Absolutely great at taking tests and doing things by the book but completely unable to apply the things they should have learned to a problem that falls slightly outside the examples.

Great story though, even though it makes me shudder.

</comment></comment></comment><comment><USER11> I was going to ask if any attempt was made to reach the book author for comment, but it looks like he died in 2007. RIP.

[https://www.findagrave.com/memorial/29007415/robert- joseph-t...](https://www.findagrave.com/memorial/29007415/robert-joseph- traister)

<comment><USER12> It appears that someone having read your comment here has left a horribly abusive comment on that memorial page now under the handle "Screw You Bob".

> ... The Hacker News army is here.

"Screw You Bob" you do not speak for me. Hopefully, you don't speak for many people on HN.

Words fail me. Can't we let the dead rest in peace?

<comment><USER13> I'm surprised there is no way to report one of those on the site.

<comment><USER14> There is a feedback form in the lower right and the email address.

</comment></comment></comment></comment><comment><USER15> The fixed-location variable allocation strategy the author mentions is called overlaying or compile-time stack[0]. It's still very much alive today, thanks to architectures like 8051 that are not really stack-friendly (even though they do have a stack).

> _The Keil C51 C Compiler works with the LX51 Linker to store function > arguments and local variables in fixed memory locations using well-defined > names_

[0] [http://www.keil.com/support/man/docs/bl51/bl51_overlaying.ht...](http://www.keil.com/support/man/docs/bl51/bl51_overlaying.htm)

<comment><USER16> Is there anything I can read to learn more about overlaying in C? I was reading, to my limited abilities' limits, 2.11 BSD source and there was a lot of references to overlaying.

<comment><USER17> On a modern POSIX environment, you can hack together an approximation of an overlay by loading some code to an area of memory, mprotect( ptr, len, PROT_EXEC) the segment, ((int(*)())ptr)() to call the function and if you did everything right, you don't segfault too hard. Later, you can overwrite that area of memory with other code and repeat.

This is similar to what actually goes on under the hood of the dynamic loader. [http://tldp.org/HOWTO/Program-Library-HOWTO/dl- libraries.htm...](http://tldp.org/HOWTO/Program-Library-HOWTO/dl- libraries.html)

<comment><USER18> That is a different sort of overlay, a code overlay.

The other example was data, with the compiler assisting by changing local variables to have fixed addresses that get carefully reused for different variables at different times.

</comment></comment></comment></comment><comment><USER19> Yesterday I encountered a similar program on a HN comment chain as shown in this link. I am genuinely confused as to why this program is bad. I am a student and I do not know the best practices regarding pointers, but it is how I would write a program to combine two strings.

Can someone please elaborate why it is bad? Are their any good resources to fill gaps in my knowledge?

Thanks in advance.

Edit: Thank you guys for pointing out so many problems. It seems that I have a lot to learn. :)

<comment><USER20> It is wrong in many ways.

It copies s and then t to a fixed size buffer, without any checks. That will write to invalid memory (probably smashing the stack) if len(s), len(t) or len(s) + len(t) > 100.

It returns a stack allocated buffer (r) pointer to the caller. The array will be invalid when the function returns, as the automatic variables only live in the function scope (during the call), they are deallocated when the function returns.

To do this right you have various strategies.

1\. Allocate a buffer of len(s) + len(t) + 1 with malloc, copy the strings and return it. Have the caller free it when it's done. It can be inapropiate because of the dynamic allocation.

2\. Have the caller pass a destination buffer and its size. If you know the char *'s are zero terminated, check if you have space for them in the dest buffer. If not, truncate or error out. Most of the times, this is the prefered solution.

3\. Use a static local buffer, and return it to the caller. You may need to truncate the copy too. Not recomended. This is not a good solution as the function also will not be reentrant (unsafe with multiple threads).

You can use libc functions like strncpy (C89+), snprintf (C99+) etc to make a "size-checked" copy with various automatic truncation semantics. You can refer to their man pages for details.

Edit: to the downvoters, please point out what is wrong in the comment.

<comment><USER21> You're right, although any mention of strncpy should come with a big disclaimer that it's effectively broken because you can end up with a non-NULL terminated string in some cases. strlcpy should be the way to go but unfortunately it's not part of the C standard and not available everywhere (sometimes for rather bullshit reason IMO, but that's a different story).

<comment><USER22> Documented behaviour is a little different to "effectively broken". The difference between strncpy and strlcpy is that strlcpy will NUL terminate the last byte for you always. There is nothing stopping you from doing the same thing yourself when you use strncpy. If you care enough, write your own strlcpy - it's only one extra line.

<comment><USER21> I'm not saying it's hard to work around but I maintain it's broken. You have a function that deals with C-string that in some conditions returns something that's not a C-string but can't be trivially distinguished from one and will trigger undefined behavior if used like one. It's terrible ergonomics and almost certainly not what you want to do in any situation.

You can argue that truncation is an error condition but then it ought to notify it somehow, for instance by returning NULL in such a case. And even then it's incoherent with snprintf which doesn't have the same behaviour and does always terminate with '\0' even in case of truncation (assuming non-0 buffer length, of course).

It's just an unnecessary footgun that serves no practical purpose. It would be like a date function that gives you the today's date except on the 4th of December where it replies that it's the 31st of February. Not hard to work around but still broken.

<comment><USER23> It's not broken, but it _is_ misnamed.

This is because it is not intended to work with the same kind of string that the other str* functions work with (ie. an ordinary null terminated string).

Instead it's supposed to work with fixed-width string fields that pad out values shorter than the field width with nulls. This is how original UNIX directory entries were stored.

See how the name is copied into u.u_dbuf here: [https://github.com/hephaex/unix-v6/blob/daa355109625a50e6b10...](https://github.com/hephaex/unix-v6/blob/daa355109625a50e6b1080184dee30c9136549d1/ken/nami.c#L72)

<comment><USER21> I see your point but at this point I think it's just a matter of taste. I don't really see how having a function meant to deal with a special case of character buffers disguised as a general purpose string manipulation routine in the stdlib could be considered reasonable. I understand why it's here, I understand the history, I understand why it made sense at some point to have such a function but you won't be able to convince me that it's not broken or that it shouldn't be deprecated in favor of strlcpy (ditto for strncat/strlcat). After all it is in <string.h>, not <fixed-width-string.h>, it's pretty heinous that it fails at the very low bar of actually producing a valid C string every time (especially given the very high prejudice of having rogue unterminated "strings" in a C program).

<comment><USER23> It seems fairly unlikely that the C standard would add strlcpy() and strlcat() when it already has strcpy_s() and strcat_s() in Annex K.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER24> I've definitely bought a few programming books that, on closer inspection, just appeared to be money-grabs from the author.

But, my biggest memory is the book I didn't buy. I once worked with a programmer who wasn't very good, and then I heard he wrote a book. I typed his name into Amazon, and there was his book. It was all about the half-baked concepts he was trying to put into our failing project. (Ultimately canceled because we couldn't ship a very simple product. We couldn't ship it because everyone just wanted to add code generators and additional layers around a database... Instead of learning how to use a database.)

I couldn't get out of that job fast enough.

</comment><comment><USER25> When I was learning C in the eighties, I bought a book about 3D programming, the worst programming book I've read. I believe that examples worked, at least the ones that I typed did, but the style was atrocious. The concept of function parameters seemed to be totally alien to the author. The idiot created x1, X1, x2, X3, x, xthis, xthat... variables instead. He was a former BASIC book author too.

I can't warn you because I put it to the trash bin long ago.

<comment><USER26> _He was a former BASIC book author too_

Hmm, I'm starting to see a pattern. Is it possible BASIC, plus lack of internet back in the day, plus attrocious books are the reasons for truning poeple into terrible programmers? I happen to know only a couple of seniors but without exception their code, no matter what language written in today, is horrible on all fronts. I used to think it was a lack of attention to detail, their lack of wanting to strive for even the tiniest bit of more than just 'good enough for tady'. Possibly stemming from lack of education and lack of continuous self-education. But maybe there's more to it. Maybe they were influenced by a bad book. And/or by a not-so-optimal language like BASIC.

<comment><USER27> There's a sense in which the hardest programming language you'll ever learn is actually your second one. I think the reason for this is that with just one language under your belt, you have very little ability to distinguish between the abstractions the programming language offers you and the capabilities of the machine, and to distinguish between the abstractions the programming language offers you and the capabilities of programming itself. So for your first language, you're learning what is actually just an approximation and simplification of that first language, where all three of those things are all mixed together so you don't have to spend the cognitive effort to understand the differences and you can develop and rely on huge misconceptions without seeming to pay too large a price, but with your second, you're unlearning errors about the machine, unlearning errors about programming in general, and also learning a second language. Particularly difficult if you're making the leap from something like BASIC to C, where the second language is also substantially more difficult than the first.

For people of certain of a certain psychological orientation, there is the additional challenge that having put away your first language, you now think you are a "Programmer (TM)", and learning that second language and learning that you have a number of misconceptions can strike at your very identity. People can get psychologically attached to their misconceptions if it means retaining the illusion that they have mastery.

Nowadays the easiest way to screw this up is to go to a computer science/engineering program that uses just one language. As tempting as it may be from a curriculum simplicity perspective, it's a big mistake. I've interviewed a number of people who think that Java === computing. Not even the "JVM", mind you, but Java, the language, itself. I don't blame Java for this, it's the education. Java itself is not a great lens to understand computer capabilities through, and it's a miserable language to be your lens to understand the general capabilities of programming through, especially 10 years ago. (It's slowly getting better, with easy closures and such, but it's still stuff bolted on the side 20 year later.)

Looking at it from that perspective you can see why 8-bit-era BASIC was even worse than that. It offers a very impoverished view of the computer's capabilities _and_ a very impoverished view of the possibilities of computing. (It was possible to rehabilitate BASIC into at least a passable language; I'm glad I don't have to use Visual Basic to do my job, but it's still light years ahead of the BASICs that still used line numbers, and I've done Real Work (TM) in it, albeit a long time ago.) A 21st-century Java-only programmer is substantially better equipped than a 20th-century 8-bit-era BASIC-only programmer.

(By "8-bit-era", I mean the timeframe, not necessarily the CPU. I'm fairly sure there were BASIC implementations with line numbers and such on non-8-bit- machines, and they'd still be dangerous. But as computers got into the 16- and especially the 32-bit era, even BASIC had to grow up.)

<comment><USER28> > I've interviewed a number of people who think that Java === computing. Not > even the "JVM", mind you, but Java, the language, itself.

Could you elaborate on this? What exactly made you realize that was how/what they thought?

<comment><USER27> I had to ponder on what it is that really sets this sort of person apart, and I think it's the sort of sneering disdain at the idea that any of the other languages in the world are worth anything, or have any good ideas. Or maybe it's the way that when you ask them what's good or bad about some other language, you get back just a list of differences those languages have with Java, and it is simply assumed that all differences are ways in which they are inferior to Java.

And let me say again that it's not specifically Java. I've seen a couple of people that way with C, for instance, though not in an interview situation.

</comment></comment></comment></comment></comment><comment><USER29> > _Pointers to functions are seen mainly as a way to obfuscate your program. > "A pointer to a function serves to hide the name and source code of that > function. Muddying the waters is not normally a purposeful routine in C > programming, but with the security placed on software these days, there is > an element of misdirection that seems to be growing." (p. 109)_

> _" GIGO (garbage in, garbage out) is a term coined to describe computer > output based on erroneous input. The same applies to a human being." (p. > 152) — ???_

(like the readers of this book?)

Priceless.

</comment><comment><USER30> I'd be interested in a review of the author's C++ pointer book _Conquering C++ Pointers_

[https://www.amazon.com/Conquering-Pointers-Robert-J- Traister...](https://www.amazon.com/Conquering-Pointers-Robert-J- Traister/dp/0126974209/)

</comment><comment><USER29> > _" Both programs also contain another value of 43. This is the constant that > was written directly into the program." (p. 29) — I have no idea what this > means._

> _I believe that the author thinks that integer constants are stored > somewhere in memory. The reason I think this is that earlier there was a > strange thing about a "constant being written directly into the program." > Later on page 44 there is talk about string constants and "setting aside > memory for constants." I'm wondering now…_

Yes, most of the book is wrong. In this example, the author probably also presented this idea in a wrong way.

But the author is correct for having the idea that _" constant being written directly into the program"_ (by the compiler!) and _" integer constants are stored somewhere in memory"_, they are correct and make perfect sense. Of course the integer constants and string constants are all allocated and stored somewhere in memory (or somewhere that can be mapped as memory). They are usually known the text segment and data segment.

> _…(remember, the array name becomes a pointer when used without the > subscripting brackets) "_

> _" …while a pointer, as always, is a special variable that holds the address > of a memory location." (p. 57) — Still wrong, but slightly less wrong._

Good enough IMHO. It is true that an array "name" is a pointer to its base address.

<comment><USER23> _It is true that an array "name" is a pointer to its base address..._

No, it's not. It _is_ true that an expression of array type, when it is not the subject of either the unary-& or sizeof operators, _evaluates to_ a pointer to the array's first element.

      sizeof array

gives the size of the whole array, not the size of a pointer.

      &array

gives the address of the whole array, not the address of a pointer.

<comment><USER29> I've programming under the useful but wrong assumption, that

> array[x] and *(ptr+x) is completely equivalent, so array and ptr is > equivalent.

until now. Thanks for the clarification.

<comment><USER31> Strictly speaking, the initial part of your assumption is not wrong, but the later conclusion is.

array[x] and *(array+x) are indeed equivalent for any identifiers 'array' and 'x' (assuming one of those evaluates as a pointer value, and the other as an integer value; otherwise the code is incorrect). In fact, in this context an actual array is not subject to either unary-& or sizeof operators, so it evaluates to a pointer value, fulfilling the precondition.

This is why "array subscription" also directly works with pointers (i.e. "ptr[x]"), and from the equivalence above follows one of the common useless facts that you can swap the identifiers (i.e. "x[array]").

(This comment is probably confusing enough without saying that "(&array)[x]" is valid code too, but isn't the same thing as those before.)

</comment></comment></comment></comment><comment><USER32> Heh, not only this but there are also plenty of C++ books that are literally less than worthless.

Additionally another common domain of clueless writing is computer graphics and the related math. There are so many articles written by enthusiastic people (no doubt) where the information is just adding noise. Finding trustworthy good quality information requires that you know a considerable amount already so you know what is good and what is not (talking about online content here) :)

<comment><USER33> Didn't some of the C++ books have to be crappy in some ways due to limitations of free (as in beer) compilers with arbitrary limitations? One I vaguely remember was a ridiculously (even for the time) limited stack size, so a lot of examples had to do unnecessary allocation just so readers could compile.

I think it was this book ([https://www.amazon.com/Flights-Fantasy-Programming- Video-Gam...](https://www.amazon.com/Flights-Fantasy-Programming-Video- Games/dp/1878739182/ref=pd_sbs_14_1?_encoding=UTF8&pd_rd_i=1878739182&pd_rd_r=6ce9213c-7912-11e8-8434-9191398a8362&pd_rd_w=5vYRm&pd_rd_wg=1DW3X&pf_rd_i=desktop- dp- sims&pf_rd_m=ATVPDKIKX0DER&pf_rd_p=5825442648805390339&pf_rd_r=MBCC0PXWQSFBW41PV2MT&pf_rd_s=desktop- dp-sims&pf_rd_t=40701&psc=1&refRID=MBCC0PXWQSFBW41PV2MT)) that taught me 3D programming better than anything else. The code was readable, the maths was well explained and it included sections on how to do things without those newfangled maths co-processors. I'd love to buy a copy now just to see if it really was a good book or if it led me astray.

</comment></comment><comment><USER34> I doubt books like these are as common today, but tutorials are everywhere. I don't know how often I have found scheme tutorials that teach a language I barely understand. Not dangerous maybe, but very weird nonetheless.

I see beginners writing code like that all the time, which makes me sad.

<comment><USER35> Yeah, a few months (a year?) ago I was getting back into Javascript so I went to the mozilla website [1] to refresh my knowledge of prototypical inheritance. And it seemed all wrong. So I actually ran their short bits of example code in firefox and they worked like I expected them to. Their documentation is just nonsense.

There hasn't been a lot of activity on it recently so it's probably still wrong.

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

</comment></comment><comment><USER36> It's books like this that lead to inventions like Java and Go, with explicit aims of avoiding certain difficult constructs.

Not that pointers are particularly difficult in the scheme of things, but if someone who doesn't understand them tries to teach them, pointers inevitably _do_ become "difficult"

</comment><comment><USER37> _"...But like analyzing a terrible movie that somehow gets made, it's more fun to reason through the "behind the scenes" parts..."_

I do too. Many times I find it much more interesting understanding how the sausage is made than what the actual sausage tastes like.

This is a great meta review. As somebody who's just published a book for tech teams, I need to be acutely aware of my own work to make sure I'm not falling down the same hole: taking a little bit of knowledge and and trying to fluff it out to appear to be a comprehensive body of work.

It's not just the 80s and old coding books. There has been quite a trend over the last decade or so of people over-publishing (I guess that's the term). Promising all sorts of things while delivering on little.

In some ways I think this is okay. The received wisdom is that you don't have to know everything, you just have to know more than the reader and be able to explain how to move them a bit forward. Perhaps the key is attitude. Woz says _"..'Ive always found the authors come from a position of earnestness, attempting to draw the best conclusions based on decent principles and what they knew at the time they wrote it..."_

A little humility, careful scoping, and honesty in a tech book can go a long ways. (Insert long discussion here about whether people would buy such a book, and how people are much more naturally attracted to books with a strong emotional impact "Make money with C Now!" than they are books that simply try to helpfully explain something without all the glitz) There is a natural tension at work here.

</comment><comment><USER38> It seems that the author followed the same logic as the author of the "English As She Is Spoke"[1] phrase book between Portuguese and English, with the French dictionary in between.

[1][https://en.wikipedia.org/wiki/English_As_She_Is_Spoke](https://en.wikipedia.org/wiki/English_As_She_Is_Spoke)

</comment><comment><USER39> I always wondered about the C tutorials Brian Kernigan mentions in his talk ( [https://www.youtube.com/watch?v=8SUkrR7ZfTA](https://www.youtube.com/watch?v=8SUkrR7ZfTA) ) , many of the examples seem intentionally designed to be incorrect by some trickster spirit.

Now I know the even darker truth.

<comment><USER40> The exact same code sample appears in the talk as in the article.

<comment><USER41> Yes, the article mentions the sample was taken from the talk.

</comment></comment></comment><comment><USER42> This was a fun read, but left me with the question: What book on C pointers would be the polar opposite of this one?

I'd like to read that book.

<comment><USER43> While I haven't read either of them, _Pointers on C_ and _Understanding and Using C Pointers_ both have good reviews.

</comment></comment><comment><USER44> Make sure to click the link at the end of the article for code samples with potential for Segmentation fault:core dumped in 4 lines.

Even more concerning is the book seems to have some positive reviews on Amazon(!), and just one shredding it.

<comment><USER45> The example given at the top of the article can cause a segmentation fault. See the other comments here for how.

<comment><USER44> Returning out of bounds pointers will do that. Was more impressed by the range of errors in his 4 line examples - the sort of thing you'd expect from a struggling student not a tutor or author. :)

</comment></comment></comment><comment><USER46> This reminds me of the first textbook I tried to learn C++ from. It was fun to read, because the authors seemed to put more energy into writing Limericks than explaining object-oriented design. I don't think it touched on inheritance, and things like, I don't know, inline functions or templates were not mentioned at all.

It did not even contain working example programs, let alone exercises. It was so bad, as the saying goes, it was not even wrong. I still have that book on my shelf as a reminder to not blindly buy the first/cheapest textbook I can find.

</comment><comment><USER47> Oh wow, I have the "Going From BASIC to C" book! I remember reading it first because I knew Apple BASIC really well. I also had K&R. Looking back, I wonder if learning C was made harder or easier by that book…

</comment><comment><USER48> I've found that it's usually those with embedded systems experience who are most knowledgeable about pointers, but I suppose BASIC experence with embedded systems doesn't count --- the ones I'm referring to usually started in Asm/C, and others I know who started in Asm (not necessarily for embedded), also are extremely good at pointer use.

The modern equivalent would probably be Arduino experience. I wonder if there are similar examples in books out there about C++ written by someone with only that...

</comment><comment><USER49> I took a look at some of the transcribed code examples. Understand, I consider myself a novice at C, one who's just starting to get a clue about pointers. But reading the code examples, more than once I found myself going, "Wait...what?".

I briefly tried to learn C++ an C in the 90s. I'm somewhat glad I didn't find this book in the library. I think it would have made attempting to learn harder, or given me some bad and dangerous habits.

</comment><comment><USER50> Apparently Mr Traister has written a number of other books - [https://www.amazon.com/default/e/B001H6UPHY/](https://www.amazon.com/default/e/B001H6UPHY/) \- according to Amazon...

Made me wonder if the quality of the content in the other 11 books is anything like the one the Woz took apart.

<comment><USER51> It's not Steve Wozniak. They just happen to share the same last name. From [https://wozniak.ca](https://wozniak.ca):

> I'm Geoff Wozniak, just one of those persons on the Internet. My blog is > hosted here, but not much else at the moment.

<comment><USER50> Thank you!

</comment></comment></comment><comment><USER52> [https://www.findagrave.com/memorial/29007415/robert- joseph-t...](https://www.findagrave.com/memorial/29007415/robert-joseph- traister)

</comment><comment><USER53> I have this book, a pristine first edition, with maximum wrongness. It's pristine because I bought it when I started learning C in 1990, and never opened it after my first read through.

</comment><comment><USER54> Usually, that kind of venom in C book reviews is reserved for books written by Herbert Schildt ;-)

</comment><comment><USER55> Bad reviews are always so much more fun to read than good ones.

<comment><USER36> To review your comment: "The author's well meaning and accurate comment is that well-written negative reviews are typically far more fun to read than positive ones of any quality -- in the positive case you usually want to simply read the book, while the implication of the comment is that the pleasure of reading the negative ones is a delicious _Schadenfreude_.

"Regrettably, this insight was obscured by a regrettable poor choice of terminology ("bad" and "good"). The comments, azernik, has enough HN karma to suggest that this error ought be assigned to the casual, off-the-cuff nature of internet commenting, and that this comment is not up to the usual work (i.e. comments) of the author.

<comment><USER41> "Regrettably" and "regrettable" is a single sentence, "comments" instead of "commenter", missing "to" after "ought", lowercase "internet"; all that in a single paragraph. Error density in gumby's English is astounding.

</comment></comment></comment><comment><USER56> WTF is this "for (x=y; ...)" part?

<comment><USER47> That's just standard C. It was not really part of the WTF.

<comment><USER56> but y is uninitialized, am I missing something?

<comment><USER47> Yes. The line right above it:

        y = strlen(r);

</comment></comment></comment></comment><comment><USER57> Author of book is a Markov chain?

</comment><comment><USER58> The only thing worse than C, is that we got stuck with Java.

</comment><comment><USER59> C'mon, viewing a book from 1990 with the lens of 2018 must be funny of course; almost nothing in programming languages aged well, baring some theoretical principles. Many of the things the book author tried to avoid (like not using integer indexes) were necessary for writing fast code on 4MHz processors with 256kB of RAM in primitive compilers back in the day...

Can you please add some xBase book review to the mix for more outdated fun and facepalming from the heightened point of view on a hill of three decades next? /s

<comment><USER60> No, all of that example was malpractice in the 80s when it was written. Note the context: it's highlighted as malpractice in a talk by Brian Kernighan!

<comment><USER59> I'll bite: argument from authority can be reversed - if Brian didn't mess up the language design, these sorts of "code drivels" wouldn't have appeared! I think you've heard that argument from many language designers already... Then we can argue that back in those times it was something progressive etc. And we are straight back with the argument I was making. When you read StackOverflow, books on Deep Learning or computation on Spark, how much drivel did you go through already? Even the language authors are sometimes confused about some unplanned side effects...

<comment><USER61> > if Brian didn't mess up the language design, these sorts of "code drivels" > wouldn't have appeared!

OK, ignoring the s/Brian/Dennis/ snafu... WTF is a "code drivel"? What are you trying to say here?

Second, your point is irrelevant: It's pointless to write a book about driving cars and fill it with a long rant about how riding motorcycles is so much better. It's a _non sequitur_ , and false advertising. Much like how this book is presented as a good resource for learning C and is, in fact, a horrible example of precisely how little the author understood C.

> Then we can argue that back in those times it was something progressive etc.

Aside from your infelicitous attempt at English, this is wrong: This book was _never_ good, and claiming it was insults the past.

<comment><USER59> I love intellectual debates, but this really isn't one. I just have the feeling this is an "intellectual" mob in progress. BTW, it's wonderful to attack people for their English skills; I speak 8 languages but not all of them at C2 level, despite being grad at one of top US colleges. Would you take my sincere apologies for offending you by not being on your level?

<comment><USER61> I get the impression that you're using odd phrasings deliberately, to obfuscate a point too weak to stand on its own, and to avoid responding to the points of others.</comment></comment></comment></comment></comment></comment>


Anatomy of a DNS lookup – Part I - <AUTHOR> https://zwischenzugs.com/2018/06/08/anatomy-of-a-linux-dns-lookup-part-i/ <comment><AUTHOR> This fantastic comment points out a few nits regarding the article:

[https://zwischenzugs.com/2018/06/08/anatomy-of-a-linux- dns-l...](https://zwischenzugs.com/2018/06/08/anatomy-of-a-linux-dns-lookup- part-i/#comment-2312)

including that it's not just Linux that works this way, and some history and extra details around some of the methods of getting addresses or DNS server info.</comment>