Why You Should Start Marketing the Day You Start Coding - <AUTHOR> http://www.softwarebyrob.com/2010/10/14/startup-marketing-part-6-why-you-should-start-marketing-the-day-you-start-coding/ <comment><USER2> I absolutely hate hearing these things:

 _Remember, ideas are worth nothing. And these days, even your code is worth very little._

Alright, so creativity and idea-making worth _nothing_. Technical expertise to make it? _nothing_.

Honestly, what's left? The business side of things?

Maybe this article just bothered me because I was getting similar vibes to "you can just have an idea and hire some programming monkey to create it for you."

Or as he said it: _You and I could get together and clone almost any popular web application in a month. Or for that matter, we could simply buy a clone script. Twitter, Facebook, eBay, Groupon, Digg, and about 50 others are available for around $100 each._

<comment><USER3> That's exactly right. Ideas aren't worth much. I like Siver's article on ideas as multipliers. Execution and the 'business side of things' as you stated are what matters. If Zuckerberg didn't execute like he did with Facebook, Facebook would've still have been a cute little toy project at Harvard. The idea of Facebook itself is pretty simplistic.

<comment><USER4> He was also lucky, in the right place and time, and savvy enough to exploit his luck. Plus, the value of Facebook (and other sites mentioned) is the community and mindshare. You can't just buy a Facebook clone and expect overnight success.

<comment><USER5> This attitude bugs me a lot. There is probably a path for every single person in this country to make a million dollars in the next year if they were just "savvy enough" to take advantage of it. It seems everyone wants to diminish Zuck's success by ascribing luck to it, but let me tell you something. Zuck executed the shit out of Facebook. Did the community and mindshare just come out of thin air?

There's no good reason to believe that Zuckerberg is lucky at all. Saying he was in the right place at the right time has this tacit assumption that if he were somewhere else at the wrong time he would have tried the same thing and fell flat on his face.

It seems because Facebook is an outlier, people feel safe talking about the luck factor, but that's meaningless because we all exist with individual circumstances, and by that measure everything every one of us does is based on luck. Instead, I prefer to ascribe luck to things that the individual actually had no control over, such as winning the lottery.

<comment><USER4> I'm not saying his success was due purely to luck, but that luck was a major factor.

Being the right place and right time is a huge part of it. He was the right age, in the right environment, when the right technology reached the right tipping point and critical mass.

I'm not disparaging Zuckerberg's ability or hard work. However many with greater ability and who have worked harder have failed because of circumstances beyond their control.

<comment><USER5> But isn't it just a platitude you tell yourself to feel better that you will never be that successful? How can you be sure Zuck isn't better than those who failed? And how can you be sure those who failed didn't do something wrong? You see how pointless this is?

<comment><USER6> Luck plays a role in building a billion dollars company, otherwise billg, stevej, would be building billion dollars company every 10 years which is not happening.

Building a million dollars company is hard work (I mean 10 million at least ), but still billion dollars company are mostly about being lucky and exploiting it. I doubt that billionnaire entrepreneurs seriously worked much more, or much smarter than millionnaires. Billionaire companies landed there because they exploited ideas inherently more monopolistic, more able to spread.

If you take the sivers multiplier <http://sivers.org/multiply>, ideas still have some potential : a x20 multiplier is a huge boost.

<comment><USER5> _sigh_ thank you for totally missing the point. This is all mental masturbation. You're just using luck as a synonym for circumstance, which is not a good attitude for an aspiring entrepreneur to take.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER7> Reason #3: The boy who cried vaporware. If you end up with a history of advertising vaporware, nobody will listen when you finally get it right.

If you are super amazing and you can get your first product to market, this obviously doesn't apply. But most people aren't. And most of those who do, they're just lucky.

Reason #4: Duke Nukem Forever will be out any day now. If you take too long to get it to market, your product will be a joke and people will lose interest.

<comment><USER8> Can anyone recall the names of the two products I announced on my blog and then abandoned for various reasons? Was anyone here even aware that happened at all?

Just failing isn't nearly enough to get people to remember you. You have to be truly epic to be remembered for that. ( _How_ many enterprise deployments go years late for every Slashdot joke about Duke Nukem again?)

<comment><USER9> Only one I remember is Kalzumeus, which I think was a rental property management webapp for targeted for single-family residences as opposed to apartment buildings and the like. Was going to have awesome integration with Paypal. I could be wrong, that's from memory and I could be confusing you with someone else.

</comment></comment></comment><comment><USER10> I'm ambivalent about this. Having been through a few different startups with various degrees of marketing, it seems like the issue is really sensitive to your product and your schedule.

Mog.com started out with minimal hype despite a lot of effort by its CEO, and had an very (almost disastrously) slow startup phase. When we ran into implementation difficulties we compounded this slow-start problem even more. Mog managed to pull through this because of prudent financials and perseverance, but it was a near thing.

Powerset had the opposite problem, we had so much hype we didn't know what to do with it. What Powerset delivered was pretty impressive, but much less than what people expected. Cries of "Deeply Disappointed!" rained down on us like drops of acid, and we were powerless to do anything but deliver on what we could and say the rest was either too expensive or too difficult for the moment. But we _did_ have a lot of users and interest, so we had a huge launch.

Now I'm at BankSimple, which is somewhere in between these other plans. BankSimple is aggressively talking to people and getting their message out, so there is some pent-up demand. We're also very diligent about responding to people as people, we do a bit of research before replying to (almost every) email. This means that we get some impatient tweets and messages ("Who cares what you look like? Where is your service?!") asking for unreasonably fast development time, but it also means we get a lot of insightful feedback and commentary.

Our biggest obstacle seems to be controlling the hype. It's very easy for people to build up what we promised into veiled hints some kind of complete reform of the US financial system, which is probably an unreasonable launch goal. ;)

<comment><USER11> As someone who signed up for BankSimple around the time the first wave of press was going out, I can say that I probably check your blog once a week, and have sent your site to countless of my friends. (I'm trying to be patient, but it's hard. :)) I think it's a great example of why marketing early (with the right message) can be super useful.

One thing that the article didn't go into was getting people familiar with you. Even if someone doesn't sign up (or if you don't have a way for them to give you their email address for some reason), if someone stumbles across your site/product a few times before it launches, they're likely to start to remember it and be more interested when it launches.

(KirinDave- Keep up the good work! I'm excited to hear back from you guys and start using whatever you guys give us.)

</comment></comment><comment><USER12> After reading Zed Shaw's post yesterday about how "Long Beards" are getting marginalized by "Product Guys" I cringe when I hear bullshit like this:

 _Ideas (and in most cases even the code itself) is worth little. It's marketing that makes the startup._

(Mind you, ideas _are_ worth little, but the rest... yeah)

<comment><USER13> Don't take this the wrong way, but why did it take a Zed rant to see through this? Usually "department x is more important than anyone else" arguments are flawed to begin with.

<comment><USER12> You're right; it didn't take Zed to convince me, I just thought it was odd that I read two articles arguing about the same thing on vastly different ends of the spectrum.

</comment></comment></comment><comment><USER14> A reason not to start marketing right away:

\- You may pick the wrong people to market to and they convince you to abandon your project

While this may save you some time, the people may just have convinced you to stop work on a valuable product.

Even though I've done a couple projects that haven't gone anywhere, the fact that I have completed them in a working and useful state has greatly helped me get interviews and led to higher paying work.

<comment><USER15> Isn't that like saying "Don't try to find any potential customers for your idea because they may not like it and you may give up?"

<comment><USER16> I guess the customers might think different when they actually see the product.

</comment></comment></comment><comment><USER17> "No, these days even technical execution is mostly trivial (with a few exceptions for apps built around unique algorithms). Far more important is marketing execution."

Can someone please smack this idiot?

<comment><USER18> I think in the context of "which is harder, building the product or building the market?" most programmers will admit that the coding is (almost) trivially easy compared to actually getting users. Perhaps trivial is too harsh a word but I understand what he means.

<comment><USER19> agreed. "trivial" is an overstatement but the essence of what he's saying is completely right.

</comment></comment></comment><comment><USER20> Another reason you may want to delay pre-launch marketing is that if you plan on patenting your product you can invalidate your ability to do so in certain juristictions (including most of the EU) simply by "disclosing" your invention.

If your landing page could be construed as an "offer for sale", and goes up more than one year in advance of your patent application, you've lost your ability to patent protect the idea in the US as well.

Of course most startups these days (the ones reading HN at least) are working on web apps and patents are not as commmonly employed. If you ARE working on a patentable idea though, you should do some research and consult with an IP lawyer before you go and put up any public marketing material before you have applications in to the jurisdictions where you want protection.

</comment><comment><USER21> Yeah I should have started marketing two years ago, or at least show my idea to other people. I started that only after the first year, with a survey to find out if my idea is right (and it was). The thing about marketing, or anything that involves people from outside, is that you can easily motivate yourself by dropping details no one wants (saving time ftw) or add new ones if you see there's someone who's interested in this or that little extra.

</comment><comment><USER22> Disagree: Technical and design execution matters a lot. Facebook was brilliant in both. While myspace pages were a mess and friendster was having trouble keeping the server up, facebook out executed both.

If you don't have a good product marketing can't help you. Marketing can give you an edge over other equally good products but cannot guarantee success.

Dropbox / Tweetie (before it stagnated) / Minecraft etc succeeded because the product was good. Not because of marketing

<comment><USER23> I don't think there is any mention of marketing at the cost of technical execution in the article.

If your market does not know your product exists, it won't matter how good it is anyway. I'm reminded of Hugh MacLeod's brilliant cartoon "Welcome to Nobody Cares": <http://www.gapingvoid.com/11444661477.jpg>

edit: I stand corrected. "technical execution is mostly trivial"? No thank you. I did not become an engineer to write wedding planner software.

</comment></comment><comment><USER24> Marketing is hard as hell, especially so for developers.

As with many other articles like it, the advice given is too vague. We know that we need to market our product but how? Make a landing page, and get 600 subscribers out of the blue? Just blog it all up in the twittersphere and get 1000 likes, no problem?

Anyone who has tried that without a thorough understanding of marketing, and no real budget for it, will know it doesn't work like that.

When I read these marketing articles, it feels like they are explaining how to model my abstraction layers, when I haven't even written Hello world yet.

</comment><comment><USER25> _Once this is setup the major task is driving traffic, which is far beyond the scope of this article._

Yes, and it's the hardest part of the process. Saying "start early" doesn't help much if you punt on "start what?" Glossing over that 650 strong list is skipping the meat of the subject. How much did they cost, where did they come from, and how long did they take to get? Those are the questions worth answering. You need to answer (or guess at) those questions before you decide when to start your marketing.

<comment><USER15> First off, the article is "Why" to do this, not "how to market a startup." I named it this way for a reason; marketing is a huge topic. I devote an entire chapter to it in my book, and am tossing around the idea of writing an entire book on the subject.

So offering the how and why in a blog post is a bit more than you should expect.

And there is value in saying "start early." Most devs I know don't do this and it costs them when they launch. If you've heard it and already know this that's fine, but many others have not.

With that said, here are quick answers to your questions:

>>How much did they cost

Typically nothing.

>>Where did they come from

It depends on your niche, but typically from being involved in that niche's community, publishing blog posts that get mentioned on Twitter, being interviewed on podcasts, and generally getting in front of the audience who will buy your application.

At a 50% conversion rate you only need 1300 uniques for a 650 person list.

>>How long did they take to get?

Most often 4-6 months. Most first-time startup founders can drive 1300 targeted uniques to a landing page in 4-6 months.

For more on this topic keep your eyes on the blog; I'll be posting more about this kind of stuff over the next few months.

</comment></comment><comment><USER26> I think this is awful from the standpoint of morale (coming from personal experience). If you start marketing, and start getting positive feedback way too early, you end up cashing in the rewards a bit too early. Early positive feedback from friends killed many personal projects since I got the praise before I did anything and lost motivation to actually finish them.

YMMV, but this is how I react.

</comment><comment><USER27> I'm not sure why we require 1,500 words to convey the very basic idea that you shouldn't build a product in a vacuum. This entire article could fit in a tweet:

 _Show it to the people you want to sell it to as you build it, and start building a mailing list before launch._

</comment><comment><USER28> "Ideas are worth nothing" - it's a big statement and quite a prevalent view these days.

I think it's true to an extent - a successful startup doesn't need an entirely new, innovative idea but at the same time a new, innovative idea doesn't necessarily result in a successful startup. I think what's more important is not the idea itself, but the angle you take to market your idea. And that is why the blog post has some sound advice.

For example, facebook wasn't the first social network but the way it marketed itself (ie exclusively to college students ) etc was quite effective. Google wasn't the first search engine but its 'clean, simple' branding was quite unique.

Your marketing strategy/approach shapes the design and the features of your product.

</comment><comment><USER29> For every 1000 people who has the idea, one actually does it.

I think the really big differentiator is not _how well_ you execute (in code or in marketing), but _whether you do it_ at all.

If you're prepared to stumble-and-ratchet (ie. explore; try-fail-try-again; "pivot"; experiment), ahead of everyone else, you win.

The only exception is if someone is massively more skilled/knowledgeable/resourced/intelligent/determined than you. But a funny thing is... that for a new market-product fit, _you_ are the expert, and the most skilled, because the only way to get the knowledge and skill is to stumble-and-ratchet. You are also most well-known in the market. It's really _hard_ for someone to catch up.

</comment><comment><USER3> You can build an email list cheaply, just use Google Forms: <http://www.google.com/google-d-s/forms/>

<comment><USER30> Or you can have a fully managed list for free up to 1000 subscribers at mailchimp.

</comment></comment><comment><USER31> 1\. I think everyone here is missing the point of the article... Market now, not later.

2\. There is a lot of "code above all" because we are programmers. The sad reality: All aspects of a business are valuable; the ideas, code (IP), marketing, user interface design, customer service, strategy & processes! If you want to be successful, all aspects of your business need to be properly nurtured, provided for & grown.

</comment><comment><USER32> Idea x Execution x Marketing x Persistence x Luck = Success

Based on Sivers Multiplier idea:

\- <http://sivers.org/multiply>

</comment><comment><USER33> Why not start a few days (at least) before you start coding?

"Sell before you build" is my new mantra.</comment>


Ask HN: EU Cookie Law Element Standardization? - <AUTHOR> I'm sick of seeing these things. If we could all agree to give the elements a unique class name like "useless-eu-cookie-law-notice", a simple element blocking rule for uBlock Origin would solve the issue.<p>I think there are already some blocking lists out there, but that seems like a silly thing to waste time maintaining given neither web master or user wants them to exist in the first place. <comment><USER2> Perhaps a more structured class name would be better, such as "legal-eu- cookies"? Then similar names could be used for other legal notices, such as "legal-us-children" and "legal-eu-gdpr".

Then someone outside the EU could block everything that starts with "legal- eu-" to get rid of everything added to comply with EU law, and someone outside the US could block "legal-us-" to get rid of everything added to comply with US law.

(Do the major blockers allow blocking based on a prefix of a class name? If not, the same effect can be achieved by giving the element multiple class names such as "legal- legal-eu- legal-eu-cookies").

People might want to block by subject regardless of what jurisdiction's laws caused something, which suggests there should also be "legal-gdpr-eu", so if the US passes a similar privacy law someday that could by "legal-gdpr-us", and someone could block "legal-gdpr-" if they don't want to see any of these kinds of notices. But the US probably would not call its similar law "GDPR", so may it would be better if instead of "gdpr", we start with "legal-eu-privacy-gdpr" and "legal-privacy-eu-gdpr"? Then a similar US law would get "legal-us- privacy-x" and "legal-privacy-us-x" where "x" is whatever tortured acronym name Congress comes up with. (And probably cookies then belong under legal-eu- privacy-cookies).

This is getting complicated enough that it might be better to go to some kind of tag based system, with tags implemented by class names of the form "legal- NAME-VALUE" (for now, I'm assuming this is all for blocking regulator imposed legal notices, hence all tags started with "legal-").

Tags that might be used for the earlier examples include:

      legal-jurisdiction-eu
      legal-jurisdiction-us
      legal-category-privacy
      legal-category-children
      legal-law-gdpr
      legal-law-dumb_us_acronym
      legal-law-cookies
      legal-law-copra

So GDPR notices would be tagged "legal-jurisdiction-eu legal-category-privacy legal-law-gdpr". Notices about protecting children in the US would be tagged "legal-jurisdiction-us legal-category-children legal-law-copra".

For this to both be useful and not become an ungainly mess to deal with, it would need probably be carefully thought out beforehand, and have some group maintaining and managing a registry of supported tags, and making sure any additions to the list are well thought out and consistent. It could be a lot of work.

<comment><AUTHOR> I actually came back here to add that same idea, but why does jurisdiction matter? I was thinking a single tag like "legally-required-readonly- notification-container", for any notice that doesn't require user action for the page to work. I think any of the child targeted notices usually require user action to proceed. Those aren't nearly as prevalent or annoying. The attempt at age ratings/restrictions on content is just as silly as the cookie thing, but it's nice to have those 18+ things come up after blindly following a link at work or in public.</comment></comment>


How to build a Bitcoin Wallet - <AUTHOR> https://helloblock.io/docs/tutorials/how-to-build-a-wallet-1

<comment><USER2> Initially did not see anything thanks to Ghostery + RequestPolicy. Since all the JavaScript disablers tend to trigger the haterade dispensers, I also checked to see whether or not they had anything in place for the search bots:

[https://www.google.com/#q=site:helloblock.io+how+to+build+a+...](https://www.google.com/#q=site:helloblock.io+how+to+build+a+bitcoin+wallet)

      > Your search - site:helloblock.io how to build a bitcoin wallet -
      > did not match any documents.

Too bad, as 'building a bitcoin wallet' is certainly worth ranking for (and the content is certainly high quality)!

<comment><USER3> Building static pages using a javscript framework seems to be the new thing. Doesn't really make sense to me - this page is hardly dynamic (as opposed to a single page app).

<comment><USER4> There's also a block explorer - [https://helloblock.io/latest](https://helloblock.io/latest)

<comment><USER5> I assume your point is to justify the fact that this page does not load if JavaScript is disabled, because the domain has a web app on it at a separate URL? It is possible to have both static document pages, viewable without JavaScript, and a web application that requires JavaScript to function.

</comment></comment></comment></comment><comment><USER6> This is fine for learning about Bitcoin, but don't use this is in production. No matter how secure you think you are, someone can likely get into your server and serve their own JavaScript (making your clients send all their money and/or keys). Also, this tutorial uses a Bitcoin centralized service to communicate with the network, and you have to trust that they won't feed you false information/withhold transactions/perform malleability attacks.

<comment><USER7> > No matter how secure you think you are, someone can likely get into your > server

Well if that happens you're in deep shit in any case whether you use this service or not...

</comment></comment><comment><USER8> What kind of security concern would there be with using JS to implement your wallet? Or building the wallet yourself as opposed to a solution with updates and whatnot?

<comment><USER9> Looking at the two popular web wallets as an example. Blockchain.info and Coinbase. Blockchain.info is a client-side wallet implemented in JS Keys are encrypted client-side and encrypted keys stored in the server. There are good good benefits there because if blockchain.info is hacked, your keys are still with you and not compromised (Different story if the server starts serving malicious JS though)

The server-side wallet approach means that if their hot wallets gets hacked, all the funds will be gone.

<comment><USER10> Generally server-side wallets don't keep all user funds online. Most are stored offline in cold storage, which requires multiple signatures to access.

<comment><USER7> They still have to keep at least the amount the richest user owns online in case that user decides to withdraw all their coins.

</comment></comment></comment></comment><comment><USER11> I thought several times about building a bitcoin wallet but I'm just too worried that I'll get something wrong and either lose a key or accidentally make a transaction that loses coins so decided not to risk it even for my own use. I'd frankly be terrified to let anyone else risk their own money on something like that without extreme levels of code review etc.

</comment><comment><USER12> These kind of handson tutorials are awesome. You can just copy/paste and run the code inside the browser console and see your transaction propagate to the network. I wish more tutorials were as easily 'runnable'.

</comment><comment><USER7> Good tutorial and good service. Interested in seeing Part 2: Manage Addresses/Keys</comment>


Ask HN: What would you do with $5k/mo basic income for rest of life? - <AUTHOR> <comment><USER2> If assuming that everyone was also receiving $5k/mo "UBI"...

Nothing different, because the cost of everything I buy will go up by a total of $5k/mo. Hence why UBI is flawed. My total purchasing power will be unchanged.

Edit: Maybe I missed it but... I can't find this post anywhere on the HackerNews pages anymore. That's rather funny. It was quickly pointed out how flawed a theory UBI is by multiple commenters and then _poof_. Funny...

<comment><USER3> It will most likely be worse as inflation will hit widely consumed products (basics) harder than least consumed ones. Quantitive easing 2.0.

Anyone said housing?

<comment><USER4> Including all the cheap housing available in the small towns which have lost population because people are leaving for the big cities for jobs?

</comment></comment></comment><comment><USER5> Pay it all to keep up with rent increases that resulted from everyone having $5000/month.

(When you call it a "basic income", that suggests everyone is getting it; "free money" would be more appropriate if you didn't mean that.)

<comment><AUTHOR> Thanks for clarification. It's "hard-earned money"

</comment></comment><comment><USER6> Quit my job. Travel the world.

Although one thing that's always bothered me about the UBI idea is that if everyone else is getting this basic income, wouldn't it effectively make that 5k worthless? Perhaps someone with a greater understanding of economics could enlighten me?

<comment><USER7> It is not necessarily inflationary, just redistributive

<comment><USER8> Where does the money come from in the most common UBI scenarios? Is it the richest people subsidising the entire rest of the world?

<comment><USER9> It would come from the entire rest of the world subsidising the rich slightly less.

<comment><USER8> Could you elaborate?

</comment></comment></comment></comment></comment><comment><USER10> I'd probably take six months and do nothing at all, except for maybe work on the house. Then I'd start picking up every online college degree that tickled my fancy. At some point I'd probably find some places to volunteer and help out the community. Also, maybe I'd have time to get around to music and art... probably not, but maybe.

</comment><comment><USER11> Try to hedge against the inevitable inflation, as suddenly there is more money chasing the same amount of goods and services.

</comment><comment><USER12> For those worried about the inflation risk: it depends on how the money is generated.

Theoretically, if it is created by, for instance, taxation (redistribution over people) or bonds (which is redistribution over time), you shouldn't risk too much overall inflation.

It will, however, change which goods increase in price. I suspect restaurants will become more expensive and yachts will be cheaper if it happened by taxation.

Having said that, inflation itself seems to be blind to the theory and does whatever it feels like.

For the purposes of this exercise, let's suppose I get $5k/mo and others don't. I think it depends on when I got it.

In my 20s -> Travel and grad school

In my 30s -> Supplementing my meager income to enjoy myself

In my 40s -> Investment

<comment><USER8> Wouldn't it be better to start investing as early as possible? I'm in my early 20s and have been thinking that if I got a time machine the first thing I'd do is go back ten years and tell myself to get a job.

<comment><USER13> Agreed. In my early 20s I was tempted to take my "signature loan" account of $10K and put it into investments, as a sort of enforced savings, and pay that off. In some ways, that's stupid, but 20+ years on, I wish I had done that.

I mean, not as much as I wish I had held onto those bitcoins I sold for $15, but still... :-)

</comment></comment></comment><comment><USER14> I have about 7 different business ideas in my queue. I would pick the first, related to increase charitable giving, and would commit myself to that.

<comment><AUTHOR> That's my plan too (charitable open source software). But, something else besides just work? I worked so hard past 6 years I almost don't know how to find other stuff to do.

<comment><USER14> I can relate. I've thrown myself into work and family in the past 4 years. It's been a while since I read a book or drew a picture. I was browsing around B&N today thinking I should get back to doing that.

</comment></comment></comment><comment><USER15> Is it taxed?

Do we have healthcare?

Will a spouse have the same benefit?

Rent takes a fifth of that net, minimum, and you guys are talking about retiring, travel, lounging around and lives dedicated to charity?

It's not 5k a week. Am I missing something?

Given what I see here, a stinkbutt stance of a question, I'd say the greatest impact to myself would be some stress reduction, slightly relaxed job requirements and a helluva better outlook for a tired, aging body.

</comment><comment><USER16> Start investing $5k/mo while keeping my day job.

</comment><comment><USER17> Probably quit my job and spend time pontificating on how someone managed to provide a BMI at a level which is above the US median household income.

Sorry, that number just doesn't work, even granting a government willing to do redistribution on that level, you're looking at an outflow that is something like 3x current total government tax revenue.

</comment><comment><USER18> Spend the rest of my life writing FOSS all day

</comment><comment><USER19> Move to Jamaica to be closer to my family. Write code for small businesses there who need it badly but cant afford it.

<comment><USER20> I wouldn't be surprised if most types of UBI require you to spend most of your time in the US. Otherwise they be pouring free cash into other economies.

</comment></comment><comment><USER21> I can't remember where I read this, but I really liked the idea that UBI was compared to VC funding. I.e. most startups fail, yet investors still invest in startups because the few that succeed compensate for the ones that fail, making investment in startups still worth while.

What I read was that UBI can be seen as a government investing in it's people. Not everyone will be doing brilliant and innovative things, but, the person who'd normally would get a secure job at big corp might now feel secure enough to undertake starting something or working on an idea living in the middle of nowhere and when successful, adding an enormous amount of value to the rest of society.

So, to answer your question. I'd also be more than happy to live in the middle of nowhere working on ideas and open source etc.

</comment><comment><USER22> Since this is talking about basic income, please allow me to digress a little and ask a few things that have been on my mind for a while. World GDP per capita is $1,400 Only need to make all people capable of 3.5X more productive, and we'd all be able to live at that rate with some universal income + universal work. Maybe the UBI idea shouldn't be decoupled from universal work. If we truly believe humans are worth giving $5K a month, surely we can devise a way that they can be given that no for free (without inflation, or whatnot, just plain old more distributed production.) Should making people more productive (distributing the means of production) be concentrated on much more than just redistributing the already existing wealth.

</comment><comment><USER23> Consider how stable it is. Save it for now. Consider whether I might move up retirement.

</comment><comment><USER24> Work on the many educational and political tool ideas that I have kicking around in my head. Then get involved in local volunteer work in those areas (primarily teaching).

</comment><comment><USER25> If it was a viable option and not a flawed economic theory, I'd return to school and learn more languages/arts to go with all the STEM stuff I already know.

</comment><comment><USER26> Assuming $5k USD per month _with current purchasing power_ to avoid the concerns about rent inflation. $5k per month is what I'm expecting in my next job, except my next job will have (hopefully German) taxes.

I'd save as much as I can to buy (another) house, write more, and start a family.

</comment><comment><USER27> I would do exactly what I'm doing now (building for profit companies and doing non-profit work @ spreadthevote.org) except I would be much more thoughtful between for-profit projects. I would likely work on slightly bigger problems.

</comment><comment><USER28> Start a business. Until then, it's debt management, making ends meet, and hopefully get enough handle on finances to be able to sufficiently save/invest for retirement. Survival vs thriving, pretty much.

</comment><comment><USER29> Spend a little of it, save most of it.

I would quickly adjust to my new standard of living and continue doing everything else the same.

$60k/year is not near enough for those of us with a family.

<comment><USER30> Depends where you live. My wife and I lived on less than $50k. I know some families that live on $40k. We live well above that now, but our standard of living is drastically higher.

</comment></comment><comment><USER31> Quit my day job, work on ideas for companies, build OSS.

</comment><comment><USER32> Retire. Relax. Perhaps tinker and work to better the internet, after I have recovered from being a desk jockey for quite a few decades.

</comment><comment><USER33> Retire.

</comment><comment><USER8> I'm already quite comfortable living off less than $1,000, so I would split the rest among four of my best friends.

<comment><USER20> But won't they also get $5k/mo?

</comment></comment><comment><USER34> Write open-source web app platforms that enforce transparent administration of schools, prisons, and local governments.

</comment><comment><USER35> Absolutely nothing. Live happily ever after.

</comment><comment><USER36> Woodworking.

Start small with a few tools and work my way up to a shop area.

Possibly start a shared shop area with interested friends.

</comment><comment><USER37> Live somewhere great, have myself chauffeured everywhere, donate to some choice people.

</comment><comment><USER38> Go back to school full-time through Grad school and keep working on side- projects.

</comment><comment><USER39> Work part time for a NGO

</comment><comment><USER40> Start a business making tools and machinery for makers.

</comment><comment><USER41> Volunteer full time.

</comment><comment><USER42> Finish some novels, work on a side business perhaps.

</comment><comment><USER43> Pay some of my rent

</comment><comment><USER44> Get involved in local politics.

</comment><comment><USER45> Start going to the gym!

<comment><USER8> Why would you need basic income for that?

<comment><USER36> Presumably, 5K would cover income lost from time spend at the gym vs time spent working.

Also gym membership and insurance (just in case).

Plus, those t-shirts aren't going to rip themselves.

</comment></comment></comment><comment><USER46> I would consider retiring so that I could write and open source robot trading platform that utilizes the latest advances with neural networks to analyze and _successfully_ trade in the stock market that is simple enough for any high school graduate to use so that UBI would no longer be needed

<comment><USER47> wouldn't this fail as it became ubiquitous in the market?

<comment><USER46> If it failed, and it would not meet the criterion of _successfully_ trading.

A successful algorithm would likely need to be able to adjust based on the amount of capital being controlled using the algorithm and the number of parties that are using the algorithm

<comment><USER47> Is it a paradox then? At 100% ubiquity you couldn't satisfy the criteria.

<comment><USER46> Is Alpha Zero is a paradox when it plays itself, since it can never truly beat itself?</comment></comment></comment></comment></comment>


Rise of ghost hotels casts pall over Toronto rental market - <AUTHOR> https://www.thestar.com/news/investigations/2019/04/22/rise-of-ghost-hotels-casts-pall-over-toronto-rental-market.html <comment><USER3> Isn't this related to a bigger problem which is lack of affordable housing? Airbnb just exacerbates the problem. Many other cities are faced with the same issue, London, NY, Paris. It's a city planning issue that mayors and governments should tackle, not an Airbnb issue. If Airbnb leaves, it doesn't mean that everyone will magically find cheap rental units.

<comment><USER4> Right, it's one of many factors contributing to the absurdly low vacancy rate (and resulting absurdly out-of-reach housing costs)

Presumably addressing this issue could be a multi pronged approach, which may involve restrictions on airbnb. But i totally agree the city can't just ban airbnb and call it a day - that would be unproductive at best

<comment><USER5> high vacancy rate, or low occupancy rate

<comment><USER4> Vacancy rate for standard long-term rental units, is absurdly low in toronto (1.1%)

A low vacancy rate generally means that rentals are a seller's market - <USER2> a bad unit or a high price, or both, and you can easily find a tenant, because there's just so few places to rent.

I believe a healthy vacancy rate for a city is in the 6-7 percent range. 1.1 percent is insanely low.

But, it's not terribly surprising. The story of housing in the 21st century is that vacancy builds in the tiny manufacturing towns of yesteryear (much of the Midwest USA for example) while people move en masse to a few superstar cities that usually fail under overbearing regulations and zoning to build anywhere near enough units to match the incoming migration.

</comment></comment></comment></comment><comment><USER6> All this means is that there's a demand for more housing, in one form or another.

<comment><USER7> I thought a big reason for Airbnb's success is they are large enough that they're now the go to site to find short-term housing. What's the non Airbnb site that you go to? They're successful just because everyone goes there.

</comment></comment><comment><USER8> The more the merrier. If this brings down prices for apartment rentals then I am all for it. So many people are willing to leave their Airbnb apartments empty for months at a time only to cash in on an absurd "premium".

<comment><USER9> It increases the prices as supply is reduced overall.

</comment></comment><comment><USER10> Anyone else read the subject as Toronto has a lot of haunted hotels?

<comment><USER11> No. Maybe if it was a reddit post.

</comment></comment><comment><AUTHOR> [https://outline.com/mHDHEM](https://outline.com/mHDHEM), if the article is pay walled.

</comment><comment><USER12> What? Who the hell calls Short-term rentals "ghost hotels"?

</comment><comment><USER13> If it only came to the idea of the Toronto government to ban tourism, it would achieve the same effect as reducing airbnb's.

<comment><AUTHOR> Absolutely not true, maybe look into the matter and data first before commenting?

<comment><USER13> What data do you want, that Airbnb is used by tourists?

There's plenty for it: [https://www.airbnbcitizen.com/airbnb-shares-new-data- globall...](https://www.airbnbcitizen.com/airbnb-shares-new-data-globally-and- starts-initiative-to-drive-healthy-tourism/)

<comment><AUTHOR> TIL that tourism didn't exist before AirBnB. It's not like Toronto is some scrub city that only saw tourists because of AirBnB.

<comment><USER13> All tourism raises rents. The less tourism, the lower the rents.</comment></comment></comment></comment></comment>


France's Government Aims to Give Itself Carte Blanche to Spy on the World - <AUTHOR> https://www.eff.org/deeplinks/2015/09/frances-government-aims-give-itself-and-nsa-carte-blanche-spy-world <comment><USER2> Disclosure: I'm French.

The EFF is complaining that we are lowering what amounts to be the Human Rights, and they are right. However the EFF hasn't succeeded in taming the US standard.

What may be happening here is pressure for an international agreement. We'll only have leverage to make a deal with the US if we (the rest of the world) practice the same disrespectful spy acts against innocent American citizen. Then we can agree on stopping our activities in a bilateral or UN agreement.

Of course what is funny about threats from my country is that we are quite powerless. We don't have the world's Facebook records, neither do we manage the world's largest email. With this kind of law, chances are we won't. I, for one, host my email neither in France nor in US.

For this threat to be leveraged against US, a lot of other countries have to do the same, until there's a major uprising against surveillance methods.

The world has changed. 20 years ago, the right to not be searched when traveling within a country was enough to protect most citizen. Now all citizen cross boarders once a year or use remote Internet websites, which in both cases dismisses their rights as citizen. We need a global protection against unwarranted searches.

<comment><USER3> Hi, I'm the author of the piece. What you describe, while astute, isn't what's going on here, because at the level these agreements are being made, the French intelligence services don't care that the NSA is spying on French nationals. There's no negotiation to be made: they simply want to maintain their existing capacity, but have been required to give it legal cover by the greater recent visibility of mass surveillance. In fact, among intelligence services of putative allies, having another friendly nation spy on your nationals grants you a potential advantage, since it means you can bypass domestic restrictions by simply trading intel with them. (It's also one of the reasons why bilateral agreements would be undermined, and difficult to initiate. They would also preserve the idea that some classes of innocent users are fair game for mass surveillance, while others deserve protection.)

France's surveillance advantage comes from its access to submarine cables rather than local servers. That's the information it will be collecting, and potentially trading with others.

Much of the problem here, I'd note, comes from not separating the defensive and offensive components of the intelligence services. Whatever you belief is the proportionate level of surveillance of a population, it's clear that an institution whose job was to protect the assets and personal data of a nation's population would have a very different attitude to letting others spy on its comma traffic than one which was primarily concerned with aggressively investigating other nations. Politicians are therefore hearing policy proposals from only one side of a debate. That's why they think that backdoors would help and not harm national security, and why they think spying on the rest of the world without oversight won't erode their own citizens' privacy.

<comment><USER4> I agree. The NSA/US gov could care less that France will spy on its citizens. For all we know they may already have a deal to do _exactly that_ to bypass some of NSA's own restrictions of spying on Americans.

I think it's already known they do that with the GCHQ. And they make European countries spy on each other, too, while they promise them not to spy on them _themselves_ , but then get the data from others. Sweden spies on Germany, Germany spies on Sweden - and NSA gets all of that data.

From everything they've said and done so far, it's also clear the NSA would rather _maintain_ the status quo of an insecure Internet and insecure computers, backdoored encryption and whatnot, _even_ if the US has the "most" to lose, as long as they can use that insecurity to spy on others, too. They much rather prefer this scenario than if say 99% of the global population were all using end-to-end encryption and let's say Qubes OS.

This seems exactly backwards for a national "security" agency, especially with all of their recent calls for increased "cybersecurity", but there you go.

<comment><USER5> The NSA makes the Swedes spy on the Germans? Is there any way they can get control of their country back? And why would they even need to when Germany is littered with US military bases?

</comment></comment></comment></comment><comment><USER6> > The United States makes an improper division between surveillance conducted > on residents of the United States, and the surveillance that is conducted > with almost no restraint upon the rest of the world.

> Treating two sets of innocent targets differently is already a violation of > international human rights law.

It was bothering me for quite a while. I'm not an American. So what? I have lesser privacy rights?! Am I lesser human? Is spying okay as long as it's not spying on you?

<comment><USER7> All countries should create their own facebooks and invite Americans to join theirs. It's sort of stupid to allow Facebook into any country unless all of its business operations and servers are based in the said country with proper controls. Even then that does not preclude the US government forcing Facebook to turn over data on Non-US citizens to itself.

Facebook is the #1 vector of US government's indiscriminate spying on everybody's else's citizens. Google comes a close second, but you don't generally give Google as many personal details as you give to Facebook. At least not by your own free will.

And that's really the problem that France has, everyone uses American services so America can basically create a dossier on everyone. No one uses French services other than French citizens, and perhaps a few other souls.

<comment><USER8> So you're basically suggesting that every country should build their own Great Firewall?

Whose side are you on?

<comment><USER9> Already in proposal stage in many places. My current home, Thailand, just announced plans for their own version. I am not amused.

However, hilarity has already ensued. The gov here is so incompetent that they couldn't even make an annoucement without having a bunch of gov websites taken down by a _manual_ DDOS attack yesterday [1]. A few thousand people coordinated via social media to repeatedly visit the gov's ICT website which brought it to a standstill. Yet the gov thinks they can manage a single internet gateway to facilitate surveillance and it won't be ruinous.

[1] [http://www.bangkokpost.com/news/general/714432/single- gatewa...](http://www.bangkokpost.com/news/general/714432/single-gateway- protest-halts-government-websites)

</comment></comment></comment></comment><comment><USER10> I love the EFF, but honestly, I'm not sure what they can do about this, other than educate and inform.

The US, the rest of the Five Eyes, France, China, Russia, along with every state that has the ability has been, and will continue to spy _illegally_ on the rest of the world.

Passing laws to either allow or prohibit this activity is nothing but political posing so long as the laws have no determination on the penalties applied to breaking said laws.

Did Clapper get imprisoned for lying to congress?

Did Litvinenko get a fair trial for "exceeding the authority of his position"?

Does anyone believe that Snowden would get fair treatment from an unbiased jury?

This is the theater of international espionage. Without transparency, honesty and consistency, complaining about the laws, or lack thereof, is pretty much a waste of time.

Or maybe I'm just overly cynical and we'll eventually get an Erin Brokovich of international espionage to blow the lid off the whole deal and hold the bastards accountable.

I'm not holding my breath.

<comment><USER11> French here,

I've been a web developper for more than 15 years now and I try to follow what's going on with digital laws in France and Europe thanks to "la quadrature du net". I try to inform people around me but most people don't have any interest in digital laws, because 1) most medias don't talk about it or in a caricatural way. 2) People and most member of parliament don't undestand these laws. 3) Lobbys knows 1) and 2) The results is that any digital law bills can be passed along easily as long as it doesn't disturb any strong lobbys in place as media won't talk about it and people and member of parliament won't speak up anyway.

Those who understand why these laws could turn very bad are a really small minority, and small minority without lobby means can be very badly represented in a democracy. Honestly I lack imagination to think of something more to do that could make significant change here.

</comment></comment><comment><USER12> Don't worry, here in the UK we just went ahead and spied on everyone and ignored the legal ruling.

Everything is secret, using laws lets the terrorist and paedophiles win. (to summarise what the home secretary says on the matter.)

<comment><USER13> Actually this is the same thing in France.

The bill is simply aimed at "legalizing" practices that have been going on for years. Also, since the Snowden leaks, some actors have started to question the legality of some practices, and this bill would address those concerns.

For instance, French secret services used to be able to get phone records for someone by simply calling the phone company; now, phone companies are feeling uneasy about the lack of legal frame for these practices.

</comment></comment><comment><USER14> I think it's pretty safe to presume that all countries are doing it already, within their technical capabilities. I'm also pretty sure they will continue to do it, regardless of any local or international laws, simply because today information means power, and I can't imagine that any government would be ready to just let it slip out of their hands.

<comment><USER9> Yep. And some are dumb enough to announce they are doing it, [http://www.bangkokpost.com/news/general/714432/single- gatewa...](http://www.bangkokpost.com/news/general/714432/single-gateway- protest-halts-government-websites)

</comment></comment><comment><USER15> I know it's easy, but i can't help remember that every single terrorist that striked in the last years in france were already identified by security services, and for a very long time.

For what i know, the problem in France seems to be much further down the data pipe, aka not enough (competent) humans analysing the threat data. I very much doubt flooding those services with an even bigger stream of information will help in any way.

</comment><comment><USER16> Hell, why shouldn't they. The USA has already done it, why not them too. Maybe there is actually even some sort of kind of MAD principle in that concept. I don't really see how it would end up well, but it at least has a chance of a positive outcome relative to the USA dominating and spying on the world unilaterally.

I guess the ideal situation would be a transglobal civil intelligence corp that hacks and publicly publishes the secrets of governments their officials and corporations. A crowd-sourced intelligence organization that tracks public figures and agents and activities across the globe.

</comment><comment><USER4> > The original surveillance law included limits on data retention when spying > on French nationals (30 days for the content of communications, four years > for metadata, six years for encrypted data). The new international limits > are much longer—one year, six years, and eight years respectively.

I can't imagine any of that will be allowed by the EU Justice Court. Now who's going to sue the French government?

The EUCJ is also going to rule on Europe vs Facebook case next week, which will affect the EU-US Safe Harbor agreement as well, and possibly some of these new spying laws in the EU. I can't wait (I think it will be a positive ruling).

</comment><comment><USER17> The US, UK, etc. are doing this anyways; why not the French? Let the spying race begin.

</comment><comment><USER18> That explains the cheese and wine ads.</comment>


Rare earth: The New Great Game - <AUTHOR> http://www.bbc.co.uk/blogs/newsnight/paulmason/2009/11/rare_earth_the_new_great_game.html

<comment><USER2> Summary: rare earth minerals are probably going to be increasingly important in the future, and governments are getting involved in managing the supply. Currently most of the production takes place in China.

I wouldn't recommended reading the article, because it's a jumble of facts and numbers with no thesis and no insight. It's got the vague "yellow peril" undertone that's common these days, but doesn't offer any real evidence that rare earth elements will be the next oil.

<comment><USER3> I disagree strongly. "Probably" going to be important? The article makes it very clear that rare earth minerals are absolutely essential to the clean technologies that will drive the post oil future. While the United States has ignored creating a strategy on developing future technologies and its major corporations have colluded to kill green tech, the forward thinking Chinese government has aggressively positioned themselves to being central to any development of electric cars and any other tech that is strongly reliant on batteries.

<comment><USER2> That may well be true, but the article isn't very convincing from any angle. There's no technical or economic analysis of other ways to make magnets (say, emerging technologies vs. more expensive, low-tech technologies). No in-depth data from geological studies about the quantity of rare-earth deposits in other countries, and how easily they could be exploited. No evidence that the Chinese government is actually making an active effort to corner the market on rare-earth elements (low labour costs have made it a leader in many low-value areas, too).

And, nobody is totally certain that battery-driven cars are necessarily the way forward. A decade ago, when fuel cells where the hot story, maybe this article would have been talking about China cornering the market on platinum for catalysts.

</comment></comment></comment><comment><USER4> Japanese industrial policy seeks pretty much three things: competitiveness of the Japanese export industry, assured supply for the Japanese domestic markets, and _preventing China from screwing us_. They have a curious frenemy thing going on: increasing economic cooperation with the aim of effectively establishing economic mutually assured destruction if either restarts the more traditional Japan/China relationship. (Japanese industry essentially can't survive without Chinese raw materials at present -- rare earth being only one example of hundreds. Similarly, Japanese investment is fueling much of China's economic boom.)

Sidenote: Notice the California NIMBYism versus global warming angle? I suppose our coming global apocalypse is worth any effort to stop... as long as it doesn't require _radiation_ in California.

<comment><USER5> About the NIMBYism: that was just one more part of the article that sounded like a press release from the US rare earth producers.

Basically, they want protectionist policies to avoid foreign competition and they want exemptions from environmental legislation. So just the same as _every other business in existence_.

Every business has its pet bogeyman to scare legislators (or to give legislators plausible cover for their actions). I'm sure China will play this role well for various groups.

</comment></comment><comment><USER6> The only reason 97% of them are mined in China is why everything else is produced in China -- it's cheaper. There is a shuttered mine in the U.S. that is being restarted that has and will produce all of these elements. The mine closed because they were undercut by China. If China won't sell at any price, presumably they will be profitable again. IMO, the U.S. should embargo Chinese rare earths since they have been shown to be a politically unreliable supplier.

</comment><comment><USER7> "rare earth" and "cheap" sound a bit contradictory.</comment>


Caddy – HTTP/2 Web Server with Automatic HTTPS - <AUTHOR> https://caddyserver.com/ <comment><USER2> For a fun time, run it with the -quic flag and browse your site in Chrome.

Thanks to work by Lucas Clemente and Marten Seemann, Caddy ships with a functional (but still experimental) QUIC server implementation[1] you can try right now. Your site will load better over slow connections or while you switch from WiFi to cellular, for instance.

There was a lightning talk by Lucas Clemente just last week at dotGo about QUIC; looking forward to the video being posted!

[1]: [https://github.com/lucas-clemente/quic-go](https://github.com/lucas- clemente/quic-go)

<comment><USER3> Where does QUIC sit in between TCP and HTTP2?

<comment><USER4> QUIC is a UDP based network protocol. It is an alternative to HTTP2 or HTTP, which are TCP based protocols. If you visit google.com with a recent version of chrome, you're using QUIC. Open chrome://net-internals/#quic in another tab and click a connection UID to see the conversation.

<comment><USER5> This is mostly correct but not entirely.

HTTPS is layered such that it's HTTP > TLS > TCP.

QUIC replaces the 'TLS > TCP' portion with 'QUIC > UDP', which you can then run HTTP or HTTP2 on top of.

QUIC is _not_ an alternative to HTTP2 (yet), although there's work underway to (re-)define HTTP2 in terms of QUIC [1], thereby replacing the awkward transport protocol aspects of HTTP2 with the very similar mechanisms provided by QUIC.

[1] [https://tools.ietf.org/html/draft-shade-quic- http2-mapping-0...](https://tools.ietf.org/html/draft-shade-quic- http2-mapping-00)

<comment><USER6> Is QUIC specific to HTTP, or can it be used as as transport mechanism for arbitrary protocols?

<comment><USER5> QUIC stands on its own; it just so happens that QUIC and SPDY (the predecessor of HTTP/2) show some convergent evolution.

You could use QUIC to transport other L7 protocols, but tracking down generic- enough implementations may be difficult, or at least was the case in the past [1][2]. Maybe things are better now [3].

[1] [https://daniel.haxx.se/blog/2016/07/20/curl-wants-to- quic/](https://daniel.haxx.se/blog/2016/07/20/curl-wants-to-quic/)

[2] [http://stackoverflow.com/questions/17896432/](http://stackoverflow.com/questions/17896432/)

[3] [https://github.com/google/proto-quic](https://github.com/google/proto- quic)

</comment></comment></comment></comment></comment></comment><comment><USER7> Automatic HTTPS may be the most recognized feature of Caddy but there are more that make it worth to give it a spin.

Configuration simplicity is important. For example try to properly setup a reverse proxy to jenkins from nginx. Almost impossible unless you google and find the specific nginx snippet on jenkins' documentation. Deviate and you will have jenkins complaining for an improperly configured proxy. On Caddy the same can be achieved in one line with just two words (and a slash).

The last feature I used for a project, was Caddy's browse directive which lets you browse files in a directory (unless there is an index.html). Not only it has a great look from the start, not only it can be templated, but also Caddy will be happy to serve you the contents of the directory as JSON. So now, not only humans but also software can browse your files easily.

Have a look at its modules to get some ideas: [https://caddyserver.com/docs](https://caddyserver.com/docs)

Also go makes it easy to write a module of your own or alter one of the existing ones to fit your needs.

</comment><comment><USER8> So Caddy has been discussed a few times prior. My question is who is using this for production? (In other words, not for a personal or hobby site, but an actual product). Is anyone using it stand alone (no nginx or apache involved - CloudFlare is ok edit: or similar), sorry if it was asked in a previous discussion I want to know if anything has changed since.

<comment><USER9> It's a patchwork of different Go libraries, Caddy doesn't implement anything itself like Apache or Nginx would. It's useful but certainly not "proved" in a production environment. The heck you don't need Caddy if you are already using Go to develop servers, just use the libraries it uses directly.

<comment><USER10> Do you really need a throwaway account to make a comment?

<comment><USER11> I think there's a certain subset of people that like to read HN but not submit/comment, either for reasons of anonymity or just because they don't want to. They may be inclined to comment from time to time, and create a temp account to do so, since HN does not allow anonymity. Also, it's possible they _had_ an account that was banned/shadow banned, and refuse to make another full account out of protest.

That is, this may not be someone using a throwaway account in lieu of their real account, but because they don't have a real account to use.

</comment></comment></comment></comment><comment><USER12> All of this does look lovely.

I guess a big question for me would be:

What are the downsides? When should I _not_ use this?

Also, is there something similar to the Baader-Meinhof phenomenon, but for finding software that neatly solves a problem after you've just spent a while doing yourself?

</comment><comment><USER13> HTTP/2 out of the box with a free download is a great reason to use it over nginx. Are any performance comparisons available though? I suspect nginx's maturity may make up some of the difference.

<comment><USER14> Does nginx not have HTTP/2 or a free download? I've got a couple of webservers that as best I can tell are responding to HTTP2 requests, running nginx (that I didn't pay for)

<comment><USER15> > _Does nginx not have HTTP /2 or a free download?_

It does, as a module, not as core code[0].

However:

> _The module is experimental, caveat emptor applies._

[0] [https://nginx.org/en/docs/http/ngx_http_v2_module.html](https://nginx.org/en/docs/http/ngx_http_v2_module.html)

</comment></comment></comment><comment><USER16> Also worth mentioning if you want automatic HTTPS is Russ Cox's implementation that works with Go's built in HTTP server:

[https://github.com/rsc/letsencrypt](https://github.com/rsc/letsencrypt)

I've used it. It's incredibly easy. It seems he now recommends this more official-looking package:

[https://godoc.org/golang.org/x/crypto/acme/autocert](https://godoc.org/golang.org/x/crypto/acme/autocert)

</comment><comment><USER17> I cannot recommend it enough. In comparison to nginx, you can setup the reverse proxy with configuration many times shorter and https without hassle. Also, what it does is much more readable.

It is not without quirks and there is no installer in debian repo, but I recommend giving it a try.

<comment><USER18> ITP (intent to package): [https://bugs.debian.org/cgi- bin/bugreport.cgi?bug=810890](https://bugs.debian.org/cgi- bin/bugreport.cgi?bug=810890)

</comment></comment><comment><USER19> Matt Holt, the creator of Caddy, was recently a guest on the Go Time podcast where he talks quite a bit about Caddy as well as TLS and ACME protocols[0]. I really enjoyed this episode and recommend others check it out.

[0]: [https://changelog.com/gotime/14](https://changelog.com/gotime/14)

</comment><comment><USER20> I already have nginx set up to use HTTP/2\. Would I get any benefits from switching?

<comment><USER21> Only if you wanted to use the automated Let's Encrypt certificate feature in Caddy.

<comment><USER20> That sounds like a very useful feature for new installations. However, I already have automatic renewal set up with nginx.

</comment></comment></comment><comment><USER22> For static files:

1\. Mimefy plug: check

2\. Gzip feature: check

3\. HTTP/2 new protocol: check

4\. Auto SSL: check

5\. Cache static files on memory to avoid reading then on disk, then Mimefy, then gzip on eveeeery request: MISSING <\- this plug would be nice to have it to reduce disk I/O and CPU.

<comment><USER23> I am not a caddy developer but I notice the same plugin missing so I started my own. [https://github.com/nicolasazrak/caddy- cache](https://github.com/nicolasazrak/caddy-cache) still needs a lot of work thought.

<comment><USER2> Cool! Thanks for working on this. It may address one of the oldest issues: [https://github.com/mholt/caddy/issues/10](https://github.com/mholt/caddy/issues/10)

</comment></comment></comment><comment><USER6> With HTTP2, you're no longer limited to a request-response model. What interfaces do people use to expose this new paradigm to the application? (e.g. application-based push).

<comment><USER5> They usually don't, because server push is a micro-optimization, proper use of which requires a lot of effort from the server (and perhaps the client), as evident from Google's research on the matter [1].

Google has coded their App Engine to read a 'push manifest' generated by a tool they publish [2]. Akamai gives you a GUI [3]. Cloudflare wants you to manually set headers [4] defined by the brand-new W3C draft 'preload' [5]. Last year, the Caddy devs blogged that HTTP/2 Push is essentially a big exercise for the reader/implementer [6].

I'm currently unaware of any web application framework which exposes idiomatic hooks to use HTTP/2 to push additional resources to the server. There are some generic server push addons or plugins that use older techniques from the websocket or pre-websocket days.

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

[2] [https://github.com/GoogleChrome/http2-push- manifest](https://github.com/GoogleChrome/http2-push-manifest)

[3] [https://blogs.akamai.com/2016/04/are-you-ready-for- http2-ser...](https://blogs.akamai.com/2016/04/are-you-ready-for-http2-server- push.html)

[4] [https://blog.cloudflare.com/announcing-support-for- http-2-se...](https://blog.cloudflare.com/announcing-support-for- http-2-server-push-2/)

[5] [https://www.w3.org/TR/preload/#server-push- http-2](https://www.w3.org/TR/preload/#server-push-http-2)

[6] [https://caddyserver.com/blog/implementing-http2-isnt- trivial](https://caddyserver.com/blog/implementing-http2-isnt-trivial)

<comment><USER6> Push was just an example. HTTP2 is fundamentally different from HTTP; it's more akin to TCP in L7. Can applications take advantage of this fundamental paradigm shift? What about for non-browser clients (api clients)?

<comment><USER24> Nothing that HTTP/1.1 and websockets can't do, really.

<comment><USER6> Sure but then you have a websockets interface , is there something similar for http2 that breaks the resource requests-resource response model?

</comment></comment></comment></comment></comment><comment><USER25> I run high load nginx servers that typically serve static 1-2 GB files typically at 1gbit throughput.

Does any one have experience with Caddy know how well it can be used to serve large static files with heavy load or is caddy best used to serve smaller files like a website.

Thanks!

<comment><USER2> Caddy should serve you well. I would be interested in knowing how it goes for you if you try it! If it has problems, let's fix them.

</comment></comment><comment><USER26> It allows wildcard domains/subdomains with automatic certificates... how does it know which certificate to serve without an IP-to-domain mapping? Is it relying on SNI (i.e. no support for old devices)?

<comment><USER2> Yes, Caddy uses SNI. Although it can't get wildcard certificates from Let's Encrypt, it can obtain certificates during the TLS handshake for a specific server name.

</comment></comment><comment><USER27> Looks like HTTP/2 and Auto HTTPS servers written in Go are on the rise, [https://armor.labstack.com/](https://armor.labstack.com/)

Good to have options!

</comment><comment><USER28> Apache license for any wondering

</comment><comment><USER29> How battle-ready (that is, security-wise) is this beautiful piece of software?

<comment><USER2> In what regards? Caddy has never been vulnerable to a number of widespread CVEs including Heartbleed, DROWN, POODLE, and BEAST. Caddy uses TLS_FALLBACK_SCSV to prevent protocol downgrade attacks. Like any other web- facing service, it's exposed to DDoS attacks. I've never heard of a machine being compromised by exploiting Caddy...

If anyone has a vulnerability to report, please email me directly[1] (or if it's not serious, a PR would be faster).

[1]: [https://github.com/mholt/caddy/blob/master/CONTRIBUTING.md#v...](https://github.com/mholt/caddy/blob/master/CONTRIBUTING.md#vulnerabilities)

</comment></comment><comment><USER30> Any benchmarks?</comment>


Google Closure: How not to write Javascript - <AUTHOR> http://www.sitepoint.com/blogs/2009/11/12/google-closure-how-not-to-write-javascript/ <comment><USER2> SitePoint swallowed my comment, so I'll just post it here:

I found some of your claims questionable, so I cherry-picked one to test for myself.

      This code converts arguments[i] to a string object using the
      String conversion function. This is possibly the slowest way to
      perform such a conversion, although it would be the most
      obvious to many developers coming from other languages.

      Much quicker is to add an empty string ("") to the value you
      wish to convert:

I compared the time it took to run 100,000 of each of String(fn) and fn + "", and found that the results were more ambiguous and less definitive than your assertion. In fact, fn + "" was 6.6% faster on Firefox 3.5, but 15.8% slower on a recent Chromium build. In any case, the difference was, even over 100,000 runs, a few milliseconds, so it hardly seems like this particular case would be an area to focus on for optimization.

I wonder how many of your other strong claims would stand up to similar testing.

Test code and results: <http://gist.github.com/232944>

<comment><USER3> I've done a lot of testing on creating strings by concatenation and it turns out that + is actually one of the slowest. It's much faster, for example, to create an array and then join it with "". Maybe try that in your test and see how it compares.

Example:

      x = []
      x.push("latortuga")
      x.push(" is so right")
      str = x.join("")

<comment><USER2> That's a different issue than the what the OP was writing about, which is getting a string representation of an object, in this case, a function.

</comment></comment></comment><comment><USER4> Some Sitepoint Article: How not to Critique a Javascript Library

        for (var i = fromIndex; i < arr.length; i++) {

        This for loop looks up the .length property of the array (arr)
        each time through the loop. Simply by setting a variable to
        store this number at the start of the loop, you can make the
        loop run much faster:

From six lines above, in _array.js_ :

        if (arr.indexOf) {
            return arr.indexOf(obj, opt_fromIndex);
          }
        if (Array.indexOf) {
            return Array.indexOf(arr, obj, opt_fromIndex);
          }

It only falls through to there if Array _already has no indexOf prototype method on it at all_. In that case, performance on "for" loop is the least of your concerns, because you're using a terribly slow browser where it won't matter anyway. They used a cached length property later on in the very same file, in places where it might actually matter.

        Google's developers seem to have figured this trick out
        later on in the same file. From array.js, line 153:
        var l = arr.length;  // must be fixed during loop... see docs
        ...
        for (var i = l - 1; i >= 0; --i) {

        This loop is better in that it avoids a property lookup each
        time through the loop, but this particular for loop is so
        simple that it could be further simplified into a while loop,
        which will run much faster again:
        var i = arr.length;
        ...
        while (i--) {

On V8 and SquirrelFish Extreme, these two loops are exactly the same speed (and indeed, probably generate near-identical native code.) On FireFox and older Chrome/WebKit, the average difference on an array of 10,000 elements is something like the difference between 0.068ms and 0.072 ms to iterate (I don't remember the actual figure on my machine, it's negligible.) In V8, Google's own native iterators are implemented _in JavaScript_ using that incrementing 'for' loop.

        But not all of Closure Library's performance woes are due
        to poorly optimized loops. From dom.js, line 797:
        switch (node.tagName) {
          case goog.dom.TagName.APPLET:
          case goog.dom.TagName.AREA:
          case goog.dom.TagName.BR:
          case goog.dom.TagName.COL:
          case goog.dom.TagName.FRAME:
          case goog.dom.TagName.HR:
          case goog.dom.TagName.IMG:
          case goog.dom.TagName.INPUT:
          case goog.dom.TagName.IFRAME:
          case goog.dom.TagName.ISINDEX:
          case goog.dom.TagName.LINK:
          case goog.dom.TagName.NOFRAMES:
          case goog.dom.TagName.NOSCRIPT:
          case goog.dom.TagName.META:
          case goog.dom.TagName.OBJECT:
          case goog.dom.TagName.PARAM:
          case goog.dom.TagName.SCRIPT:
          case goog.dom.TagName.STYLE:
            return false;
        }
        return true;

        This kind of code is actually pretty common in Java, and
        will perform just fine there. In JavaScript, however,
        this switch statement will perform like a dog each and
        every time a developer checks if a particular HTML element
        is allowed to have children.

        Experienced JavaScript developers know that it's much
        quicker to create an object to encapsulate this logic:

        var takesChildren = {}
        takesChildren[goog.dom.TagName.APPLET] = 1;
        takesChildren[goog.dom.TagName.AREA] = 1;
        ...
        This code can be further bulletproofed against outside
        interference using hasOwnProperty (see below for a full
        explanation of this).

        return !takesChildren.hasOwnProperty(node.tagName);

Really? You tested it? Because a 'switch' does not necessarily generate the same code as a dynamically constructed set of object properties. In Google's original example, if none of the cases match, it immediately returns 'true'. In Sitepoint's example, if the property does not match on the highest level, it must crawl the property chain on the object until it eventually reaches 'undefined'. Not to mention you are making two inner function calls and a fully dynamic property lookup (!(), hasOwnProperty, and node.tagName), none of which I believe can be calculated statically.

Actually, I'm going to end this rant early, because I just read more of the article, and it looks like the author just keeps pulling random shit that he remembers reading from "Javascript: The Good Parts" or whatever and vomiting it back up onto his keyboard.

<comment><USER5> _it must crawl the property chain on the object until it eventually reaches 'undefined'_

If it were a normal property lookup, yes, but not with `hasOwnProperty' - that's the same as any old hash table lookup. So efficiency here really depends on the implementation, and Google's is probably faster. Regardless, we're really splitting hairs - these optimizations will get a few milliseconds, on average. As much as I am a perfectionist, it's all completely negligible in terms of UX.

<comment><USER4> I'm talking about the class tracing V8 does, not prototype chains. "Property chain" meaning in V8, it must climb the series of what it calls "hidden classes" in order to find all of the properties. Other engines do various things when you pass a totally dynamic property lookup in. Some slower engines probably use naïve hash tables, I don't know.

Feel free to correct me if I'm wrong on this one, though. I've never really ripped open V8 or any of the other engines to look inside, I just go by what I read from their design docs.

<comment><USER6> From my reading of the V8 docs, the hidden class climbing is done when properties are added to the class. Each added property causes a transition to the next hidden class. The final hidden class has all the properties as offsets and a failed lookup might chain through prototypes (not sure there) but does not work though the other hidden classes.

</comment></comment></comment></comment><comment><USER7> Might some of these little idiomatic optimizations be automatically performed by the Closure Compiler, making their absence from the original source irrelevant?

<comment><USER8> That was my first thought. I ran the "slow loop" through the online compiler at:

<http://closure-compiler.appspot.com/home>

And whether I checked "Simple" or "Advanced" I got:

for(var a = 0;a < arr.length;a++)

So it's not optimizing that pattern yet.

<comment><USER9> It would have to determine that arr.length doesn't change during the loop. Pretty difficult problem. :)

<comment><USER7> I'm unsure if the smiley means you're being sarcastic, but if not:

Such determinations are a pretty common thing for an optimizing compiler to attempt:

<http://en.wikipedia.org/wiki/Loop-invariant_code_motion>

</comment></comment></comment></comment><comment><USER10> Well, I learned something new from most of the points mentioned.

Only thing I would take exception to is:

>Those 1.0s are telling. Languages like Java represent integers (1) differently from floating point numbers (1.0). In JavaScript, however, numbers are numbers. (1 - factor) would have worked just as well.

It works just as well but the code seems to be clearer (without any loss of functionality or performance) for explicitly making it a '1.0'

<comment><USER11> Yes this point was particularly ridiculous. Yes, this is a convention from Java (and C++), but I actually do this in my JS code as well. Every minifier will easily fix this for you, and in my opinion it makes things clearer. In fact, there exists an argument that this form of clarity is more important in a language like JavaScript precisely because you don't have a type system (in other words, seeing a 1.0 when an operation should clearly be dealing with ints can flag incorrect logic).

</comment></comment><comment><USER12> Way too nitpicky, and the memory leak point regarding the unbound cache is reaching a little bit.

<comment><USER13> I don't know what definition of memory leak the author is working with, but a real memory leak occurs when all references dynamically allocated chunk of memory are lost without free()ing the memory. An unbound cache does not fit this definition.

<comment><USER14> The term "memory leak" is also sometimes applied, particularly in GC environments, to mean "memory that is still referenced, but will never be used again".

Poorly-thought-out caching is an easy way to do that, especially if the cached values themselves have a chain of references to other values.

<comment><USER13> With caching I don't think you can assume any values are sure to never be used again.

Yes, there are some situations where circular references to DOM elements and the like will cause reference count based GC engines to leak memory. But an unbounded cache does not fit that description. It could be poor memory usage but not a memory leak.

</comment></comment></comment></comment><comment><USER15> The section "The Slow Loop" posits that many for-loops in the library are much slower than they could be because they "[look] up the .length property of the array ... each time through the loop".

I wonder what the performance difference is in terms of referencing a local var vs. referencing an object property? Surely it's negligible?

<comment><USER16> I wondered that too. I wonder if they just don't notice it because the modern VMs they mainly use would cache or inline it, but older implementations do a search for the property each time? (I'm speculating on both those points)

<comment><USER17> I think it's an oversight. The coding conventions I work with ban that form of a for-loop, precisely because the .length access can potentially be very costly. (I'm in a different part of the company, one that doesn't use Closure, but our latency constraints are even tighter than theirs are.) If you're iterating over a NodeList and not just an array, it can actually turn an O(N) loop into an O(N^2) one.

<comment><USER16> Interesting, thanks.

</comment></comment></comment></comment><comment><USER18> A commenter at sitepoint noted the positive point about Google open sourcing Closure. I think it's a good point. It leaves room for people to review, critique, and help improve things.

I thought the more interesting thing about Closure was the optimizer (and I wonder if the optimizer offsets any of the issues described in this critique.)

Regarding the library, I think the interface is more important at this point than the implementation. The latter can be refactored, while the former will always be there.

<comment><USER19> blatant self promo - <http://closureoptimizer.com/> \- for a simple form to play with the optimiser basics

</comment></comment><comment><USER20> Hey,

goog.isString = function(val) { return typeof val == 'string'; };

var b = new String("I am also a string!"); alert(goog.isString(b)); // Will output FALSE

If that doesn't scream ignorance of the language, what does?

<comment><USER21> For reference for anyone else who doesn't know how this should be done correctly (I had to go and look at the dojo source).

        dojo.isString = function(/*anything*/ it){
            // summary:
            // Return true if it is a String
            return (typeof it == "string" || it instanceof String); // Boolean
        }

<comment><USER22> I write a lot of JavaScript and I'm not even sure this is preferable. The "object wrappers" like String are considered deprecated in some circles as a matter of style, e.g. by Crockford. From this point of view, a stricter check is cleaner. And contrary to what the article implies, String(foo) is a cast to a primitive string, and doesn't create an object like 'new String' does.

So the Google function correctly returns whether String(foo) is a no-op.

</comment></comment></comment><comment><USER23> The project is open source and patches can be submitted.

</comment><comment><USER24> If you want to super careful, obj.hasOwnProperty(key) is actually dangerous. What happens when obj has it's own property named "hasOwnProperty"?

The safest thing to do is:

        Object.prototype.hasOwnProperty(obj, key)

Of course, as with the "undefined" example, malicious or incompetent code could overwrite Object.prototype.hasOwnProperty

</comment><comment><USER25> My favorite part:

 _This function checks if a particular variable has a value defined. Or it does, unless a 3rd party script sets the global undefined variable to something else. This single line of code anywhere in the page will bring Closure Library crashing down:

var undefined = 5;

Relying on the global undefined variable is another rookie mistake for JavaScript library authors._

Granted, yes I think libraries in particular should code defensively and I originally saw the var undefined; trick in jQuery some time ago, but realistically, I think they are making a mountain of a mole hill. In my mind it's more of a rookie mistake to trample the undefined type in your code than it is to assume the undefined type has been trampled. I'm no elite js interpreter wizard but in fact I believe the other reason why libraries use the var undefined; trick is to gain a slight speed boost.

<comment><USER26> Some code is so bad that it's hard to have sympathy for the people who wrote it when stuff breaks. Overriding undefined is one of those things.

If we're getting that nitpicky, having an isDef method at all is adding an unnecessary function call that will slow down your program. And while you certainly could create an undefined variable for checking against each time, I'd hardly say not doing so is a "rookie mistake".

</comment></comment><comment><USER27> Funny.

Blogger complaints that there's permanent lack of some optimizations in the code because authors have chosen an intuitive way of expressing things in the language. The problem is maybe not the authors, but the fact that efficient way of programming in JS is usually counter-intuitive.

Wake up JS, it's XXI century! ;P

</comment><comment><USER28> Wow, sometime reading around HN is a little scary! The sheer amount of expertise that the community can bring to bear on nearly any topic is pretty crazy. Even more-so with something like this that impinges on a core subject for many of the people here...

</comment><comment><USER29> Is it just me, or is it becoming fashionable to criticize google's code? This one is a few days old:

[http://webreflection.blogspot.com/2009/11/google-closure- im-...](http://webreflection.blogspot.com/2009/11/google-closure-im-not- impressed.html)

</comment><comment><USER30> Pretty good critique. Hopefully Google gets these (mostly minor issues) cleaned up in the next release.

<comment><USER26> I'd say it isn't. As you said, most of the problems are minor. Some of the performance assumptions are false. Very little of this seems to be of any consequence.

<comment><USER31> Agreed. I was expecting a critique of the library API. JavaScript APIs (including, especially, the browser APIs) have a long history of being overly- verbose, and designed as if it was Java.

Has anyone used the closure library API enough to comment?

</comment></comment></comment><comment><USER32> The article succeeds at least in one thing. It shows that not everything Google releases is perfect and great. Keep your eyes open.</comment>