Ask HN: Why prefer CSS-in-JS over inline styles? - <AUTHOR> I've been using inline styles in my React apps for awhile now, and I've found it makes styling much, much easier.
That said, it seems the winds have shifted a bit and more people are eschewing inline styles in favor of CSS-in-JS solutions such as styled-components or emotion.  I've tinkered with both of these libraries a bit, and I have to say I can't see how these are an improvement over plain inline styles.  They introduce additional build steps, the use of string literals instead of plain JavaScript objects, and they mess with the core React.createElement function.  The upside is you get to use pseudo-selectors, which is nice, but I've found with a real programming language at my disposal (i.e. JavaScript), I don't really need many pseudo-selectors beyond :hover.
What am I missing? <comment><USER2> These days any new technology has a stampede of youtube tutorial makers, Pluralsight authors, and other programmer "influencers" that make it seem like it's the next new thing.

At the same time people who understand one technology may not want to learn new ideas and techniques. If it aint broke don't fix it.

The point of me writing these two conflicting ideas is inject some skeptisism into the conversation. Maybe you aren't missing anything and the tool is overhyped and you don't fully understand the benefits. Both of these things can be true.

</comment><comment><USER3> I think the future of CSS is that we'll see all the innovation from the CSS- in-JS world come back home to CSS stylesheets.

It's hard to beat the high-level declarative nature of writing style rules in a stylesheet that can style any HTML or XML DOM you use them with. I think a lot of current CSS-in-JS tooling ends up being too limited in that it often requires you to know the DOM in advance and couples the styles tightly with the DOM - while also leaving you unable to style anything you run across or need to work with that was created outside your particular workflow or pre- exists outside of your app.

The future looks like CSS, augmented by Layout worklets written in JS, and augmented by Paint worklets written in JS, and Animation worklets written in JS, and Custom Property definitions that can be supported by JS. And we believe custom script-supported at-rules, functions, and selectors are next to come to CSS.

The long and sort of it - you should be writing CSS in CSS stylesheets, and JavaScript in your JavaScript files, and find ways to use Javascript to define the custom features you want to use in your stylesheets. This is how the technology is growing, and when you extend real CSS with real JS, you can style anything, any DOM made by any tools.

More reading:

\- [https://houdini.glitch.me](https://houdini.glitch.me)

\- [https://css-houdini.rocks](https://css-houdini.rocks)

\- [https://developer.mozilla.org/en- US/docs/Web/API/Worklet](https://developer.mozilla.org/en- US/docs/Web/API/Worklet)

<comment><AUTHOR> So a lot of that sounds good, and the Houdini stuff looks interesting, but how does "extending CSS" with JS or worklets solve the two main problems of CSS, namely the ability to define local styles and the ability to dynamically change or define styles on the fly?

Also, it doesn't look like browser support for those new APIs is going be very good for quite some time.

<comment><USER3> I'm not quite sure what you're asking about the 'two main problems of CSS' \- can you explain more about what's problematic about defining 'local styles' or updating styles dynamically?

CSS custom properties, which already do have browser support, are a wonderful example of allowing JS to set values that CSS is able to take and use dynamically - check out libraries like Splitting.js or ScrollMagic for examples of applications of that.

Houdini worklets (pluggable Layout, Paint, Animation worklets) are definitely coming - this is what's currently being worked on as well as the 'Typed Object Model' for CSS where they're tightening the bolts and helping JS become aware of the different values and types inside the CSS language.

Also, when looking at support, keep in mind that as of Jan 15th, Edge will have the same support as Chrome :D

</comment></comment></comment><comment><USER4> I see stuff like inline styles and CSS-in-JS and I can't stop remembering what web development was like in the 1990s before CSS was a thing. It was horrible, and I refuse to ever go back.

</comment><comment><USER5> Css-in-JS Pros:

      - Enforce only local styles
      - Developer productivity
      - Better theming support
      - Better support for dynamic styles
      - Easier to consume packages
      - Typesafe styles

Cons:

      - Worse runtime performance
      - Bigger bundle size
      - Fragmentation of ecosystem
      - Idiosyncratic additions to css

It depend on your project. For small and medium sized projects I would recommend CSS-in-js. For large and performance-sensitive css-modules would be better.

</comment><comment><USER6> One thing I've come to like with CSS-in-JS is the ability to define a CSS API. For example the MUI Select component [https://material- ui.com/api/select/#css](https://material-ui.com/api/select/#css) it's a non- trivial amount of customization you can add (and you can define your own). As Chyzwar said in his post, this allows theming of custom components making it almost trivial for developers

I do think it's possible to have too much of a good thing, but for the most part I've seen developers ill-define a CSS API (with no easy way to override) which then becomes messy with !important all over the place. I do wish CSS blocks from LinkedIn ([https://css-blocks.com/](https://css-blocks.com/)) had better support and adoption because I thought it looked promising. I may even try it on a project soon since my new employer doesn't have an onerous on what I do during my free time

</comment><comment><USER7> Both create more problems than they solve, both essentially break the advantages of css. What bothers me about css-in-js, it does not have a single advantage over vanilla css. Every challenge it supposedly solves is a real world non-issue if you know how css works. Local styles, theming, dynamic styles, safety, maintainability, performance, you can have all of this in vanilla css without the issues associated with inline styles and the js-in-css abomination. Just learn the damn thing. js-in-css is a lazy workaround for software developers who want to do things the way they learned, not the way it was meant to be done.

<comment><AUTHOR> Can you elaborate? Specifically curious about how you get local styles and dynamic styles in vanilla CSS.

</comment></comment><comment><USER8> I can suggest using JavaScript codes to create the CSS codes ahead of time and then just post the compiled CSS codes on the server for download by the client, rather than having the CSS codes being made up by the client.

Also, I think you should not use the HTML "style" attribute; it is bad for accessibility. Use the "class" attribute instead.</comment>


My weekend project: MongoDB implementation in Ruby - <AUTHOR> https://github.com/gdb/embedded-mongo

<comment><USER2> While this is a very nifty bit of code, I'd be very careful about using it for unit testing as there is a high likelihood of minor behavior differences verses a real mongod which can cause surprises in production.

Also, for anyone looking to embed MongoDB and who doesn't mind using C++ it is possible and rather easy. In fact some of our unit tests and all of our tools other than the shell already do this. See [https://github.com/mongodb/mongo/blob/master/tools/tool.cpp#...](https://github.com/mongodb/mongo/blob/master/tools/tool.cpp#L208-235) for the details. The DBDirectClient class implements the full C++ driver interface but does all operations in-process. The downside is that unlike when using our drivers (which have no licensing impact on your code) when you embed mongodb within your application it becomes bound by AGPL.

PS- That is really impressive for a weekend project! You should get in touch with us at 10gen if you're looking for a new job.

<comment><AUTHOR> > While this is a very nifty bit of code, I'd be very careful about using it > for unit testing as there is a high likelihood of minor behavior differences > verses a real mongod which can cause surprises in production.

Yep, that's a valid point. My plan is to run my tests most of the time with embedded-mongo, and run against real mongo on occasion (such as say, using embedded-mongo while developing locally and real mongo before pushing to production). I haven't benchmarked it yet, but my test suite seems to run a lot faster with embedded-mongo than real mongo. And it's definitely a lot less work to use than an ad-hoc mock layer.

> PS- That is really impressive for a weekend project! You should get in touch > with us at 10gen if you're looking for a new job.

Thanks! If my current startup goes down in flames, I'll be sure to give you a call :).

</comment></comment><comment><AUTHOR> One really nice part about the implementation was I could just reuse the Ruby Mongo driver's test suite.

</comment><comment><USER3> Interesting. So now I can test my mongodb app, without needing to install mongodb server on my machine? Cool!

</comment><comment><USER4> Looks great! But the stinger is in the tail : "I think the next thing to add is indexes. Currently everything works via a linear scan of the database."

<comment><AUTHOR> Thanks. Re: indexes - patches welcome :). I don't expect them to be hard to build though. Since embedded-mongo is in memory, they're just a bunch of hash tables.

<comment><USER4> In that case, I would think that the indexing stuff (i.e. hash lookups) would be way better than linear already. Cool.

</comment></comment></comment><comment><USER5> This seems really fun. I'd love to be able to use this almost like a version of SQLlite, but a JSON interface. I could see this in Android/iPhone, as well as Desktop apps.

<comment><USER6> CouchDB already has embeddable ports to Android and iOS, and it has the added benefit of a built in master-slave or multiple-master replication system, so you can have your app get and push up to date data from a server when a connection is available, but still be fully functional without it, for free!</comment></comment>


Motorola signals intent to begin patent action against other Android licensees - <AUTHOR> http://www.appleinsider.com/articles/11/08/11/motorola_signals_intent_to_begin_patent_action_against_other_android_licensees.html <comment><USER2> wouldn't this be cliche biting the hand that feeds? Seems to me motorola owes some of its recent success (or just the fact its remained in business, and not become another nokia) to its android devices? does google not have any recourse if moto decides to pull this crap? i guess worse thing google could do is leave motorola with the open source bits, and not provide any support/co-branding or whatever goes along with the current arrangement.

</comment><comment><USER3> I have a hunch this is Motorola saying: "Hey Google! Nice shiny patents over here! Shame if you didn't buy them...". Given their existing Android bet, they don't have an incentive to hit the Android ecosystem with a new front in the patent war.

</comment><comment><USER4> Motorola said they may go offensive against Android competitors, not other Android licensees; remember, it's appleinsider who's reporting.</comment>


Ask HN: How does your company account for things that are hard to measure? - <AUTHOR> There were a bunch of good comments in the recent article about Amazon stuffing search results with ads around how ad revenue is easy to measure, while long term potentially negative impact to your brand is hard to measure.<p>I'm curious if other people have experiences with how to account for some of these hard to measure, but important factors for business success, especially in a world where metric analysis and constant A/B testing is the norm. Do you actually try to measure it? Use a fudge factor to account for it? <comment><USER2> If in doubt, consider trusting and using your gut feeling. In teams full of technical people, I have repeatedly made the experience that this skill — using your intuition – has either been unlearned, suppressed, or is actively or passively being discouraged by (technical) leadership.

But trusting your gut has some considerable advantages:

1\. In the case of long term negative or positive effects you have something to base your decision on. Do you _feel_ good with that decision? Or are you hesitant that it will contribute to your long term goals? What is your first thought without trying to dissect the matter? I have made the experience that people generally tend to have a really good intuition when it comes to these kinds of decisions.

2\. In a rapidly changing environment you can make a decision _now_ — you don't have to wait for a complicated measuring process to be finished. You can _ask_ people how they feel about a certain change as well. Chances are you might get a gut feeling back.

3\. You can be truly agile. Test something by putting it out and see what happens. You need an ongoing process for learning from what you experience and applying the necessary changes though.

4\. A lot of pseudo-scientific methods for measuring outcomes beforehand are based on the assumption that their result will apply to the real world. This is not always the case. In the worst case you have wasted time by applying a complex technical process just to get an outcome that will waste you even more time, because it doesn't match what you predicted.

Don't overcomplicate stuff. Individuals and interaction over processes and tools.

</comment><comment><USER3> At a local meetup we had a speaker come in and talk about "The Process" (en.wikipedia.org/wiki/Philadelphia_76ers#2013%E2%80%93present:_The_Process_era) which he deduced is design a strategy for long term success and see what happens. My thought was most tech employees and executives have very short tenure (3 years) so making short term decisions is incentivised (there is a lot of writing on this.) You can imagine as a product manager/GM/VP you'd push very hard on something like Amazon showing ads because its "new revenue" and regardless of if its a good idea in the long term for the business, its runs on the board in the short term which will provide yourself as an individual with the best results.

I don't know if people will be shocked with that type of thinking, but I've been thinking about it more and more this year.

<comment><USER4> It's interesting that they're calling this "The Process". In general, I tend to associate that word with approaches that try to make decision-making more organisational (which tends to mean metrics above all). In this case, it does seem more a case of hire someone strong and give them substantial authority.</comment></comment>


Show HN: CallKite – Your website's video call center in just one click - <AUTHOR> https://callkite.com/ <comment><AUTHOR> Hey HN!

I'd love feedback on the idea, and the main two use cases: sales & support. This system requires no real phone, only a web browser (webrtc p2p video + screen sharing).

I was inspired to build this by a comment with a partner (on another SaaS): "if i have a team i want to scale quickly, they should be focused on 1 thing and 1 thing only"...

They do a lot of online marketing with funnels, and close deals over the phone. They use a mix of sales pages, and close deals over the phone.

So with CallKite their team of sales team can all actively answer questions of potential buyers, right there live on a sales page as if they were over their shoulder or in real life. They can sit down from anywhere with a browser, and just start answering calls.

I have a lot of ideas of where this product could go, but I wanted to get a usable and simple version out the door A.S.A.P. Thanks for checking it out!</comment>


Glitch, now v1.0, goes open-source starting with Glitch.com - <AUTHOR> https://medium.com/glitch/glitch-opens-up-welcome-85c62d0d6e84 <comment><USER2> Glitch is something special, something very activating and super engaging. This is amazing news!

</comment><comment><USER3> > We announced unprecedented new developor tools like full-stack view source

Is there a shortage on proofreaders this year?

<comment><AUTHOR> Good spot! Now fixed.</comment></comment>


NHS refuses to sign revised £3bn CSC deal - <AUTHOR> http://www.computerworlduk.com/management/government-law/public-sector/news/index.cfm?newsid=19687 <comment><USER2> When will they realise that the scale of the project in itself is enough to kill projects like this.</comment>


Ask HN: How good do I need to be to be a technical cofounder? - <AUTHOR>

I've always described myself as a product guy... in that I've got enough skill to whip together products but I've always been reticent to describe myself as a technical cofounder since I don't dream in algorithms.<p>I'm wondering how you view technical cofounders. Is it the passion for CS that defines a technical cofounder? Or just someone who has the ability to hack stuff together, and later manage a technical team? <comment><USER2> To be a great founder, you just need to be good at one thing: building stuff that people will love and buy. The rest you can either learn along they way, or hire someone to do for you.

Dreaming of algorithms doesn't make you understand customers, help you get funding, or help you build a great team. If you love your customers, and build something they will fall in love with, the rest will follow.

<comment><USER3> That doesn't address his question. It addresses what every "founder" should have, not what determines a technical cofounder...

OP, I think as long as you can build what you're trying to build and it's solid without serious issues, you're good enough. Most founders will end up hiring more technical people on to help with complex algorithms and such down the road. Not every technical founder have say, a PhD in Machine Learning for example, to build a complex semantic search engine (random example). As long as you're confident in your code to an extent to get the company up and running and be able to lead a technical team, you're probably good enough to call yourself a technical cofounder.</comment></comment>


Ballmer slams door on Yahoo deal - <AUTHOR> http://blogs.ft.com/techblog/2008/11/ballmer-to-yahoo-investors-what-didnt-you-understand-about-no/

<comment><USER2> As soon as MS signal it is interested again, the Yahoo stock will rocket. I doubt they will comment in public one way or the other.

</comment><comment><USER3> makes me want to take over yahoo and make it successful. stick it to ol ballmer the spaz...

wouldn't be hard</comment>


xkcd: Instagram - <AUTHOR> http://xkcd.com/1150/ <comment><USER2> I think a better comparison would be... a community art gallery opens, they invite all local artists to show their work for free. It becomes more popular then the Louvre and the owner gets fabulously rich, and sells the gallery to MOMA.

One day the new owner of the gallery realizes it's losing tons of money (and taking visitors from it's money making gallery in NYC), and it knows the artists are not going to pay (and maybe can't afford to). So it starts making prints of the artwork and selling them without giving the artists a royalty.

<comment><USER3> That may be a better comparison, but it's not what you'd say... you know, 'funny'.

<comment><USER4> The whole idea of instagram was "instant postcards". The idea that they would help you do make these. Not that they would go creep out shots of your family and sell them for a profit to 3rd parties without consent. Or sell your data to be analyzed and fed into behaviroual profiling for junk mail. If they want to charge for postcards, then nobody would complain in this way.

Instagram is (now) just a clever form of social engineering...not a product.

</comment></comment></comment><comment><USER5> I disagree fundamentally with the message xkcd is saying here. Instagram, facebook, myspace etc all gained traction as basically setting up a website or wordpress site was just not practical at one time. They all give the impression that it's a practical and reasonable alternative. And that's what 99.9% of their users think.

And then of course the funding starts to dry up and the accountants start needing to see some hard $$$$ income. And that's when the ToS start to "adapt" to enable aforementioned sites to monetize "their" content. Oh didn't you know ? It's not your website after all. Sorry ! And thanks for getting your friends on board too !!

<comment><USER6> Instagram, and other social networks, are fundamentally different than wordpress sites in a number of important ways. 100 million users didn't join because it was an alternative to a blog.

Their funding didn't dry up. They raised a substantial round, and then were purchased by another company that had itself just raised billions of dollars. They didn't need money.

But they did want to make it. Because they're a business.

<comment><USER7> I'm not sure what your point is here.

Raising money or being bought doesn't give them the revenue streams they need to turn themselves into a real business with a sustainable future. They could have carried on burning through capital sure, but that could only go on for so long and ultimately some sort of direction change was inevitable, whether it was asking users to pay, selling advertising or whatever.

</comment></comment></comment><comment><USER8> This is the first time XKCD has struck me as being ignorant... I'm assuming that it's for the sake of the joke.

People have a right to be annoyed by this, in fact I wish it was more common. Rights to our own creations should not be taken so lightly. So I support the sentiments of boycotters, even though Facebook is well within their rights to make this change. I don't support the attitude that it's unjust, but overreaction is better than none.

<comment><USER9> The "creations" that people are posting are low-res cellphone pics of food and random scenery with a faux-retro filter added. Why so serious?

<comment><USER10> [http://www.forbes.com/sites/parmyolson/2012/12/19/instagram-...](http://www.forbes.com/sites/parmyolson/2012/12/19/instagram- boycott-now-includes-national-geographic-and-anonymous/)

Looks like the National Geographic is doing more with Instagram than just some filters and bad food photography.

<comment><USER9> I still do not understand the outrage over this. How would the new TOS actually negatively affect the users? What would ACTUALLY happen to them that is so horrible?

Here is a hypothetical:

1\. I post a photo of a dinner table at a restaurant that shows some fizzy drinks in glasses.

2\. SodaStream wants to post an ad on Instagram, and my photo gets selected kinda like a stock-photo would be selected because it is drink/food related, and it gets shown somewhere on Instagram's website.

Result: my life is not negatively impacted by this in any way, and the world continues turning.

My reaction: If ever saw this happening, my reaction would be "Whoa cool, that's a picture I took! And now tons of people are seeing it, instead of just the 5 or 6 people that normally see my Instagram photos. I'm internet famous, haha!"

The blogo-sphere's reaction: "RAAAAAAAGGGGGGEEE!!!!!!!!!" I ask: "Seriously, what is the big deal here?" They respond: "Just shut up, and RAAAAAAAAGGGGEEEEE!!!!"

<comment><USER11> Not everyone has the same reaction about everything.

For some people, its not cool. And, being unable to buy a controlling stock option in the company to make it obey their wishes, they used the lever of public dissent.

Looks like it worked, too.

</comment></comment></comment></comment></comment><comment><USER12> "Chad's garage" seems like an appropriate generic term for a web startup whose users are not the company's customers, but it's not clear that anyone else wants to be the customer either.

As in: "-Why did MySpace fail? -They were basically Chad's garage."

<comment><USER13> Only Tom sold the garage for quite a lot of money in 2005 but there was no stuff in it, just a dusty list of people who had left the area never to return.

<comment><USER12> Apparently quite a few local bands had moved their stuff into the garage, spray-painting the walls and keeping loud music blaring all night. This had given Tom the false impression that the garage is a popular nightclub, so he expected to make his money back by selling $10 drinks but it turned out that nobody except stoned band members ever visited the garage.

<comment><USER14> Then the band members all went to holland to use this modern, well outfitted studio space in a fetching shade of orange. The owners of the studios had the sense to charge them a reasonable fee and so they actually stayed, and all was well.

<comment><USER15> What site is this? Soundcloud?

</comment></comment></comment></comment></comment><comment><USER16> Feeble. More like "I got this note from Chad. He sold his garage to a guy who collects interesting things, and is going to let him use my stuff".

But the crux of this is the complaint is _not_ "That's no way to run a storage business". The complaint is "that's a dick move to pull when he invited me to keep all my stuff in his garage, and got rich as a result".

<comment><USER17> The better analogy is that Chad got rich by selling the well-stocked garage to someone else. The new owner didn't get rich by hosting your stuff, in fact they have paid good money for the privilege and now want to find a way of making that money back.

Facebook is in the hole for one billion dollars on this deal and so far haven't made back a single cent.

</comment></comment><comment><USER18> Well, in this case Instagram invited us to use their service, and only later (as far as I know) changed the terms to allow them to sell our stuff, so the comparison between Instagram and Chad's garage isn't exactly correct.

<comment><USER19> When Instagram invited you to use their service you should have considered how they might make some money out of that...

<comment><USER20> Yes, and the most common way of achieving that is by showing me ads, not by selling my photos. Now, why should I have assumed the latter, and not the former?

Hell, I don't have an Instagram acount anyway...

<comment><USER7> If people wanted their photos hosted on an ad driven site they existed, if they wanted them on a paid for site they existed too.

But instead they chose one with uncertainty over what might happen and this is what you get.

Sure it might not be what they would have expected but that happens sometimes when you open yourself up like that.

</comment></comment></comment></comment><comment><USER21> I said it the other day in another thread, but just because you pay doesn't mean you've avoided this type of treatment. Remember when cable TV was ad-ree because, you know, people paid for it?

There is absolutely nothing stopping Facebook or Instagram from doing the same shit they currently do, even if they start charging their users. And the services that currently get by on user subscriptions alone will one day have to find another way to grow. And the way they'll do that is by selling ads and monetizing user data.

<comment> brown9-2 _Remember when cable TV was ad-ree because, you know, people paid for it?_

No, I don't. Do you recall how far back this was?

<comment><USER21> I'm pretty sure MTV was ad-free when it began. Same with HBO, etc. I'm thinking early 80s. I'm sure not _every_ cable channel was ad-free, but plenty of them were because they got enough revenue from subscriptions.

The thing is, services that start out free can't begin charging users without losing more users than it's worth. But services that start out being paid for can easily find ways to grow revenue by monetizing their user base and selling ads, in addition to maintaining or raising subscription fees. Satellite radio is yet another example.

</comment></comment></comment><comment><USER22> I don't understand the disagreements.

>Well, I'm _this_ close to not giving him any more stuff.

>That'll teach him.

The point is, unless you're paying them money, you have nothing to threaten them with. You can't stop paying for their service (like you can with other businesses), since you weren't paying in the first place. They're a business and they're not beholden to you in any way.

Maybe it would be more clear if we had another panel explaining that Chad has no job, yet recently took a large loan from the mob. And you still decided to put your stuff in Chad's garage.

The final punchline of course is that you're not going to do anything about it.

<comment><USER23> >The point is, unless you're paying them money, you have nothing to threaten them with.

That self-righteous attitude being made fun of (i.e. That'll teach them!) is the morose self-righteousness so many of our generation feel these days when they figure out that they aren't the special flower who produces sacred works of art and are rather an id in a database who needs to be exploited for revenue somehow.

No one gives a shit if you stop using Instagram over this perfectly legitimate (in my eyes) move that was unfortunately retracted. Don't announce it over Twitter, because no one is listening but yourself.

</comment></comment><comment><USER24> Metaphor is a too weak -- The differences between physical storage and social photo sharing are just too numerous.

Chad would have actively promoted that you add stuff to his garage. He'd have also encouraged you to encourage others to put their stuff there -- _and_ he'd have encouraged you to put stuff there on others' behalf.

Plus, somehow, convincing people to put stuff in his garage (greatly, greatly) increases the value of the garage.

So yeah... I know it's a joke, but it's a labored one.

<comment><USER25> Yeah, how does that work? If someone uploads a photo they took of me to Instagram, can Instagram now sell that to an advertiser and use the image of me without my consent?

<comment><USER26> It's probably not an easy question to answer: [http://en.wikipedia.org/wiki/Personality_rights#United_State...](http://en.wikipedia.org/wiki/Personality_rights#United_States)

</comment></comment></comment><comment><USER27> This is a really weak argument. It glosses over the nuances of what was originally offered from a business , and what they then tried to pivot to. Its one thing If I as an individual let you upload photos to my server, and make you a little front end to share them. It's another thing altogether If I register a business and market a product to you along with specifics about things like price and terms of service, then after I become popular and widely used I switch out the terms of service that we had originally agreed to. This is like a manufacture dumping products on the market, then once all the competitors are out of business raising prices for replacement parts.

<comment><USER7> The issue with that argument is it was (or at least should have been) clear to everyone that Instagram didn't really offer anything "as a business" initially, it was an unsustainable land grab.

That means that the pivot was always going to come, whether it be to an advertising driven model, a merchandising model, a paying user model or whatever.

While I'm not wild about the direction they've chosen, anyone using Instagram should have known that a change was coming and accepted that risk from the outset.

<comment><USER27> That's the same kind of argument that people use to say you should only buy "American" cars, or read the labels of where your clothes or smartphones were made. It doesn't work.

<comment><USER7> Two things:

1) I agree they don't but I'm saying they should. I don't think having people understand that there's no such thing as a free lunch is that much of a stretch.

2) The people filling the HN boards moaning about it are generally internet and business savvy and already have the information they need to understand this. I'm not saying they need to be happy about what's happened, but they shouldn't be surprised and should have understood the risk of it happening.

</comment></comment></comment></comment><comment><USER28> I think this one has missed the point... Chad does everything he can to get people store their shit in his garage and is really proud that so many are using his garage.

</comment><comment><USER29> But differently from Chad, instagram openly does care if you leave. So you've got leverage to negotiate with instagram, but not with Chad. I don't care if you prefer to label it as users or products or whatever. If they care to keep you, then you've got leverage to negotiate, period. The rest is just subjective semantics.

</comment><comment><USER30> Well, I would say the difference is that when you put your stuff at your friend's place, he did not say that he may sell your stuff at some later date. If he had told that, you maybe would never have put the stuff at his place at all.

<comment><USER31> He didn't tell you he _wouldn't_ sell your stuff thought. And you'll notice it's not "my friend Chad" implying a level of trust reserved for friends. It's just Chad. This guy Chad. His garage has nice shelves.

<comment><USER32> It is still legally theft though to sell stuff belonging to someone else even if it happens to be in your garage.

For it to not be theft you need an agreement which says he may sell it.

<comment><USER33> You might be right, in the sense that I probably cannot make profit from your stuff you left in my house, although I'm not sure about it.

But imagine this scenario: I don't know you, but I dump a pile of stuff in your backyard. A lot of stuff, with some relatively valuable stuff in it, like copper.

You get home and what? Are you expected by the law to put your sweat and/or money to get rid of that stuff from your backyard?

Or is it perfectly legal to call somebody which will clean that up for you in exchange for the value of the stuff? They might even profit from that (after all that's profit in exchange for work)

<comment><USER11> No one jumped a fence to place things in Instagram's back yard. They were invited in and told to leave things there.

</comment></comment></comment></comment></comment><comment><USER34> I have one problem with this comparison: If Instagram would start selling my photos I could still access and display them. I would not lose anything.

<comment><USER35> Same thing as the "you wouldn't steel a car" analogy. Didn't think XKCD would fall for that mistake.

<comment><USER36> In this case, the "car" and other garage contents in the analogy equate to the _exclusivity_ of one's legal claims to one's own copyrighted material. Under the Instagram ToS, that would have gone away, in that they asserted a perpetual, broad-scoped license to your copyrights.

A large gulf lies between having individuals infringe your copyright and having the legal ability to enforce that copyright taken away.

</comment></comment></comment><comment><USER37> Chad offered me and my friends a place on his lot to store our stuff. He told us all about how safe his lot was and how easy it would be to find our stuff.

Now Chad says that to pay his bills in the future he's going to let strangers pay to wear our clothes. And he won't tell us when they do, or how often, or which clothes they wore.

Which I think is cool, because hey, free service, free market, amirite hackers?

<comment><USER9> "...he's going to let strangers pay to wear our clothes..."

How does this match up with Instagram's TOS in any way? I still do not understand what Instagram is doing that is getting everyone so riled up.

<comment><USER37> Instagram put forth a new TOS in which they could sell your photos to be used in advertising and you would have no rights over that. They wouldn't pay you for it. They wouldn't tell you when it was happening.

They've since recanted.

</comment></comment></comment><comment><USER38> Discovered this week when tweeting a link to an old xkcd comic that @xkcd has been registered and has more than 14,000 followers ... and only 1 tweet. (Confirming it was officially Randall.)

Seems to be an opportunity for some simple automation to add some reasonable distribution into the 'Twittersphere', so I was surprised to note it.

<comment><USER31> Maybe he doesn't want to pass out flyers for his band practice in Chad's Garage.

By publishing on Twitter, he is essentially handing some control over his output to Twitter. Not a lot, but some. By registering @xkcd, he's just protecting his online identity.

</comment></comment><comment><USER39> There are waaay too many comments in here stating one way or another "this is a terrible comparison! it's nothing like this!"

A.) it's a webcomic, not a lawyers overview of the situation. B.) I think yall are missing out on the joke, which is not the metaphor with Instagram, it's the users reaction that is the punch line. C.) The take from the comic is, if you're not paying for it, don't call it a business, at least not a business where you are the customer.

<comment><USER40> Does he think he's writing a editorial cartoon now?

</comment></comment><comment><USER41> If you're not paying for the product, YOU are the product.

<comment><USER42> I'm getting very tired of hearing this. It's like we make up excuses for startups being dicks. There has to be a way to find business model that involves showing respect for your users and the content they're creating, while still making money on ads, offers, etc.

It also completely ignores the fact that paying customers get ripped off all the time, by the companies they pay money to. In the wider perspective, being a dick doesn't seem to correlate to receiving money from your user-base.

Here's an excellent text about it: <http://powazek.com/posts/3229>

<comment><USER43> _There has to be a way to find business model that involves showing respect for your users and the content they're creating, while still making money on ads, offers, etc._

I agree with the first part but not the second. What if the best way to show respect for your users is _not_ to pester them with ads and offers, but to let them pay you directly for the value you are giving them?

<comment><USER44> I think that's my biggest hangup with this. There was never a "Well, we're thinking about doing this with your photos, but we were wondering if you valued the service enough to pay for it instead?"

There would have still been outrage, but people pay to get rid of ads on services all the time.. particularly if they want to continue a streamlined experience. If not, they can tolerate the ads. But using _my_ photos as ads? If I opt-in, sure. But I don't want that by default. I'd rather see something irrelevant than have my likeness potentially supporting a business I don't want to.

</comment></comment></comment></comment><comment><USER45> Surely it would have made a better analogy if Chad had ended up hiring out stuff stored rather than selling it.

</comment><comment><USER46> Would we say that WQHT 97.1 FM in NYC is not a music broadcasting business just because it's listeners don't pay for the service? Would we argue that a lot of users threatening to stop listening is meaningless because they can't stop paying the station?

</comment><comment><USER47> How is it that when it comes to copying corporate owned assets like music the debate is always on how its not theft as the core product remains. Yet now that we are talking about user submitted content that view does not hold.

</comment><comment><USER48> I've never been to Chad's garage so far and probably ever won't.

One point to see here is that digital things are unlike physical things and can be copied and stored somewhere. You wouldn't even know!

</comment><comment><USER49> I just wrote about his same idea: <http://bckmn.com/pay-for-your-life-online/>

</comment><comment><USER50> I think Chad blinked when he heard the sound of multiple trucks backing up to his garage to collect all the stuff he thought he was going to sell.

</comment><comment><USER51> when will consumer internet businesses start charging people real money, and when will users realize that they need to open their wallets? there is no free lunch... a direct business relationship (customer x company) is better for everyone.

</comment><comment><USER52> lol Too true. It's inevitable that any free internet service will have to make money somehow - and if the only asset they have are photos you uploaded, well, they'll use them.

</comment><comment><USER53> bear in mind that the complaints appear to have worked. instagram reverted their policy, it seems (via the front page at present on hn).

</comment><comment><USER54> It's funny but the analogy doesn't really hold.

</comment><comment><USER55> Spot. On. Except Chad wants us to store our crap in his garage. Hmm.

</comment><comment><USER56> xkcd: often right, rarely funny.

</comment><comment><USER57> this is actually spot on</comment>


Productivity and the Workweek - <AUTHOR> http://groups.csail.mit.edu/mac/users/rauch/misc/worktime/

<comment><USER2> >shorter hours were assumed to be a natural consequence of increased productivity

Another possibility is that progress will increase the amount of people that are unemployed or unneeded to support society, as the others continue to work the same hours. Not that far-fetched, if you consider our current work- culture.

If this happens, there would be rising social unrest at first, but I believe we'd reach a tipping point and a decrease in population would eventually correct the offset. Of course human reproduction can't be explained away by simple supply and demand, but the fact is, birth-rates are lowering in developed nations.

While these may just be suppositions, I think it's interesting to try and predict how progress will shape our population growth.

<comment><USER3> > a decrease in population would eventually correct the offset

a.k.a. lots of people die

</comment></comment><comment><USER4> > An average worker needs to work a mere 11 hours per week to produce as much > as one working 40 hours per week in 1950.

Suppose there's a meteor heading for earth that will collide in 30 years. If that's the case, the increases in productivity will be helpful in saving the race.

That said, IMO it makes sense to channel some percentage of productivity increases into faster progress, but also some remaining percentage into reducing standard working hours a little.

</comment><comment><USER5> [https://news.ycombinator.com/item?id=8262381](https://news.ycombinator.com/item?id=8262381)

<comment><AUTHOR> wow that's strange: I searched the title (without the year) before posting it but I got only one result from 2011 and no comments

<comment><USER6> If you search for for "Workweek" (which is what appears in the actual title of the article), it doesn't find the posting from four days ago since the submitter changed the title to "Work Week".</comment></comment></comment>


CDC reports the rich sleep better at night - <AUTHOR> https://medicalxpress.com/news/2020-07-cdc-rich-night.html <comment><USER2> I know a lot of "rich" people that have better life habits: don't smoke, drink very little, use a budget, live within their means, exercise, eat healthy, etc. I'm guessing this is the underlying reason why. Causality is a hard thing to link because it gets us into a chicken-egg scenario... One likely breeds the other.

</comment><comment><USER3> this is a question from me to people who are rich (or at least richer than the poor people this article alludes to):

what advice do you give to poor people who don't want to be poor? is it out of their control? is there anything they can do?

<comment><USER4> The advice is endless. There are so many traps out there to keep poor people poor it's insane. Mostly targeted at racial minorities but a lot target lower income people in general.

1\. Avoid lotteries and gambling

2\. Avoid fast food and expensive prepared convenience foods.

3\. Focus on cheap or zero cost recreation like hiking, running, or cycling. Avoid expensive stuff like Movies, Restaurants, Bars, and Gyms

4\. Minimize costs in your life as much as possible.

5\. Spend spare time accruing valuable skills (Plumbing, Electrical, Software, Engineering)

6\. Invest in index funds

7\. Avoid cell phone plans

8\. Avoid car ownership

9\. Learn to cook low cost meals

10\. Balance a budget and keep track of every transaction.

Even then there are tons of traps like addiction, depression, ignorance, and peer pressure.

<comment><USER3> further down in the thread (other replies to my original post), the consensus seems to be that none of this matters. it basically boils down to "were you born poor or rich? what type of education did you receive growing up?"

<comment><USER5> Don't fall into that trap of "I cannot do anything about it if I wasn't born rich".

The commenter above gave perfectly sensible and practical advice on how to reduce costs (e.g. choose your hobbies according to your income) and how to potentially boost your income (e.g. develop valuable skill such as plumbing or software engineering).

You might not become millionaire or billionaire, but you can definitely learn how to live within your means or how to boost your income.</comment></comment></comment></comment>


How and Why to Hash Passwords in PHP - <AUTHOR> http://phpsec.org/articles/2005/password-hashing.html

<comment><USER2> Well, bonus points for including SQL that doesn't suffer from SQL injection issues, but every one of the suggestions is wrong.

I'm personally confused by this comment:

      Note: Using MySQL's password() function in your own applications isn't recommended - the algorithm used has changed over time and prior to 4.1 was particularly weak.

So.. if you know it's not recommended, why even include an example of it?

</comment><comment><USER3> yikes, a php security site telling people to use sha1().

don't use sha1 hashes for storing passwords, use bcrypt. <http://www.openwall.com/phpass/>

or a quick code snippet:

            for ($salt = "", $x = 0; $x++ < 40; $salt .= chr(mt_rand(0,255)))
                ;

            $hashed = crypt($password, '$2a$08$' . hash("whirlpool", $salt));

</comment><comment><USER4> I hope this article is really old...at least then the author can claim ignorance.

phpsec should update this article with a more secure example.</comment>


Show HN: SpendStudy is now free - <AUTHOR> http://www.spendstudy.com/

<comment><AUTHOR> I got some feedback from HN about the pricing which made me think honestly about the pricing structure I was adopting.

So I have now made a free version sans the text messaging facility. Please do let me know what you guys think</comment>


California Police Arrest Man for Video Recording, then Kill his Dog - <AUTHOR> http://photographyisnotacrime.com/2013/07/01/california-police-arrest-man-for-video-recording-then-kill-his-dog/

<comment><USER2> such bullshit that this was deleted when it was the top story on the frontpage. Clearly it's relevant to this site if it was upvoted to the front page!

<comment><USER3> Eh, I get where the admins are coming from, on the one hand I'm glad to have been told about this, on the other hand this seems more like Digg or Reddit content than HN content. If HN put outrageous things on the front page whenever they occur, we'd probably have nothing else left.

<comment><USER4> It's got 4744 upvotes and 7708 comments on Reddit atm. I agree with you entirely.

<comment><USER3> And Reddit appears to have just removed it from /videos. With that in mind I am now more open to the idea of it being on HN.

<comment><USER4> Still up on /r/Bad_Cop_No_Donut - [http://www.reddit.com/r/Bad_Cop_No_Donut/comments/1hg9xa/haw...](http://www.reddit.com/r/Bad_Cop_No_Donut/comments/1hg9xa/hawthorne_ca_police_kill_dog_of_onlooker_xpost/) \- and probably loads of other places. Memes will surface about it, etc. I agree that it is bad; I just think that Reddit is the perfect forum for such expositions. HN will just turn into Reddit if it goes down the "high emotional content" route, imo.

</comment></comment></comment></comment></comment><comment><USER5> Reddit is leaking again.

<comment><USER6> Feeding the troll here, but...

I find it highly relevant that every action private citizens perform online and while out in public is recorded, stored, and indexed en masse 'for your protection' while police intimidate and arrest citizens who do the same to them while they perform their duty as public servants.

</comment></comment><comment><USER7> All I can say is that the dog owner failed to properly control his dog...

Sadly, the dog paid for it with his life.

<comment><USER6> Think about it for a second before blaming the victim here... Police are advancing towards this guy to apparently illegally arrest him, one of them armed with what looks like an assault rifle.

Now you're suggesting that after getting the dog into the back of the car he should try to get in the front seat to raise the windows? (assuming they are power) How do you suppose the police will respond to that?

He had to make a split second decision while heavily armed men, having demonstrated no respect for the law or his civil rights, are advancing. I can only imagine my adrenal response would be in full gear and all that entails, while this man is helping them with the handcuffs.

In my opinion this citizen deserves our sincere respect and condolences for his dog, and good luck to him in his criminal defense and, if all goes well for him, civil suit against the city of Hawthorne.

<comment><USER7> I have viewed the video more than once, and it appears that the man is antagonizing the police.

Not a good idea in today's police state.

He knew that he was antagonizing the police, and this is why he placed the dog inside the vehicle.

The man is obviously not blind, and even a partially blind man (me) is able to see that the rear driver side window ot the car is opened enough to permit the dog's exit from the vehicle.

That the dog exited the vehicle from the passenger side rear window illustrates the extent of the dog owner's negligence. The dog had more than one choice of egress from the vehicle, which the dog owner failed to act upon.

I don't like this story any more than you do, but the death of the dog is the owner's fault.

<comment><USER8> No, the fault lies entirely with the police and their policies. The police failed, and it's clear to most people who happen on this story.

<comment><USER7> I don't know about the laws in your jurisdiction, but in my state, we have a law regarding dogs known as, "Liability, dog owner."

This law deals with irresponsible dog ownership.

Who here will attest to the fact that this dog owner maintained complete control of his dog?

Don't mistake my position for being pro-police, look at the facts of the matter.

That dog would never have been shot by the police if the dog had been properly constrained within the vehicle.

<comment><USER8> It's very hard not to mistake your position as being pro-police when the owner was not capable, despite his intentions to properly constrain his dog within the vehicle.

To me it all sounds like a bully taking a kids hand and using it to punch the kid's face all while saying: "Stop hitting yourself! What are you stupid? Stop hitting yourself!"</comment></comment></comment></comment></comment></comment>