Ello mocks Facebook by being creepy - <AUTHOR> http://mashable.com/2015/06/25/ello-facebook-ads/

<comment><USER2> Unfortunately, the Ello ecosystem seems more or less resist any non-artsy content like an immune system warding off a plague. They've quite thoroughly positioned themselves as an alternative to Tumblr photoblogs, and little else. The recommendations and suggested users are all weighted towards hipstery, partly because the algorithms all seem to be seeded off connections to the founders, themselves artists.

The end result is that everyone not interested in posting art photos inevitably seems to get bored and wander away.

<comment><USER3> It's not totally a bad thing though is it? Seems almost natural for a social network to start with a sort of single focus

<comment><USER2> No, it's totally a cool place, if that's what you're into.

As a writer and a techie though, I struggled to even find anyone else on the network with similar interests, and of those, they seemed to wither away over time.

The end result is less a "Facebook-killer" and more a "Tumblr/Pinterest alternative for upmarket artists".

<comment><USER4> @ddailey has some amazing SVG examples, I highly recommend him:

[https://ello.co/ddailey](https://ello.co/ddailey)

There's @ellotech: [https://ello.co/ellotech](https://ello.co/ellotech)

And @ellowrites: [https://ello.co/ellowrites](https://ello.co/ellowrites)

Search can turn up people writing on topics of interest, say:

[https://ello.co/search?terms=webdesign](https://ello.co/search?terms=webdesign) [https://ello.co/search?terms=python](https://ello.co/search?terms=python) (about 90 posts in 9 months)

Or you can enjoy the art.

</comment></comment></comment></comment><comment><USER5> Somebody should write an open protocol for social applications. Then convince the governments to enforce companies to use that open protocol (like it is already the case for telephony, for example).

I think for the European government, this would not be impossible to achieve.

<comment><USER6> That would bring the kind of unbridled, exuberant innovation that typified telephony for decades to the internet.

<comment><USER7> I think you're trying to make a joke, but AT&T's Bell Labs was one of the greatest centers of innovation in engineering and applied mathematics of the 20th century. The output was remarkable.

<comment><USER8> I guffawed, but then I remembered that these same people gave us sendmail.

<comment><USER7> Sendmail? No, but they invented the transistor. And UNIX. And introduced the discipline of information theory. Confirmed the wave nature of electrons. Pioneered cell-based (cellular) communications. Invented the solar cell. And the laser. Created the first trans-Atlantic communication cable. The first communication satellite. The C programming language.

</comment></comment></comment></comment></comment><comment><USER9> Those ads will be removed very quickly. The publicity is not from the ads but from the articles about the ads. And the snake continues to eat its own tail...

</comment><comment><USER10> Me, and a lot of my friends, really _tried_ to use ello, but the interface is so confusing that we really couldn't figure it out (not for lack of trying!).

Reading their about page just stinks of pretentiousness, as well, which kindof leaves a negative taste.

[https://ello.co/wtf/about/what-is-ello/](https://ello.co/wtf/about/what-is- ello/)

<comment><USER11> Much the same experience. They could do with an easier interface if nothing else.

</comment></comment><comment><USER12> As an avid user of Twitter, all I can say is that Ello has captured my attention to the point that I'm spending more time there these days (@teanee). Twitter is still best for in-the-moment news, tracking bugs or product updates, quirky random asides, and even finding other Elloers. Brevity is the sweet spot for Twitter. However, privacy and ad tracking (including Twitter's rush down the Facebook algo path) have made me look at Ello as a bit of an oasis. I like the company's principles and take on what a social platform should be. So yeah, I'm loving it on Ello - especially with an app now.

</comment><comment><USER8> Ello is beautiful? Guess it really is in the eye of the beholder.

<comment><USER13> Just went to the Ello website and got greated by a flashing heading and a menu with a single-digit font size. Not very welcoming in 1995, and a turn off in 2015.

<comment><USER4> What browser/OS if you don't mind?

<comment><USER13> Chrome on Windows and similar (less usable but better looking) experience on Safari/iOS8.

<comment><USER4> Thanks.

</comment></comment></comment></comment></comment><comment><USER14> I don't get those banners... First I thought they were placeholders not removed by my blocker.

</comment><comment><USER15> Ello? Does that still exist?

</comment><comment><USER16> I will def. give it a try after they published their Android app.

<comment><USER4> That's being worked on.

[https://ello.co/cacheflowe/post/VCub0RNsU- EkEzPd4dKmpQ](https://ello.co/cacheflowe/post/VCub0RNsU-EkEzPd4dKmpQ)

<comment><USER16> Yes, that is why I'm waiting. I'm on that list.

</comment></comment></comment><comment><USER17> The joke is on anyone who invested in this company, thinking it would be even 1/100 a successful as Facebook. Remember bebo?

<comment><USER18> I remember when Bebo sold to AOL and made its investors and founders incredibly wealthy.

<comment><USER4> AOL: [http://techcrunch.com/2008/03/13/aol-buys-bebo- for-750-milli...](http://techcrunch.com/2008/03/13/aol-buys-bebo- for-750-million/)

<comment><USER18> Thanks</comment></comment></comment></comment>


Ask HN: Project based interviews in SF? - <AUTHOR>

Are there companies in SF that do project based interviews?  I am currently looking for a job in the bay area (from the East Coast), and I am finding it extremely tough/nerve wracking to do these live coding sessions that every SF based company seems to do.  As I am still currently working, trying to line up these phone sessions during my days off are tough, but I really do not want to go on-site and do these white board tests as the only technical test of my ability.  It seems like I have to pass them to get any kind of offer, and I feel like it would be beneficial (to both parties) if they can judge me of my abilities before they pay me to fly over there.
I just find it frustrating as I always hear about the huge demand of developers in the bay area, and I believe I have a great resume and work experience (at least good enough to get a response to companies I like) to at least get some type of position, but trying to schedule all these interviews and the added pressure of "performing" in front of someone that can make or break my plans is just not a very pleasant experience.  That's why I'm looking for other ways to show off my technical abilities, and project based interviews seems to be ideal.  I can work on them nights/weekends and overall, it is less time consuming (vs studying/planning/flying).  Plus if a company rejects me, I feel like they at least judged me by my code rather than some interview question that I didn't get because of being too tired/stressed/etc. <comment><USER2> I've felt the same way for a long time... and the only way to get over it is to practice. Buy a whiteboard and practice at home. Buy some books (e.g. [http://www.amazon.com/Introduction-Algorithms-Edition- Thomas...](http://www.amazon.com/Introduction-Algorithms-Edition-Thomas- Cormen/dp/0262033844) and/or [http://www.amazon.com/Cracking-Coding-Interview- Programming-...](http://www.amazon.com/Cracking-Coding-Interview-Programming- Questions/dp/098478280X/ref=sr_1_1?s=books&ie=UTF8&qid=1411625412&sr=1-1&keywords=cracking+the+coding+interview)). You can also subscribe to [http://codingforinterviews.com/](http://codingforinterviews.com/).

Not exactly an answer to your question, I know. Most startups I know in SF/Bay Area at least do a technical test (either coding or just regular questions) on the spot. It is stressful, but as anything, you can learn how to do it.

<comment><AUTHOR> Thanks for the recommended books and links. That's actually what I'm currently doing. Studying and practicing. I just wish there was a better way. I feel like I'm back to my school days where your SAT/GRE scores mean more than your body of work. Of course, the difference is that I have to take a test for each company I apply to now.

</comment></comment><comment><USER3> Wow, that's one big paragraph. :)

It's going to depend heavily on the companies you're applying to.

Do you have a Github account? That might help. Also if you've got a really healthy Stack Overflow account or similar, it might help change the course of your interview.

There was a thread the other day about this -- [https://news.ycombinator.com/item?id=8200562](https://news.ycombinator.com/item?id=8200562) \-- where the OP is trying to avoid onsite interviews, so clearly they're out there.

On another level: you should know that there's no universal consensus on how to hire developers. If you keep talking to different companies, you'll find someone that's a good fit for you in your current situation.

Keep at it, and don't get frustrated.

<comment><AUTHOR> Hah.. sorry about the long paragraph. I edited it so it's now two whopping paragraphs :) And thanks for the link, that's really useful!

An active github/stackoverflow account would definitely have helped me, but it seems like, those things just gets you to the first step of getting a phone interview. You will still have to go through the entire process. But yeah, I do just have to keep at it.

<comment><USER3> One other idea that comes to mind:

If you're talking about a company that's been around a while and has a big HR department, they're going to have a well-defined interview process, and you'll be playing by their rules.

A smaller company or a startup is more likely to be flexible, and you may be able to suggest that they give you a sample project to start. They may prefer this, as they don't have to pull an engineer off an active project to spend time interviewing you. Everyone is different, so if they don't like the suggestion, you may have to work with them.

I saw from another commenter that you are practicing your skills at working with someone. The time and energy you invest in your people skills will pay off in a lot of ways over the course of your career (and in your personal life), so it might help to think of this as an opportunity.

FWIW Here's my company's project (bottom of the page) [http://cloudspace.com/hiring/](http://cloudspace.com/hiring/)

</comment></comment></comment><comment><USER4> We do project based interviews for candidates with the right backgrounds. If you want to know more, my email is in my profile.</comment>


New Mobile Safari stuff in iOS5 - <AUTHOR> http://davidbcalhoun.com/2011/new-mobile-safari-stuff-in-ios5-position-fixed-overflow-scroll-new-input-type-support-web-workers-ecmascript-5

<comment><USER2> I'm very disappointed that you still can't upload files in Mobile Safari. I "get" the whole no filesystem thing, but come on at least show the photo/video picker.

Little impossibilities like this make mobile web apps perpetually less useful than native apps, and that sucks.

<comment><USER3> Use a different browser. iCab Mobile supports uploading, downloading, and side-loading to DropBox or iDisk. The only time I use Safari is when I clock a link in Mail or Twitter or some other client; otherwise, I use iCab almost exclusively.

<comment><USER4> while i use icab 99% of the time, i've hit a few limits. first off, not being able to set it as a default browser is frustrating. secondly, i've found a few rendering differences between it and safari: onswipe (the tablet theme powering wordpress.com blogs) and google font api being the two biggest ones i've ran into recently.

<comment><USER3> Jailbreaking will take care of the first issue (can't wait to jailbreak my iPad...).

I agree that there are some issues with it (it crashes frequently enough that I care), but, overall, I've found, overall, it is much better.

Features I use daily:

      * Pinboard current page
      * ReadItLater current page
      * Readability
      * Side-load to DropBox to pick up on my Mac
      * Youtube inside the browser
      * Ad filters

And so on...

</comment></comment></comment></comment><comment><USER5> No word of whether activating a contentEditable now opens the keyboard. That'd be a big step for lots of content-focused web apps

<comment><USER6> Give me a sample URI and I'll check it for you. Or wait until I have the time to write up a naive example.

<comment><USER5> Try <http://aloha-editor.org/>

<comment><USER3> Too bad they can't be bothered to put any pricing information online. I have a project that needs an editor, it looks really good, AGPL is not even kind of an option, and I'm willing to pay for a license. But heck if I want to deal with "contacting" somebody to start thinking if it's worth looking at.

<comment><USER5> There is a bunch of other contentEditable implementations you may want to look at, many of them under a permissive open source license:

<https://github.com/alohaeditor/Aloha-Editor/issues/121>

BTW, the Aloha devs are willing to give exceptions to AGPL at least to open source projects.

</comment></comment></comment></comment></comment><comment><USER7> If no one gets before me ill verify today if Nitro is running in WebView / Fullscreen webapps, I would also like to check if webgl is working now but can't check right now, at work.

Great news that webworkers are "working" :)

I'm sure we'll also get an update from Phoboslab and impactjs if there are any significant performance gains elsewhere for html5 graphics.

</comment><comment><USER8> Man I hope the datetime picker allows masks/filters. I'd like to limit minutes to say, every half an hour.

<comment><USER9> Here is the spec: [http://www.whatwg.org/specs/web-apps/current- work/multipage/...](http://www.whatwg.org/specs/web-apps/current- work/multipage/states-of-the-type-attribute.html#date-and-time-state)

There is a step attribute. I don't know if they implemented that.

</comment></comment><comment><USER10> position:fixed is the most welcome addition.

</comment><comment><USER11> Any word on adequate html5/javascript sound support; e.g., does the demo at [http://www.schillmania.com/projects/soundmanager2/demo/chris...](http://www.schillmania.com/projects/soundmanager2/demo/christmas- lights/) work better than iOS4 (where the lag is huge)?

</comment><comment><USER12> Guy I just found a web browser does flash page without paying monthly fees. Puffin browser!! Check it out</comment>


Ask HN: Games that will teach me new ways of thinking / skills - <AUTHOR> I have a piece of paper from an academic institution that tells me I'm a smart guy with a huge enjoyment of learning new things. But experience suggests I can exclusively learn new things by actually doing them.
This means I can either struggle through turning technical documentation, textbooks, lectures, and so on, and then go and teach myself how to actually do the things afterwards -- which is hard -- or I can find learning resources that are setup for my style of learning, which is immediately rewarding.
From another thread here on HN, I recently found Human Resource Machine, which I love, and which (sort of) teaches you the basics of interacting with a simple chip. Some of the harder exercises there have caused me to write a little DSL which pretends to be an assembler so that I can solve the problems in an IDE. This has in turn probably piqued my interest enough to actually write some real assembly language.
I want more games that will teach me ways of thinking while having fun. I would rather whatever it teaches me expands my mind a little. I love both Civ and Simcity, but all I'm really learning while playing each is the algebra behind the respective game engines. I'm also not that interested in games that might give me a very shallow snapshot of history -- I'd rather watching a film!
On my short-list so far, from some quick searching:
- Rocksmith 2014 - teaches you guitar
- Dragonbox - apparently has an adult-version of teaching you more algebra
- MS Flight Simulator
- Kerbal Space program - orbital physics
- Duolingo, maybe
Any other recommenations? <comment><USER2> Chess : lichess.org</comment>


Cory Doctorow: Why I'm Leaving London - <AUTHOR> http://boingboing.net/2015/06/29/why-im-leaving-london.html

<comment><USER2> I like Cory Doctorow.

I've seen him speak a few times at the Open Rights Group conferences. It's a shame he's leaving Britain but I understand completely.

I'm seriously considering the same thing and possibly renouncing my citizenship in future.

I really dislike the direction it is headed as a society.

<comment><AUTHOR> My view is that LA is not necessarily that much better. Grass is greener...</comment></comment>


A quarter of Alabamians live in homes without internet access - <AUTHOR> https://www.al.com/news/2019/12/rural-disconnect-majority-in-some-alabama-counties-dont-have-internet-access.html <comment><USER2> The article is unclear about mobile phone internet use. Most poor people I know have (at most times) cell phones with a data plan. This is sufficient for most basic internet needs (eg billing, applying for jobs, gov't assistance).

Whether or not a wire goes to the house is less important.

<comment><USER3> I wouldn't bet on the availability of a data plan.

I regularly drive through Alabama on the way to Florida (from Atlanta). One time, I took a wrong turn and ended up in a small town with absolutely no cell signal and closed roads everywhere. We stopped and asked a local for directions. This was SE of Dothan, AL, I think.

And several times, Google Maps has routed me through areas where I no longer have a signal (south-central AL). Once when this happened, the road it wanted me to go on was closed and it couldn't download an update. I handled this one by just driving northish, knowing that I'd hit Montgomery eventually.

</comment></comment><comment><USER4> Given that the majority of the people they're talking about are poor or in poverty and most services they need, if not require it, at least are easier to obtain with internet access, this is tragic.

This is a very wealthy nation. We must do better.

<comment><USER5> Okay, as part of we, what are you going to do to help get these people internet?

Are you starting a charity or an LLC to build the infrastructure?

Are you going to invest in a company working to expand access?

Or so you just mean that someone else in the "we" collective needs to do something?

<comment><USER4> We should hold companies like AT&T accountable for the billions they have given to investors that was supposed to supply internet to rural areas for a start.

And why are you attacking me? I vote for candidates who I think will help. I am a foster parent so I have opened my home to the children displaced. Sure I could do more. But some don't do anything. At all.

<comment><USER5> Your anecdotes don't mean much to me other than that you can take action on things you care about. Which is good.

I simply dislike vacuous "someone, somewhere should do something" statements. Be they from you or anyone else.

And yes, we should hold at&t and other who were granted monopoly power and government mandates accountable for their failures. No disagreement

<comment><USER6> > I simply dislike vacuous "someone, somewhere should do something" > statements.

Indeed. People should stop doing that.

<comment><USER5> Cheeky, but respectable.

</comment></comment></comment></comment></comment></comment><comment><USER7> Why is exactly Internet access a "human right" (whatever that term means) more than television or going to a football match?

<comment><USER8> Because watching television or going to a football match is clearly entertainment.

But you get a discount on electric installation if you sign up for your new service online.

Internet service isn't just entertainment: It is communication, banking, and lots of very basic things folks need in life. It just happens to be multi- purpose, so you get the entertainment value as well.

Many jobs require internet access to apply: Fewer and fewer take any sort of paper applications and not everywhere has kiosks to apply and test at (low paying jobs, at least). Heck, game disks are getting rarer, so you sometimes need to be online to use a PC game. Lots of research for school papers is done online.

Also, communication. Few folks send snail mail letters anymore due to email. Chat programs work well too.

If you aren't connected to the internet, you are at a disadvantage. I cannot say that about television in general or a football match - going without those _sometimes_ means you don't have as much to talk about with folks that consume those.

<comment><USER7> >But you get a discount on electric installation if you sign up for your new service online.

That should be illegal. It's discrimination for a basic service.

>Internet service isn't just entertainment: It is communication, banking, and lots of very basic things folks need in life.

You can still walk into the bank. Checking your account from home is cool, but hardly a vital thing.

>Many jobs require internet access to apply: Fewer and fewer take any sort of paper applications and not everywhere has kiosks to apply and test at (low paying jobs, at least). Heck, game disks are getting rarer, so you sometimes need to be online to use a PC game. Lots of research for school papers is done online.

I doubt they can pull this shit off in a place where 25% of people have no access to the Internet. Otherwise they wouldn't find applicants.

>Also, communication. Few folks send snail mail letters anymore due to email. Chat programs work well too.

A bummer. Hardly a "human rights" issue.

<comment><USER9> > You can still walk into the bank. Checking your account from home is cool, > but hardly a vital thing.

What are you talking about? A lot of Alabama (and the US generally) is unbanked specifically because there's no bank in walking distance.

</comment></comment></comment></comment><comment><USER10> Ctrl-F phone. 0 results.

I suspect most of those 25% who lack wired broadband internet have smartphones, most of which support tethering, but even without it, your smartphone is an internet-connected computer, fairly suitable for most consumption related activities.

I suspect the omission of phone stats was not an innocent oversight.

<comment><USER11> These two lines:

>The majority of households in four rural counties - Perry, Monroe, Conecuh and Greene - don't have any sort of internet access

> Mississippi has the worst mark in the country. Thirty percent of households > there don't have any access to the World Wide Web.

make it clear they are talking about "ability to access the internet from their house by any means" not just a dedicated broadband connection at home. So that would also include people who don't own smartphones and/or tablets and people who have no cell phone service at home.

<comment><USER10> That's the clear _implication_ of the words in the article. I'm not convinced it's accurate, given that over 81% of adult Americans (not households) own a smartphone and if they had data which included they were considering smartphones as excluded, I'd expect them to specify that for clarity.

I find many instances where a journalist reads a finding of "no internet" and interprets it for readers to say "no access to World Wide Web" and in the process making it wrong.

In a Census survey format, people who don't have wired internet but do have a smartphone are very much liable to answer that they "don't have internet at home". I'm 95% sure my quite well educated parents would answer that way in that circumstance. A possible control question on the survey would be "how many smartphones are owned by your household?"

The finding is based on data from 2017 and reported on (in headline form at least) as "news".

I'm not disputing what the text says. If it's 100% accurate, that's appalling, of course.</comment></comment></comment>


Groovy Document Builder - <AUTHOR> http://www.craigburke.com/2015/01/22/groovy-document-builder.html

<comment><USER2> I don't think Groovy's future funding is in question so perhaps this marketing is unnecessary. The only real unknown is who will be in the team being funded. I'm picking Groovy and Grails will be consolidated into one group with one project manager and all the present technical people.</comment>


Show HN: 2Lead.in – Cold emailing campaigns, revisited - <AUTHOR> https://2lead.in

<comment><AUTHOR> Hey!

[https://2Lead.in](https://2Lead.in) is an idea I come up with when I needed to reach a big list of people, without having to create an account, paid upfront an amount that would not reflect my needs or have to pay for a monthly subscription.

I wanted to be able to send attachments and view the actions taken by my potential customers.

That's how 2Lead.in was born. I took the simplicity from my other service, [https://www.voilanorbert.com](https://www.voilanorbert.com) and did my best to implement it in 2Lead.in.

I hope you will like it ! :)</comment>


C++ Patterns: The Badge - <AUTHOR> https://awesomekling.github.io/Serenity-C++-patterns-The-Badge/ <comment><USER2> I used to carefully design my C++ code with public / private / protected / friend (and the pointer-to-impl pattern for "compile time private") but a few years ago I started doing everything all-public ala python (struct instead of class by default) with occasionally an m_ prefix for "intended to be private", and I've never looked back. It's been great, made my programming life much easier.

This badge thing is clever, but seems like yet more accidental/unnecessary complexity on top of the already-probably-unnecessary private/protected/friend - as requirements change you now have this extra layer of access-control cruft to reason about, that you probably wouldn't even miss if it didn't exist.

Not to get too ranty, and no disrespect to Andreas, but the C++ culture seems to thrive in unnecessary / accidental complexity, deep template hacks and the like that add friction to refactoring, obfuscate underlying logic so you miss opportunities to simplify, and turn straightforward programming problems into brain-bending template puzzles.

OOP also; I've seen so many crazy class architectures that could just be a handful of plain-old-functions, complex virutal "type families" that could just be a TypeOfThingThisIs enum with some if statements in the respective functions, etc.

I don't know the Serenity codebase and use-case very well, and perhaps this kind of thing has a place in large libraries, but honestly even then I'd lean towards just making everything simple & public and use a prefix when needed, or describe appropriate usage in documentation. Seems to work in the python world (minus a few outlier codebases that go OOP-crazy).

<comment><USER3> In larger codebases with many developers, attention to the API is required in order to be able to maintain code without breaking clients.

The main downside of Badge<T> is that it comes with a performance penalty and ABI change for something that should be statically deducible (empty struct is one byte in C++).

<comment><USER4> There is no performance penalty in any modern compiler that I am aware of (effectively no code will be emitted).

You can have a look here: [https://godbolt.org/z/DmeYL-](https://godbolt.org/z/DmeYL-)

<comment><USER3> Sure within a single compilation unit. Otherwise, I like dearrifling's suggestion.

<comment><USER4> The example also shows a call to a different translation unit. There's no code for passing the empty struct. There's also none for handling it, as you can see from the assembly output.

The one byte rule does nothing here, because its value is undefined and its address not observable.

edit: if you find a case where an empty struct parameter causes code to be emitted, let's consider filing bugs.

<comment><USER3> Oops, I did miss that, but this seems to be compiler or calling convention specific. x86_64 gcc 9.1, linked, shows no difference. However arm64 gcc 8.2 and x86-64 clang show a difference.

<comment><USER4> thanks for clarification! you're of course right about the calling convention.

</comment></comment></comment></comment></comment></comment></comment><comment><USER5> Hello friends! Author here, nice to see so much discussion :)

I've spent most of my adult life working on large C++ codebases with public API's (most notably Qt and WebKit), which has led me to cultivate a defensive programming mindset. Someone mentioned Hyrum's law, which is 100% accurate in my experience.

I should be honest and admit that Badge<T> is not yet diligently applied everywhere in the Serenity codebase. I wanted to "feel it out" for a while first, but now I've decided I like it, so I'm applying it more and more going forward.

Oh and while I have your attention, I recently posted a May 2019 update video[1] on the Serenity OS project if you're curious how things are going :)

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

<comment><USER6> I like this idea, except for the fact that the extra parametrer pollutes the method signature and method calls, for something that really should only be a compile-time directive.

I'm actually curious why something like this has never been included as a language feature, it seems trivial to come up with a syntax for fine-grained access control, that is fully backwards-compatible and a true zero-cost abstraction.

Most obvious first shot:

      class A
      {
        private:
          void badgedFunction() const friend Device, SomeOtherClass;
      };

Did you ever check with the C++ working group if there are any proposals for language extensions for this purpose?

<comment><USER5> Yeah, polluting the signatures is a shame.

I've only just decided that I enjoy using this pattern so my internal standards committee hadn't progressed to the proposal stage yet. :)

Your syntax makes perfect sense to me, and I think it would make a great addition to the language. I wonder what the real working group would say. (I tried quickly googling for something that might sound like an existing proposal but came up empty.)

</comment></comment></comment><comment><USER7> Personally I'd move the register_device() and unregister_device() functions outside of the VFS class entirely, perhaps to namespace scope.

Alternatively, there are other ways to leverage friendship and access control in C++. Here's one option:

        template <typename Registry>
        class DeviceManager;

        class Device {
            template<typename Registry> friend class DeviceManager;
            int y;
        };

        class VFS {
            friend struct DeviceManager<VFS>;
            int x;
        };

        template <typename Registry>
        struct DeviceManager {
            static void register_device (Registry& registry, Device& device) {
                registry.x = 1; // accessing privates
                device.y = 2;   // accessing privates
            }
        };

        int main() {
            VFS vfs;
            Device dev;
            DeviceManager<VFS>::register_device (vfs, dev);
        }

Here all DeviceManager<>'s can reach inside Devices, but only the VFS device manager can reach inside VFS.

This is also flexible. Remove 'static' and you get yourself a stateful mediator/manager. Add a variadic template register_devices_s_ member to Devicemanager and you've got yourself a convenience function for registering multiple devices (of heterogeneous types) without bloating the VFS API and, without runtime cost, and without losing type safety (by e.g. casting down to Device& from USBDevice&).

<comment><USER8> The thing is, there is no restriction on who calls DeviceManager<VFS>::register_device. main() is able to do it.

This doesn't seem so different from:

       class A { private: friend void foo(A &, B &); int x; };
       class B { private: friend void foo(A &, B &); int y; };

       void foo(A &a, B &b)
       {
          a.x = 1;
          b.y = 2;
       }

       int main() {
          A a; B b;
          foo(a, b);
       }

We've just obfuscated it a bit by using a template class with one function in it, and declaring that to be the friend instead of just a non-member function.

<comment><USER7> Yes, your version is what I mean by moving it to namespace scope, and it's probably what I'd do to start off with.

> there is no restriction on who calls DeviceManager<VFS>::register_device

Well, you can make it private inside DeviceManager and give the class its own friends :-))

Another benefit of my solution is that adding things to DeviceManager<VFS> doesn't require changing the VFS.h or Device.h headers at all. Anything that links these 2 classes is an entirely separate concern and very much in line with thinking in terms of models or concepts rather than types. What you want at the end of the day is an absolute bare minimum of member functions in any class.

To be honest, whatever the solution, the key is that having the Device class self-register to the VFS in its constructor (as in Andreas's blog post) is, imho, an anti-pattern and is what is really leading to this Badge mess.

</comment></comment></comment><comment><USER9> Could you make the badge the last argument and give it a default value, so you don't need the initialization at the function call? It looks a bit strange and would need an explanation for why the empty initialization list is there IMO.

I'm not sure if it would work, cppreference has this to say about default arguments:

> The names used in the default arguments are looked up, checked for > accessibility, and bound at the point of declaration, but are executed at > the point of the function call

[https://en.cppreference.com/w/cpp/language/default_arguments](https://en.cppreference.com/w/cpp/language/default_arguments)

<comment><USER10> It's an empty struct so the compiler will elide any storage either way, but agreed having it be the first arg is a bit odd. Perhaps it's for regularity in the cases where you want to make variadic functions 'badged' in this way.

<comment><USER11> Empty structs have size 1, per the C++ spec. The compiler probably won't elide the storage unless it can _show_ that no one probably cares.

<comment><USER4> In this case, it should absolutely do it.

Take a look: [https://godbolt.org/z/DmeYL-](https://godbolt.org/z/DmeYL-)

<comment><USER11> I'm surprised, particularly about the cross-linking bit as that seems to violate the spec (per my recollection of the spec, which is the most likely thing to be wrong).

It's worth noting that it does apply to the latest gcc and Clang but not to all the compilers listed there. For an example of a difference, the latest djggp (7.2.0) inserts an extra push in the call when the empty argument is present.

<comment><USER4> If you use a calling convention that mandates the use of stack, you would see that push, or at least have a byte reserved.

AFAICT the C++ standard itself does not specify the particulars of calling convention, which is a function of the platform, compiler and flags/attributes.

</comment></comment></comment></comment></comment></comment><comment><USER12> I do C++ for almost 20 years but never came across this simple technique before, so I'm quite surprised that I actually like it.

I usually avoid 'friend' in these situations and just write

        //private:

before the method declaration. But it actually happened that co-workers used these private methods because they use code-completion instead of reading the header...

But I might would call the class Friend<T> or something.

<comment><USER13> > But it actually happened that co-workers used these private methods because > they use code-completion instead of reading the header...

A nice feature I've noticed in Elixir is that giving a function a "@doc false" annotation will actually prevent IDE/REPL autocomplete from completing the function. (It's still there to call if you type it yourself.) Maybe that's something C++ tooling could copy.

</comment></comment><comment><USER14> I like it but is access restriction really a problem? In my years of C++ programming it always seemed to be a theoretical problem more than something that leads to crashes.

<comment><USER15> This solves a chronic architectural maintenance problem in complex C++ code bases, which I've also run into countless times.

Any visible interface, public or private (via friend), will eventually be used by other programmers for other than its intended use case simply because it is there and accessible. For the maintainer of an interface with a single intended purpose, what should be a clean, tidy modification within the scope of its intended use ends up breaking all kinds of unrelated code that the maintainer wasn't even aware of that is using the interface in ways the designer didn't anticipate. It is a common form of architectural rot. Reducing the incidence of this in large code bases is usually enforced by soft means, like sternly worded comments, vigorous policing, etc but that only goes so far. Ideally, an access policy would be in the code itself and enforced by the compiler.

The public/private labels don't address this. If you make things public, the world has the ability to do unseemly things with your interface. If you friend a bunch of classes so they can access private methods, those classes have the ability to do unseemly things with your private implementation details. Both cases embrittle the architecture. What you really want is fine-grained ACLs to class members to document both intent and dependencies.

This method of restricting usage of methods to specific classes at compile time is clever and provides good documentation of design intent, I haven't seen that pattern before. I also would guess that the compiler elides the Badge argument since it is never used.

<comment><USER16> There's a name for this phenomena: Hyrum's Law.

> With a sufficient number of users of an API, it does not matter what you > promise in the contract: all observable behaviors of your system will be > depended on by somebody.

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

<comment><USER17> I never knew it had a "real name". I always referenced back to the comic: [https://xkcd.com/1172/](https://xkcd.com/1172/)

Essentially, a bugfix that prevents CPU overheating breaks someone's workflow involving a temperature sensor (jokingly).

</comment></comment></comment></comment><comment><USER18> A different pattern I have thought of would be to provide an accessor interface object, and certain functionality is limited to be accessible only through that object. Controlling who has access to that interface can be flexible (possibly returning it along with construction, or passing it in at creation time...) Albeit, this is not without overhead, and for that, Badge is actually better, in terms of performance, if it fits the use case. What happens when you have multiple Device objects though, in this case, they can all access VFS..

\--

C++'s private inheritance can be used here to avoid some of the gymnastics, wherein, that private aspect of the class can be passed out into the appropriate party at creation time or otherwise.

To illustrate: [https://gist.github.com/arithma/0d96aec5c07e2d8dc24cfc6cd31f...](https://gist.github.com/arithma/0d96aec5c07e2d8dc24cfc6cd31f0c16)

Note: I have never used this in production as far as I remember.

<comment><USER19> Pretty sure you described the attorney-client pattern.

<comment><USER18> If it is, it's the first time I hear about it. It always gives me a kick when I make up a similar design pattern to some grey beard's invention. Alas, I should read up on those patterns to avoid reinventing stuff and sharing things with people with appropriate names.

</comment></comment></comment><comment><USER20> I like it! The self-documentation of where the call is coming-from is quite nice (though a more descriptive name like CallFrom<T> would make that even clearer, were it the principle intent). I can't help myself, though:

        template<typename T>
        Badge<T> FakeBadge() {
          struct Stub {}
          return reinterpret_cast<Badge<T>>(Stub());
        }

<comment><USER8> Doesn't subvert Device badges for me. Complete sample:

      template<typename T>
      class Badge {
          friend T;
          Badge() {}
      };

      template<typename T>
      Badge<T> FakeBadge() {
        struct Stub {};
        return reinterpret_cast<Badge<T>>(Stub());
      };

      class Device {
      public:
        static Badge<Device> getBadge() { return Badge<Device>(); }
      };

      void needDeviceBadge(Badge<Device> badge)
      {
      }

      int main()
      {
         needDeviceBadge(Device::getBadge());   // no error
         needDeviceBadge(FakeBadge<Device>());  // error!
         return 0;
      }

g++ errors:

      badge.cc: In instantiation of 'Badge<T> FakeBadge() [with T = Device]':
      badge.cc:25:38:   required from here
      badge.cc:10:10: error: invalid cast from type 'FakeBadge() [with T = Device]::Stub' to type 'Badge<Device>'
         return reinterpret_cast<Badge<T>>(Stub());
                ^<comment><comment><comment><comment><comment><comment><comment><comment><comment><comment><comment>

A reinterpret_cast won't turn an instance of the Stub local class into a Badge<Device>.

That doesn't even have to do with friendship/protection. If we move that line into the Device class, the reinterpret_cast still doesn't compile.

<comment><USER21> It does, however, work fine if you use a proper "* (Badge<T>* )&stub" cast.

<comment><USER22> Isn't casting unrelated types undefined behavior?

<comment><AUTHOR> Yes, in the standard it isn't defined, but on most--or maybe even all?-- systems and compilers it's perfectly defined, since there is no reason why a compiler would layout two different empty structs in different ways; they're both empty anyways.

Edit: Actually, from reading some of the other comments in the thread, the standard apparently specifies that empty structs are 1 byte in size, so technically they would both be the same size, so casting between them should be fine.

<comment><USER8> It's not defined on systems unless a document spells it out. However, the actual behavior can be deduced to be harmless from black-box testing. compiler source code and generate object code.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER23> This reminds me of the Passkey idiom: [https://arne-mertz.de/2016/10/passkey- idiom/](https://arne-mertz.de/2016/10/passkey-idiom/)

<comment><USER5> Oh wow, that's so similar! So similar in fact, that I must have seen this blog post at some point and internalized the idea :)

The improvement that Badge<T> makes is the <T> part; you don't need to look up the PassKey declaration to see who can construct PassKeys, it's encoded right there in the type instead.

I do like how PassKey makes the copy ctor private. I think we can improve on that and delete both the copy and move ctors in Badge.

</comment></comment><comment><USER10> How is this different from the (relatively common afaik) passkey idiom [https://arne-mertz.de/2016/10/passkey-idiom/](https://arne- mertz.de/2016/10/passkey-idiom/) ?

<comment><USER24> Yes, this has various names. "Ticket" is traditional.

</comment></comment><comment><USER25> This is a typical example of a solution to an artificial, self-imposed problem created by C++'s assumptions.

As a programmer, I would feel frustrated to have to figure this out instead of spending time on something a user would actually care about.

<comment><USER15> Which popular programming languages provide proper ACLs (or equivalent functionality) for class members?

<comment><USER26> I'm aware of C++ and Xojo for sure.

<comment><USER27> Is it possible to have a proper compile time ACL for C++?

Arguably the Badge pattern as presented in the article is just an honor system that provides zero security, since it's trivial to forge a fake Badge: [https://repl.it/repls/BountifulQuerulousCron](https://repl.it/repls/BountifulQuerulousCron)

<comment><USER4> It's less trivial if you make the copy/move constructors private.

[https://repl.it/repls/HatefulMadeupMicrostation](https://repl.it/repls/HatefulMadeupMicrostation)

Of course, type systems are orthogonal to any real security, at least in most languages, and certainly all languages with no-holds-barred interface to machine code.

</comment></comment></comment></comment></comment><comment><USER28> This is especially helpful in conjunction with private constructors and make_shared or make_unique. You cannot even friend make_shared because of namespace aliasing in standard libraries, but shared_from_this can make improperly allocated objects error at runtime. Private badges/tokens solve that problem by allowing public constructors requiring a parameter value of the badge/token type that has limited visibility, but can be constructed inside a factory and passed to make_shared.

</comment><comment><USER29> I often wonder how this would map to other languages (as C++ often entails complexity and clever work arounds such as this article).

In Java or C# (and of course in C++), you could have a token system where the token can only be provided by Device :

VFS: void register(DeviceToken):

DeviceToken: empty interface (marker)

Device: private DeviceToken provideDeviceToken();

This hides both VFS and Device classes from accessing each others' private members.

You can also constrain how gets to provide DeviceToken by adding sufficient comments in code.

</comment><comment><USER8> C++ could solve this without badges, if it didn't have a very tiny, silly misfeature.

The misfeature is this: a class A can only declare a specific member function of class B as a _friend_ , if that B member function is public!

Example:

The idea here is that Device has a static member function called _Device::registrationHelper_. That specific function (not the entire Device class) is declared a friend to VFS, and so that function can call _VFS::registerDevice_.

[Edit: this doesn't quite match the Badge solution, though. If this worked, it would have the problem that the _registrationHelper_ has access to all of _VFS_ , which is almost as bad as the entire _Device_ class being a friend of _VFS_. That is one of the problems which motivate Badge. Nice try, though! The C++ restriction is probably worth fixing anyway. What the C++ friendship mechanism really needs here is to be able to say that a specific member function in B is allowed to access a specific member of A.]

      class Device;

      class VFS;

      class Device {
      public:  // we want this private!
         static void registrationHelper(VFS &v, Device &d);
      private:
         void registerWith(VFS &vfs) { registrationHelper(vfs, *this); }
      };

      class VFS {
      private:
         void registerDevice(const Device &);
         friend void Device::registrationHelper(VFS &, Device &);
      };

      void Device::registrationHelper(VFS &v, Device &d)
      {
         v.registerDevice(d);
      }

But we are forced to make _Device::registrationHelper_ public, which defeats the purpose: anyone can call it and use it is a utility to register devices with VFSs.

If we make Device::registrationHelper private to prevent this, then the "friend void Device::registrationHelper" declaration in VFS fails.

This is an oversight; the privacy of the _Device::registrationHelper_ identifier means that the _VFS_ class is not even allowed to mention its name for the sake of declaring it a friend.

That should be fixed in C++. Declaring a function a _friend_ shouldn't require it to be accessible; we are not lifting its address or calling it; we are just saying that it can call us. Allowing a function to call us is not a form of _access_ to that function, yet is being prevented by _access_ specifiers.

<comment><USER7> Your solution is similar to mine and you might find it helpful:

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

</comment></comment><comment><USER30> I might be wrong, but doesn't it look like a way to enforce SRP violation? In the provided example we don't only let the device know how to register itself via VFS, but we also make sure there will be no future DeviceManager to do that. Unless we duplicate the entire interface with Badge<DeviceManager> tag. Am I missing any non-obvious benefits of this approach?

</comment><comment><USER31> While this is a clever little pattern, I'd argue that if you have a method of class X that can only be called from class Y, that is a code smell.

<comment><USER32> Sometimes, clever little patterns like that are useful to get stuff done in time. However, it that case it definitely smells a lot. Also, the global singleton stinks.

To me this is a violation of the Interface Segregation Principle. I think the author went the right way to fix it, but not far enough.

He added a parameter to segregate the device registration operations from other operations. It works, but the segregation is artificial : you still need a Device object (which seems to be used by a lot of classes, another smell, god object ?)

Instead of asking for an entire Device object, register_device should ask for a different type, specific to that operation, like « NewDevice », « UnregisteredDevice », etc. This object would depend on very specific information only available at the device creation. Now, if another developer tried to call register_device, he would need to create a weird object that he never heard of, with parameters he cannot even provide.

Thoughts ?

<comment><USER33> Is an object really a god object if lots of people use it? I thought it was the opposite way around: a large object that contains too much functionality, but this device could be a tiny single purpose object for all we know, that a lot of clients need to use.

</comment></comment></comment><comment><USER11> Up to this point the comments seem to be missing the obligatory "Treasure of the Sierra Madre" reference, so here I am fixing that.

</comment><comment><USER34> In D, you can access private members of a class within a single module. I like it, because it allows to move methods outside of the class, but doesn't require explicit friend declarations. And you still have the data protection because other modules can't access the private fields.

<comment><USER35> Maybe C++ could add this feature at some point now that it too will get modules.

</comment></comment><comment><USER36> I had never seen this before, I cannot think of another way to do this. I suspect it has 1 byte overhead (on the stack) cost, but that's pretty cheap and may be optimized out.

</comment><comment><USER37> How can {} return a Badge object? Some kind of operator overload?

<comment><USER36> It's bracket initialization of a struct, in this case the struct has no variables - the type is implicit from the method declaration.

<comment><USER38> While it makes no difference in this case, it's worth noting that Badge<T> is not an aggregate type because it has a user-provided constructor. Therefore the object is value initialized, i.e. the braces are equivalent to 'Badge<Device>()'.

edit: what this means is that even if the struct had data members, you couldn't brace initialize it like an aggregate type, and to achieve something syntactically similar, you would need a suitable constructor.

</comment></comment></comment><comment><USER39> So a badge seems a bit like a capability. Clever; I like it.

<comment><USER40> Yeah, my thought too. Even the name badge invokes the idea of a capability.

<comment><USER41> And, I believe you could probably subclass Badge to make capabilities more granular.

</comment></comment></comment><comment><USER42> This is essentially a capability system enforced by the compiler, which means your code is not actually in control for any third party caller.

A glaring security hole. Any old hacker can forge or clone a data structure. This "badge" (AKA token) has to be explicitly unpredictably replay-proof generated and hard to forge, and also automatically verified.

</comment><comment><USER43> Seems more of a people problem than a software problem. That's normal. Why not just use a comment that says "Don't use this. It will break."? If people can't obey simple instructions, you have a different problem entirely.

<comment><USER44> Code completion doesn't necessarily read comments. Why would people read the headers before using?

If people would only obey simple rules, C++ would be a memory safe language. Alas, they don't.

</comment></comment><comment><USER45> whats the advantage over declaring register_device as a functor object from an anon class? for example:

      class Device;
      class VFS {
      public:
       class {
       friend Device;
       void operator()(int y) {/* do stuff with y here*/}}     register_device;
      };
      class Device {
      public:
       void foo(VFS fs) {
        fs.register_device(1);
       }
      };

      int main(int argc, char *argv[]) {
      // fails:
      // VFS().register_device(2);
      // works:
       Device().foo(VFS());
       return 0;
      }

and no need for a badge class (erm... well but an anon class).

my c++ skills are a bit rusty, because most of the time python works just fine.

<comment><USER5> Hmm, IMO Badge has two main advantages over your approach:

1\. Aesthetics. (This is down to personal taste of course, but I much prefer how Badge gets the job done without needing multiple lines of code at every declaration.)

2\. What if I need to put the function implementation out-of-line?

</comment></comment><comment><USER46> Wouldn't -Wextra yell about the Badge being an unused parameter in the register devices? You would have to do some kind of dummy call that the compiler would have to optimize away.

<comment><USER5> If an argument is nameless, the compiler won't complain about it being unused.

No warning:

        void VFS::register_device(Badge<Device>, Device& device) { ... }

Warning:

        void VFS::register_device(Badge<Device> badge, Device& device) { ... }

</comment></comment><comment><USER47> > These functions are called by all Device objects when they are constructed > and destroyed respectively. They allow the VFS to keep track of the > available device objects so they can be opened through files in the /dev > directory.

> Now, nobody except Device should ever be calling VFS::register_device() or > VFS::unregister_device(),

Why?

Either have VFS call the constructor because non-registered devices are banned and RAII is good, or don't create arbitrary restrictions to hamstring how the rest of the system manages Devices.

<comment><USER48> I kind of agree that it's not clear why a VFS needs to register devices that only register themselves, however, if you suspend disbelief on that one it's a clever trick that is easy to imagine being useful.

</comment></comment><comment><USER49> Isn't this exactly the problem that categories in Objective C solve? Why not adopt that pattern versus this "Badge" thing?</comment>


Cool twist on shorteners - <AUTHOR>

http://www.makeuseof.com/tag/6-cool-url-shorteners-twist/ <comment><AUTHOR> I really like the part with the rating.. seems pretty useful since I trade most everything at work</comment>


Show HN: I made a Chrome extension to stop mindless browsing - <AUTHOR> https://www.getintention.com/ <comment><AUTHOR> Hey HN,

I've been working on a Chrome/Firefox extension called Intention to help me stay focused and not get distracted, and for me and my friends, we've found it more effective than other tools we've tried.

The idea behind it is extremely simple: Commit to a time limit __before __using a distracting site.

This prevents the two most common ways that we get sucked into distractions online:

1\. Habitual navigation: Throughout the day, we reflexively type t/f/r <enter> and immediately start scrolling through Twitter / Facebook / Reddit / etc. Intention stops you before you start browsing and gives you the opportunity to decide not to get sucked in.

2\. Mindless browsing: Our willpower is no match for the endless stream of personalized content optimized to keep our attention for as long as possible. Intention pauses your browsing after your intended time limit and restores your focus.

You can set a daily limit to know how much time you've spent across all distracting sites, and for every day you stay under your limit, you'll grow your personal streak.

I designed Intention with privacy as a core priority, and here's what that means:

\- Intention requests access only to the sites you select, not all sites.

\- Intention gives you full control over the data you share.

\- Your browsing history stays in your browser and is never transmitted.

Intention is part of a suite of tools I'm developing to help people spend their time well, and I'd love to hear your feedback.

DK

P.S. If you'd like to read about the process behind developing Intention, I've been publicly writing a daily journal at [https://roadtoramen.com](https://roadtoramen.com)

<comment><USER2> I like this a lot.

What I've found that:

\- No breaks is bad.

\- It is even worse when a 10 min break turns out to be a 2h rabbit hole.

But most of the current software does not address that. For example:

\- I use social media after midnight, and it does not stop me then but cuts the limit for the next day.

\- There is a nasty surprise when an app kicks me out, with no warning. So nasty (especially when I am in the middle of writing a long comment) that it may prompt be to uninstall it.

\- To strict limits. Sometimes I know that a given day I need more social media.

In your case, it solves all. Also, I see that the timer is at 23 sec, so I click "reply". :)

Thanks!

<comment><USER3> I've yet to check out the OP's extension, but I've used a Firefox extension called LeechBlock before which (with some creativity) can achieve your bullet points as well. For the first I would set up one blocking profile to apply through early morning and a different profile (with the same sites) for the rest of the day; for the second LeechBlock lets you put a countdown timer in the corner of the screen so that at all times you know how much time you have left; for the third it lets you set up an "Override" which will resume blocking after a certain amount of time.

(Sorry if this is distracting from the OP, I aim not to shill but to help more people make use of productivity tools in this era of endless distraction.)

<comment><USER4> I use Crackbook Revival (Chrome) which is similar in purpose. However instead of giving you a countdown timer (because "but 5 more minutes, mooooom") it never actually stops you from browsing, but instead slows down select sites with every page load. First loading a page is instantaneous. 100th time takes _seconds_ which is frustrating enough to cause me to go off and do something else, but without the same anxieties that Leechblock causes.

</comment></comment></comment></comment><comment><USER5> I love this idea and just installed it. However it falls into a similar problem I have found myself in with iphone's screen time.

On my iphone I have found myself mindlessly clicking the "add 15 minutes" of screen time and typing in my 4 digit code so often that it is now just muscle memory to do so. Yes, I have no self control.

Could you add a feature so you have to type in a pin to continue BUT the number pad is in a random order, to break up muscle memory? Or randomly re- arrange the add 1,5,15 min buttons? Or a math problem?

<comment><USER6> I think the math problem could help, but you also need to ask yourself if you're just going to keep bypassing it anyway.. in which case software is unlikely to help much.

For you I would recommend the book: The Willpower Instinct by Kelly McGonigal. (audiobook is also well narrated)

It's well written and full of great methods for gaining your self control back.

</comment></comment><comment><USER7> Hey this looks really helpful! I appreciate your commitment to privacy, that's a very important feature for me. Nonetheless, having been burned by Chrome extensions in the past [1], I'm worried about privacy and I'm wondering if you'd be willing to make it open source to allay those concerns.

[1] [https://robertheaton.com/2018/07/02/stylish-browser- extensio...](https://robertheaton.com/2018/07/02/stylish-browser-extension- steals-your-internet-history/)

<comment><AUTHOR> Hey! I totally get where you're coming from. I wrote a post exploring the privacy and security of Chrome extensions: [https://www.notion.so/dkthehuman/Day-4-The-Danger-of- Chrome-...](https://www.notion.so/dkthehuman/Day-4-The-Danger-of-Chrome- Extensions-af93b84006ed48c18b807f512b6c0a07)

I'd love to open source Intention like I've done with a ton of previous projects ([http://github.com/dkthehuman/](http://github.com/dkthehuman/)), but since it's a Chrome extension, that'd make it trivial for anyone to copy. Given that I'd like to eventually develop a paid plan and make working on this full-time financially sustainable, I hope you can understand why open sourcing doesn't seem like a viable option.

I'm brainstorming ways to make the extension as transparent as possible (e.g. if I ever decide to include analytics, (1) providing an opt-out and (2) a way to view all the information that's transmitted in a human-readable way), but at the heart of it, using Intention will require some trust in my integrity and care as a developer. I'm also hoping that writing about my decision-making process publicly in my journal ([https://roadtoramen.com](https://roadtoramen.com)) will provide transparency and help develop that trust. If you ever see me going astray or not thinking clearly, please keep me accountable!

If it helps, here are some of the things I've written about privacy (I think about this quite a bit):

\- My privacy principles: [https://www.notion.so/dkthehuman/Day-97-Privacy- Principles-5...](https://www.notion.so/dkthehuman/Day-97-Privacy- Principles-5ba3c280848e4697869b2c11d773cc92)

\- Privacy gut checks: [https://www.notion.so/dkthehuman/Day-86-Privacy-Gut- Checks-0...](https://www.notion.so/dkthehuman/Day-86-Privacy-Gut- Checks-070419ee59ff46f5ac1f464f16cacd16)

\- Exploring whether I should include analytics: [https://www.notion.so/dkthehuman/Day-45-Should-I-include- ana...](https://www.notion.so/dkthehuman/Day-45-Should-I-include- analytics-13bdda9215284442bd1a0f29b82b57fb)

<comment><USER8> To be truly open in terms of privacy, open-source + auditable open releases is the way to go.

I'd recommend a free extension with a paid plan which has additional features. Provide the basics in the free version and the really good stuff in the paid version.

If source code is the same and it's just feature flagged based on a ping to a server to validate a license key, then it'd be indeed easy to copy the paid features in another extension. To a large extent you'd be relying on the web store moderation a copy to not be published and to tech-savvy users to not install it locally.

However, that approach could ensure a wider reach of users so the share of the paying ones to be big enough in absolute numbers.

Marketing the extension to non-developer audience would help reduce the chance of manual installation.

The biggest difference would be that the developer audience could contribute to the open-source code and you'd be making money from those contributions. I don't think the income from that alone would be enough to support you in the short-term, but in the long-term with good expansion with other products, that could prove to be a very strong passive income.

</comment></comment></comment><comment><USER9> This is just lovely. Clean, exactly what I need, and the on-boarding/privacy experience is best-in-class. Well done.

<comment><AUTHOR> Thanks so much! I spent a ton of time making sure that it's as privacy- oriented as possible and asks for minimal permissions, unlike most extensions in this space that ask for permissions for all sites. It doesn't make sense that a tool to help with YouTube or Twitter should also have access to your banking site and emails.

Glad you appreciate it. :)

</comment></comment><comment><USER10> I've developed an easy to follow method to stop procrastinating in time "black-hole" sites, like social networks, etc... I've observed that the problem in my case is having the possibility of accessing my account at those sites immediately, as soon as I get bored doing any repetitive task at work, or I have an idea about something I could post in a social network, etc... So the easiest way for me to avoid that is to use a long, very-hard-to-remember password there, write it down in a notepad, and _never_ save the login info in the browser. Bonus measure, you could leave the notepad outside home (in the car f.e.)... that way, losing time procastinating requires actually more effort for me than just stand up for a little and then return to work. The point is never allow that to be an easy option, an easy way to escape from responsibilities... Installed "walls" via browser extensions etc never really worked for me, as in the end I just disable them if I feel that's bothering me. PS. Also of course, avoid to save the cookie session once you close the browser in "dangerous" sites...

<comment><USER11> Memorised a 14 character (incl. punctuation) password after attempting that, and really didn't take me long, unfortunately.

<comment><USER10> Go for 64 characters then, if possible :-)

</comment></comment></comment><comment><USER12> This is fantastic :D! Thanks for building this.

As a feature request, I would love to be able to restrict my time spent on websites I arrive at _from_ e.g. HackerNews, not just _on_ HackerNews itself.

</comment><comment><USER13> You should look into Motion. [https://www.inmotion.app/](https://www.inmotion.app/) It is very similar to your product.

<comment><AUTHOR> Yup, I'm a fan of Motion, and I'm glad they're also trying to help people spend time well! It's a big problem to tackle, and given that we're up against multi-billion dollar corporations, we can use all the help we can get. Motion inspired parts of Intention's design (e.g. the default unlock duration in Intention used to be 5 minutes, but I liked how Motion defaulted to 1 minute so I changed it).

Some key differences between Intention and Motion:

Product

\- Intention lets you set a daily limit so that you're encouraged to limit your distracted browsing.

\- To calculate remaining time, Intention uses active time (time actually spent on a site), not clock time (time passed since you unlocked a site).

\- Intention displays its timer in the browser toolbar instead of directly on the page, which can block UI elements

Privacy

\- Intention only requests access to the sites you select, not all sites.

\- Intention gives users full control over what data they share. Right now, Intention includes only crash reporting (no analytics or tracking), and you can disable even that inside the settings.

<comment><USER14> Thank you very much! The privacy aspect was key for me, thanks for doing this right.

</comment></comment></comment><comment><USER15> Here's a similar one that I build few years back. It forces you to wait specified number of seconds before visiting a website. That way you break the dopamine cycle.

[https://chrome.google.com/webstore/detail/waitblock/kcnjfepp...](https://chrome.google.com/webstore/detail/waitblock/kcnjfeppclpdinikcljfjigoongebpkh?hl=en)

<comment><USER16> breaking the dopamine cycle requires a bigger effort because it must include phone browsing and notifications, there is a good video about it at [https://www.youtube.com/watch?v=9QiE-M1LrZk](https://www.youtube.com/watch?v=9QiE-M1LrZk)

<comment><USER15> Thanks for the link. Turning off notifications and using greyscale mode certainly helps as well.

</comment></comment></comment><comment><USER17> these last 2 weeks me and my wife created a strict rule where we can't have any screens (laptops, phone, tablets) in a bedroom.

now we don't browse while laying in bed in the morning or at night. this simple change cutdown on my addiction even when out of my bed room.

When we go to our bedroom at night we know it means bed time, its a mental change.

Also, at first you'll feel an urge to look at your phone at night, but it goes away.

<comment><USER18> I think what contributes the most to that bad habit is dependency on alarm clock app in our smartphones.

I need to finally buy two alarm clocks with snooze and weekly schedule.

<comment><USER19> If you have an old dumb-phone without a sim-card you can use it as an alarm instead. For me it turned out to be cheaper and better!

<comment><USER18> Should uninstall any browsers too :)

</comment></comment></comment></comment><comment><USER20> To the author: this is AWESOME.

I find myself caught in the y/t/f <enter> loop all the time. I use a site blocker, but if I do want to visit a site, I end up turning off the blocker and forgetting to re-enable it. This seems like much a better solution that allows me access to the sites I need, but ensures I don't get lost in them, and tracks my usage.

I am seriously so pumped about this, funny that I needed to visit one of my blacklist sites (hacker news) in order to find this. Please keep us posted with updates (settings page of the app?), if I continue to use this I'd be happy to pay for it in the future.

One thing I'd love to be able to do right now is whitelist certain times in the middle of the day. For example, lunch. Punching in 30 mins on a site is an easy fix, but it'd be nice if that were built in.

<comment><AUTHOR> Thanks so much! There's an in-product mechanism that shows messages on major updates, but I might create a mailing list / Slack channel for a more dedicate space for feedback and updates. If I do, it'll add it to the next in-product message.

Once I get through the incoming bugs, I'll spend some time thinking about what options to provide in Intention while making sure that the product stays simple. Appreciate the kind words!

</comment></comment><comment><USER8> This is awesome! I would also pay for this after I've seen the privacy-aware and clear onboarding!

Feature request:

"Focus mode"

Ability to start a focus session for 30m, 1h, 2h etc. in addition to having the schedule. E.g. by default my schedule allows browsing reddit on the weekend, but if I need to get something done on Sunday I can get click the focus button. Or disable schedule and use it only in focus sessions. For now I can only either change the schedule constantly or disable/enable the extension. A simple "Focus" button would solve those 2 cases.

The focus mode could even countdown the focus time with a different colour.

This would replace RescueTime for me and I've been a paid user for years.

<comment><AUTHOR> Hey, I'd like to understand your request a bit better. Would the focus mode block all distracting sites for that period or simply activate Intention during a period that's normally disabled via the schedule?

<comment><USER8> I meant the latter - override the schedule on demand. E.g. if my schedule is 9-6 Mon-Fri, but I want to get focused sometimes when doing a weekend project, I can just click the focus button.

</comment></comment></comment><comment><USER21> Thank you for releasing a Firefox version along side the chrome extension.

<comment><AUTHOR> No problem! I personally use Chrome as my primary browser for various reasons, but I love Mozilla's mission to create an Internet that puts people before profits. Happy to support my privacy-forward users. :)

<comment><USER22> Respect for that

</comment></comment></comment><comment><USER23> Now my compulsive snoozing can continue even during daytime :)

</comment><comment><USER24> Shameless plug: I've a similar chrome extension called Baitblock ([https://baitblock.app](https://baitblock.app))

\- It even offers you summaries of links before you click them where available.

\- Blocks cookie notices.

\- Hides Facebook/YouTube feed.

\- 1st party tracking resistance (deletes cookies on every page load for websites that you're not signed in to)

\- Website blocking

The upcoming version even has in page reader mode so you dont leave the page (video in tweet): [https://twitter.com/BaitblockApp/status/1252623683266494464](https://twitter.com/BaitblockApp/status/1252623683266494464)

[https://chrome.google.com/webstore/detail/baitblock- distract...](https://chrome.google.com/webstore/detail/baitblock-distraction- blo/gabkpiepfabknggoijbdfhbidkcnlikl) \- for chrome

[https://addons.mozilla.org/en- US/firefox/addon/baitblock](https://addons.mozilla.org/en- US/firefox/addon/baitblock) \- for firefox

</comment><comment><USER25> This is awesome! My mindless browsing became so bad at one point that I made my own extension that I called "Detour". It automatically redirects you from one site to another, so if I absent-mindedly navigated to Reddit, it'd detour me to my homework to-do list. Never got around to really fleshing it out and building the types of features that would really make it useful like this. Kudos!

</comment><comment><USER26> This is quite similar to HabitLab [https://habitlab.stanford.edu/](https://habitlab.stanford.edu/) which also includes a number of other options (such as pausing videos on youtube before playing them, hiding comments and news feeds on Facebook, etc). [Disclaimer: I built HabitLab]

</comment><comment><USER27> Good job on helping to curb mindless browsing!

On this topic, another add-on I have found to be fairly helpful is called "Pluckeye" [1]. At its base level, it simply blocks all images and video from your browser. You can customize it by adding/removing websites from the blacklist, and is fairly robust to occasional cravings by having a delay on changes to the blacklist that allow a website. The only downside is that most websites now look broken, but I've found that I don't really miss being bombarded by the colorful graphics on websites.

I think there is significant work to be done on making these tools more widely known, but I'm happy with the progress being made. Good job, again!

[1]: [https://www.pluckeye.net/](https://www.pluckeye.net/)

<comment><USER28> Or just use Links.

</comment></comment><comment><USER16> "Mindless browsing" is just dopamine addiction, happens with phone notifications, porn and many other stimulus, a good video about it at [https://www.youtube.com/watch?v=9QiE-M1LrZk](https://www.youtube.com/watch?v=9QiE-M1LrZk)

<comment><USER29> The advice I got is that you need to take a very hard look at what things in your life recharge you, and prioritize the ones that work well over the ones that are minor or neutral.

Your initial list will contain a bunch of things that are really just playing for time. They don't recharge you, they just keep you still long enough for you to recuperate a little bit.

One of my big ones is naps, but I'm still wrestling with the idea that going to sleep is an activity instead of the absence of (nearly) all activity.

</comment></comment><comment><USER30> This looks really good, I've been going down the rabbit hole of optimising focus and killing distractions...

Is there any chance we could get it to make a rest API call on certain actions? I'd like to change my lights in home assistant as an added visual reinforcement.

</comment><comment><USER31> I use Youtube for music, so I usually have a tab open for prolonged time. However, I also waste some time on Youtube by randomly opening a tab. Is there any way you plan on handling this use case?

<comment><AUTHOR> Already handled! See [https://news.ycombinator.com/item?id=22940299](https://news.ycombinator.com/item?id=22940299)

</comment></comment><comment><USER32> Great Job. I like the simplicity. As time passes you'll be tempted to add features. Be very selective, it's better not to add a feature than to add complexity without real benefits.

<comment><AUTHOR> Thanks for the fantastic advice. Keeping things simple is one of my core product principles, and I intend to be quite careful in what I add. I think it's much better to do a few things extremely well rather than many things somewhat okay.

</comment></comment><comment><USER33> I am absolutely hopeless YouTube addict. The first review says you can set breaks compared to other blockers. I have Leechblock setup in a way with dynamic "breaks" I give myself 1,5 hours on YouTube and other blocked sites every 4 hours. Problem is I cheat myself by using the "overwrite feature to give me another 9 minutes again and again. I caught myself just switching to another browser its really really bad. How could this be different?

</comment><comment><USER34> This looks really interesting. I've found the best way for me to stay focused is to just block sites via my /etc/hosts file. I'll unblock it when I'm done working and then block again at the end of the day so I'm ready to go in the morning.

If I mindlessly type youtube.com in and hit a error I immediately realize I did that mindlessly and get back to work. I've been doing this for a while and it has worked every time.

</comment><comment><USER35> This is great. I wanted to give it 5 stars on the Chrome app store, but apparently I can't due to COVID-19: "Due to adjusted work schedules at this time, we are pausing the ability to post reviews on the Chrome Web Store. Our primary objective is to help ensure the Chrome Web Store continues to be stable, secure, and works reliably for anyone who depends on it."

<comment><AUTHOR> Yeah, that's a bummer, but thanks for trying!

</comment></comment><comment><USER36> This is really great! I love the implementation and the idea of having you actively chose to do something you feel is unproductive.

One thing that would be nice to see would be a way to track the referring site - for HN or Reddit it would be easy to go in for a minute, open a ton of tabs, then waste hours. Having the tabs count against the timer for the originating site would help

</comment><comment><USER37> Pretty cool!

Recently I blogged how I make my twitter password really hard to recover through heavy, repeated hashing, which has helped mindless social media browsing

[https://softwaredoug.com/2020/04/05/kill-your-twitter- addict...](https://softwaredoug.com/2020/04/05/kill-your-twitter- addiction.html)

</comment><comment><USER38> This is good. A different approach would be to implement hackernew's noprocrast filters, which I quite like. It's nice to have something meter your usage with gaps rather than allowing you to frequently visit the site and prevent you from meaningfully engaging with something else (and instead revisit the site every 10 minutes for 1 minute).

</comment><comment><USER39> I used to use Motion but it asks me to login and shit and then doesn't even bother syncing across browsers. Waste of time. And then it slows down web pages and sticks that annoying little box on the side. My user agent has a place for you, in the toolbar. Stop rendering on top of content and then making scroll slow. Ugh.

I'll give this a shot.

</comment><comment><USER40> Love the idea and the execution looks great too!

I'm the kind of person who will just keep selecting to view a bit longer so it wouldn't work for me (I need more rigid restrictions on things like Freedom and actual physical locks) but I'm super happy to see new approaches to this kind of thing emerge.

</comment><comment><USER41> This is great. Definitely the most thoughtful of these kinds of plugins. I downloaded it and my afternoon was more productive for it.

I think that it forces me to take a moment to stop and answer the question, "Do you really want to spend time on this?" before continuing is going to be quite powerful.

Thanks!

</comment><comment><USER42> Thank you for making this! I was using StayFocusd until now. The look and feel of Intention feels so much fresher and easier to use. Also, having a lot more flexibility for blocking is a great feature. And of course privacy. Much appreciated.

</comment><comment><USER43> This is really awesome. I really like how it has you, the user make the final call. I'm hoping long term use of this will make start to catch myself before I even type the url in. Thanks for making this extension!

</comment><comment><USER44> If i could request one thing, it would be the ability to block a site during the scheduled time outright, and / or add a challenge of typing some awful lorem ipsum or something to unlock it for a short time.

</comment><comment><USER45> I can't seem to get it working in Firefox. I can click the icon in the top right but it just says I'm on a distracting site it does not launch the popup. Any configuration needed in Firefox?

<comment><AUTHOR> Hm, this is a bit strange. It should work fine on Firefox, and a lot of other people on this thread seem to have no issues.

Can you share what OS you're on and other extensions you have installed?

Feel free to reply via email — my address is email@example.com.

<comment><USER46> I think I got it sorted. I tried it on 6 different computers/laptops/VMs/Ubuntu/Windows and it never worked. Then I tried Chrome and after I clicked install I was presented with a picture of (I assume) you and a "Continue" button. I had never bothered to click on that before, always going straight to the extension button in the top right corner. However, if you don't press "Continue" it doesn't request the permission it needs to work.

I don't know if this is possible, but it might make sense to check that tab permission again (for example, when the user tries to block a site).

Hopefully that makes sense. Let me know if you need further clarification.

<comment><AUTHOR> Ah, gotcha. If I'm understanding correctly, you skipped the onboarding which is where permissions are granted so it never worked.

Thanks for finding this! Will add a check like you suggested.

</comment></comment></comment></comment><comment><USER47> I've been using something similar but at the router level using DNS, so that it works on all devices and it is not easily circumvented. Reclaiming that wasted time is pretty nice.

</comment><comment><USER48> This looks great. I just signed up for Freedom to solve this problem because it works across devices. I'll test your extension as well to see if it does the job as effectively.

</comment><comment><USER49> Too early to say for sure, but this seems to strike the sweet spot as far as nudging me towards my 'intention' without being so onerous that I simply disable it.

Thanks a bunch!

</comment><comment><USER50> I will definitely give this a try. Also found the shout out to Peaceful Cuisine on your homepage amusing given that I have lost hours of time watching that channel.

</comment><comment><USER51> I found this really useful. Oddly enough I have been using Habit Labs and it's more feature rich but I like this interface - it's clean and in my face.

</comment><comment><USER52> There are 478 upvotes to this post and yet after 1 day, there are only 535 users of this extension after 1 day (16:40EST on Apr-22).

<comment><AUTHOR> The Chrome Web Store has a delay of about 1 day. I posted the latest stats on my journal entry today: [https://www.notion.so/dkthehuman/Day-108-HN- Aftermath-d9e824...](https://www.notion.so/dkthehuman/Day-108-HN- Aftermath-d9e8241640cf445e95c0d2dd8ffcb5c2)

</comment></comment><comment><USER53> Yay Firefox version! Will definitely give this a go.

</comment><comment><USER54> I hope you can get browser syncing implemented soon, without it I don't really have control of how (un)productive I've been.

</comment><comment><USER55> Consider a setting to remove the icon from the toolbar. It's too easy to right click an uninstall it.

</comment><comment><USER56> Found a hack. Move focus to another window. Then timer stopped, but you can still use mouse wheel ;-)

</comment><comment><USER57> this extension has helped me save a ton of time on distracting websites -- particularly Hacker News

I also love DK's other extention, hidefeed.com, which I use for sites like LinkedIn where i need to go to do work, but don't want to get sucked into the newsfeed.

</comment><comment><USER58> Just installed it to try it out. Really liked your setup process: clean, informative and fast.

</comment><comment><USER59> Awesome! I loved! It is exactly what I was looking for in this quarantine period!

</comment><comment><USER60> Stayfocusd does this as well.

<comment><USER7> It only has daily limits, not session limits, right?

<comment><USER60> I think so.

</comment></comment></comment><comment><USER61> huh this seems very similar to [https://browsewithintent.com/](https://browsewithintent.com/) which has been around for a while?

</comment><comment><USER62> Love this!! Been using it for a few days now :)

</comment><comment><USER63> Thank you. Great user experience. Very well done.

</comment><comment><USER64> Looks nice! How does it compare to LeechBlock?

</comment><comment><USER65> But mindless browsing is how I found this post

</comment><comment><USER66> Tried it and really liked it! Thank you!

</comment><comment><USER67> This but an Android launcher

<comment><USER36> There are some nice "minimal" launchers out there that restrict you to essentially a phone, camera, and messaging app. It adds a hurdle to accessing the apps that are easy to waste time in.

While now 100% the same as this, I've found introducing some extra friction can go a long way in curbing unwanted behaviors

<comment><USER67> I'm looking for something that asks me what I want to do before letting me open any app on the phone. Then it could periodically ask if I have accomplished my goal. "You have been "reading hacker news" for 30 minutes, are you still "reading hacker news"? [No] [Yes- turns off phone]"

</comment></comment></comment><comment><USER68> this is the exact opposite, but did anybody here ever use stumbleupon?

</comment><comment><USER69> Loving this. Great work!

</comment><comment><USER28> Just switch to Gopher :)

</comment><comment><USER70> Love the interface!

</comment><comment><USER71> actually this is what i need. thank you</comment>