SQLer – Turn Your SQL queries into RESTful APIs without any programming language - <AUTHOR> https://github.com/alash3al/sqler <comment><USER2> See also: [http://postgrest.org/en/v5.2/](http://postgrest.org/en/v5.2/), which works with usually zero configuration against PostgreSQL databases

<comment><USER3> This is awesome. It seems like any API is really just abstracting the database (or other data store) behind it. But, if only we could just expose the db directly and let users write their own queries to get exactly what they want. That way they could select exactly the fields they want like with Graphql, and write joins to simplify multiple requests into one. I wonder what is still preventing this from being reality? Not enough permission support on the db, or fears of performance issues from badly written user queries?

<comment><USER4> Once you give users direct access to your db, you can no longer change it. That's why there are abstractions which allow changing the underlying data layer without changing the public API.

<comment><USER5> One of the suggested ways to use PostgREST is that rather than pointing it at the Postgres schema called "public" (where created tables live by default), you point it at a schema consisting of nothing but SQL Views which communicate with those tables. That way, the underlying table structure can be altered without affecting the clients that consume the auto-generated HTTP interface.

It's more effort to have to maintain some extra SQL code for those views, but with all the labour-saving PostgREST delivers in the first place, you still come out ahead.

<comment> duncan-donuts But if you're going to do all that why not just put an abstraction in code (that could actually have some automated tests)?

<comment><USER6> There are test frameworks for postgres.

[https://pgtap.org/](https://pgtap.org/)

</comment></comment></comment></comment></comment></comment><comment><USER7> I really like the idea behind this. It's a bit like PostgREST, except with tht, if you want custom SQL, you need to make views or stored procedures. With SQLer you write the scripts on your application server, which has all the usual pros and cons of having code live on the appserver vs in the database. I think most people prefer the code in the appserver, which theoretically would make SQLer the better choice at least from that perspective.

I sorely miss a comment about security authentication, however. How are sessions done? Cookies? Etc?

More fundamentally, I find myself really liking many things that are inspired by CGI. I think that when we moved from CGI to monolithic application servers two decades ago, despite all the good reasons to do so, we threw a _lot_ of babies out with the bathwater. There's an elegance to the "http request? just run some code" model that only very recently got popular again with AWS Lambda and the likes.

<comment><USER8> This is nothing like postgrest :) In postgrest the query is mostly determined by the the user calling the API, in SQLer the query is hardcoded by the api developer, the user just supplies the parameters to the query.

</comment></comment><comment><USER9> I do something similar with Rails and Postgres. I've never been good at publicizing tools I've built.

I think the biggest problem with Rails is Arel and by making it easier to write raw queries that serve json straight from the database you get great performance, composability and its still all really simple.

I don't need GraphQL because its so easy to write in one one endpoint everything I need to get back from my database and then write endpoints for all the smaller endpoints.

But yeah my project is basically handlebars meets SQL. I'm currently working on writing my own template language and hope to port it to other common languages.

[https://github.com/monsterboxpro/monster- queries](https://github.com/monsterboxpro/monster-queries)

I get really depressed working on projects with a million small endpoints or they take the other extreme of using GraphQL.

I'm quite tired of Full-stack development since things are taking 100x more effort and not because things are getting more complicated because they can't see the simpler solution.

</comment><comment><USER10> I love the idea behind this and PostgREST, but one thing keeps me from using on projects with a team: versioning. I've been using it for personal projects and, while doing CREATE POLICY, CREATE ROLE here and there is easy when working alone, I can only expect a nightmare when working with a medium-sized team.

Migrations are, of course, a possible solutions, but I'm yet to see a decent toolset for managing schema changes.

[https://martinfowler.com/articles/evodb.html](https://martinfowler.com/articles/evodb.html)

[http://www.jeremyjarrell.com/using-flyway-db-with- distribute...](http://www.jeremyjarrell.com/using-flyway-db-with-distributed- version-control/)

<comment><USER8> [https://docs.subzero.cloud/managing- migrations/](https://docs.subzero.cloud/managing-migrations/)

</comment></comment><comment><USER11> Don't know why exactly, but I'm not sure if that headline is for a new piece of tech or a new security flaw.

</comment><comment><USER12> Also try jHipster. Bakes you a full stack application from just the data model: [https://github.com/jhipster/generator- jhipster](https://github.com/jhipster/generator-jhipster)

<comment><USER13> Can second this, have multiple times in the past to quickly spin up prototypes/internal apps, worked nicely.

</comment></comment><comment><USER14> > {{ .BindVar "name" .Input.user_name }}

Now, this definitely looks like a programming language construct. How long before this project gets loops and conditionals? See for example ansible.

<comment><USER15> It uses HCL and the new unreleased version does have loops and conditionals:

[https://www.hashicorp.com/blog/terraform-0-1-2-preview](https://www.hashicorp.com/blog/terraform-0-1-2-preview)

</comment></comment><comment><USER16> Interesting use of hashicorp's configuration language. How has it been working with it? Why use it rather than json, toml, or yaml?

I arrived at something similar recently in Rust, using actix-web. However, as an open source author of prior work (Yosai, in python), I realize that releasing this work is only the beginning. There's a lot more effort required to make an open source project viable. I'd gladly talk with folks about how one might do it, though.

It would be helpful to understand the demand for a project like this (and postgrest et al). What are the use cases where people finding value in creating enterprise-quality auto-generated endpoints?

</comment><comment><USER17> Doesn't GraphQL eclipse a RESTful interface when interfacing with a database?

e.g. [https://github.com/prisma/prisma](https://github.com/prisma/prisma)

</comment><comment><USER18> Also have a look at DreamFactory ([https://www.dreamfactory.com/](https://www.dreamfactory.com/)), an open source API generation and management platform. DreamFactory includes connectors for 18 databases, numerous file systems, e-mail delivery, mobile notifications, and more. Also API key management, roles, limiting, and logging. _shameless plug_

</comment><comment><USER19> XQuery was much more suited for this than SQL will ever be, so much so that some naive people made a thing called XRX [https://en.wikipedia.org/wiki/XRX_(web_application_architect...](https://en.wikipedia.org/wiki/XRX_\(web_application_architecture\))

Did it take off? Of course not.

</comment><comment><USER20> Reminds me of this [https://open.blogs.nytimes.com/2007/07/25/introducing- dbslay...](https://open.blogs.nytimes.com/2007/07/25/introducing-dbslayer). The source can still be found on github. Except dbslayer is supposed to be readonly.

</comment><comment><USER21> > sqler uses nginx style configuration language (HCL)

nginx configuration looks nothing like HCL (which is json compatible)

</comment><comment><USER22> I didn't see it mentioned, but OpenRESTy has my business for declarative JSON APIs backed by PostgreSQL. It's nginx so it's got a bit of momentum working for it.

</comment><comment><USER23> It's not critical but having a bcrypt function which doesn't take in the cost parameter feels like bad practice for the future.

</comment><comment><USER24> Something like Flask doesn't take too much more effort to achieve something similar, and will be a lot more flexible, no?

</comment><comment><USER25> Its great, it would be even better if it could be deployed to AWS Lambda.

</comment><comment><USER26> Not really limited to just RESTful APIs, you can write an RPC api as well and call stored procedures to perform all sorts of complex actions on your data.</comment>


Ask HN: How can we get porn sites to support HTTPS? - <AUTHOR> Most of the top porn sites do not support HTTPS, meaning the exact videos we watch (and our fetishes) are visible to our ISPs.  Why haven't porn sites deployed HTTPS to protect this data?  How can we convince porn sites that HTTPS is important and get them to deploy it? <comment><USER2> Check out Dr Susan Block's Cliporama, I set all their sites up for ssl when I was working for them they may be the only adult sites that use ssl (thanks to me).

</comment><comment><USER3> Honestly, I feel that they're not losing any customers as compared to the small overhead they'd take if they implemented it. It's not really a selling point for most people. Even Facebook took quite a long time to universally implement HTTPS.

</comment><comment><USER4> What if you watch through a vpn?

</comment><comment><USER5> Seems to be a feature people would be willing to pay subscriptions for.</comment>


Go After 2 Years in Production - <AUTHOR> http://blog.iron.io/2013/08/go-after-2-years-in-production.html <comment><USER4> Go seems to be hitting some kind of tipping point where it's going from being more of a niche thing with a small user base to something with a broader appeal. I don't think that it's because go is changing so much as the kinds of problems people are encountering writing web services that need to scale (or at least have that option).

I've been comparing go to scala lately and what has really got me into go is the development speed. The fast compiles and fast web page auto-reload make it feel every bit as fast to develop in as ruby or python or php, but with type safety, fewer tests, and very clean code.

Scala is a fantastic language, but even with jrebel autoreload you still have 2-3 second page reloads and a 5 second test suite reload. That seems like a small thing, but the faster I see code change results, the more hooked I am to the process. A 5 second wait is probably enough to get me out of the zone.

With go, on just a default simple test of a small thing it is less than a second to compile/run. In revel, pages reload/update as fast/faster than they do in rails/sinatra.

Oh, and with go, each web request will run in a separate goroutine, so you get excellent nonblocking IO performance without dealing with the callback soup of node.js.

It might just be irrational exuberance because I haven't built anything big and messy yet, but so far go is seriously fantastic and solves a lot of real world problems elegantly.

<comment><USER5> So you've enjoyed all the marketing and Google employee upvoting?

<comment><USER6> Comments like this never, ever improve threads.

<comment><USER7> The other thing that never improves threads is everyone only posting what they think might get upvoted instead of saying what they actually think, especially when there might be a grain of truth in it. Tedious comment back-patting is the death of good communities.

<comment><USER8> How about we avoid both trollish sarcasm and tedious back-patting, and say what we really think politely? That's not so hard.

</comment></comment></comment></comment></comment><comment><USER9> "Two years in, Go has never been our bottleneck, it has always been the database."

I would expect this to be true with any language, if you code well. Regular web applications do not have state so they are very easily scaled horizontally anyway. Databases on the other hand are trickier to scale the same way and will end up being the bottleneck almost all the time.

<comment><USER10> In my experience, with slower platforms/languages, while it may be conventional wisdom that the database is the bottleneck, that's not actually the case in many circumstances.

Certainly in circumstances where you're doing a complex query involving fields that are not indexed or several joins, you're going to be waiting on the database.

But if you're just fetching rows by ID or indexed fields, slower platforms and languages end up being a bigger bottleneck than modern databases. Sometimes this is masked somewhat by the fact that the database drivers and/or ORM are slow, so from the application's perspective, the "database" is the bottleneck. But one should not confuse the drivers and ORM for the database.

<comment><USER9> If you are talking about a breakdown of time consumed during a single request's processing, then yes on slower platforms/languages/frameworks, the database access portion may not be the most significant percentage of time used. But this is not that relevant as even the slower platforms usually can handle a single request reasonably fast.

What I was talking about was more about in the scaling of a system, i.e. what happens when your architecture needs to handle lots of requests. In this case, it is very rare for the application server part of your architecture to be a bottleneck in scaling because it is generally stateless (for normal web apps at least) and hence very easily horizontally scaled out. Of course a faster platform will allow you to use fewer servers but 15 servers on Go vs. 20 servers on Python is not that big of an issue.

<comment><USER10> "Reasonably fast" is in the eye of the beholder.

In my opinion, many popular platforms and frameworks are not reasonably fast at providing a response in real-world applications. As a result, many web sites are frustratingly slow in my opinion (for example, a popular site used for hosting source code repositories). If those sites were to capture and share their profiling data (including time spent in drivers and the ORM), I would guess the database proper would not be as great a bottleneck as conventional wisdom says.

Perceived slowness is latency, and horizontal scaling doesn't necessarily address latency. Horizontal scaling may help alleviate an over-taxed CPU dealing with too many concurrent requests, but if a single request in isolation runs in 300ms, it will not run quicker than 300ms. It may run _worse_ when contending for CPU capacity versus concurrent requests, but not better, unless a faster CPU is dropped in.

Performance matters, even in the world of horizontal scalability. Performance brings reduced latency (user experience) and reduced cost (size of cluster). If we can get that paired with an efficient, enjoyable developer experience, then yay for us.

Finally, "15 Go servers == 20 Python servers" seems a little unfair to Go.

<comment><USER11> I think the confusion arises because jd007 is discussing _throughput_ and you are discussing _latency_.

Latency and throughput can be inversely related depending the precise architecture of a system (queueing is the classic mechanism that trades them off).

But in terms of "horizontal scaling", the goal really is to improve total throughput. Often imposing a tax on latency due to coordination costs.

<comment><USER10> True enough. This thread of conversation was kicked off by the premise that most applications are bottlenecked on their database server. When I said, "not necessarily," I meant as far as latency is concerned--for any given request on a slower platform, it is likely that the database's contribution is actually a minority.

That is the conventional wisdom I find in need of disruption.

But you are correct. Since a conventional database server can be more difficult to scale horizontally on its own right, even that small latency contribution, when multiplied by the number of queries being run by a wide array of application instances may ultimately mean the database server is the first observed bottleneck. By which I mean, the first device to reach 100% CPU without the simple recourse to just throw more money at Amazon and spin up another instance to solve the problem.

So I buy that.

But when I see slow web applications--when I criticize a site for being slow-- I am always talking about latency. When we look under the hood, assuming the application is not being silly with its queries or doing a fundamentally challenging work-load, user experience slowness (latency again) usually originates from the application's own code or slow platform.

For example, I've observed applications that require 200ms of server-side time to render a login page. Behind the scenes, I may observe that they are badly designed and include one or two trivial (but utterly unnecessary) queries. Still, those two queries can be fulfilled by modern hardware in ~5 to 10ms. The remaining ~190ms of server processing is on the application. To my mind, that is unacceptable. A login page should be delivered in ~3ms of server time (under load!) on modern hardware.

And back to the OP, Go is a platform that brings JVM-class speed (the capability to return a login page in ~3ms) to those who can't stomach Java. Bravo to Go!

<comment><USER12> I don't entirely disagree with you but I do think you're not doing anybody any favors by "disrupting this conventional wisdom."

When I was an engineer at Formspring I profiled our social graph service which was basically PHP client hitting a Python service that queries against Cassandra. Thrift was used to communicate between PHP and the Graph Service and, being Cassandra, Thrift was used between the Python Cassandra client and the Cassandra server. So, two-way serialization, twice.

In the end, this isn't a bad design. I didn't write it then but if I were re- writing it now I'd probably use protobuffs but aside from that, it was a clean separation of concerns and fit in nicely with our larger SOA.

Point being, though, that serialization is CPU expensive. Reading from Cassandra was blazingly fast compared to the work Thrift was doing.

All that said, I think noob engineers should be taught that network operations (db queries included) are at least an order of magnitude slower than, say, opening and writing to a local socket. Experienced engineers can see the balanced view of things and agree with the point you're making, so advocating it, IMO, will only serve to make you look smart and confuse noobs.

<comment><USER10> I appreciate your point of view. It's not my intent to confuse noobs.

You're right, with that in mind, the conventional wisdom is worth retaining so to instill the proper fear of treating database queries as trivial. Thinking of queries as cheap--or not thinking about queries at all--is what gets applications into a state where a single request runs dozens if not hundreds of queries to deliver what is effectively static content! :)

That said, I've met more than a few senior folks who continue to fiercely stick with the premise that database queries trump all. As someone else in this thread said, profiling can be illuminating, even for senior developers. But it seems on that point, we're all in agreement.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER13> Another Scala user here. And I've been using Scala for the last six months. Mostly developing web applications on Scalatra and Play. I love Scala - <USER2> still has its goodiness and it's an excellent alternative to Java.

If you notice in all of the Scala books (I've read the one by Martin and the One by David Pollak as well), they all seem to push you towards the functional programming model instead of the much more common imperative model.

But you know, there's a problem with that. Not with the language itself, but with the web development side of Scala. There's only certain ways by which you can program with a particular function that accepts a request and returns a response. So, most of the time, I would find myself wasting time thinking "How can I make this more functional?"

Functional programming is really great when you can actually enforce it - <USER3> writing algorithms and so forth, but otherwise, you are forced to fallback to this imperative model which sucks, because you have to constantly keep changing your mindset between these two models.

Another downside of Scala is its HUGE syntax. Processing strings? Here's a ten million ways to do it.. (a bit over-exaggerating). Oh and if you chose this way, then you should use this syntax. No, not that one, THIS one. Oh no, not that one, this variation of that one that looks like this.

I've advocated Scala to many HN members here in the past, you can even check out my comments, for instance. But from my experience, I think Scala is an Academic language. But it's superior in its own ways - I just LOVE the concept of avoiding nulls and passing an Option. It's beautiful. But the downside is its huge academic complex syntax. I want to be able to write code which shouldn't reduce my hair count even if I look at it after 6 long months. I don't want to refer to an 800 page book each time I'm confused about something.

That's why I think Go is beautiful. The syntax is just enough to keep it inside your head forever. I fear that as the language matures, this might also evolve into something as complex as Scala, but let's hope not so.

Go isn't a magic bullet though. It has its own downsides, but nothing w.r.t performance or similar. For the most part, it's awesome.

Once you go Go, you never go back.

P.s - I still love Scala as well ;)

<comment><USER14> I've historically been pretty pro-Scala 'round these parts, so my response to this should be considered in that light. So, with that disclosure out of the way... =)

I have to admit, I don't agree with the assertion that the cognitive dissonance associated with programming in an imperative way versus a functional way is a major problem to Scala. I realize personal preference is a very big part of this, but there are many problems which are just easier to solve in a functional way versus an imperative way. Of course, the opposite holds true as well. This is the beauty of Scala; one can write performance- critical imperative code while exposing a functional interface; or, one can consume a fluent functional interface to produce imperative code.

Frankly, I guess I've become something of a functional zealot, so my problem with Go is that it's so stubbornly imperative. This is why I can't get behind Go, as much as I want to. I feel like it doesn't consider many of the lessons that have been learned about FP making life easier. Set operations (map, filter, reduce) are insanely common, yet doing them imperatively sucks to the point of discouraging them. Excessive mutability is difficult to reason about. Nobody expects the nil/null/none inquisition. We tend to forget about side effects. Without an extensible language, which requires truly first-class functions, you're at the language designer's mercy.

Hell, Scala probably isn't the be-all, end-all answer to all of this. I just don't think that a doggedly-imperative, non-composable, statement-oriented language is the future of programming "in the large", not when the past has shown us that we tend to produce buggy, unmaintainable software this way. I'm pragmatic enough to realize that pure FP isn't a solution, but I feel strongly that sticking to traditional imperative because it's familiar is a costly mistake.

I can't argue with your take on the syntax, though, since that's personal preference. =) If you have any thoughts on why you feel productive in Go, I'd love to hear them; as I've said, I've been really struggling with motivating myself to learn and enjoy it.

<comment><USER15> Have ever tried programming in Go?

Edit: Functional Programming in Go 1\. [http://stackoverflow.com/questions/4358031/functional- progra...](http://stackoverflow.com/questions/4358031/functional-programming- in-go) 2\. [http://golang.org/doc/codewalk/functions/](http://golang.org/doc/codewalk/functions/)

<comment><USER16> Go doesn't lend itself to functional programming, in part because of its lack of type parametrization. In a language like Scala or Haskell, using functions like map, fold, and filter is clean an idiomatic. In Go, it is so ugly and convoluted that you immediately reject this approach and use for loops instead.

<comment><USER17> Standing firmly in one paradigm is a good thing for a language IMHO. I've worked in multi-paradigm languages and they suffer from the fact that their communities can't find a common style. "Should I use a fold or a loop or a tail recursion?", or some library designers want to be as typeful as possible, others don't, etc.

<comment><USER18> > "Should I use a fold or a loop or a tail recursion?"

Neither, use a combinator, like map or traverse. (And that applies to all languages that support this style.)

</comment></comment></comment></comment></comment></comment><comment><USER19> I can't be the only person who thinks Go is really interesting, but can't get over the 'package' hump... It's just too wonky for 'real-world' from my experience. For example, how do you create clear lines of separation with internal modules? If you want to use 'namespaces' then each namespace has to be it's own package, which then requires its own Repo that you have to 'go get'. There's unsustainable for a project of any useful size.

I must be missing something.

<comment><USER20> Google has said they don't use 'go get' internally to manage dependencies, so they appear to agree with you.

<comment><USER21> I would imagine this has something to do with having an existing package dependency management system company-wide and it causing friction trying to get the two to coexist.

I have similar issues where I work with trying to integrate an internal build system and rubygems. Our answer is to essentially mirror the gem version internally into our own repo. It's not the best answer I could hope for.

</comment></comment></comment><comment><USER22> I know it's cliche, but I still can't live without generics or a macro-like approximation thereof. I suffered under Java 2 for too long to go back to that.

<comment><USER23> It's not cliche, it's just personal. For instance, most of the code I write is numerical code. To that end, any language without operator overloading is a non-starter, since it's far harder to find a bug in:

div(add(mult(-1,b),sqrt(sub(pow(b,2),mult(mult(3,a),c)))),mult(2,a))

than it is in

(-b+sqrt(b^2-3 _a_ c))/(2*a)

On the other hand, if I wrote server code, operator overloading would be far less useful. I'd probably curse any programmer who used it and thank the gods that it was left out of Go.

Conversely, since I write a lot of numerical code, I don't care about generics or typing, which is crucial to many other programmers. Generics don't matter since everything I work with is either a Double or a collection of Doubles. Similarly, static typing doesn't help, since most functions just have the type (Double -> Double) and the type checker can't tell a sine from a logarthim. Of course, the reverse is also true. Since everything is either a double or a collection of doubles, the fancy tricks that dynamic languages offer don't give me a damn thing, so I'm extremely ambivalent about the typing debate.

Of course, on other projects, I've written code that benefited from static typing and I've written valid code that would choke any type checker. I've written code that heavily needed generics. When I did that, I used the languages that had the features I needed.

Go just won't work for the programs I write and it sounds like it doesn't work for yours, either. That's why we won't use Go. I've heard it works wonderfully for a certain class of server software and I'm glad those guys have a useful language for their domain. If I ever have to write another server, I might even teach myself Go. But don't feel guilty that you're using an old hammer instead of the shiny new saw.

<comment><USER24> It's not quite that bad in Go,

(-b + math.Sqrt(b _b - 4_ a _c)) / (2 _ a)

though if you're using a ton of matrices it could be.

I for one have found Go great for computing. The really quick compile times with static checking plus the composability are great. It definitely depends though; while the native concurrency is great there aren't a lot of easy solutions for non-shared memory computations. (I saw an MPI package at one point, but I haven't tried to use it)

<comment><USER24> Sorry, new to posting on HN. How do I get asterisk literals?

<comment><USER25> [https://news.ycombinator.com/formatdoc](https://news.ycombinator.com/formatdoc) says two leading spaces formats code verbatim:

      (-b + math.Sqrt(b*b - 4*a*c)) / (2*a)

</comment></comment></comment></comment></comment><comment><USER26> As a developer on the Python stack, I would love to know when would be a good time to start using Go in serious production work. It seems to me that it solves a lot of the backend services infrastructure problems associated with interpretive languages (one of the reasons I was considering diving in Scala or other JVM languages), is relatively reliable, and has a fairly strong core library. It still seems bleeding edge, but the language seems to have developed far faster than Python did over the last decade or so.

<comment><USER27> > I would love to know when would be a good time to start using Go in serious > production work

Now would be a good time. No language, runtime, compiler, library, or framework is ever going to be perfect, but now is a great time to dive in.

> It still seems bleeding edge

This is probably a good thing in many respects because Go doesn't have the baggage from yore, and it was created by some pretty smart and capable people.

> but the language seems to have developed far faster than Python did over the > last decade or so

Language designers are getting better at marketing. No language succeeds without fantastic marketing.

<comment><USER28> _This is probably a good thing in many respects because Go doesn 't have the baggage from yore, and it was created by some pretty smart and capable people._

As was Javascript plus Node.js two years ago, Ruby and RoR five years ago, etc.

You'd think that more reasons are required than 'it is new, doesn't have baggage in was created by smart people'.

<comment><USER27> Go isn't a framework. NodeJS is a framework, as is Rails. JavaScript and Ruby are very old languages, both laden with baggage.

<comment><USER29> node.js is not a framework, it's a platform written in c++ and js.

<comment><USER27> Yeah, you're right. Thanks for pointing that out.

</comment></comment></comment></comment></comment></comment><comment><USER30> I wish we could know what happens "after 12 years in production" (just 10 more).

Update:

Sorry if someone did feel offended (the negative voting), I said it with my best and more constructive intention.

In my opinion, the problem is not in the content of my comment. Well, maybe, if someone understands it as: "oh, can't argue against that, is attacking the language" instead of, "let run your imagination to 2023".

Have a nice day/night.

</comment><comment><USER31> The memory footprint for Go seems to makes it ideal for mobile devices. Also, considering that Dalvik performance is much slower than Java, it really seems like have Go on Android would be a huge win.

[http://en.wikipedia.org/wiki/Dalvik_(software)#Performance](http://en.wikipedia.org/wiki/Dalvik_\(software\)#Performance)

Go compiles to native, so "compile on install", would probably be needed.

<comment><USER4> Go on Android would be great, but Google used Java in the first place so that they could leverage all the Java devs in the world to build Android apps.

Go might be a much better choice from a pure dev standpoint, but from a getting everyone to build apps standpoint, it's a fail in the short/middle term.

<comment><USER31> I didn't say get everyone to build apps. It would simply be another option. App development is getting more competitive, of course, so people that want to stand out might need to move to Go to gain an edge. Plus, I image that a Go environment might provide a better interactive development cycle.

<comment><USER4> Yeah totally. I'm with you there. It would be great and I hope they do it.

</comment></comment></comment></comment><comment><USER32> It's a shame they have actually converted a real system, and they rely on the language benchmark to make an argument about performance.

That said, not having run into a problem is a worthwhile feedback.

</comment><comment><USER33> Anyone got a good tutorial on Go? I'm interested in fiddling around with it.

<comment><USER34> [http://tour.golang.org/#1](http://tour.golang.org/#1)

<comment><USER33> Sweet, thanks Barkmore!

</comment></comment></comment><comment><USER35> Not so relevant but for any of you who prefer Rust to Go and haven't tried Go, don't do it.

Go's std, visibility by case and gofmt, among other things will make you cry for using Rust.

I really hope Rust get's better with time and it really focuses on being developer friendly not just a bag of nice features.

<comment><USER36> > Not so relevant

Then why post?

<comment><USER37> I, as a user interested in both, did find value in the comment regardless of his/her intentions. This comes off as a 'shut up' when really, it could be a good opportunity to look at what Go does right for implementation in Rust, no?

<comment><USER36> Because it's plainly a troll. ("Go will make you cry for using Rust" made that clear, especially considering the user's comment history, in which I've already explained why at least visibility on case doesn't make sense.)

<comment><USER35> Not trolling at all, just sharing my opinion as noob with Rust coming from Go.

That particular quote is related to "cleanliness of the language" obviously it's not an apples to apples comparison.

My apologies to all of you Rust devs who might get offended with my comment, wasn't my intention, you are doing an awesome job I'm looking for 1.0 meanwhile I'll keep toying around with the language.

</comment></comment></comment></comment></comment><comment><USER38> This is awesome. I much prefer this to "we rewrite some stuff with Go" articles.

</comment><comment><USER39> Interesting that Go lost so heavily to Ruby on amount of code (~ 3x more on average.)

</comment><comment><USER40> Being using go for a year now. Really enjoying using it.

</comment><comment><USER41> I would love to see codeacademy, codeschool, treehouse, and the online course community to jump on creating go curriculum.

<comment><USER42> [http://tour.golang.org/](http://tour.golang.org/)

</comment></comment><comment><USER43> on an unrelated (to golang) note, does anyone have any experience they would like to share about iron.io? especially it vs rabbitmq or amazon sqs?

<comment><USER44> [Disclaimer/Warning I work there and this is about Iron.]

Vs RabbitMQ: \- Native cloud service over HTTP transport \- Clean easy API \- Scales to unlimited queues/clients \- Push queues can have URL endpoints as subscribers \- Highly available (our #1 priority is to keep it running at all times) \- Nice UI to manage queues, stats, rate, etc. \- IronWorker integration (workers as a service)

Vs SQS: \- Fast, clean API \- FIFO \- One time delivery \- Multi-cloud \- Push queues / pubsub / fanout as first class feature \- IronWorker integration (workers as a service)

Best way is to just try it out. It's already one of the leading cloud MQ's out there and we have a lot of big plans for IronMQ to make it the safest "bet your business" cloud message queue available.

<comment><USER45> RabbitMQ supports HTTP and has a clean easy API. Scales in lots of ways. Supports very high throughput on a single cheap AMI. Has awesome GUI and UI. Etc. YMMV.</comment></comment></comment>


Water-powered jet pack lets you swim like a dolphin - <AUTHOR> http://kottke.org/11/12/water-powered-jet-pack-lets-you-swim-like-a-dolphin

<comment><USER2> Product page: <http://www.zapata-racing.com/uk/flyboard_uk.php>

4900e sounds very affordable, but I suppose you need a jetski to power it

<comment><USER3> From the website:

 _"Fly Board: Acceleration from a stand-up PWC (aka jet ski), 4900 euros.

Optional: Acceleration from the Flyboard directly, 900 euros."_

If you watch the video again, you'll notice that Flyboard isn't attached to a PWC but to something smaller. There's an another video [1], where you can see a close-up of it on 04:27.

[1] <http://www.youtube.com/watch?v=lM8kEHjQz9U>

</comment></comment><comment><USER4> Well this alternative (<http://www.jetlev-flyer.com/>) is $80K USD so the price seems incredibly affordable. Assuming it's accurate.

<comment><USER5> You'll be able to rent these in tourist shops. I'd wager flying around by yourself gets old after a while anyway, no matter how awesome this seems. Remember your first RC helicopter? How long did you keep playing with it?

<comment><USER6> Depends on who you ask: <http://www.helifreak.com/>

</comment></comment></comment><comment><USER7> Longer and better video ... <http://www.youtube.com/watch?v=im1iNq02Kz0>

Saw this a few months back — totally cool. I'd imagine that you'll start seeing them in your highest concentration touristy beaches for rent soon.

<comment><USER7> Actually I guess the video I linked too is a different model / company ... I like the one in the above video better ... but both look fun!

</comment></comment><comment><USER8> Here's a slightly different model, and a funny goof on launch that made the rounds last summer: <http://www.youtube.com/watch?v=qRVspuAJyAY>

</comment><comment><USER9> Is that available commercially in the US? I can see many potential applications for something like this.</comment>


Waalflower: A wall mounted wireless charger for your tablet - <AUTHOR> https://www.kickstarter.com/projects/waalflower/waalflower-a-wall-mounted-wireless-charger-for-you/description <comment><USER2> Neat, though there's a lot of visible cable clutter to this. You both have a device now affixed to your tablet (with a cable), and then a cable down from your wall mount to a power outlet.

Maybe this is great if like, wall mounting your tablet is your primary use case for it, such as a home automation controller. But I can't see the average user wanting to affix a wall mount to the back of their iPad.

<comment><AUTHOR> Yeah there are applications where I can see this being useful and a smart-home controller is there at the top for sure. There are also applications like co- working space meeting room management, store shopping terminals etc.

As for consumers, I think it may be popular with those who like the minimalist approach, although you there are still cables, you are right. I think I'll get one though.</comment></comment>


Trump Comes Out Against Bitcoin, Libra, and Other "Unregulated Crypto Assets" - <AUTHOR> https://twitter.com/realdonaldtrump/status/1149472282584072192 <comment><USER2> This seems somewhat ironic to me. If what everyone assumes (that he's used many tax shelters and loop holes to avoid paying significant taxes) is true, it would be pretty hypocritical.

</comment><comment><USER3> Gee, I wonder if this tweet is in any way connected to his previous one about weakening the USD to match the (alleged) currency manipulations of the Euro and China?

Please hang on to those US dollars. They are very solid, strong and stable. If the S&P 500 hits all time highs, its certainly because everyone is getting so rich, and not because we are inflating the currency. ;-P

</comment><comment><USER4> I get a vicarious sense of irony when hearing Donald Trump talk about the need to avoid bank fraud.</comment>


Epic Fail: Electronic Health Records and Lack of Interoperability - <AUTHOR> http://www.motherjones.com/politics/2015/10/epic-systems-judith-faulkner-hitech-ehr-interoperability <comment><USER2> This is a huge issue that healthcare is not dealing with. Having the ability to have access of your medical record anywhere at anytime is crucial especially in emergency situation. Having the my medical ready to be used on any system is a problem caused by the multiple EHR company. It's like having different Microsoft Word programs and they all produce the same type of doc file. Yet some genius in the company thought it was smart to limit the accessibility for each software. It's like come on! You guys are all trying to do the same thing and you are trying to be secretive about it. Doesn't make any sense at all.

I'm on a mission to deal with this problem. Our medical record should be available at every medical facility in cases we check into that facility. Our data shouldn't be a problem to be read on any computer system out there. Data is simple. It's the complexity of the EHR system trying to dominate one another that causes this problem to happen.

There's a huge elephant in the room when discussing medical record, and no one is bothering to deal with it due to their own selfish needs.</comment>


Random Ideas For Sites and Startups - <AUTHOR> http://thebetastartup.com/2012/08/18/ideas-2012-part-i-online-based/ Feel free to take, comment, do etc <comment><USER2> > Live Cam Porn – site with channels. People watch only live. The better girls > perform, the better rating. The more people visit, the more money girls will > make through revenue sharing. You can pay money to be the one to interact > with the girl (tell them to do things, talk with them etc).

This is a solved problem. :)

I'm really surprised the author hasn't run into it before.

> Chat Support

This sounds like a great idea, but I think we'd have a problem finding qualified parties to do it 24/7.

It might work for lower grade work though like Wordpress support.

> Your Recipes – A site where you keep your own recipes.

Recipee sites do exist. I wonder what their short comings are in his eyes.

> Discussion Board Online –

Sounds a little like Branch.com as described.

<comment><USER3> >> Discussion Board Online > Sounds a little like Bridge.com as described.

You mean Branch.com?

<comment><USER2> That's the one. Thanks. I edited it to correct.

</comment></comment></comment><comment><USER4> It's a bad idea to take a startup idea from this list and attempt to make a company out of it. You have to find something you're passionate about or something you want to fix.

I seem to come up with ideas daily which was somewhat of a problem but when I wanted to work on my second company I wasn't sure what to do and tried to brainstorm ideas, this eventually failed but I did come up with an idea I'm passionate about outside of this process.

<comment><USER5> Two things.

1) Well firstly you dont need to be passionate about something very specific. For example you can be passionate about making great websites that people love to use and thats it. Edison was passionate about inventing things (apparently also patenting them) for example.

2) I think brainstorming to think about what ideas you're passionate about is a great logical misstep( which I am also guilty of in the past). Rather, think about the things that people need and are willing to pay for and maybe ask yourself if you are really impassionate enough to not get into that market/business. (Ex: CRM Software is a booming market, yet I am too impassionate about that market to even consider getting into it.)

</comment></comment><comment><USER6> Are these original? In app referal? Aren't there many already?

chat support? The example given, SO, HAS chat.

Mindmaps online? Used many.

And some perverted ideas!

<comment><USER7> What perverted ideas?

</comment></comment><comment><USER8> "Vision without execution is hallucination" I have myself plenty of awesome ideas. I have noticed other people executing similar ideas and getting millions of funding. Ideas are worthless until you actually start working hard and execute them.

<comment><AUTHOR> Right. I have one thing I am working on, but I am sharing all my other ideas so that if anyone likes something they can work on it. Sometimes someone has something similar and just by reading those summaries can come up with a mix or with the missing piece in his puzzle. You never know.

</comment></comment><comment><USER9> As for #1)In-app Referrals - I'm not so sure if this would be a business, but on the topic of apps, why not make a "Compete.com for apps", where you can track how many downloads a specific keyword can net you, or how many downloads another app has over time. of course, this type of data is only known by Apple, but you can run some heuristics for estimating it.

Also app-store optimization is something that's relatively unsaturated now. Perhaps some sort of tool that runs statistics and gives you correlations on what factors goes into an app ranking high for a keyword.

</comment><comment><USER10> "Mobile Mating App – You define your gender and parameters of your phone. Then you mate it with other peoples phones..." -

hmm, all my phones are spayed and neutered to prevent phone overpopulation.

</comment><comment><USER11> > Real Life Game

Though I've never tried it out, look at <http://www.superbetter.com> for an interesting take on this idea.

Plus the relevant TED talk: <http://www.youtube.com/watch?v=lfBpsV1Hwqs>

</comment><comment><USER12> I'm willing to bet he was a little horny and/or lonely while writing this.

And while I think few if any are actually good ideas, you have to respect someone for posting their brainstormings publicly. Yet HNers will tear through and criticize each one like he was pitching them for funding.

</comment><comment><USER13> And for every idea mentioned, i thought to myself: "There's a startup for that."

</comment><comment><USER14> 90% of those already exist... did you at search for any of those ?

<comment><USER15> Why is that a bad thing? Competition is generally good, and it helps prove theres somewhat of a market for these ideas already.

</comment></comment><comment><USER16> For "Online Mindmaps", there is already the awesome <http://www.mindmeister.com/?r=5892> software!

<comment><USER17> You should disclose that there is an affiliate code in that link.

</comment></comment><comment><USER18> Website doesn't work here.

<comment><USER19> Here's a pastebin of the article: <http://pastebin.com/bjq9zR4B>

</comment></comment><comment><USER20> uh... let me get this straight: live cam porn?

what the fuck. what sort of "idea" is that? are you a pervert or something? or do you just have no respect for women maybe? do you have experience interacting with normal human beings?

<comment><USER21> ? why so shocked? These sites already exist, and they not only cater to "perverts" with "no respect" for women. Either that or you'll be sad to realize that most people are, in your eyes, perverts who have no respect for women.

<comment><USER20> if you don't see the presence of this "idea" on this guy's list as at least a little off, and the tacit approval of HN readers as doubly off, i don't know what to say.</comment></comment></comment>


Anonymous Stole and Leaked a Megatrove of Police Documents - <AUTHOR> https://www.wired.com/story/blueleaks-anonymous-law-enforcement-hack/ <comment><USER2> This weekend I was using Google to search for info on John Bolton's book (coming tomorrow), but instead of Amazon or Indigo or whoever showing up first as I had expected, the first link was to an indexed directory containing a leaked PDF copy of the book. I have a hard time believing the leak wasn't part of ensuring its public release.

The site I had found is run by the folks mentioned in this article. Judging by the other file names in the directory, and the number of files and directories in general, this must be said megatrove.

I don't know what they do for SEO, but I was impressed that Google seemed to rank them higher than the usual _legal_ places to get the book.

</comment><comment><USER3> Big discussion earlier: [https://news.ycombinator.com/item?id=23599081](https://news.ycombinator.com/item?id=23599081)</comment>


Julius Caesar battlefield unearthed in southern Netherlands - <AUTHOR> http://www.theguardian.com/world/2015/dec/11/julius-caesar-battlefield-unearthed-southern-netherlands-dutch-archaeologists <comment><USER2> Picking a round number of 200MM people in the world at the time [1], this is 0.1% of the entire population killed in a single event, which is staggering.

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

<comment><USER3> All the more staggering because back in those times the majority of the world population resided in China and India. At around 0 A.D, there were 100M people in India and 58M people in China[1][2], leaving a few tens of millions in the rest of the world.

By the way, in the 202BC battle of Gaixia, 250,000 people died in a world of 150M people[3].

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

[2] [https://en.wikipedia.org/wiki/Demographic_history#India](https://en.wikipedia.org/wiki/Demographic_history#India)

[3] [https://en.wikipedia.org/wiki/Battle_of_Gaixia](https://en.wikipedia.org/wiki/Battle_of_Gaixia)

</comment></comment><comment><USER4> The Dutch _National Geographic_ article contains more detail and reads reasonably with computer translation:

[http://www.nationalgeographic.nl/artikel/genocidaire- slachti...](http://www.nationalgeographic.nl/artikel/genocidaire-slachting- onder-leiding-van-julius-caesar-bij-kessel)

Regardless, the scale of slaughter is staggering.

</comment><comment><USER5> You can read, Caesar's version here: [https://en.m.wikisource.org/wiki/Commentaries_on_the_Gallic_...](https://en.m.wikisource.org/wiki/Commentaries_on_the_Gallic_War/Book_4#1)

</comment><comment><USER6> According to Caesar he made 430000 casualties, while historians now estimate it were about 160000. Among these were women an children. On the Roman side there were zero casualties so it was more a genocide than a battle.

<comment><USER7> > On the Roman side there were zero casualties so it was more a genocide than > a battle.

While it's certainly true that it meets the definition of a genocide, it's rather anachronistic to call it that. Ancient peoples did not possess our norms and values.

To the Romans, the Germanic and Celtic peoples represented an existential threat. And they were correct in that analysis. Periodically, for hundreds of years, German tribes the Romans had never even _heard_ of came down into Italy in mass migrations looting and killing everyone in their path. The numbers involved were always absolutely _massive_ , and in many respects the Germans were superior fighters. On several occasions the Romans survived only by the skin of their teeth. For various reasons, the cultural and demographics of the Germanic tribes provided them with a huge birthrate and rapid population growth, which led to pressure that eventually led to huge armed migrations. (Of course, war for pleasure and profit were also common, and later often they fled from even more numerous, warlike tribes, Germanic or otherwise.)

To say, as an aside, that 'among these were women and children' is also a little disingenuous and anachronistic. Not only were women and children not regarded as particularly sacrosanct or immune from the horrors of war, the Germanic and Celtic peoples often included their women in their armies _on purpose_ to prevent the men from retreating, to assist in whatever ways they could, and sometimes to fight. Sometimes the women in the rear merely mocked or pleaded with the men not to retreat. Sometimes they _killed them_.

I confess I am not intimately familiar with these particular tribes and this particular battle. But from a realpolitik point of view, Caesar was acting sensibly. Letting these tribes survive would be to the eventual detriment of Rome. They would eventually invade. No agreement with the Germanic peoples ever lasted long. Nothing less than genocide ever kept a tribe suppressed for more than decades or centuries.

In general, ancient peoples had a _very_ different mindset than we do. Most of them regarded their ethnicity and culture as an absolutely bedrock part of their identity. For many of them, it was better to die as and for who they were than to live in submission - even peaceful submission - to a foreign people. This was true for both the Romans and many of the Germanic tribes. The Cimbri women, for example, killed their children and themselves rather than submit to the Romans. Indeed, the particularly strong Roman identity is one of the reasons for their early successes. The Romans often suffered devastating losses, both in absolute numbers and relative proportions of the Roman people, and refused to surrender or stop fighting where many other peoples did. We could probably, anachronistically, call the Romans and the Germans genocidal racists. But the only reason the Romans survived to become an empire and provide future generations with all their advancements and civilizations was _because_ they were genocidal racists.

Of course, as time went on, and Rome became an empire, 'Roman' became more of a national identity and less of an ethnic or cultural identity. This was correlated with what Roman conservatives thought of as mass decadence: for example, the importation of foreign values, dress, and behaviors. The conservative outrage against homosexuals and transgendered people almost reads like something from the modern day. And the truly 'Roman' part of the population became less of a factor due to lower birth rates (Romans had birth control and abortion, and probably also due to the increasingly large role of women in society). Perhaps consequently, Romans began seeing the military as less of a duty and more of a burden, particularly in conjunction with ever- ongoing wars, and the Roman military essentially became a mercenary army.

As time went on, German pressure on Roman borders became intolerable. Rome constantly meddled with the tribes to play them off against each other, but Germanic peoples remained a perpetual problem for the empire. Since Germans were incredibly effective fighters - born to military life, and often bigger and stronger than Romans, particularly as the empire became more 'decadent' and commercial and academic activity became more common than warfare for the average citizen, Romans began to incorporate Germans into the military, both as auxiliaries and as actual members.

Then as Roman internal politics became increasingly complicated due to the changes in the governance structure, the economy, and interminable civil wars, the Roman military became less effective and the Romans often turned a mostly blind (and helpless) eye to Germanic migrations/invasions and sometimes encouraged them. Then, after several more crises, the Romans allowed a contingent of Germanic refugees fleeing from the Huns into the empire. Ultimately these Germans (the Goths) turned against the Romans (perhaps justifiably) and that was one of the primary proximate causes of the end of the western Roman empire.

...I suppose I went on a little there, but I like the subject and I recently finished Decline and Fall of the Roman Empire. :)

<comment><USER8>
        Decline and Fall of the Roman Empire.

And since when is that a credible work of historical scholarship, rather than a (not very subtle) apology of British imperialism (England the new Rome)?

<comment><USER7> > And since when is that a credible work of historical scholarship, rather > than a (not very subtle) apology of British imperialism (England the new > Rome)?

Since always. I'm not sure where you're going with this since it's received innumerable accolades and been considered an exemplary classic for hundreds of years. You must be aware that criticism such as you just gave is a minority view, but you didn't present it as such.

D&F is very well sourced, cited, and footnoted from primary and secondary Roman sources. There are criticisms to be made of it, and there are a few things that modern discoveries have shed more light on, but by-and-large reading Decline and Fall gets you a decent grounding.

I'm afraid I did not read at all an apology of British imperialism; if anything, a criticism of it, but I wouldn't go so far as to say that either. Historians still recommend reading Decline and Fall.

</comment></comment></comment></comment><comment><USER9> Related: For curated list of the 100 largest atrocities, ranked by largest loss of life, check out Matthew White's _The Great Big Book of Horrible Things_ [0]

It grew out of his website, _Historical Atlas of the Twentieth Century_ , and while he is not an historian by profession (I believe he's a librarian), the book is very well researched (lots of footnotes, citations, etc.) and IMO, "fun" to read. (Only because of his style of writing, obviously not about the content)

Each event is a relatively short read, with decent background provided, though the book is quite long overall.

Spoiler: One of the items on the list is Caesar's Gallic Wars, and there are many dedicated to various events that transpired the Roman {Republic, Empire}

0\. [http://www.bookofhorriblethings.com/](http://www.bookofhorriblethings.com/)

1\. [http://users.erols.com/mwhite28/20centry.htm](http://users.erols.com/mwhite28/20centry.htm)</comment>


Boycotting Amazon - <AUTHOR> https://thenextweb.com/opinion/2018/04/16/its-time-to-boycott-amazon/ <comment><USER2> "The reporter, Alan Selby, reportedly saw some staff members "asleep on their feet, exhausted from toiling for up to 55 hours a week." Toilet breaks were timed, and workers were admonished by supervisors for stopping to catch their breath.

Conditions are so dire, a recent poll of 100 Amazon warehouse workers from labor advocacy group Organise showed that more than half suffer from depression, and eight percent had contemplated suicide."

While I acknowledge it's not a totally fair comparison, I find it interesting that you could replace "55" with "90+" and "Amazon blue collar workers" with "Lower level financiers and consultants on Wall Street" and get probably the same statistics. Maybe even true for some spaces in tech/entrepreneurship.

Is this an Amazon problem, or a modern world problem?

<comment><USER3> I'd like to see some statistics comparing Amazon to other retail jobs. Low- skilled retail jobs are often physically exhausting and not fulfilling. Many amazon workers might feel depressed, but would they feel better if they worked at Walmart instead?

<comment><USER4> I can't comment on Walmart specifically, but from my experience working in a warehouse for a couple months it seems that Amazon is totalitarian in a way your average crappy low-skill job isn't.

</comment></comment></comment><comment><USER5> This isn't just an Amazon problem. I've got a friend who worked at Wal-mart for a while. They give points against you for taking sick days no matter how bad it is. One time she got sent home for having some poison ivy on her arms and was still punished for it. Workers who have high points, but not so many to get fired get their schedules screwed with until they quit.

<comment><USER6> I mean if you are in the top 90th percentile nationally for taking sick days, then working you into the schedule would probably be a nightmare for managers. By reducing your hours, they are reducing the scheduling work that managers need to do. Also, It's likely expected that every employee has some points, but taking way more than everyone else is what this type of system is likely designed to catch.

<comment><USER5> It's not just reducing hours. For example you might start getting rotated around different shifts. They'll make your schedule as irregular as possible to encourage you to accrue points or quit. My friend saw this happen to several coworkers in her two years there. Towards the end her direct manager even asked her why she hadn't quit yet.

</comment></comment></comment><comment><USER7> Well I guess anytime the Internet has a problem these days, we are either going to delete the problem or boycott it into oblivion. If you look deeply into any giant Corp or business serving millions of people you're going to find faults and deficiencies like this every time. Follow the production Chain of Apple, Google, Tesla etc etc you're going to find someone at the deep end bearing the entire cost of their success.

So what happens now ? Assuming everyone boycotted Amazon and the unlikely event occurred and it shut down. What next? Tens of thousands of those works go home to what? Does the editor then start another campaign to employ all the people laid off? Think they'd be working there if they had a lot more options?

How about trying to fix the problem or at least fix as much as humanly possible? How about putting pressure on your reps to draw up some regulations? How about the government? Isn't that what they're there for? Do we have to resort to Social justice for everything now ? Because it obviously doesn't work with these corporations. See Equifax, See Facebook ?

<comment><USER8> > How about putting pressure on your reps to draw up some regulations?

I think the idea is to convince the company directly rather than relying on politicians.

> Because it obviously doesn't work with these corporations.

There are some pretty glaring examples where it has worked. Nike sweatshops probably being the most visible. Boycotts and lawsuits hit the bottom line, which is what they ultimately care about.

<comment><USER9> > I think the idea is to convince the company directly rather than relying on > politicians.

Relying on politicians is hard in the short term, but regulatory policy fixes the problem more or less permanently in an accountable, democratic, and globally applicable (in a national context) way. If we as a society believe what Amazon is doing is fundamentally wrong, why not prohibit legally rather than rely on an ad-hoc solution that will probably be circumvented once attention fades away?

</comment></comment></comment><comment><USER10> So long as we can save a few pennies and a few minutes by utilizing Amazon, there will be no boycott of any meaningful size.

Also, user comments in the Reddit thread about the "comfort break" incident indicate that AWS is Amazon's primary source of revenue these days. This is backed up by much of Amazon's own PR reporting. For a boycott to have any meaningful impact against Amazon, it would have to include a hit against that revenue.

Call it pessimism, but it's my opinion that few if any companies will incur the costs to move their own business out of Amazon simply to penalize them for poor working conditions in another section of the company.

<comment><USER11> > AWS is Amazon's primary source of revenue these days

Source on that please? I'm highly dubious.

<comment><USER10> Inaccurate wording on my part. AWS is amazon's primary source of "operational income" (i.e. raw revenue minus operational costs) these days. $1.17 billion for AWS vs. $0.35 billion for Amazon as a whole, for Q3 2017.

[https://www.cnbc.com/2017/10/26/aws-earnings-and- revenue-q3-...](https://www.cnbc.com/2017/10/26/aws-earnings-and- revenue-q3-2017.html)

<comment><USER11> I see, I see. Thank you for clarifying.

</comment></comment></comment></comment><comment><USER12> There's a big difference between boycotting Nike, and boycotting Amazon. In the case of Nike, there were more than enough substitute goods to fill the gap for a consumer choosing to not purchase athletic gear from Nike.

How would that work with Amazon? Their product isn't only the stuff you buy. It's the ease of the process and the quickness of delivery. What can you substitute for that?

<comment><USER13> The thing that worked for me was to not renew my Prime membership. It then became much easier to force myself to use something like eBay. It's really difficult to wait those 5 extra days for shipping but makes me feel a little better nonetheless. For cloud I use Azure.

<comment><USER14> And if you absolutely _need_ something within two days, USPS Priority mail comes within that time frame (though may be prohibitively expensive for large packages).

</comment></comment></comment><comment><USER15> Everybody is talking about a decentralized Facebook alternative, but can't we build "federated shopping", where independent shop owners join in an Amazon- like shopping experience (for the customer), with reviews based on proof-of- purchase, using smart contracts/blockchain technology?

<comment><USER16> What does blockchain add to this?

<comment><USER17> You can prove that your reviewer is the same person as the person who paid with blockchain. I'm just not sure how to do so if the customer pays with traditional means.

<comment><USER16> That has an interesting side effect. If someone writes enough bad reviews, will people stop selling to them? We saw VE electronics refuse to sell anything else to anyone who gave them a bad review on any product. Would vendors band together on this?

<comment><USER17> I suppose one could just create a different wallet and use that one.

</comment></comment></comment></comment></comment><comment><USER18> No, it's time to have labour laws making what's happening in Amazon warehouses too costly due to fines to continue.

<comment><USER19> We have a legal system that contains far too many greys areas. It is not clear if Amazon is using legal loopholes or deserve fines. I see the legal system as something always getting more bloated and more complex. Evidence of its malfunction is that the outcome of a trial is often unpredictable (see Oracle vs Google). I think the legal system should try to become more like a deterministic algorithm.

<comment><USER20> I agree the legal system needs a good refactor from time to time. It's like software, over time accrues debt.

<comment><USER21> > I agree the legal system needs a good refactor from time to time. It's like > software, over time accrues debt.

It's like software, in that incremental changes are safer and ground-up rewrites are usually disastrous failures engineered by people who failed to fully understand the complexity of the application domain.

OTOH, I'm not sure a "refactor" is a meaningful concept for the legal system. Oh, sure, you can hold requirements and expected outcomes the same and change the details, structure, and organization of legal code. "Refactors" of that kind happen all the time. They aren't as significant in impact as with software, because the code isn't imperative and doesn't run on dumb machines, so refactors are mostly about readability, and don't (e.g.) improve runtime resource usage significantly.

</comment></comment></comment></comment><comment><USER22> Why does an article about boycotting Amazon try to convince you to share their content directly to Amazon's servers? Seems to me like the author does not believe in this mission one bit and is just writing clickbait.

Author, if you're reading this, you ought to live by your words and reduce at least your Amazon supporting activities in the very article you are complaining about their doninance in. Remove that Reddit share icon and everything eles that sends data to Amazon, or we'll all assume you don't care about this, you're just in it for the money and the fame and the clicks. With that Reddit share button, you make it clear you want us to use Amazon a lot to spread your content far and wide.

Can't have it both ways.

<comment><USER23> TNW is a well respected and well established tech news site with a large team [0]. The author likely doesn't have direct control over the sharing buttons.

I take your point, but on the other hand it is probably quite difficult to be aware of all sites that use AWS, especially if they sit behind a CDN. I didn't know Reddit use AWS.

[0] [https://thenextweb.com/team/](https://thenextweb.com/team/)

</comment></comment><comment><USER24> I always wondered why Amazon doesn't have some labor union which at least negotiates normal working conditions.

Boycotting usually doesn't have the same effect as a 2-days strike.

<comment><USER25> They seem to have an union at least here in Spain, and maybe in other countries as well. Last month, workers at a local Amazon ware house in Madrid did a 2-day strike, which was pushed by a national workers union as a complain on the working conditions [1]. I've been out of the loop on news so I don't know how things are going since then.

[1]: [https://www.reuters.com/article/us-amazon-com- spain/spains-a...](https://www.reuters.com/article/us-amazon-com-spain/spains- amazon-workers-call-two-day-strike-over-wages-rights-idUSKCN1GP13L)

</comment></comment><comment><USER26> Boycott isn't a solution, proper media coverage is. Nike was damaged not by boycott campaign but by a massive media outbreak. Just image effect of good documentary film created by some famous talented director. It's much much worse for reputation than disorganized boycott campaign.

<comment><USER21> Boycotts are, among other things, tactics to get media (and thereby public) attention. Saying a result. wasn't produced by a boycott because it required media attention which was in significant part drawn by the boycott, which had drawing such attention as a goal, is, well, missing the point of active protest entirely.

</comment></comment><comment><USER27> No

</comment><comment><USER28> Even without a boycott movement, we may already have reached peak Amazon.

This year, the Supreme Court may create a revolution in the ability of US states to tax consumer purchases from online retailers ([https://en.wikipedia.org/wiki/South_Dakota_v._Wayfair,_Inc.#...](https://en.wikipedia.org/wiki/South_Dakota_v._Wayfair,_Inc.#Supreme_Court)). This could erode Amazon's online retail profitability enough to seriously slow its ever-increasing sales volume and give the competition enough breathing room to survive and even grow a bit.

And Trump keeps complaining about the prices the USPS receives to deliver Amazon. Whether or not there's any merit in Trump's complaint, as a convenient piece of political theater, this cause could easily be picked up by the next president and renegotiated. It would be a crowd pleaser for someone like Elizabeth Warren.

Perhaps the playing field will be tilted just enough to slow the whole Amazon machine.

<comment><USER29> Or perhaps the playing field will be tilted even further in Amazon's favor. Collecting taxes is _difficult_. There are hundreds of thousands of variables depending on where you are currently standing and what you are buying. Consider, for instance, that you pay different sales taxes in different parts of Disney World.

There's a space for a service that manages that burden for you. The service might already exist and is probably called 'Amazon Fulfillment'.

<comment><USER28> There sure seem to be a lot of sales tax calculation service and software companies already, aside from Amazon:

[https://www.capterra.com/sales-tax-software/](https://www.capterra.com/sales- tax-software/)

A lot of them are revealed by googling 'sales and use tax software'

I think that sort of software solution has been around for about 20 years.

<comment><USER29> Oh, no doubt. I helped to support that software twenty years ago. It was expensive. It took constant grooming from an entire team of people. At the end of the month, the company had to cut hundreds of checks to authorities all over the country. For a Fortune 500 company, this is a normal cost of doing business. But this is not the kind of thing you want to subject small business owners to.

We only had to go through this mess two decades ago because we had nexus sites at all our warehouses. Before Mayfair, the mom-and-pop internet seller could get by with only taxing their local customers.

The Mayfair result is going to force difficult and expensive sales tax compliance onto the backs of small business. Your small business owner doesn't want to go shopping for 'sales and use tax software'. They want the shopping cart to do that work for them.

Unless the states actually get together to come up with a simplified and unified system, companies like Amazon who can abstract all that away are are going to be a necessity. I think a nation-wide internet sales tax is better than forcing additional burden onto small business or driving them right into the arms of places like Amazon.</comment></comment></comment></comment>


A React.js case study - <AUTHOR> http://blog.krawaller.se/posts/a-react-js-case-study/ <comment><USER2> Thanks for putting this together, always interesting to see people use React for the first time! I did a code review of sorts and cleaned up the code to be more idiomatic React. You can find the series of commits with in-depth comments on GitHub [1]. I may even write this up as a blog post on my website [2].

In short:

\- Don't pass around components and call methods on them; prefer to pass props instead

\- Conditional rendering instead of hiding, exactly as [3]

\- Use the JSX harmony transforms

\- Declare props

\- Use classSet

\- setState only needs to include props that change, rest stay the same

[1] [https://github.com/ianobermiller/reactexperiment/commits/](https://github.com/ianobermiller/reactexperiment/commits/)

[2] [http://ianobermiller.com](http://ianobermiller.com)

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

<comment><USER3> I agree with all of these changes. Code-style-wise, I prefer to call the actual handler implementations `handleFoo` as opposed to `onFoo`. It's a very small detail, but it makes code a little easier to sift through (as well as search/replace), because you always know that `onFoo` is a prop (whose implementation is foreign to the component) and `handleFoo` is a method (whose implementation is native to the component).

<comment><USER2> Not a bad idea. We would typically use _onClick for any component handler methods, so the _ would distinguish it. We have an internal transform that mangles anything in a module starting with _ so that it cannot be accessed outside.

<comment><USER3> I also prefix with _, if only to indicate what's private and what's API. Mind sharing your transform?

</comment></comment></comment></comment><comment><USER3> > I first tried to do this: [...] ...which actually worked, but generated a > React error message about an unmounted component.

I suspect that you were doing something wrong that triggered this error. Unmounting components based on state is perfectly idiomatic React, and I do it all the time:

        {this.state.mode === 'map' && <Map/>}

You pay for the added DOM work, of course, but this is usually negligible in my experience, especially in your case. You do have to make sure you follow the component lifecycle so that you don't try to use getDOMNode() or similar with a component that is not currently mounted.

<comment><USER4> How does React work under the hood. JavaScript would normally throw an error if it found <Map /> in the source code. How does React do this? Is it JS?

<comment><USER5> This is not React's, but a javascript preprocessor called JSX that compiles to JS (like LESS -> CSS).

[http://facebook.github.io/react/docs/jsx-in- depth.html](http://facebook.github.io/react/docs/jsx-in-depth.html)

Something like <Map foo={bar}/> would compile to a function call Map({foo: bar}). Behind the scenes, React is not dealing with HTML.

You can use React without JSX, but it's useful.

<comment><USER4> Is React a client-side framework, or server-side?

<comment><USER6> It's primarily client-side, but React components output a virtual representation of the DOM, so it's relatively simple to render a page on the server and return HTML.

</comment></comment></comment></comment></comment><comment><USER7> I see some criticism here but I think it is worth pointing out this looks like a person learning to use a new technology and sharing their experience, which is great.

Sometimes that means using non-idiomatic constructs or just having some rough edges. Please be considerate.

</comment><comment><USER8> I'm not particularly fond of the way React mixes presentation (returning nodes in render()) and logic. Particularly things like:

        var classes = _.reduce(["flipped","correct","wrong"],function(m,c){return m+(this.state[c]?c+" ":"");},"",this);

seem very inelegant compared to say, Angular's ngClass, which does the same thing in a data-driven way. But, that's not to say Angular is free from template logic either.

<comment><USER9> This isn't a React issue; this is a failure to use an abstraction where appropriate. React offers the classSet plugin for exactly this use case.

[http://facebook.github.io/react/docs/class-name- manipulation...](http://facebook.github.io/react/docs/class-name- manipulation.html)

I think the React authors agree that React classes shouldn't contain excessive logic; if your class does, consider extracting it to somewhere more appropriate.

<comment><USER10> Oh, indeed, I've completely missed the classSet plugin! That would indeed make the code more elegant. And fair point about the logic perhaps being too complicated here.

Thanx for the pointers!

</comment></comment></comment><comment><USER11> Why do

        className={this.state.playing ? "hidden" : "showing"}

instead of

      <div>
          {(this.state.playing
               ? <Board/>
               : <Wordform/> )}
      </div>

<comment><USER12> It is much simpler to animate between two classes in straight CSS. That's the primary reason I favor the `className` approach.

<comment><USER3> React has a solution for that which actually automatically applies class names as components are inserted and removed: [http://facebook.github.io/react/docs/animation.html](http://facebook.github.io/react/docs/animation.html). It's not perfect, and it's better than doing it manually.

</comment></comment></comment><comment><USER10> There's now a follow-up to this post, walking through a refactor based on the comments given here and elsewhere. Thank you all for the feedback!

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

</comment><comment><USER13> Doesn't work properly for me using FF 31.0

I can see the words on the tiles before clicking them.

<comment><USER10> Might be I've been sloppy with adding -moz- to some css rules. Will take a look!

<comment><USER14> Same, I can see the words (backwards) before clicking a tile. Chrome works fine, except it seems like after a match the first click on a tile doesn't do anything, and I have to click again to make it flip.

<comment><USER10> The not doing anything is intentional - only when the pair is resolved and the status row goes back to saying "choose a tile" can you click a new tile. This "feature" really needs to be communicated better though, sorry abouy that.

</comment></comment></comment></comment><comment><USER15> Off-topic: Why do people use lodash over underscore.js?</comment>


Bad "most popular" algorithm led to United Airline's stock collapsing. - <AUTHOR> http://online.wsj.com/article/SB122109238502221651.html?mod=hps_us_my_companies

<comment><USER2> "Tribune said it asked Google to stop using Google to crawl newspaper Web sites but Google continued to do so."

Wait, really? I find this disingenuous to say the least, coming from the same Tribune company that created a skunkworks project six months ago explicitly tasked with co-opting and "gaming" online communities of note (Digg, twitter, flickr and others.) They're desperate for pageviews. How many readers would they lose if the Googlebot actually kept out?

And can't they just block it out with a robot.txt file?

<comment><USER3> Maybe they did ask and Google didn't respond because they figured any idiot knows about the robot.txt file. Of course they weren't expecting the idiocy of the Tribune's web admin.

</comment></comment><comment><USER4> So, the Tribune put an _undated_ story on their front page under "top stories" and blames Google for not figuring out that the story was old? How would a human even realize that, let alone a bot?

If accounts of the story are accurate then the _only_ party that screwed up was the Tribune by a) using an absurdly naive "top story" algorithm and b) not dating their stories (pathetic for any site in this age, but a _newspaper_!?)

<comment><USER4> Here's the Sun-Sentinel approved story: [http://www.sun- sentinel.com/business/sfl-flzunited0909sbsep0...](http://www.sun- sentinel.com/business/sfl-flzunited0909sbsep09,0,7405794.story)

Apparently, we're supposed to guess article dates by reading the copy or look at the dates on the comments. Nonetheless, they appear to be dating all of their stories now.

</comment></comment><comment><USER5> It's incredible that this story had such a dramatic effect on UAL. This suggests a strategy:

      1. Plant bad stories about large companies.
      2. Buy put options and wait.
      3. Profit!

<comment><USER6> This is nothing new; it happens all the time, though usually with smaller companies. It's quite illegal, of course.</comment></comment>


Legal Systems very different from ours, because I just made them up - <AUTHOR> https://slatestarcodex.com/2020/03/30/legal-systems-very-different-from-ours-because-i-just-made-them-up/ <comment><USER2> This is easily one of the most amusing things I've read in a long while - clever, refreshing, no political/moral posturing, and still lightly thought- provoking.

</comment><comment><AUTHOR> I wonder what ideas can be adopted at the local or state level in the US. Cars already have liability and collision insurance similar to grievance and medical insurance as outlined in the Sanzorre example.

Flight insurance is similar but does not insulate the airlines. Would this work for workplace or patients i.e. workers and patients get grievance insurance in th US?</comment>