GE accidentally makes the case for not owning smart GE bulbs - <AUTHOR> https://www.theverge.com/2019/6/20/18692583/c-by-ge-reset-insanity-internet-of-shit <comment><USER2> I can't believe this is a thing that passed any internal approval...what an infuriating process. I'm curious how the cost of consumer education and returned-assumed-broken-products compare to just adding a damn reset button

Some youtube comments suggest this is intentional to make consumers buy a new bulb instead of suffering the procedure. If that were the case though, they wouldn't have bothered with a reset at all, just toss it like any other blub, and save on making help videos.

Other comments theorize was an internal-only process that was forced to be public because some later discovered bug; I disagree though, as two generations of bulbs use different versions of the timing (another, "whyyy??")

<comment><USER3> Have you tried to reset a Philips Hue switch? it does have a reset button but also requires precise timing to get it to the correct state.

<comment><USER4> Up, up, down, down, left, right, left, right, A, B, select, start? This IoT is growing into a parody of itself, without ever having worked.

</comment></comment></comment><comment><USER5> It seems odd that they need to have a signal to unilaterally reset the device, when all you really need is a signal to push it back into a "receptive" state, where it will accept commands such as "reset firmware" from any control hub that connects to it.

Then, all you need to do is use a signal such as "on-off a bunch of times", at which point it goes into receptive state for, say, 30 seconds, then returns to normal operations if nothing sends it a command.

Now, if your kids decide to flip the switch on and off a bunch, all you have is a 30 second window where normal commands don't work, after which everything goes back to normal with no real harm done.

<comment><USER6> I think the issue is that sort of behavior requires coherence it may not have and can fail if say its stacks are stuck in infinite loops. That approach seems a bit more like a "launch options" than a "reset" function.

A reset signal on the chip level essentially needs to takes priority over all other processes - since if they aren't responding to requests from entering undefined behavior it will never hand over. Then once reset is achieved it restores it to a base state - implying either a default state like say all 0s or all 1s works without any logic (probably not for internet of things) or it loads over a default state from a ROM.

<comment><USER5> The way I see it, if they're able to trigger a reset routine from a series of on-off signals, they can trigger any code path from it.

A base configuration wipe or code overwrite could just as easily be a call to a separate code process/stack that runs completely isolated from all configuration values and supports the primitive commands that you'd need anyway to configure the device to a deterministic state for your use case, or update the firmware, etc. If you're able to configure the device in the first place, you're able to trigger it again since nothing on that code path ever changes, has persistent state, or reads configuration values.

</comment></comment></comment><comment><USER7> Maybe this isn't the right thread for this, but it really bothers me what home IoT has become. The "connected home" should be designed solely for people with disabilities who can't see a thermostat or don't have motor control to work a lightswitch, and if it happens to be cool and trendy, that's a bonus. Instead it's this convoluted mess of many walled gardens for software engineers who don't get their fill of technology at work and want to keep working at home. Smart versions of fridges and TVs are objectively worse than non-smart, just a ploy to collect and sell data. They require tons of work to maintain and become disposable when the company moves onto a new line.

Thankfully I'm not handicapped and can use non-smart appliances, but it'd feel pretty bad to not be able to and have this kind of ecosystem as the solution.

</comment><comment><USER8> Coincidentally, I just had to do the same procedure for a LIFX BR30 smart bulb this morning. To be fair, I doubt the timing is actually that critical, and it's more easily summarized as "turn it on and off five times." Not the worst thing ever.

However, that was just to get started. WiFi setup from iOS failed with an "unknown error" multiple times. So I had to wait 20 (!) minutes for it to fall back to the old style open-AP type configuration, open the app, manually enter my SSID and passphrase...

I bought this one bulb as a curiosity, not expecting to be impressed, but honestly wasn't expecting to find an implementation as botched as this. The day/night cycle feature seems cool until it randomly stops working. The app often can't seem to figure out if the bulb is on the network or not.

Did I choose a lemon or is this par for the industry?

</comment><comment><USER9> It's an error recovery procedure, not something you usually need to do, so it's not important to make it quick an easy. It could be a couple steps fewer with shorter delays, but in general it's not a big deal.

What is important is that it shouldn't reset by accident, even if you have kids fascinated by light switches.

Using power on/off instead of a reset button on the bulb allows resetting of bulbs installed in hard to reach places.

</comment><comment><USER10> why not a tiny recessed button you push with an inserted paperclip ?

<comment><USER11> Inevitably someone would electrocute themselves while trying to reset it while still in a socket.

<comment><USER10> button is on the side and inaccessible while bulb is in socket</comment></comment></comment>


It's Time for Action on Data Privacy - <AUTHOR> http://time.com/collection/davos-2019/5502591/tim-cook-data-privacy/ <comment><USER2> Cook's version here is significantly stronger than Jobs'. Not that Jobs was wrong as far as he went, but merely being informed that you're about to be punched in the face doesn't actually make being punched in the face acceptable.

What we're missing today is the option to use normal products and services without any of this data sharing and telemetry going on when they aren't necessary for the normal functioning of the product or service, which the kinds that upset or concern people almost never are. We need to sever the ties between using everyday things and participating in data-based schemes that make the suppliers more money but are otherwise not necessary for what the customer was buying. Clearly the market has failed here and is in a race to the bottom, and that is the point where regulation/legislation should step in.

<comment><USER3> They are often "necessary" for monetization though, aren't they? A few privacy-minded people would probably pay a few bucks a month to use Google without tracking, ads etc, but I doubt that it would be a lot. And it wouldn't be cheap either, I'm afraid. Let's say you take what Gmail offers for free and buy it at ProtonMail - that'd be 20-30 euros a month just for Email. Who would spend hundreds of dollars a month to get today's average digital experience but with solid privacy? And who could actually afford to?

<comment><USER4> Be real on your price tag here, I pay 30€ a year (since around ten years) for an email/domain provider. More mainstream I also pay 2,99€ a month for iCloud storage wich also include email (should I wanted to) and lots of services.

Theses services are cheap, they are just not as mainstream as they should be. But your hundred dollar a month estimation is just a fear mongering excuse to stick with privacy reselling model.

On the side note, Google should start to wonder what drive the double digit growth of Apple services revenues. iTools was an experiment, .Mac was clumsy, MobileMe was a setback... But I think Apple pretty much nailed it with iCloud.

<comment><USER3> I'm not (knowingly) engaging in fear mongering, I just looked up what I'd pay at ProtonMail (privacy first) to have equal storage space I get at GMail (19GB; privacy last), and that's 20-30 euros. Looking at a web search engine, how much would that cost me? What about a place that syncs my images from my cell phone? Or Analytics for my blog? An OS for my smart phone? Google provides all that for free and finances it by mining the data users give them in return.

Apple gets something like $9bn a year to let Google be the default search engine. That's revenue for Apple, coming directly from Google's wish to get more data. If you remove that, will iphones be 10-20% more expensive?

</comment></comment></comment></comment><comment><USER5> The irony that the article isn't available in the EU because of data/privacy laws that time.com obviously thinks is too restricted so they decided to block the EU.

<comment><USER6> With uBlock Origin it works, a gray overlay on the page disappears after a while, but it still contacts:

\- Cloudflare

\- Google (several domains, fonts, Google proper, JS)

\- [https://segment.com](https://segment.com) (I read the landing page and don't understand what they do)

\- wordpress.com

12 other domains are blocked

<comment><USER7> I think of Segment kind of like a routing layer for behavioral tracking data. Rather than installing N trackers on your site, you just add Segment's and then in your configuration for Segment you tell them where to route the tracking events (to Google Analytics, Mixpanel, whatever).

I think it goes beyond behavioral tracking data use cases as well.

</comment></comment></comment><comment><USER8> Even if qualified as an instance of "do good and talk about it", Tim Cook's stance on this matter is rather untypical for not only the IT industry (see other comments in this thread). I for one see no alternative to legal regulations for stopping this race to the bottom.

</comment><comment><USER9> And it is time for running whatever we want on our device.

<comment><USER10> Tell that to the manufacturers of TVs, cars, home alarms, AV receivers, smart watches, digital cameras, smart home devices, dash cams, game consoles, universal remotes, cordless phones, cable tv boxes, baby monitors and printers.

The world is full of devices that are not open platforms for alternative operating systems. If you don't like Apple's choice in focusing on their particular solution which involves intimate software-hardware integration, the answer is to buy from a competitor. There are lots of them and they make an extremely diverse array of alternatives.

Personally I'm pleased that Apple is making the product the way they do. If Apple changed to suit your needs, that would come at the expense of my needs.

<comment><USER9> well, phones and pads are good starters

update: I compare it to computing slavery.

<comment><USER10> You don't need to demand Apple change. There are countless phones and pads available from other companies, many of which will satisfy your requirements.

<comment><USER9> Look, I am not saying these things to satisfy my personal needs, and I am not demanding Apple anything, that's only a piece of advice. A reminder that there is a bigger elephant in the room. I have been using Android since my iphone6 retired, and everything is great.

</comment></comment></comment></comment></comment><comment><USER11> Also time to give up user data to the Chinese government, apparently.

[https://iphone.appleinsider.com/articles/18/02/24/apple- to-m...](https://iphone.appleinsider.com/articles/18/02/24/apple-to-move- chinese-icloud-keys-to-china-servers-opens-door-to-government-data-requests)

<comment><USER10> Only if you're a Chinese citizen in China.

From the article: _" Apple to move Chinese iCloud keys to China servers...Once on Chinese soil, government agencies will be able to request information through the Chinese legal system, which lacks the transparency, checks or oversight of its American counterpart."_

If you think the US Government would never act without transparency, checks or oversight, you are being delusional. And factually wrong.

Apple is complying with the local laws, just as it does in all other countries. The suggestion that Apple should breach these laws—or exit the market entirely—is absurd and unproductive.

<comment><USER12> Have you tried replacing "China" with "Hitler Germany" in your argument? Do you think it still applies? Or can you explain why not?

<comment><USER11> Interestingly, IBM successfully used similar arguments after WW2 and escaped with barely a scratch on their reputation.

</comment></comment></comment></comment><comment><USER13> He says there should be a

"Federal Clearinghouse"

Where users can

"Correct and delete personal data online"

How does that not definitionally centralize data...

Straight into Governments' view?

</comment><comment><USER14> Can Apple refuse to give information to the US government? Can they even disclose it if they do? After the Snowden NSA revelations it seems any corporation in the US is suspect. And that's not even counting the fact that all the telecoms sell your data anyway.

<comment><USER15> I don't think so, no. But I believe that they are moving towards the goal of keeping data in an encrypted format that they cannot read themselves, or not collecting it all.

</comment></comment><comment><USER16> Is "content" "data"? (Assume "content" is something the user generates and intentionally shares with one or more other users via a computer network. It could be a text message, a web page, a PDF, a photo, a video, whatever.)

For example, when he says companies should avoid collecting identifiable data is he arguing against companies that collect user "content" (e.g., a cache of googleusercontent webpages, or a backup of photos stored in an Apple iCloud datacenter)?

Or is he arguing against promoting user "accounts" where users identify themselves to companies to receieve the "benefits of signing in" or perhaps as a absolute requirement for access to "content" created by someone else via the company middleman?

Much of the "data" that concerns privacy activists is what they might call "metadata". It is not the collection of "content" that alarms them, and no doubt the companies collecting it would remind us this content has been voluntarily shared.

However... without the collection of "content" first by a middleman, there is no metadata for these companies to collect.

We could have a debate about regulating the middlemen. We could try to define what their obligations should be toward users. A more interesting conversation IMO would be about how we can use technology to _eliminate_ the middleman.

</comment><comment><USER17> Tim Cook has been a single light of hope in this vast dark ocean of surveillance capitalism. I'm so tired of hearing the "nothing to hide, nothing to fear" type responses.

Privacy is not "hiding." I shouldn't have to hide to keep my business, well, my business. I believe I have the right to carry on with my life without this all-seeing eye recording every part of me and using it to con me into buying, or selling it to the highest bidder.

I was such an idealist about freeing information and empowering people. And I'm no fan of government regulation. But we know business won't regulate itself when it's either the bottom line or what's best for people.

Yes, it's time for action.

<comment><USER18> My understanding is that it is only after Apple failed at setting up their own advertising business that they jumped into the privacy bandwagon.

Now I agree that when you want to achieve something, there is nothing to be gained from questioning the motivations of powerful allies (which in this case I think are more about attacking the competition than guenine concerns about privacy). But it does mean that Apple's stance could change quickly if its business interest evolves.

Not complaining, I am all for privacy regulations, merely a word of caution.

<comment><USER19> _My understanding is that it is only after Apple failed at setting up their own advertising business that they jumped into the privacy bandwagon._

\- Introduction iAd: 2010

\- Introduction of iMessage with end-to-end encryption: 2011

\- Introduction of the secure enclave: 2013 (iPhone 5s). Remember that Apple plans several years ahead, so the secure enclave was probably already in the cards ~2011.

\- Shutdown iAd: 2016

The timelines just don't match up. Apple has been pursuing a focus on encryption and privacy since at least 2011. Remember that Apple was the first to roll out an end-to-end encrypted messenger to hunderds of million users, years before WhatsApp.

(I am not contesting that their focus on privacy is for marketing reasons. We don't know, it could be or Tim Cook has strong beliefs on this topic.)

</comment></comment></comment><comment><USER20> Apple failed at the business of mining users private data, its CEO takes a moral stance against it.

<comment><USER21> On some level you take what you can get.

</comment></comment><comment><USER22> We already have a good definition and framework for privacy, thanks Tim.

We don't need a watered-down definition that plays to your current business model and leaves out bits that don't.

[https://ico.org.uk/for-organisations/guide-to-data- protectio...](https://ico.org.uk/for-organisations/guide-to-data- protection/guide-to-the-general-data-protection-regulation-gdpr/)

</comment><comment><USER23> Which roughly translates to: "competing devices are too cheap".

<comment><USER15> You're going to have to provide more context here, since otherwise your comment doesn't seem very substantial.

</comment></comment><comment><USER24> continue button doesnt even work without disabling all my browser security. no thanks.</comment>


Time to tame the NSA behemoth trampling our rights - <AUTHOR> http://www.theguardian.com/commentisfree/2013/sep/13/nsa-behemoth-trampling-rights

<comment><USER2> "Given the persistent lying and strategic errors of judgment that this week's revelations disclosed, the NSA needs to be put into receivership. Insiders, beginning at the very top, need to be removed and excluded from the restructuring process. Their expertise led to this mess, and would be a hindrance, not a help, in cleaning it up."

And that is why reforming institutions in a rentier society that has given itself wholly to institutional corruption is difficult. It's literally unimaginable to people at the top of the pyramid that any of their peers should be stripped of their powers _as_a_group_; or that an institution whose function is the maintenance of elite control should be restructured.

That someone of the stature of Professor Benkler is calling for a restructuring of the Intelligence Community as it stands now, is a big deal. It is direly needed, let us hope it happens before the US of A falls to an even more authoritarian government; or worse, a dictator in deed if not in name.</comment>


Pelican imaging array will potentially be used on Google Project Ara - <AUTHOR> http://www.modularandroid.com/pelican-imaging-array-camera-module-for-googles-ara-modular-smartphone/

<comment><AUTHOR> The potential with this imaging array on a smartphone is kinda limitless. I was in love first time I saw it :)</comment>


Ask HN: Suggestions for books about API design? - <AUTHOR> In my case I'm specifically building a REST API with Lambda, but I'd be interested in any API design books you found valuable. <comment><USER3> Not a book, but the best recorded talk ever given about API design is (IMO) by Joshua Bloch, in a 2007 tech talk at Google. "How to Design a Good API and Why It Matters".

He was one of the creators of the Java Collections API and the Java Executor Framework, two of the most durable and most widely-copied APIs ever. That may not seem relevant for an HTTP/REST API, but it is. The design principles are timeless. Here's that reference:

[https://twitter.com/amontalenti/status/1260030567501840386?s...](https://twitter.com/amontalenti/status/1260030567501840386?s=19)

When I had to design a widely-used "HTTP/RESTful" API a few years back, I wrote a summary of the design principles here. It also includes a reference to an old O'Reilly book on the topic, which I summarized:

[https://www.parse.ly/help/api/restful- apis](https://www.parse.ly/help/api/restful-apis)

<comment><USER4> I really cannot agree with the "just use GET" suggestion. GET must not be used for actions that modify the data server-side. Also, POST and PUT means some action is or is not idempotent.

Using different methods than GET is easy in the browser (easier than JSON-P) and avoids a huge class of problems that come with abusing GET.

<comment><USER3> Yes, honestly this was written at a time when browsers (specifically, the XHR API) did not support non-GET requests reliably at all (e.g. pre-CORS), so there was no other option. (And once you publish an API, it's hard to change.) You're right that today there is better support for POST/PUT, although there might still be some issues lurking in the corners.

<comment><USER5> I don't think there's ever been a time browsers haven't reliably supported POST.

<comment><USER6> I dimly recall a pre-form web, but it could easily be they just took over a little-used Berners-Lee verb. (For instance, PUT support was atrocious for a while.)

<comment><USER3> This is not about pre-form web. It's about pre-CORS web. Which is pretty recent web. CORS was "widely & properly" supported by "recently released" browsers around 2012-2013. Of course it's only as of very recently that you could safely assume 2010-2013 browser versions were completely out of circulation.

<comment><USER6> My bad; hadn't parent'ed enough, and the "using different methods than GET" clarification would not have been anachronistic even in the previous century.

</comment></comment></comment></comment></comment></comment></comment><comment><USER7> Don Norman's "The Design of Everyday Things" ([https://en.m.wikipedia.org/wiki/The_Design_of_Everyday_Thing...](https://en.m.wikipedia.org/wiki/The_Design_of_Everyday_Things)). Yes, API design has its own gotchas and specific practices—but some of the best (and worst) APIs I've ever interacted with were good (or bad) for the same reasons any kind of design can be good ( or bad): affordances, feedback, coherent conceptual models, and so on.

<comment><USER8> Yep, I second this. Don Norman _really_ and _truly_ understood the user in the deepest way. It's hard to find people like him who put their entire consciousness in the shoes of the user, simulate what the user goes through when interacting with the world and provide insights about how, we the designers, on the opposite aisle think about design as not some aesthetic shit but as a tool to solve problems.

Design and designers, vast majority of them are chasing aesthetics and trends. Just go on Behance to see it for yourself.

<comment><USER9> That's about as accurate a judgment on designers as calling programmers "code monkeys."

Follow a couple designers on Twitter for a few weeks and you're almost guaranteed to see someone quote Steve Jobs saying "Design is not just what it looks like and feels like. Design is how it works."

All designers know that.

<comment><USER10> To be fair, most programmers are code monkeys. But that's true for most people in any profession. It's not a fair comparison to compare the average worker to workers of excellence.

</comment></comment></comment></comment><comment><USER11> Stripe blog posts are unparalleled

[https://stripe.com/blog/api-versioning](https://stripe.com/blog/api- versioning)

[https://stripe.com/blog/idempotency](https://stripe.com/blog/idempotency)

It goes beyond "what is rest" and real life UX of apis

</comment><comment><USER12> I'd highly recommend reading Roy Fielding's dissertation paper where he introduced REST.

For anyone who hasn't read it, it will fundamentally change how you think about REST and APIs for network services, and you'll create much better APIs armed with that deeper understanding.

Paper: [https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm](https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm)

Chapter introducing REST: [https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arc...](https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm)

<comment><USER13> Do you think it's still relevant for modern client web apps / data backend (I have no doubt it is for websites though).

<comment><USER12> REST is fundamentally about how do to useful communication between networked services. I'd recommend reading the paper for anyone doing anything related to that. I happen to use GraphQL at work, but that doesn't stop me from learning a lot from the paper.

</comment></comment></comment><comment><USER14> [https://apisyouwonthate.com](https://apisyouwonthate.com) and their book(s) offer good advices.

Not a book, but MS REST API Guidelines are pretty good although they don't cover funky important details like how to properly do REST operations/actions.

[https://github.com/microsoft/api- guidelines](https://github.com/microsoft/api-guidelines)

This is short one based on RedHat VM engineer experience:

[https://restful-api- design.readthedocs.io/en/latest/intro.ht...](https://restful-api- design.readthedocs.io/en/latest/intro.html)

Manning has a solid books on topic:

[https://www.manning.com/books/the-design-of-web- apis](https://www.manning.com/books/the-design-of-web-apis)

[https://www.manning.com/books/api-design- patterns](https://www.manning.com/books/api-design-patterns)

</comment><comment><USER15> I've found [https://aip.dev](https://aip.dev) really useful! In fact this is a canonical resource for building REST apis at Google.

</comment><comment><USER16> I would suggest having a close look at the OpenAPI specification as a way to bound and constrain your REST API design: [https://swagger.io/specification/](https://swagger.io/specification/)

Once you start thinking in terms of requests, responses, parameters, schemas etc the rest should easily fall into place! You also get the benefit of having a machine readable definition of your API if you write your design with the spec.

</comment><comment><USER17> About REST : REST API Design Rulebook by Mark Massé (O'Reilly).

My reference when I'm designing a REST API.

[https://www.oreilly.com/library/view/rest-api- design/9781449...](https://www.oreilly.com/library/view/rest-api- design/9781449317904/)

<comment><USER18> Agreed. Simple and clean, with an approach that makes for consistency.

</comment></comment><comment><USER19> Domain Driven Design: [https://smile.amazon.com/Domain-Driven-Design-Tackling- Compl...](https://smile.amazon.com/Domain-Driven-Design-Tackling-Complexity- Software/dp/0321125215)

It's not about designing APIs, it's about designing your software to reflect the reality you're encoding into your software. It's a book of first principles that you can apply to any software you design.

</comment><comment><USER20> Not a book, but the current issue of [https://increment.com/](https://increment.com/) is about APIs.

<comment><USER21> I hadn't heard of Increment before. They have some very interesting articles! I like how they group a number of articles from different authors on a related topic. Thanks for sharing.

</comment></comment><comment><USER22> I found JSON:API to be a great starting point, especially for small teams that want to get started right away. You can either adopt it or use it as a guideline for all the topics you need to consider.

[https://jsonapi.org/format/](https://jsonapi.org/format/)

</comment><comment><USER23> The Little Manual of API design

You can read it in an hour or two. It cover a lot of things that you should consider

<comment><USER24> Which one? There is 20 of them.

<comment><USER25> I was looking for this specific title in the suggestions, as I got this recommended myself a few years back. If we have the same little manual in mind, it's by Jasmin Blanchette. I can't say anything about the other 19.

</comment></comment></comment><comment><USER26> Check out Google AIP

[https://google.aip.dev/general](https://google.aip.dev/general)

</comment><comment><USER27> A philosophy of software design - John Ousterhout

This has an interesting generic discussion of API design which is technology agnostic.

<comment><USER28> The most influential technical book I have read over the past 10 years for sure. The author guides the reader though the process of managing complexity with some intriguing concepts such as "Define errors out of existence" and "Deep modules". I definitely recommend it.

</comment></comment><comment><USER29> Do people still design rest-ful APIs? I often find I end up needing to do RPC- like things that make the API end up as a weird hybrid. I'm on the verge of abandoning the idea of trying to be rest-ful at all, so it's less incohesive.

<comment><USER30> Honestly, prefer GraphQL -- it's more like designing a schema which you may already be doing in your database anyway. The client decides which data in what shape it fetches.

<comment><USER31> If you're designing an internal API to power a rich client app, yes. If you're designing an API for developers to interface with you SaaS, plain old HTTP is a better choice, even if it's only RESTful in a hand wavy sense.

<comment><USER30> Yeah, agree - if your product is an api, I'd have REST first, then graphql later perhaps if people are interested in that.

</comment></comment></comment></comment><comment><USER32> I don't have any book recommendations to make since API design is more art than science. As such I'd recommend that you beta test the API (route names, payloads, etc) with a few potential users to gauge durability and the ease with which users can intuit. The last thing you want is to release new version quickly or to require users to always refer to your documentation.

Some of these problems can be solved with an SDK (highly recommend, as it can greatly improve developer experience especially in a modern text editor or IDE) or switching to GraphQL (not without its own problems).

</comment><comment><USER33> If you use gRPC, I think you can see Google API Design [1] useful.

[1] [https://cloud.google.com/apis/design](https://cloud.google.com/apis/design)

</comment><comment><USER34> Consumer centric API design

[https://github.com/tlhunter/consumer-centric-api- design](https://github.com/tlhunter/consumer-centric-api-design)

<comment><USER35> I just read through a good chunk of this, hoping it'd be a good resource.

There's a lot of good stuff in here:

\- Higher level than a spec, but still detailed.

\- He outlines the anatomy of an HTTP request and gives examples.

\- Lots of good suggestions of conventions and rules of thumb, e.g. for URL structure and naming.

\- Good demonstration of why using fitting HTTP verbs is important. Explains idempotent and safe.

On the flip side, his ethos isn't the best at points, he presents some subjective takes as fact, and even includes some plain errors against the specification.

For example:

\- JSON keys should be snake cased, or camelCased "if you're one of _those_ people". (I'm a snake case guy, but really?)

\- Return a 400 if there are any problems with the request. (400 explicitly means request body can't be parsed, e.g. syntax error in your JSON. The spec isn't perfect, but 422 is often more fitting if the consumer input didn't pass validation. Either way 400 clearly violates the spec.)

\- He misses the nuance of what PUT is in the spec. You're saying "store this resource at this URL". Not technically update. Although in practice it's usually update, and I'm sure this point will be viewed as pedantic by many.

Overall a decent resource, but take it with a grain of salt.

</comment></comment><comment><USER36> This book is really good: [https://www.manning.com/books/the-design-of-web- apis](https://www.manning.com/books/the-design-of-web-apis)

It even spends the first few chapters talking about API design in general (not just for REST) with really great, intuitive examples.

</comment><comment><USER37> Please check "The C Interfaces and Implementations" book by David Hanson [1]. Someone has implemented the concept using his library that you can check and use [2].

Another excellent reference is the "The Linux Programming Interface" book by Michael Kerrisk that documents most of the API available under Linux [3].

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

[2][https://github.com/gon1332/gonlibs](https://github.com/gon1332/gonlibs)

[3][https://www.amazon.com/Linux-Programming-Interface-System- Ha...](https://www.amazon.com/Linux-Programming-Interface-System- Handbook/dp/1593272200)

</comment><comment><USER38> API design in C++ by Martin Reddy is a good text.

<comment><USER39> Agree. It is very good, but I think thee things he is concerned with are very c++ specific.

</comment></comment><comment><USER40> Maybe Lauret's _The Design of Web APIs_? [0]

[0]: [https://www.manning.com/books/the-design-of-web- apis](https://www.manning.com/books/the-design-of-web-apis)

</comment><comment><USER41> Ebook from APIGee is pretty good, at least for me.

[https://pages.apigee.com/web-api-design- register.html](https://pages.apigee.com/web-api-design-register.html)

</comment><comment><USER42> Great recommendations! For another perspective, I'd add O'Reilly's "Continuous API Management" with some chapters around designing APIs as products and suggestions around how to implement a lifecycle. Also, strictly for design I'd also do what was suggested here and check API design guidelines from several sources. I like the Adidas one.

</comment><comment><USER43> I analyzed 24 blog posts on API design (rest/graphql/rpc) and compiled a list of the books they recommended (sorted by the most popular ones first) [https://www.readthistwice.com/lists/best-api-design- books](https://www.readthistwice.com/lists/best-api-design-books).

</comment><comment><USER44> I really liked: The REST API Design Handbook by George Reese.

It is everything you need to know and thinks about the angle of the people who need to consume your API. Quick read too.

[https://www.amazon.com/REST-API-Design-Handbook- ebook/dp/B00...](https://www.amazon.com/REST-API-Design-Handbook- ebook/dp/B00890OBFI)

</comment><comment><USER45> Ignore the fact that this is a book about .NET, it's an excellent source of wisdom about the design of APIs:

[https://www.amazon.com/dp/0321545613/ref=cm_sw_r_cp_apa_i_wn...](https://www.amazon.com/dp/0321545613/ref=cm_sw_r_cp_apa_i_wnivFbAXFCB24)

</comment><comment><USER46> for REST APIs, [https://apisyouwonthate.com/books/build-apis-you-wont- hate](https://apisyouwonthate.com/books/build-apis-you-wont-hate) book is my recommendation if you haven't read it already. I read it as a beginner, so it was kind of an eye opener for me on why we should do things a certain way when it comes to API.

</comment><comment><USER47> Not a book, but the best advice on API design I've ever seen was in 2004 by Casey Muratori on his talk "Designing and Evaluating Reusable Components".

[https://www.youtube.com/watch?v=ZQ5_u8Lgvyk](https://www.youtube.com/watch?v=ZQ5_u8Lgvyk)

</comment><comment><USER48> Not a book, but this is a great talk about [How to Design Great APIs - <USER2> Developer Day 2013]([https://www.youtube.com/watch?v=qCdpTji8nxo](https://www.youtube.com/watch?v=qCdpTji8nxo))

</comment><comment><USER49> I like Framework Design Guidelines by Cwalina, Barton, and Abrams. The 3rd edition was recently released.

It's targeted at developing .NET frameworks with a broad audience so some of the guidelines aren't appropriate for internal APIs or applications.

</comment><comment><USER50> Casey Muratori (Rad Game Tools, Handmade Hero) talk from 2004 covers reusability and design for ease of use.

[https://caseymuratori.com/blog_0024](https://caseymuratori.com/blog_0024)

</comment><comment><USER51> I wrote a popular blog post on this one:

[https://www.vinaysahni.com/best-practices-for-a-pragmatic- re...](https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api)

</comment><comment><USER52> Moesif has many free resources for API design, development, and maintenence.

[https://www.moesif.com/blog/api-guide/](https://www.moesif.com/blog/api- guide/)

</comment><comment> ayush--s [https://github.com/microsoft/api- guidelines](https://github.com/microsoft/api-guidelines)

REST API guidelines from Microsoft

</comment><comment><USER53> Google published their guidelines for designing APIs [0]

[0] [https://cloud.google.com/apis/design](https://cloud.google.com/apis/design)

</comment><comment><USER54> Sure, read some books.

But know that they're all wrong. Some fatally.

The best you can do, ever, is to be consistent. So pick a style and stick to it. Honor the principle of least astonishment.</comment>


Generation crunch: young UK grads face crisis in hunt for work - <AUTHOR> http://www.guardian.co.uk/education/2009/jan/10/graduate-employment-crisis-rescue-package

<comment><USER2> That's a bizarre comment from Malcolm Grant. UCL firmly believes there are only two universities in the world, itself and Harvard, and it's not really sure about the latter.</comment>


Create Statistics in PostgreSQL 10 - <AUTHOR> https://www.citusdata.com/blog/2018/03/06/postgres-planner-and-its-usage-of-statistics/ <comment><USER2> The biggest issue related to statistics I've encountered is when using jsonb columns. As far as I understand they have a hardcoded statistic, which can cause pretty bad plans if your data isn't close to that value. You can create an index on individual keys in the jsonb column, which do have their own statistic, but that is not really an option for most cases where you'd use jsonb in the first place.

Bad statistics can really mess up queries, so any tool to fix this kind of situation is very welcome. I don't think this specific tool would help with this variant of bad statistics, unfortunately.

<comment><USER3> [https://blog.anayrat.info/en/2017/11/26/postgresql--- jsonb-a...](https://blog.anayrat.info/en/2017/11/26/postgresql---jsonb-and- statistics/) explains this problem in more detail.

</comment></comment><comment><USER4> Will that slow down inserts? Or am I understanding it wrong and this is just one time generation like vacuum analyze?

<comment><USER5> The latter. What would slow down inserts is excessive indexing

<comment><USER4> Yeah, been there. Kinda too bad that it's just a one time thing. But even if it wouldn't be, I forgot that unlike index update it doesn't have to block transaction, it can be updated whenever later and doesn't have to be done after each insert.

Anyway, postgres team is doing awesome things. So much great functionality while keeping it rock stable. Kudos.

<comment><USER5> I assume once you've told it once it will maintain them when it autovacuums. But the correlations shouldn't change that much if the source data is genuinely connected

</comment></comment></comment></comment><comment><USER6> Very cool feature which will help certain use cases which have no other way of improving the plan chosen without changing the way the data is stored.</comment>


Start Shout - What Happened? - <AUTHOR>

Just went over to recently launched StartShout.com, started by HN user 'str'.  The message on the site says that it's "Coming Soon", and that the site isn't configured.<p>I'm launching tomorrow, and I need it.  Does anybody know what happened?  Or does anybody have a copy of the list? <comment><USER2> I guess the site has been shut down, If your product is related to social networking, contact me at fastgush.com</comment>


Apple engineer killed in Tesla SUV crash was playing videogame - <AUTHOR> https://www.marketwatch.com/story/guid/6AA12BB8-5803-11EA-BF64-5AC3A6D77C0D <comment><USER2> Tesla refuses to add driver monitoring like others do and calls driving assistance Autopilot.

It's common human bias to fall a sleep or do something else as long as the car works 99.9% of the time and you have noting to do. You can go on days, weeks, months even years without accidents and then you die or get injured.</comment>


8 Reasons Why Code Breaks - <AUTHOR> https://www.git-tower.com/blog/reasons-why-code-breaks/ <comment><USER2> Add also "code is not documented"? While that by itself may not cause bugs, but will certainly make life more difficult for users and maintainers, esp. if they are not the original author.</comment>


Exarcheia: the self-governing community Athens police want rid of - <AUTHOR> https://www.theguardian.com/cities/2019/aug/26/athens-police-poised-to-evict-refugees-from-squatted-housing-projects <comment><USER2> Real estate at this part of Athens should be very depreciated.</comment>


What's coming up for RethinkDB in 2015 [video] - <AUTHOR> https://www.youtube.com/watch?v=GuDP6hyxcng

<comment><USER2> Hey all, Slava @ RethinkDB here (speaker in the video).

We've been working on realtime push functionality for a while and are very excited to release it in a few weeks!

I'm an Oakdale RethinkDB meetup ([http://www.meetup.com/GDG- Oakdale/events/219317732/](http://www.meetup.com/GDG- Oakdale/events/219317732/)) right now so may not be able to answer questions in realtime, but I'll go through every question later tonight in case other Rethinkers miss some questions.

<comment><AUTHOR> Hey Slava, thanks to you and the team for all the hard work! Watched the video a little while ago with introductions to all the great features, excited to use the new stream functionality!

</comment></comment><comment><USER3> Real-time updates to queries looks awesome. Way simpler than doing pushing updates through pubsub. Great work, guys!

<comment><USER4> It looks really awesome, I can't wait to check it out! Great work by the team at Rethink.

</comment></comment><comment><USER5> Really cool, instead of polling for changes, RethinkDB will push. The best part, you simply add .changes() to your query and it just magically works. Curious though how the clients work? Do they just block waiting for data?

<comment><USER6> The Ruby and Python clients will block if you try to fetch the next change and there isn't one available. You can prevent this by using a separate thread for the blocking request. The node.js client uses a callback.

We're currently considering alternatives. See <[https://github.com/rethinkdb/rethinkdb/issues/3298>](https://github.com/rethinkdb/rethinkdb/issues/3298>).

<comment><USER5> And any support planned for the red-headed stepchild php?

<comment><USER7> Have you tried [http://php-rql.dnsalias.net/](http://php-rql.dnsalias.net/) ? It's pretty much equivalent to the official drivers, and well maintained (usually gets updated within a week after new RethinkDB releases).

</comment></comment></comment></comment><comment><USER8> In the video he calls changes() on a query that has an orderBy and limit filter. In the description for Changefeeds ([http://rethinkdb.com/docs/changefeeds/javascript/](http://rethinkdb.com/docs/changefeeds/javascript/)), it says this is not possible. Is this new functionality? If so, that's pretty great. Using the diff format makes that pretty intuitive (even if the client will be slightly harder to implement).

<comment><USER6> Yes, this is new functionality that will be released as part of RethinkDB 1.16. RethinkDB 1.16 is expected to ship in a couple of weeks.

<comment><USER9> How do you handle disconnects and missed messages? What's required to make this a robust sync solution, including syncing the first query and then changes, akin to Firebase? Are there plans to support direct access from web clients and optimistic writes on the client?

<comment><USER6> Right now you have to start over if your changefeed gets disconnected. But we're discussing better options; see <[https://github.com/rethinkdb/rethinkdb/issues/3471>](https://github.com/rethinkdb/rethinkdb/issues/3471>).

We don't have any plans to support direct access from web clients. The main problem is security. RethinkDB doesn't have any notion of users or access privileges, so any client can e.g. drop a table. We might add this eventually, but it's low on the priority list. See <[https://github.com/rethinkdb/rethinkdb/issues/266>](https://github.com/rethinkdb/rethinkdb/issues/266>) for more discussion.

</comment></comment></comment></comment><comment><USER10> Is there a slidedeck or blog I can read about this presentation? I want to learn but don't have time to watch the video now.

<comment><AUTHOR> Here's the documentation on changefeeds, which was a lot of what the presentation was focused on:

[http://rethinkdb.com/docs/changefeeds/](http://rethinkdb.com/docs/changefeeds/)

<comment><USER6> This documentation is for RethinkDB 1.15, but the cool features in Slava's presentation are arriving in RethinkDB 1.16.

<comment><AUTHOR> Accurate - I don't think there's documentation for the 1.16 stuff yet? Though the code is available in the nightlies supposedly</comment></comment></comment></comment>


3D airplane visualization - <AUTHOR> https://mdbootstrap.com/snippets/jquery/ascensus/212648 <comment><USER2> What's the interesting part here? It uses Three.js to display a wireframe model.

<comment><USER3> It's not even an original model, it's from here: [https://github.com/baronwatts/models](https://github.com/baronwatts/models)

</comment></comment><comment><USER4> As someone that usually picked the tail of the airplane and flew around the world many times, let me tell you one thing... If you don't like turbulences, the back is often a little more sickening than at the wings.

Maybe someone who did the math can confirm or deny... it's just a feeling.

<comment><USER5> I get sick in 10 mins on an airplane. Sitting on the wings helps tremendously. Sat in the tail once, never again. The front is okay as well for me but i can orient myself better on the wings and there is a lot less movement.

</comment></comment><comment><USER6> Given how detailed the mesh is, I find it surprising that you cannot translate the camera. Unless I'm missing some controls somewhere, I seem to be limited at rotating and zooming about the origin.

I tried click-drag, WSAD and arrow keys. Unfortunate that so much work went into building the mesh, yet the tool provides no method to explore it fully. It's a tease!

<comment><USER7> >Unfortunate that so much work went into building the mesh

As others have pointed out the mesh is from here: [https://github.com/baronwatts/models](https://github.com/baronwatts/models)

</comment></comment><comment><USER8> It's of course somwhat useless in fulfilling its putative purpose: apparently, seat-level data isn't available, making this a somewhat overwrought visualization for the data. And the most visible feature are colored seats, but the color does not communicate anything. You have to click on each button to get a single data point each, shown in easy-to-miss text above the useless model.

Why not invest the time to find an example that is actually useful? There is seatguru(?) that has all sorts of seat-level data available , I believe.

</comment><comment><USER9> site breaks back button

<comment><AUTHOR> what do you mean?

</comment></comment><comment><USER10> responsive in mobile and quite addictive to play in mobile

good job

<comment><USER11> Very good. Not sure someone said it is just ... may be it is just ... but it is still quite good.

</comment></comment><comment><USER12> very 90s looks nice

<comment><USER13> You must have had pretty modern 90s. My 90s looked like this:

[https://www.forum64.de/index.php?thread/58960-giga-cad- plus-...](https://www.forum64.de/index.php?thread/58960-giga-cad-plus- converter-v1-0-1-hires-multi-1fach-hires-4-fach-und-10-fach-zu-png/)

<comment><USER12> [https://networkchatter.wordpress.com/category/cad/](https://networkchatter.wordpress.com/category/cad/)

<comment><USER11> Not want to involve in argument but it really depend upon where you work. Someone are evaluating autocad in 1985 I believe when we are using cadcam in mainframe. The Ibm has to be upgraded all the times. Well, from building point of view one floor cost More than the whole Ibm mainframe and we are building whole housing estate. Those are still standing and housed 1/2 million people.

But what surprise me not is how giving up or not pursue Priate help autocad due to the key is Human Resources. That is why apple Xcode is so much cf visual studio until lately. That is why open source is nothing about business but mind share.

Bim bim bim. Sigh. As support guy it is not sure how to do it. But it is coming. Welcome come to 21st cen. Can it run under Js and the 24 inch windows surface station. Wonder today.

<comment><AUTHOR> besides that, it ultimately isn't done with autocad ;)

</comment></comment></comment></comment></comment><comment><USER14> Some people have way too much time on their hands. Next time I buy airline tickets, I will have seats in the back though.

<comment><USER15> I've watched a youtube video about the chances to survive a fall from/or with airplane parts (sorry forgot the channel but it was some physics channel) and the reason seems to be that airplanes tend to break in the middle while the rear of the plane tends to stay in one piece. So you still have some protective shell around you if the plane has a crash that is at least to some degree survivable.

<comment><USER16> Yeah, I prefer to sit in the last few rows. But my wife, she likes the first few rows, because it's less hassle. So we alternate, depending on who makes reservations.</comment></comment></comment>


The maker/manager transition phase - <AUTHOR> http://joel.is/post/36051780992/the-maker-manager-transition-phase

<comment><USER2> Right now, I'm the CTO of a small startup in NYC. I'm probably 80% development, 30% other.

When I've been on bigger teams, it's probably more like 10-15% coding, 120% other.

I find that it's beneficial for me to always be in the code even as the team grows - even just a little bit. But, I usually take on small "nice to haves" (or small bugs) that no one relies upon and isn't critical to the product. So when it takes me a month to write it, no one cares.

In the least, it forces me to understand how to keep the system up and running on my machine and answer/demo general purpose stuff to other folks without looking like an idiot.

If you're a technical manager, I think dropping to 0% coding is a bad thing. It's way too easy to get out of touch.

<comment><USER3> I totally agree with this. There is no bigger disservice to your team or company than being the guy in charge whose knowledge is 10 years out of date.

That doesn't just apply to technical things either. It's an easy example to talk about the project manager who cut his teeth writing procedural code in QBASIC and has an unrealistic grounding. It also applies to the store manager in a fast food restaurant who hasn't made a cheeseburger.

<comment><USER4> I think those are two different jobs. On one hand you have the Product Leader, whose job it is to stay on top of the technology that drives the product, and to be aware of the codebase. On the other hand, you have the Team Leader, whose job it is to facilitate communication between team members. To make sure team members are productive and happy.

</comment></comment></comment><comment><USER5> Two points to augment the article:

1) It's too easy to fall into the pattern of _bullsh%t by day, hacking by night._ There are two problems with that. First, you're still seeing management as bullsh%t (a natural inclination for a hacker.) Second, it's unsustainable and overwhelming. If you find yourself feeling like you never get anything done while other people are around, then your job is no longer coding and you have to accelerate the transition to manager (especially in your own mind.) This has been my experience.

2) Not every engineer should make this transition. If you're a founder or CEO, you will have to, but make sure you build a company where every engineer does not have to. I've worked at companies where the only path to success was through delegation and distance from the code. That sucks. Some people are amazing coders who will continue to deliver increasing value for years and you will only lose them if you can't find a way to let them progress their careers without having to do things they find uninteresting or are simply not well suited for.

</comment><comment><USER6> I am also a CTO for a small startup in Seattle. We now have an engineering team of 4 and I find myself oscillating between playing these roles. At this stage, I have to make sure I don't ignore either position.

If I ignore coding, I begin to feel detached from the product we are developing. It becomes easy to lose interest in the quality of what is being produced. On the other hand if I ignore the managing aspect, we become a much less effective team.

Sometime later this year we will be growing and I wonder if and when it will be appropriate to drop coding altogether and start developing my management skills with 100% focus.

</comment><comment><USER7> I work on an internally-funded startup within a small business - equal parts management, development and devops simply by necessity. So i'm guilty of finding management a chore, or at best, a huge time-sink.

But there are highlights. It's oft-repeated but it really is true that supporting your customers and dealing with marketing can give you great insight into your own product. Through customer interaction i've gotten simple feature requests that add significant value, that I would never have encountered on my own with a programmer mindset.

I'd still take a pure 'maker' position any day of the week.

</comment><comment><USER8> A key ingredient in this transition and being successful in it is trusting in your team.

We've gone from 3 to 10 in last year and realizing everything might not happen my way but will still be done well required some mental adjustment for me. But the ability to do this was purely a function of trust in the people on the team and their instincts, judgement, skills, etc. (note: the mental adjustment remains a work in progress. Maker tendencies are not easy to lose)

</comment><comment><USER9> Great read, I've put some similar thoughts of mine here - <http://gtziralis.com/from-doer-to-leader/>

</comment><comment><USER10> Fantastic post, and one that I think a lot of developer founders can sympathize with. If you're in the specific circumstance of being the developer founder turned CEO, I think this is one of the toughest aspects of that role. I appreciated the fact that you brought in advice from numerous outside sources as well.</comment>


Lilium Aviation raises €10m Series A funding round with Atomico - <AUTHOR> https://email@example.com/10million-funding-b49addcdfa71 <comment><USER2> Flying cars are coming. Another startup in that space is based in Bay Area and got funding from Larry Page: [http://www.zee.aero/](http://www.zee.aero/)

<comment><AUTHOR> I am working on a similar project I know very well the space and I can say that this project is pure science fiction, the Zee.Aero is possible but with a lot of constraints the Lilium project is pure fiction.</comment></comment>


What Keeps Programmers Happy? - <AUTHOR> https://www.divio.com/blog/what-keeps-programmers-happy/ <comment><AUTHOR> Would be interested to know what the experience is of this in other companies, smaller ones as well as large corporations with masses of $$$$ swirling around.</comment>


Montana becomes first state to implement net neutrality after FCC repeal - <AUTHOR> http://thehill.com/policy/technology/370133-montana-becomes-first-state-to-implement-net-neutrality-rules-following-fcc <comment><USER2> The headline is a little misleading. The state is not implementing rules or regulations for net neutrality. It is simply requiring, as a condition of contracting with the state, that ISPs abide by the principles of net neutrality. If an ISP does not have any state contracts, it is free to do whatever it wants under the federal law.

Many jurisdictions attach such conditions to entering into a contract with the jurisdiction, ie paying a living wage, hiring a certain percentage of minorities, etc.

<comment><USER3> So if they choose not to abide by net neutrality, the state will just do without internet service?

Seems like the state would be in the same place most consumers are, we don't like it, but there are no alternatives.

<comment><USER4> Two of the best ISPs in my area here in Montana are Montana owned. One is even a co-op. I don't think it would be too painful to have Charter or Century Link leave the state.

<comment><USER5> So then this would seem to be a good argument against the idea of Comcast or Century Link being a monopoly and a serious argument against the idea that net neutrality needs laws to enforce it.

<comment><USER6> Not in the least. There are still plenty of areas where there is only one option.

</comment></comment></comment></comment></comment><comment><USER7> Good job Montana. If I recall correctly, the FCC ruling also prevented states from creating their own NN laws. I am wondering if there will be litigation around in executive order.

<comment><USER8> Definitely going to be a number of lawsuits regarding this. With as many states doing it or planning on doing it. But I think the only way it's going to happen is if the ISPs sue the states doing it. I'd be surprised if the FCC tries to sue the states over it.

<comment><USER9> It'll be interesting to see what propagandic angle the lobbyist and purchased politicians take if ISPs sue states over this. When it was anti-NN, the language was "Defeating Federal Overreach to Allow an Open Internet."

<comment><USER10> Indeed. "Defeating States Rights to Allow an Open Internet" has a very different ring to it.

</comment></comment></comment></comment><comment><USER11> It's really ironic that the Comcasts of the world were probably hoping to get a free pass to do whatever they want, when in reality they will end up with different rules for each state increasing the cost of compliance.

<comment><USER12> Montana could also structure their rules such that any ISP with a connection terminating at a state government must apply their NN rules to any data transferred through the state while it is in-state, even if the source and destination are outside of the state.

Now _that_ would be a regulatory nightmare.

</comment></comment><comment><USER13> So, as someone with no knowledge of the landscape in Montana, I'm wondering: how many ISPs are there who would pick Montana state contracts over the ability to throttle and prioritize traffic?

<comment><USER14> My friend made an app that lets you peek at the State Checkbook and see what ISP's are getting checks.

[http://www.porkcast.com/](http://www.porkcast.com/)

<comment><USER15> Looks like it's gone. The domain is for sale.

<comment><USER14> Whomp whomp. If I recall, it was Centurylink and Charter who got the biggest checks.

<comment><USER16> [https://web.archive.org/web/20170422171000/http://www.porkca...](https://web.archive.org/web/20170422171000/http://www.porkcast.com/)

</comment></comment></comment></comment></comment><comment><USER17> Montana. Now that's an unexpected source for business regulation.

<comment><USER18> Why do you say this?

I ask because, I am from Montana and I often find outside knowledge of Montana consists of "they have an unlimited speed on the highway/interstate" (which hasn't been true for quite sometime) mindset applied to any information about Montana. It is usually viewed as a red state, but it's a different kind of red than what you find on the coasts. Our governor is blue and our state was essentially founded by socialists. Our state is usually pretty vocal on political matters and protecting the public (our most famous and easiest example of course being protection of public lands).

<comment><USER19> When I think of Montana politics the first thing I remember is this: [https://www.washingtonpost.com/news/morning- mix/wp/2017/05/2...](https://www.washingtonpost.com/news/morning- mix/wp/2017/05/25/fox-news-crew-watched-in-disbelief-as-gianforte-slammed-and- punched-reporter/)

For better or worse this makes me think of Montana as a pretty red state unlikely to pass regulation like NN.

<comment><USER18> Yes that was our most recent national claim to fame in politics. Gianforte is not a good representation of Montana politicians. He is a party boy and his campaign was nearly a replica of Trump's in a time of political uncertainty. He went up against a very weak Democratic candidate and a very week Libertarian candidate. That event also took place on the night before going to the polls after most Montanan's had sent in their ballots through the mail. When it boils down to being a red state, you'll see more party line voters. However if you were to sit down with these red staters you'd find they're mighty different.

<comment><USER20> Just to be clear, the majority of Montana's do not vote by mail. It's just about 1/3 of the population. And only 2/3 of those absentee ballots had been returned when that news hit.

So still ~75% of the population voted with that knowledge and put him in office.

[https://www.google.com/amp/s/amp.cnn.com/cnn/2017/05/25/poli...](https://www.google.com/amp/s/amp.cnn.com/cnn/2017/05/25/politics/montana- special-election-turnout/index.html)

</comment></comment></comment></comment></comment><comment><USER21> While it's not a complete net-neutrality across the board. Having lived in Montana before I can tell you why they did this despite being Red State. Montana has always been a state that values strong state rights. It was one of the last States to have a speed limit.

So state preemption would rub a lot of Montanians the wrong way. Montana also has a democrat governor at the moment.

<comment><USER22> Montana is also the state that tried to pass a gun law that didn't require federal registration if the gun was made, sold, and used in Montana. Federal courts struck that one down.

[https://en.m.wikipedia.org/wiki/Montana_Firearms_Freedom_Act](https://en.m.wikipedia.org/wiki/Montana_Firearms_Freedom_Act)

<comment><USER21> Honestly, when reading about that, I find the panels reasoning of: "Circuit panel unanimously ruled that Congress could regulate the internal manufacture of firearms within Montana because the creation and circulation of such firearms could reasonably be expected to impact the market for firearms nationally."

Seems a bit of stretch if you ask me. I am not sure I would call that interstate commerce.

</comment></comment></comment><comment><USER23> And California (where I live) is still lounging, doing nothing.

</comment><comment><USER24> Create a state law that defines what constitutes "internet access". ISPs would be forced to offer that or "limited internet access" or some such.

</comment><comment><USER25> Another executive order... and this one only affecting ISPs wanting a contract with the state government. Is that really the best that can be done?

<comment><USER26> If you're the Governor of Montana, it probably is the best that can be done.

It's not a lot by itself, of course, but I'm not going to begrudge local and state officials from exercising what powers they do have to try and make the situation a bit better.

<comment><USER27> They could stop running as Republican candidates. Just an idea.

<comment><USER28> The Governor of Montana is a Democrat.

<comment><USER29> The governor's even been a Democrat for the past 13 years, for that matter (4 consecutive elections). People seem to have the idea that Montana is an ultra- conservative state where Republicans win every election, which isn't really true.

</comment></comment></comment></comment></comment><comment><USER30> Is it likely that the whole NN issue will end up decided by SCOTUS?

<comment><USER31> What's there for the SCOTUS to decide?

</comment></comment><comment><USER32> That's great news! But what about internet privacy?

</comment><comment><USER33> If it's at all effective congress will preempt it.

<comment><USER34> I think that'd be an uphill battle.

E.g., I, for one, oppose federal interference with the technical decisions of ISPs via so-called net neutrality. I've written my representatives on multiple occasions saying so. If I lived in Montana, I'd be similarly opposed to the state government's meddling. As a citizen of Minnesota, I'd actually oppose an overreaching federal government if they tried to overturn Montana's law. Even though I think it'd be better policy for Montanans, I regard Montana's rights as a state as more important than my ego's desire to direct their policy from afar.

My guess is that a lot of other opponents of federal internet regulation would agree.

I'm actually quite glad to see this playing out among the various states as 'laboratories of democracy'. In ten years, we'll both have a lot more data on which policy promotes better offerings.

What I'd really like to see is one of the states declare municipal grants of telecommunications monopolies to be void. E.g., if some town has contracted with Comcast to be the only ISP legally allowed, then the state would come in and say that those terms are legally unenforceable and that the town has to license at least one or two competitors or face charges from the state.

<comment><USER33> > I think that'd be an uphill battle.

Yeah, nothing in this arena's going to come easily to either side, there's far too much at stake. The Supreme Court didn't help planning or certainty when it disturbed fairly well-settled federal preclusion doctrine with a number of split holdings over the past 20 years so one way or the other we're in for a show.

</comment></comment></comment><comment><USER35> Congrats!

</comment><comment><USER36> Good for them. Hopefully Texas will fo-lol I can't even finish that sentence.

<comment><USER37> Reading Cruz's tweets on net neutrality invokes a special type of enragement[0]. It is downright offensive how he treats his constituents, especially us lucky folks in the "People's Republic of Austin".

0\. [https://twitter.com/tedcruz/status/941489723901665280?lang=e...](https://twitter.com/tedcruz/status/941489723901665280?lang=en)

<comment><USER38> The way that Cruz talks about NN is infuriating to everyone I have talked to in CS or literally anyone I have talked to in DFW. There are a massive amount of tech people in DFW who should be pushing for NN for their business more than there is in Austin and I am suprised nothing has come of it.

</comment></comment></comment><comment><USER39> Great, but there's like five people in Montana; it's practically a Dakota.

[http://www.enchantedlearning.com/usa/states/population.shtml](http://www.enchantedlearning.com/usa/states/population.shtml)

</comment><comment><USER5> For this requirement to have any meaning, Montana would need to be able to enforce it (ie choose another isp). But that would show that the isp landscape isn't owned by monopolies. This would actually seriously undermine many arguments as to why net neutrality needs laws to protect it over what the market can do.

I wonder is if we will start to find out that maybe the isp market isn't as closed as we thought - wireless tech, more entrants, new tech - and those saying we need NN laws because the market isn't healthy enough will pivot to a more normative claim regardless of completion.

I am somebody who could easily be brought on board with specifically crafted NN laws, but see much of the title ii at all costs advocacy a little of the mark.

<comment><USER40> > _For this requirement to have any meaning, Montana would need to be able to > enforce it (ie choose another isp)._

Why? Can't they also just fine them in increasing amounts until they comply?

<comment><USER5> No they can't. Its not a law. It is just a directive that the government will not do business with isps that do not comply to certain standards.

</comment></comment></comment><comment><USER41> Not to be against state's rights here, but isn't Net Neutrality anti-business? If a state goes it alone, does it risk pro-business components who might leave the state? Curiosity vs. equality slant, so not looking to pick a bone here. Real question ..

<comment><USER42> The parent's account appears to be new and largely used for political and ideological discussion. I'm not a moderator, but I'd encourage you to read the community guidelines as that type of behavior is specifically prohibited: [https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html)

<comment><USER41> So let's pull down reference:

Not to be against state's rights here, but isn't Net Neutrality anti-business? >> generalization, but specific to a yes/no. No politics, but setting aside states vs. federal overlap and differences >> Net Neutrality hits at the heart of overlap. That was a tactile approach to ask a question w/o saying Trump, Democrats suck, Republicans Suck .. etc.

If a state goes it alone, does it risk pro-business components who might leave the state? >> How is THIS political? I ask the risk for analysis >> to help me expand the dynamic understand that is required for Net Neutrality to have an informed view. NN IS political, and I'm trying to understand the longer view of its implications to each part. THAT is neutral.

Curiosity vs. equality slant, so not looking to pick a bone here. Real question .. >> Lastly ... I stated my intent. Intent is either what sets you free ... or lands you in jail. >> In this case, I used intent to direct towards WHY is NN so controversial and how can we make it LESS controversial. >>I don't understand people that don't like open-minded requests for help in understanding the broader strokes of very BROAD topics. It's the nuances ... not the prickly parts .. that make for good conversation.</comment></comment></comment>


Ask HN: Web framework independent Python libraries useful for web development. - <AUTHOR>

SQLAlchemy, WTForm, Jinja2, blinker would be some examples. What are the others? <comment><USER2> Flatland for form processing. Formencode is a more mature, if not as easy/flexible to use alternative.

Nose or py.test for testing.

Other template engines would be e.g. Mako and Genshi.

Lamson for email handling.

</comment><comment><USER3> Although from a different angle, mechanize is wonderful (for the testing part), along with the Selenium python bindings (but that one's not pure python).

</comment><comment><USER4> Werkzeug or WebOb if you're using WSGI.

I like kid and jinja2 for templating.</comment>


Will Cap Table Transparency Help Your Startup? - <AUTHOR> https://www.capshare.com/posts/39/will-cap-table-transparency-help-your-startup

<comment><USER2> I am not sure why employees would be motivated by option grants unless they knew how much they were worth relative to the company. Unless the company "appeared" to be doing well. Even then, the company could issue any number of shares and dilute the employees' ownership possibilities. I feel like a minimum of level 2 info (as shown in the chart) would provide the employees a good enough sense of what is going on, and therefore be more motivating.

Does anyone have any data that shows how forfeiture rates are affected by levels of knowledge?</comment>


Hints for writing Unix tools - <AUTHOR> http://monkey.org/~marius/unix-tools-hints.html <comment><USER2> _"One thing well" misses the point: it should be "One thing well AND COMPOSES WELL"_

If the implementation isn't respecting _The Rule of Composition_ it's actually not adhering to the Unix philosophy in the first place. The tweet is referring to one of Doug McIlroy's (one of the Unix founders, inventor of the Unix pipe) famous quotes:

 _" This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface."_

Pure beauty, but it's almost too concise a definition if you haven't _experienced the culture_ of Unix (many years of usage / reading code / writing code / communication with other followers). ESR's exhaustive list of Unix rules in plain English might be a better start for the uninitiated (among which one will find the aforementioned _Rule of Composition_ ).

For all those seeking enlightenment, go forth and read the _The Art of Unix Programming_ :

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

17 Unix Rules:

[https://en.wikipedia.org/wiki/Unix_philosophy#Eric_Raymond.E...](https://en.wikipedia.org/wiki/Unix_philosophy#Eric_Raymond.E2.80.99s_17_Unix_Rules)

</comment><comment><USER3> Here's one more tip: did you ever notice that "ls" displays multiple columns, but "ls | cat" prints only one filename per line? Or how "ps -f" truncates long lines instead of wrapping, while "ps -f | cat" lets the long lines live?

You can do it too, and if you're serious about writing Unix-style filter programs, you will someday need to. How do you know which format to write? Call "isatty(STDOUT_FILENO)" in C or C++, "sys.stdout.isatty()" in Python, etc. This returns true if stdout is a terminal, in which case you can provide pretty output for humans and machine-readable output for programs, automatically.

<comment><USER4> IMO, this is an anti-pattern. It's violates the principle of least surprise. (How come I see X when I run the command, but I can't grep for X in its output? How come it works when I run it from my interactive shell, but it's broken when I run it from a script? And things like that.)

<comment><USER5> I think it depends what sort of things you use it for. I often use it to switch on or off ANSI colourization, which doesn't really violate the principle of least surprise.

When used sparingly and thoughtfully, I've never personally had an issue with it.

<comment><USER6> You may not have issue with the sort of things you use it for, but others might.

For example, I run shells in Emacs and have had to tweak loads of shell scripts written by colleagues to fix their poorly-implemented colourisation. It's useful to know when a test has failed; it's not so useful to have the whole terminal set to white text on a pale pink background.

One day I couldn't SSH into our servers from Emacs. It turned out somebody had edited .bashrc for the admin user to make the bash prompt blue. Emacs' TRAMP process was looking for a prompt ending in "$" or "#", not "$\\[\033[0m\\]", so it didn't realise the connections were successful.

There are two ways of handling this: we can blame the source of the bug (the person adding the colours incorrectly, or the assumption-loaded TRAMP regex), but there will _always_ be more bugs in situations we'd never think of. Alternatively, we can avoid being 'too clever', and instead aim for consistency and least surprise.

<comment><USER7> Are you suggesting that colored prompts violate the rules of consistency and least surprise?

(Actually, if you are suggesting that, I'm not going to disagree. But I am going to say that if so, those rules don't apply in the case of colored prompts, because colored prompts are _useful_.)

<comment><USER6> I suppose I'm suggesting that, aside from personal scripts, we shouldn't assume too much about who our users are and what they're trying to do. The principle of least power tells us to use the dumbest format that will work, eg. plain text.

Anything we add on top of that, eg. ANSI colour codes, will be useful to some but harmful to others. The tricky part is working out which of those categories the current user is in.

<comment><USER7> So is your proposed solution not to have colored prompts? (I vehemently disagree.) Or not to put them in a .bashrc? (I still disagree, but only strongly.) Or something else?

<comment><USER8> Or, y'know, have coloured prompts but place the escape characters such that they don't mess with prompt-detection regexps.

<comment><USER7> To be precise, what you're suggesting is that we have prompts which are allowed to be colored _except for the $ /# at the end_, because you can't color those without following them by escape characters. And that prompts _must_ have a $/# at the end.

I don't consider that an acceptable solution.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> I'm not sure I agree with the "no JSON, please" remark. If I'm parsing normal *nix output I'm going to have to use sed, grep, awk, cut or whatever and the invocation is probably going to be different for each tool.

If it's JSON and I know what object I want, I just have to pipe to something like jq [1].

PowerShell takes this further and uses the concept of passing objects around - so I can do things like ls | $_.Name and extract a list of file names (or paths, or extensions etc)

[1]: [http://stedolan.github.io/jq/](http://stedolan.github.io/jq/)

<comment><USER10> I was also constantly thinking of PowerShell while reading that. A PowerShell- specific list of such advice would actually be rather short, given that most of the pitfalls are already avoided. I still firmly believe that PowerShell is actually a much more consistent Unix shell in that several concepts that ought to be separate are actually orthogonal. Let's see:

Input from stdin, output to stdout: Nicely side-stepped in that most cmdlets allow binding pipeline input to a parameter (either byval or byname, if needed). Filters are trivial to write, though.

Output should be free from headers: Side-stepped as well, in that decoration comes from the Format-* cmdlets that should only ever be at the end of a pipeline that's shown to the user.

Simple to parse and to compose: Well, objects. Can't beat parsing that you don't need to do.

Output as API: Well, since output is either a collection of objects or nothing (e.g. if an exception happened) there isn't the problem that you're getting back something unexpected.

Diagnostics on stderr: Automatic with exceptions and Write-Error. As an added bonus, warnings are on stream 2, debug output on stream 3 and verbose output on stream 4. All nicely separable if needed.

Signal failures with an exit status. Automatic if needed ($?), but usually exception handling is easier.

Portable output: That's about the only advice that would still hold and be valuable. E.g. Select-String returns objects with a Filename property which is not a FileInfo, but only a string; subject to the same restrictions that are mentioned in the article.

Omit needless dagnostics: Since those would be either on the debug or verbose stream they can be silenced easily, don't interfere with other things you care about and cmdlets have a switch for either of that, which means you only get that stuff if you actually care about it.

Avoid interactivity: Can happen when using the shell interactively, e.g.

        Home:> Remove-Item

        cmdlet Remove-Item at command pipeline position 1
        Supply values for the following parameters:
        Path[0]: _

However, this only ever happens if you do not bind anything to a parameter, which shouldn't happen in scripts. If you bind $null to a parameter, e.g. because pipeline input is empty or a subexpression returned no result, then an error is thrown instead, avoiding this problem.

Nitpick: You'd need ls | % Name or ls | % { $_.Name } there. Otherwise you'd have an expression as a pipeline element, which isn't allowed.

<comment><USER11> I have never used a computer that had access to Powershell, but in my new job I may have to do some small stuff to tie some systems together. I'm terrified of learning it because I don't want to be lured into some kind of lock-in scenario.

<comment><USER12> Well, you can only use it on Windows. But I mean come on, "terrified?" Bash scripts are not too useful in Windows either.

<comment><USER13> Spending a lot of time learning non-portable technologies isn't a decision to be taken lightly.

<comment><USER12> Well, if it's part of your job I'd say it's not a decision at all...

<comment><USER13> If you can't accomplish the same goals in a portable way. Of course, if you can put the knowledge to work as soon as you learn it, you're already starting to recoup your investment.

<comment><USER14> I can't believe you got downvoted for that.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER15> A nitpicky tip: --help is normal execution, not an error, so the usage information should be printed to stdout, not stderr (and it should exit with a successful status). Nothing is more annoying than trying to use a convoluted program with a million flags (which should have a man page in the first place) and piping --help into less with no success.

<comment><USER16> I am not so sure with that. Say, your program is used in a shell script and is invoked badly - you might want to print its usage then. If you exit normally your shell script might break weirdly but if you exit with error it's easier to spot the reason of failure.

On the other hand you made me thinking and probably you should have three code passes per default:

      [0] normal behaviour (exit 0)
      [1] bad arguments (exit EINVAL)
      [2] --usage (print to stdout but but exit != 0)?

Anyway I am not sure if it makes sense to declare "usage" as normal behaviour.

<comment><USER17> In my book, there is a difference between explicitly asking for help/usage and passing arguments that do not make sense, which triggers the output of help/usage.

The former, I think, should write to stdout and return 0, the latter should write to stderr and return something non-zero.

Giving help if the user asks for it is normal behaviour.

</comment></comment></comment><comment><USER18> 1978 called. It wants its pipes back.

That approach dates from the days when you got multi-column directory listings with

      ls | mc

Putting multi-column output code in "ls" wasn't consistent with the UNIX philosophy.

There's a property of UNIX program interconnection that almost nobody thinks about. You can feed named environment variables into a program, but you can't get them back out when the program exits. This is a lack. "exit()" should have taken an optional list of name/value pairs as an argument, and the calling program (probably a shell) should have been able to use them. With that, calling programs would be more like calling subroutines.

PowerShell does something like that.

<comment><USER19> You can simulate this with so-called "Bernstein chaining". Basically, each program takes another program as an argument, and finishes by calling exec() on it rather than exit(), which preserves the environment. See:

[http://www.catb.org/~esr/writings/taoup/html/ch06s06.html](http://www.catb.org/~esr/writings/taoup/html/ch06s06.html)

Or write environment variables to stdout in Bourne shell syntax so the caller call run "eval" on it. Like ssh-agent, for example.

<comment><USER20> Continuation Passing Style! [http://en.wikipedia.org/wiki/Continuation- passing_style](http://en.wikipedia.org/wiki/Continuation-passing_style)

</comment></comment></comment><comment><USER21> Additional tip: if writing a tool that prints a list of file names, provide a -0 option that prints them separated by '\x0' rather than white space. Then the output can be piped through xargs -0 and it won't go wrong if there are files with spaces in their paths.

I suggest -0 for symmetry with xargs. find calls it -print0, I think.

(In my view, this is poor design on xargs's part; it should be reading a newline-separated list of unescaped file names, as produced by many versions of ls (when stdout isn't a tty) and find -print, and doing the escaping itself (or making up its own argv for the child process, or whatever it does). But it's too late to fix now I suppose.)

<comment><USER22> > newline-separated list of unescaped file names

That breaks when you have newlines in filenames, no?

<comment><USER23> > That breaks when you have newlines in filenames, no?

That seems like an extremely pathological case.

<comment><USER24> > That seems like an extremely pathological case.

When a human is creating files by hand, I almost certainly agree. When a program is creating files, however, it's only a matter of time before weird characters wind their way in there.

I really wish newlines had been disallowed. (There's UI implications, in addition to the parsing ones — how do you do a list view with newlines in the filename?; I also wish filenames had a reliable character set and weren't just bytes.)

<comment><USER25> I think dwheeler is trying to get this fixed/standardised in POSIX via the Open group.

<comment><USER26> That it's going to be an uphill battle is an understatement.

Someone replied on LWN, when he posted his proposal, that he had implemented a sort of home-grown database using non-UTF8 characters for the file names.

Rube Goldberg, indeed!

</comment></comment></comment></comment></comment></comment><comment><USER27> Great article. The other thing I've always wished for command-line tools is some kind of consistency for flags and arguments. Kind of like a HIG for the command line. I know some distros have something like this, and that it's not practical to do as many common commands evolved decades ago and changing the interface would break pretty much everything. But things like `grep -E,-- extended-regexp` vs `sed -r,--regexp-extended` and `dd if=/a/b/c` (no dashes) drive me nuts.

In a magical dream world I'd start a distro where every command has its interface rewritten to conform to a command line HIG. Single-letter flags would always mean only one thing, common long flags would be consistent, and no new tools would be added to the distro until they conformed. But at this point everyone's used to (and more importantly, the entire system relies on) the weird mismatches and historical leftovers from older commands. Too bad!

<comment><USER28> I've often thought this - that xkcd.com/1168/ is funny is a terrible embarrassment. I would also like to add that manpage syntax help should be standardized and machine-parseable. I had an idea recently to auto-generate GUIs for command line tools from the manpage syntax line, but it turned out that while such lines _look_ precise but cryptic, they are often in fact highly ambiguous, nonstandard, and still cryptic. This seems broken to me.

<comment><USER29> Blame man(7), have a look at mdoc(7): Semantic markup for command line utilities: Nm : start a SYNOPSIS block with the name of a utility; Fl : command line options (flags) (>=0 arguments); Cm : command modifier (>0 arguments); Ar : command arguments (>=0 arguments); Op, Oo, Oc : optional syntax elements (enclosure); Ic : internal or interactive command (>0 arguments); Ev : environmental variable (>0 arguments); Pa : file system path (>=0 arguments)

</comment></comment></comment><comment><USER4> Lots of great points here, but as always, these can be taken too far. Header lines are really useful for human-readable output, and can be easily skipped with an optional flag. (-H is common for this).

The "portable output" thing is especially subjective. I buy that it probably makes sense for compilers to print full paths. But it's nice that tools like ls(1) and find(1) use paths in the same form you gave them on the command-line (i.e., absolute pathnames in output if given absolute paths, but relative pathnames if given relative paths). For one, it means that when you provide instructions to someone (e.g., a command to run on a cloned git repo), and you want to include sample output, the output matches exactly what they'd see. Similarly, it makes it easier to write test suites that check for expected stdout contents. And if you want absolute paths in the output, you can specify the input that way.

<comment><USER30> I also think headers should be included. Its really annoying to go pore through a man page just to see what the columns mean. You could use flags, or maybe send headers to STDERR.

</comment></comment><comment><USER31> Not every program will be able to take input in stdin and output to stdout. If you have a --file (or -f) option, you'd do well to support a "-" file argument, which means either stdin or stdout, depending if you're reading or writing to -f. But you won't support "-" if the -f option requires seeking backwards in a file. Neither will you be using stdin or stdout if binary is involved (because tty drivers).

'One thing well' is often intended to make people's lives easier on the console. Sometimes this means assuming sane defaults, and sometimes just a simpler program that does/assumes less. Take these two examples and tell me which you'd prefer to type:

      user@host~$ ls *.wav | xargs processAudio -e mu-law --endian swap -c 2 -r 16000
      user@host~$ find . -type f -maxdepth 1 -name '*.wav' -exec processAudio -e mu-law --endian swap -c 2 -r 16000 {} \;

Write concise technical documentation. Imagine it's your first day on a new job and you need to learn how all your new team's tools work; do you want to read every line of code they've written just to find out how it works, or do you want to read a couple pages of technical docs to understand in general how it works? (That's a rhetorical question)

Definitely provide a verbose mode. When your program doesn't work as expected, the user should be able to figure it out without spending hours debugging it.

</comment><comment><USER32> I have a strong bias against people who quote their own tweets in their own blog posts. I find this to be highly narcissistic.

<comment><USER33> I sympathize, but I have to say I find it far less annoying than the constant implorings to "follow me on Twitter!" that have become obnoxiously ubiquitous in the last few years.

</comment></comment><comment><USER34> Wow, its been a while since I've seen a monkey.org link. I thought the site was dead. Nice to see I was wrong.

</comment><comment><USER35> Another tip: don't do colored output. I don't want to deal with ANSI codes in your output.

</comment><comment><USER36> I think it's insane to restrict programs to just STDOUT & STDERR. Why 2? Why not use another file descriptor, maybe STDFMT, to capture all the formatting markup? This would avoid -0 options (newlines are markup sent to stdfmt, all strings on stdout are 0-terminated), it would avoid -H options (headers go straight to STDFMT), it would allow for less -R to still work, etc.

It's possible other descriptors would be useful, like stdlog for insecure local logs, stddebug for sending gobs of information to a debugger. It's certainly not in POSIX, so too bad, but honestly stdout is hard to keep readable and pipe-able. Adding just one more file descriptor separates the model from the view.

<comment><USER31> I honestly have no idea what you are talking about. The whole point of standard i/o streams is for them to be portable and composable by other programs without those programs having to be designed to work with yours. POSIX is here for a very good reason.

Obviously not every program will use just two file descriptors. Binary isn't handled by stdin and stdout because they're typically used for tty input/output. If you need to handle multiple files you'll take a list of file arguments. Often a program takes no input at all that isn't a command-line option.

And what 'formatting markup'? There is no 'markup' on a terminal, unless you're dealing with colors or something, which you would disable if your fd wasn't a tty. And why would you send 'headers' to a completely different file descriptor anyway?

Oh, I think I get it now. You confused the MVC architecture with Unix programs. Unix programs don't provide a user interface.

<comment><USER37> > I honestly have no idea what you are talking about. The whole point of > standard i/o streams is for them to be portable and composable by other > programs without those programs having to be designed to work with yours.

His point is that two streams are not enough, you don't want to present the same output stream or a human, a logfile or an other utility.

> And what 'formatting markup'? There is no 'markup' on a terminal, unless > you're dealing with colors or something

Right, so there is markup on a terminal.

> which you would disable if your fd wasn't a tty.

Which would be much simpler to handle if there was a stream for human consumption and one for piping

> And why would you send 'headers' to a completely different file descriptor > anyway?

Because headers are useful to human users or when capturing output in a file to read later rather than in an other utility?

<comment><USER31> In practical terms, everything you mention should be done _by different programs_ , not one giant monolithic subsystem that manages 10 completely different tasks. Each component should be reusable, independent, and interoperable. Not tied into one program.

In your program's design, the 'cat' program would handle all kinds of file i/o, provide some kind of ncurses text GUI to select a file, a progress bar for the progress of text flowing through it, sending errors to a logging subsystem, storing header metadata in some object passed along its output streams, etc. The Unix designers had dealt with this kind of crap before, and were sick of it, and so they wrote a program which did _only one thing_.

What you describe is the systemd school of design. If I just make my program more complex and technically superior, i'll have a better program. Who cares that nobody wants to use it, or that it's burdensome, hard to extend, difficult to understand, and incompatible with everything that exists today? Who cares if we can already do all these things without all the downsides? Technical superiority trumps practicality. Well, that's not Unix.

The Unix environment flourished not only because it was widely available, but mainly because it was incredibly efficient. By removing all the things they didn't need, they made the system better. There are four words that accurately express all of this, and that should guide the development of any Unix tool:

Keep it simple, stupid. [https://people.apache.org/~fhanik/kiss.html](https://people.apache.org/~fhanik/kiss.html)

</comment></comment></comment></comment><comment><USER38> I agree with what is exposed on the article and I've actually added more details in how to apply this "principles" to shell scripting:

[http://javier.io/blog/en/2014/10/21/hints-in-writing-unix- to...](http://javier.io/blog/en/2014/10/21/hints-in-writing-unix-tools-with- shell-scripting.html)

</comment><comment><USER39> I would add to this list:

If you are intercepting UNIX signals (starting with SIGINT), go back to the drawing board and think again. Don't do it. There is almost never a good reason for doing it, and you will likely get it wrong and frustrate users.

<comment><USER40> How about cleaning up tempfiles on ^C?

<comment><USER41> YMMV but I prefer cleaning the old tempfiles at start-up. It allows you to get the content of the tempfiles after the program stopped, very handy for debugging..</comment></comment></comment>


Why panpsychism fails to solve the problem of consciousness - <AUTHOR> https://aeon.co/ideas/why-panpsychism-fails-to-solve-the-mystery-of-consciousness?utm_source=Aeon+Newsletter&utm_campaign=c820819188-Weekly_Newsletter_23_September_20169_23_2016&utm_medium=email&utm_term=0_411a82e59d-c820819188-69010801 <comment><USER2> This is about whether or not it is possible to solve the hard problem of consciousness.

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

I think the underlying issue here is the limitations of human understanding. There are really only two possibilities here. One is that human knowledge can come to understand everything, as in absolute mysticism where the mind merges with all of reality. As to why it takes absolute mysticism, it's because the various finitudes we experience are greatly interconnected, and so if you are going to abolish one, the others need to go, too.

The other position is that human understanding is always limited. I and many other philosophers in the last century or so (such Neitzsche, Husserl, Heidegger, Merleau-Ponty, Whitehead, the later Wittgenstein, Strawson, and all the Pragmatists) believe that human beings, as finite, mortal creatures, are inherently finite in their understanding, and so there will always be mystery.

As to where the dividing line lays, I think the hard question of consciousness is one topic on the other side. One good argument here comes from Colin Mcginn, who says that the human brain is not designed to answer this sort of question.

</comment><comment><USER3> "How does the brain produce conscious experience? How can neurons firing give rise to experiences of colour, sound, taste, pain and so on? In principle, scientists could map my brain processes in complete detail but, it seems, they could never detect my experiences themselves – the way colours look, pain feels and so on: the phenomenal properties of the brain states involved. Somehow, it seems, brain processes acquire a subjective aspect, which is invisible to science. How can we possibly explain this?"

What you refer to as 'conscious experience' is an emergent property of processes in the brain in communication with one another. The 'subjective aspect' is an internal recreation of the external world, continuously updated from data provided through the senses. Ergo, no need to go invoking some invisible undetectable subatomic substance, the phlogiston of the mind.</comment>