License update - <AUTHOR> https://whispersystems.org/blog/license-update/ <comment><USER2> Thank you Moxie!

Although we personally trusted and would've moved forward with Moxie's informal permission to distribute SignalProtocol within ChatSecure on the App Store, our funder required us to get the legal details squared away or we'd lose our funding. This announcement is an amazing gift for us, and for other GPL compatible Mac/iOS apps.

This announcement also more broadly benefits the copyleft community. There has been a decline in GPL apps on Apple platforms, particularly because of this conflict between the GPL and Apple's App Stores. It makes it clumsy to accept pull requests because you need a CLA to allow relicensing for distribution. There's a also lot of FUD from anti-Apple copyleft zealots. Having a good template for other developers who wish to stick to strong copyleft without worrying about App Store issues is a great contribution to the Apple-friendly copyleft community.

<comment><USER3> Apple could always do what Google does, to state that in the case of copyleft licenses their term take precedence over the ToS (neutralizing restrictive terms like the redistribution ban on everything you download from the store).

<comment><USER4> Where does Google state that?

This meme keeps going around that the Android store is GPL compatible. But where is the actual license text that allows this, or at least how does the situation differ from that with iOS? I checked the current Google Play Terms of Service and the iTunes Terms and Conditions. The two were alike in several respects:

\- They had no blanket exception or deference I could find to third party agreements, nor any relevant mention of the terms "open source" or "copyleft".

There is something in the Google ToS that could be interpreted as such an exception, but the wording gives it dubious applicability to third party apps, and in any case, the Google Play ToS says that "if there is any conflict between the Google Play Terms of Service and the Google ToS, the Google Play Terms of Service shall prevail".

\- They dictated various random usage rules, again without any explicit exception clause.

\- One of those rules was a requirement not to circumvent DRM. AFAIK, both app stores do in fact store apps obfuscated/encrypted on disk, so it wouldn't be possible to usefully redistribute the apps without engaging in such circumvention. (The requirement was in each case worded broadly enough to potentially apply to any DRM included with the app itself, though this is just another example of a random potentially-conflicting usage rule.)

\- However, they both state that apps are licensed directly from the developer to the user, with the store distributing them on the developer's behalf, rather than licensed to the store and sublicensed from there to the user. (If that even means anything.) Therefore, it could be argued - I don't know how much validity this would have, but it could be argued - that the GPL's "you may not impose any further restrictions" clause is not in fact violated, because _you_ (i.e. the app developer) are not imposing any further restrictions - the restrictions come from a separate contract you're not a party to - and Google/Apple is not bound by the terms because it's just distributing stuff on your behalf rather than on its own authority.

Therefore, on both stores GPL compatibility is possible but dubious. Where is the difference?

(By the way, I've been lazy and haven't checked the respective _developer_ agreements. It's possible that one or both agreements have clauses that impede legally submitting GPL apps to the store, but they can't generally authorize behavior that the ToS forbids - since users are not party to them - so any such difference wouldn't affect my main point about the Play Store having similar restrictions to what people have complained about wrt the iOS App Store.)

Source:

== The Google ToS clause ==

Open source software is important to us. Some software used in our Services may be offered under an open source license that we will make available to you. There may be provisions in the open source license that expressly override some of these terms.

[http://www.google.com/intl/en/policies/terms/](http://www.google.com/intl/en/policies/terms/)

== Random usage rules ==

Google:

Capturing of Streams. You may not use Google Play or any Content in conjunction with any stream-ripping, stream capture or similar software to record or create a copy of any Content that is presented to you in streaming format.

Use of Android Apps. You must use apps from Google Play in accordance with the Google Play Business and Program Policies which are in place from time to time, the current version of which can be found at [http://play.google.com/about/android-developer- policies.html](http://play.google.com/about/android-developer-policies.html)

Apple:

(ii) If you are a commercial enterprise or educational institution, you may download and sync an App Store Product for use by either (a) a single individual on one or more iOS or tvOS Devices used by that individual that you own or control or (b) multiple individuals, on a single shared iOS or tvOS Device you own or control. [..] For the sake of clarity, each iOS or tvOS Device used serially or collectively by multiple users requires a separate license.

== No DRM circumvention ==

Google:

Security Features. You may not attempt to, nor assist, authorise or encourage others to circumvent, disable or defeat any of the security features or components, such as digital rights management software or encryption, that protect, obfuscate or otherwise restrict access to any Content or Google Play. If you violate any security feature, you may incur civil or criminal liability.

Apple:

You agree that the App and Book Services and certain App and Book Products include security technology that limits your use of App and Book Products and that, whether or not App and Book Products are limited by security technology, you shall use App and Book Products in compliance with the applicable usage rules established by Apple and its principals ("Usage Rules"), and that any other use of the App and Book Products may constitute a copyright infringement. Any security technology is an inseparable part of the App and Book Products. Apple reserves the right to modify the Usage Rules at any time. You agree not to violate, circumvent, reverse-engineer, decompile, disassemble, or otherwise tamper with any of the security technology related to such Usage Rules for any reason—or to attempt or assist another person to do so.

== On who is licensing apps to whom ==

Google:

When you buy "Content" (defined as data files, applications, written text, mobile device software, music, audio files or other sounds, photographs, videos or other images) on Google Play you will buy it either:

[..]

(c) in the case of Android apps, from the Provider of the app (an "App Sale").

Each time that you purchase Content, you enter into a separate sale contract:

[..]

(f) with the Provider of the Content you have purchased (in the case of App Sales).

The separate sale contract in (e) or (f) above (as applicable) is in addition to your contract with Google Inc. for the use of the Service (i.e. these Google Play Terms of Service).

Apple:

You acknowledge that: you are acquiring the license to each Third-Party Product from the Application Provider; Apple is acting as agent for the Application Provider in providing each such Third-Party Product to you; and Apple is not a party to the license between you and the Application Provider with respect to that Third-Party Product.

Source:

Google: [https://play.google.com/about/play- terms.html](https://play.google.com/about/play-terms.html)

Apple: [http://www.apple.com/legal/internet- services/itunes/us/terms...](http://www.apple.com/legal/internet- services/itunes/us/terms.html)

(warning: the Apple ToS has separate sections with similar terms for media and apps, and there is also a "Licensed Application End User License Agreement" that specifies it's merely a default for apps without their own terms, so make sure you look in the right sections.)

<comment><USER3> Google Play ToS: [https://www.google.com/mobile/android/market- tos.html](https://www.google.com/mobile/android/market-tos.html)

> 3.8: You agree that Google and/or third parties own all right [...]. You > agree that you will not, and will not allow any third party to, (i) copy, > sell, license, distribute, transfer, modify, adapt, translate, prepare > derivative works from, decompile, reverse engineer, disassemble or otherwise > attempt to derive source code from the Products, _unless otherwise > permitted_

And primarily 4.2, which you already found: In the event of a conflict between the Terms and any such licenses, the open source software licenses shall prevail with respect to those components.

These in combination has the effect I described.

[https://play.google.com/intl/en_us/about/play- terms.html](https://play.google.com/intl/en_us/about/play-terms.html)

> You may not sell, rent, lease, redistribute, broadcast, transmit, > communicate, modify, sublicense or transfer or assign any Content or your > rights to Content to any third party _without authorization_

Copyleft license is automatic authorization.

<comment><USER4> > Google Play ToS: [https://www.google.com/mobile/android/market- > tos.html](https://www.google.com/mobile/android/market-tos.html)

[..]

> And primarily 4.2, which you already found: In the event of a conflict > between the Terms and any such licenses, the open source software licenses > shall prevail with respect to those components.

No, I didn't find that, I found a similar clause in the overall Google ToS which, as I said, didn't seem like it would be applicable to third party applications. I see, this is what you were referring to. 4.2 would definitely qualify as the kind of blanket exemption I was looking for - if it is actually in effect.

Interesting. Your first link is _not_ the Google Play ToS; it's your second link which calls itself the "Google Play Terms of Service", while your first link is the "Android Market Terms of Service", and does not contain the text "Google Play". But "Android Market" is a dead brand. And a relevant-looking page on android.com contains links to the Google Play ToS and other agreements, but not your Android Market ToS:

[https://www.android.com/market/terms.html](https://www.android.com/market/terms.html)

Plus, the Android Market ToS says ©2011 at the bottom. Combining those indications, I think that despite being still up on www.google.com, it's outdated and no longer in effect.

I suppose that the failure of the new ToS to include similar language is probably a mistake, as is the fact that the Play ToS contains so many terms (like the stream ripping clause I quoted) that seem like they're intended for media rather than apps, but have no explicit limitation to the former. But that doesn't change the fact that the ToS is what it is, and has been for years, yet people still upload GPL stuff.

Also, if Google were to fix this it wouldn't just be a matter of adding the clause back. As I mentioned, from what I can tell (not an Android user myself), Google Play encrypts APKs at rest as a DRM measure; since modifying and redistributing them would require cracking the encryption, the Play ToS's anti-DRM-circumvention clause is presumably an "additional restriction" from the GPL's point of view. (If we ignore the who-contracts-with-whom question I raised, at any rate.) Giving the GPL priority prevents incompatibility, but Google presumably wouldn't want there to be a loophole where crackers could legally reverse engineer the DRM that applies to all apps by claiming to do it for the purpose of distributing a GPL app. This wasn't an issue in 2011 because the encryption feature hadn't been released yet; the Market ToS has an anti-circumvention clause too, but if there is no actual DRM to circumvent, there's no issue.

Of course, there is a solution: Google could just allow developers to turn off DRM on a per-app basis. But they'd have to care enough to implement that.

Which is essentially the same problem as with Apple. I said that Google's and Apple's ToSes were alike in enforcing random usage rules on apps with no exceptions, but there's a difference in quantity: since Apple's has separate sections for iTunes proper and the App Store, it doesn't have the same kinds of probably-not-intended-to-apply rules as Google's. In fact, aside from DRM clauses, the only restrictions in Apple's ToS that apply to third-party apps distributed with their own ToS are four paragraphs of "APP STORE AND APP STORE FOR APPLE TV PRODUCT USAGE RULES", of which two are a prohibition on using the same iTunes account on multiple commercial or multi-user devices, and the other two are essentially a description of DRM limitations. If Apple wanted to properly support GPL on the store, it would have to add an option for developers to disable DRM on their apps, same as Google, but then legally speaking it wouldn't need to add any dangerous-seeming blanket exception clause; it would just need to add an exception to those four paragraphs. Again, a matter of caring.

Historically, Google has cared a lot more about open source and particularly the GPL while Apple has kind of turned up its nose - but then, historically, Apple was under different management than it is today. Maybe I should try filing a Radar.

</comment></comment></comment></comment></comment><comment><USER5> The license change is from GPLv3 to, uh, dual GPLv3/MPL-on-the-App-Store-or- something?

> _Additional Permissions For Submission to Apple App Store: Provided that you > are otherwise in compliance with the GPLv3 for each covered work you convey > (including without limitation making the Corresponding Source available in > compliance with Section 6 of the GPLv3), Open Whisper Systems also grants > you the additional permission to convey through the Apple App Store non- > source executable versions of the Program as incorporated into each > applicable covered work as Executable Versions only under the Mozilla Public > License version 2.0 ([https://www.mozilla.org/en- > US/MPL/2.0/](https://www.mozilla.org/en-US/MPL/2.0/))._

This seems less straightforward than what e.g. Mosh has. [https://github.com/mobile- shell/mosh/blob/master/COPYING.iOS](https://github.com/mobile- shell/mosh/blob/master/COPYING.iOS)

<comment><USER6> Tough crowd! That's what we used to do, but some extremely vocal people weren't satisfied, so we've done this to integrate our intentions into the license itself.

<comment><USER7> Was this lawyered? Because the clause reads to me like Programmer Law.

> Provided that you are otherwise in compliance with the GPLv3... [we] also > grants you the additional permission to convey through the Apple App Store > non-source executable versions of the Program as incorporated into each > applicable covered work as Executable Versions only under the Mozilla Public > License version 2.0

1\. The phrase "only under the [MPL]" definitely means my app store binary isn't distributed under the GPL

2\. The phrase "Provided that you are otherwise in compliance with the GPLv3" does not seem to have any effect for distributing "only under the MPL". By distributing software "only under the MPL", I do not "otherwise" have GPLv3 obligations for me to not be "in compliance with".

3\. Unless you intend to say that I have both GPLv3 _and_ MPL obligations, in which case the same GPL obligations which [allegedly] prevented me from using this in the app store are still in effect. Also, this would contradict 1.

Please have a lawyer look at this. I guarantee my clients' legal counsel would not allow use of a library under these terms.

<comment><USER5> One thing that makes me happy about the Mosh approach is that they got lawyers (SFLC, specifically) to advise on exactly how to phrase it.

</comment></comment></comment></comment><comment><USER8> Please be aware that you may not use this code to interact with OWS servers or in an app containing "signal" in the name [0].

[0] [https://github.com/LibreSignal/LibreSignal/issues/37#issueco...](https://github.com/LibreSignal/LibreSignal/issues/37#issuecomment-217211165)

<comment><USER9> That's too bad, while I'm happy with Signal, I understand where people using LibreSignal are coming from and it'd be a shame to be unable to talk to them (or install yet another freaking app for it).

It's hard to imagine there are enough LibreSignal users to make a notable impact on the OWS infrastructure in terms of expenses. Though over time, that could change, especially if other forks joined the party, and of course the fallout of shutting them out would only grow over time.

Given OWS's worries about federation and shared standards standing in the way of progress, they might want to avoid third party access simply because it might stop them from changing the server interface. Thirds party clients would be at the mercy of their developers when OWS makes an incompatible change. Caveat emptor, I would say, but again, the problem would only grow.

My personal situation is that the only people I talk to via Signal are nerds; the kind of people who jump ship when a sexier alternative comes up -- like we did when TextSecure/Signal offered good e2e crypto. But that's stopped being a unique feature since WhatsApp also uses the Signal Protocol, which simultaneously made it feel much less pressing to convince non-nerds to switch from WA to Signal.

<comment><USER6> > Given OWS's worries about federation and shared standards standing in the > way of progress, they might want to avoid third party access simply because > it might stop them from changing the server interface.

Totally. Client interoperability as well. For us, the problem is that when a 3rd party client breaks compatibility, that doesn't just affect the users of those 3rd party clients, but the normal Signal users who communicate with them as well.

For example, LibreSignal doesn't support voice calls. When normal Signal users try to call LibreSignal users, it just doesn't work. Most normal Signal users don't care or understand or sympathize with the idea that the person they're trying to call uses some _other_ app which doesn't support voice calls. They'll just think that Signal voice calls are flaky and randomly don't work sometimes.

That's one example, but as development progresses, there will inevitably be more. We're concerned about exactly the same set of problems we found with federation.

> But that's stopped being a unique feature since WhatsApp also uses the > Signal Protocol, which simultaneously made it feel much less pressing to > convince non-nerds to switch from WA to Signal.

Just to be clear, I think that's great. If people don't feel it's necessary to use Signal because Signal Protocol is "the new normal" in the apps they already use, then I think we've succeeded. Hopefully we'll eventually have the chance to push the envelope forward again and restart that cycle.

<comment><USER10> If the code is GPL then shouldn't WhatsApp need to be open source? Or did they get a different license?

The only thing listed at [https://www.whatsapp.com/android/](https://www.whatsapp.com/android/) are some changes to qcom as per the LGPL.

<comment><USER11> I think they're talking about the protocol like "keep around these keys and exchange this", but implemented with proprietary code that doesn't use any of Moxie's C implementation which is indeed GPL.

<comment><USER12> Nope, WhatsApp were given a different license. Unlike ChatSecure, who until this most recent change, were locked out from iOS.

<comment><USER12> It's good to see.

</comment></comment></comment></comment></comment></comment></comment><comment><USER13> This is probably partially in response to some of the issues that were discussed here: [https://github.com/LibreSignal/LibreSignal/issues/37](https://github.com/LibreSignal/LibreSignal/issues/37)

<comment><USER14> It's a little depressing Moxie believes federated protocols can't compete with unfederated/proprietary ones. I don't like the idea of all future innovation taking place in the Slacks and WhatsApps rather than the IRCs and SMTPs.

Are there any recent counter examples of successful federated protocols?

It would be an interesting thought experiment to design a protocol that started with the basic features of IRC and incrementally layered on new features in backwards compatible / gracefully degrading ways until you arrived at Slack. Of course it would be a lot easier with the benefit of hindsight than if you started in the 1980s.

<comment><USER15> That thought experiment lives today in the form of Matrix.org :)

</comment></comment></comment><comment><USER16> Tangentially related, but since we're talking about Signal and have Moxie's attention ...

Does anybody know how the "privacy preserving contact discovery" works?

One of my unpleasant experiences with Signal was receiving a greeting from an unknown number when I installed it. Fortunately, it was a friend with a new number I hadn't known ... but the potential privacy leak - without any apparent warning, consent or opportunity to opt-out - bothered me.

Best info I could find is a blog basically saying "privacy preserving contact discovery is an unsolved problem" ... which is hardly reassuring:

[https://whispersystems.org/blog/contact- discovery/](https://whispersystems.org/blog/contact-discovery/)

What's the story?

<comment><USER17> I posted on the issue tracker and a few other places about this and was shut down. Apparently it's a support issue, not a technical one. From my (limited and potentially erroneous) understanding, Signal hashes each of your local contacts and uses that hash to query whether the number is registered with OWS. If so, you receive a notification to that effect. Essentially, you can identify Signal users without actually communicating with them. Though the same is true with PGP if you use a public keyserver.

That said, it gave some friends quite a fright. It's really unfortunate this wasn't opt-in or publicized before-hand.

</comment></comment><comment><USER18> The license file in the library linked from the blog post hasn't been changed in 9 months. What am I missing?

[https://github.com/WhisperSystems/libsignal- protocol-c/blob/...](https://github.com/WhisperSystems/libsignal- protocol-c/blob/master/LICENSE)</comment>


Ask HN: Alternatives to (locally hosted) CrashPlan? - <AUTHOR> tl;dr: What would you recommend as an alternative to a locally hosted CrashPlan instance to backup my files?
A bit of detail:
I've been using a locally hosted CrashPlan instance to backup my files (no cloud account) and it works really great for me because I don't really generate that much data so having a NAS turned on all the time feels like overkill.
A local CrashPlan instance worked like a charm for me because I could backup my main machine (Windows based) very easily into a small (Celeron-based) Linux server, by turning it on every few weeks and letting CrashPlan run in the background.
This gave me peace of mind since I don't have to worry about an Internet-connected NAS that might get hacked or something like that, and the very simple to use UI made things very easy.
What alternatives do you recommend now that CrashPlan for Home will be closing down?
Ideally I would like a similar setup, i.e. a locally hosted solution that has a Windows client and can backup to a Linux server, with some easy-to-use UI?
Thanks! <comment><USER2> Take a look at Arq. I began switching over to it before Code42 announced they were shutting down CrashPlan, and I've been happy with it. And if you do one- day decide you want to put some of your data in a cloud, this supports that as-well.

[https://www.arqbackup.com/](https://www.arqbackup.com/)

<comment><AUTHOR> Arq sounds interesting.

Just for completeness sake, I see in their features section:

"You can back up to your own Amazon Cloud Drive, Amazon Web Services, Google Cloud Storage, Google Drive, Dropbox, or OneDrive accounts, or your SFTP server or NAS"

So local options are only SFTP and NAS? do you know what do they mean by NAS? i.e. they support a branded NAS like Synology, or maybe OpenNAS servers? any info on this would be great as that would save me some time downloading the trial and setting up stuff just to figure this out :)

<comment><USER3> > _So local options are only SFTP and NAS? do you know what do they mean by > NAS? i.e. they support a branded NAS like Synology, or maybe OpenNAS > servers? any info on this would be great as that would save me some time > downloading the trial and setting up stuff just to figure this out :)_

The option is called "A folder on your drive or NAS", and asks you to specify a folder, so external hard disks should work fine.

</comment></comment></comment><comment><USER4> Arq has an option to backup to a local drive. This should suffice your local backup needs. They have both Windows and Mac App.

I live in India and I realized about a year back that both Backblaze and Crashplan sucks on recovery. They don't seem to have servers nearby nor the option to mail a disk quickly enough. Here is how I do my current backup setup.

Time Machine as the default option that keeps chugging along.

Carbon Copy Cloner[1] mirrors my primary computer's drive (bootable). This is scheduled to backup every day around 11:00 PM.

Arq[2] does a backup to Amazon Drive every 5 minutes but is asked to pause between 6:00 AM and 10:00 PM. I'm looking for economical alternatives[3] to Amazon Drive, as they are terminating the unlimited option.

1\. [https://bombich.com/](https://bombich.com/)

2\. [https://www.arqbackup.com/](https://www.arqbackup.com/)

3\. [https://www.arqbackup.com/documentation/pages/strategy.html](https://www.arqbackup.com/documentation/pages/strategy.html)

<comment><AUTHOR> Do you know the details for the local drive backup option?

I saw on their features list that it supports backup to a local SFTP and NAS server. Any idea what they mean by NAS? i.e. they support a branded NAS like Synology or do they support "any" NAS as in support for SSH file transfer or something?

<comment><USER4> I haven't tried the local backup with Arq but that local folder or NAS option seems straight forward to me. When I tried that as an option, it just ask me for the destination. I guess you have to just pick one (i) on a connected local drive or (ii) a folder on your NAS.

[https://www.dropbox.com/s/ns2mqe5ytr3dpie/Screenshot%202017-...](https://www.dropbox.com/s/ns2mqe5ytr3dpie/Screenshot%202017-08-30%2022.46.07.png?dl=0)

<comment><AUTHOR> Awesome, thanks!

</comment></comment></comment></comment><comment><USER5> Not a client suggestion, but if you want to run your backups unattended but not keeping the server running all the time, you can use the rtcwake command to make it sleep and then wake up at a certain time automatically. My NAS (an atom board) wakes up every three hours, syncs a git annex directory with a remote node and goes back to sleep. Very efficient.

<comment><AUTHOR> Aha!

Nice approach. I never thought of that.

I'll have to take a dive on rtcwake but that could work as a semi-automated solution.

Thanks for the tip!

</comment></comment><comment><USER6> > so having a NAS turned on all the time feels like overkill

It shouldn't. You probably only need a single drive NAS. Don't buy a multi-bay NAS unless you need one.

As for remote connectivity, just use a good password and SSL. Most hacks are caused by people coming up with bad passwords (eg hunter2).

<comment><AUTHOR> Yeah, definitely only need a single drive NAS.

What I meant was that a Synology or similar product would not really be what I'm looking for, not because it's not nice, but because AFAIK it's meant to be on all the time, which wastes energy, makes noise, prone to electrical problems (I have very bad electricity where I live, so I don't want to expose my NAS unnecessarily, even with UPS/voltage protectors/etc.)

The good password + SSL is probably a good alternative and since I already use 1Password a strong password is not a problem, however I would love to have a UI for it so I Can easily select folders/files, and either I would need to build it... or get a product that supports it, which is the why of this Ask HN post :)

</comment></comment><comment><USER7> While this is certainly not comparable to CrashPlan, for the odd Windows System I have at Home, I just setup the builtin FileHistory backup and use my existing Linux Server/NAS as a target storage.

As a second step the Linux Server already runs a more sophisticated, encrypted etc Backup to offsite storage, and I just added those folders to that too, but you can of course skip that if you are comfortable without a secondary physical backup location.

<comment><AUTHOR> Ah... Windows File History. Maybe I'm dense but I've never been able to figure out how that works. Even when I thought I enabled it I never could make it work. The history would just be empty every time. I'm sure I missed something, but I just never figured out what.

A follow up question is then , can I restore those files to a non-Windows machine?

With CrashPlan I could backup to a Linux server, and if I needed the files I could restore them either to a Windows or to a Linux machine. Can I do the same with File History? or do I have to restore to a Windows machine? or even worse, do I have to restore to the same _instance_ of Windows that I used to backup?

<comment><USER7> It just saves the changed files with a timestamp in the filename, which is good enough for me manually to grab a few files when I'm in a pinch and the Windows System is down.

I also have a python script somewhere (downloaded from github) that would keep only the latest timestamp of each file and then remove the timestamp from the filename, so kind of like restoring the last backup in full or from a folder. And I could in reasonable time rewrite that to get out a specific timestamp etc, without needing to read the database and metadata files. I'm not planing to do that as the default restore method, but I'm confident to always be able to get all data I need out of the backup without _ANY_ client software.

You can restore to any Windows instance, so to a fresh install, another computer etc.

</comment></comment></comment><comment><USER8> I came into Crashplan because for me these were essentials:

\- Encryption before data get to the cloud

\- Multi-platform support

\- Versioning - saved me few times

\- Deleted files backup without time limit to keep them.

\- No limit for size.

\- Real-time-ness.

No one else offers above. And I need 3 boxes.

$10/mo/box is more expensive than Home plan used to be - but i think i will have to bite that $360/yr bill with a good feelings - because crashplan is tested and it works on all points.

<comment><USER9> The original poster is interested in a locally hosted CrashPlan - the $10/mo CrashPlan For Small Business does not offer local backups:

 _CrashPlan for Small Business does not support computer-to-computer backups, including:

Backing up to another computer you own

Backing up to a friend's computer_

[https://support.crashplan.com/Backup/Keeping_computer-to- com...](https://support.crashplan.com/Backup/Keeping_computer-to- computer_backups_when_migrating_to_CrashPlan_for_Small_Business)

<comment><AUTHOR> Yeah, that's my biggest gripe with this.

Even though $10/mo is expensive for my usage, I was also very happy due to the GPs points. However not allowing a local backup is a non-starter for me.

For cloud backups I already use tarsnap (albeit for a much smaller subset of what I backup locally) which I think is a bit safer/better.

That's what made CrashPlan so nice for me. Having a no-fuss local backup strategy.

I'm really sad CP decided to go this route without offering an similar alternative :(

</comment></comment></comment><comment><USER10> I use Seafile ([https://www.seafile.com/en/home/](https://www.seafile.com/en/home/)) (hosted on an RPi on my home network).

Then I back up the actual Seafile data files on the server with Borg ([https://borgbackup.readthedocs.io/en/stable/](https://borgbackup.readthedocs.io/en/stable/)), which has the wonderful option to encrypt the backup. The Borg backup is on the same server/drive. Then I sync the entire (encrypted) borg backup to S3 every night.

This offers self-hosted file-syncing (ala Dropbox) w/ an encrypted offsite backup (make sure you keep a copy of your key in a safe place though). Honestly, was a pain to set up, but haven't had a problem with it yet, and my test restores work great.

I only pay for S3 storage.

<comment><USER11> This sounds like an interesting solution, thanks for sharing!

Do you happen to have followed any tutorials, or were you forced to hack things together on your own seeing how you found it to be a pain?

<comment><USER10> It would have been nice if Seafile had a verified client-side encryption mechanism, but after reading about how they do it, it seemed like a horrible hack. This is why I looked into borg, which does have stronger encryption, allowing the data to be synced to a 3rd party (S3).

All that said, no, there were no guides for this. I quite like Seafile as an app, but wanted to make sure it's all (somewhat securely) backed up, so I hacked all of this together myself.

</comment></comment></comment><comment><USER12> [https://bvckup2.com](https://bvckup2.com) is a godsend for local replication.

It's fast, light and predictable. The UI is insanely good. Been using it for ages and it's still in active development.

</comment><comment><USER13> I know it doesn't fulfill the local requirement, but I've been looking into the Cloudberry backup product allows you to pay a one-time fee of $30 (per computer) for their software (a free version is also available), and then choose which cloud provider to store the backup on.

So you could use Amazon S3 or some other cloud provider to store backups and pay the tiny amount per gigabyte (depending on the storage option you choose).

I'd recommend a cloud-based solution as further backup option even if you stick with the local option. I currently back up my NAS using CrashPlan in case a disaster (fire, flood, earthquake, theft, etc) wipes out my computers and NAS. My NAS doesn't need to be exposed to the Internet: the software runs on one of my computers with the NAS connected as network file shares.

One of the solutions I'm considering using is Cloudberry Backup. There's a bit of initial cost, because I want the features of the pro version, but cloud storage can be quite cheap in the long run. It can run on a computer and backup network shares just like CrashPlan can. Unfortunately, a local option is not supported.

Interestingly, I had renewed my Crashplan subscription only a couple days prior to the discontinue announcement, so I have until October of 2018 to figure out an alternative.

<comment><AUTHOR> I'll look up into it.

But I already have a cloud solution (tarsnap) that works great for me. The thing is I only backup a subset of my stuff to the cloud due to cost issues, so less than critical files go to my local backup.

</comment></comment><comment><USER14> I've been using Duplicati with good success.

I also wrote a tutorial on setting it up to work with AWS S3:

[https://linuxserver.io/2017/07/04/how-to-setup-duplicati- as-...](https://linuxserver.io/2017/07/04/how-to-setup-duplicati-as-a- personal-backup-service-using-docker-and-aws-s3/)

</comment><comment><USER15> This came up on the latest episode of ATP. They discuss some alternatives/options...

[http://atp.fm/episodes/236](http://atp.fm/episodes/236)

I'm not sure where in the episode the topic is discussed. I'd guess about halfway through.

<comment><AUTHOR> Thanks!

I'll take a look.

</comment></comment><comment><USER16> If you're okay with a Linux server being up all the time, then just get a NAS. I like Synology.

Back everything up to the NAS, then back up the NAS to B2 or something. Synology will do that OOTB. Can't speak to other vendors, but I'm pretty happy with my setup.

<comment><AUTHOR> That's my next alternative if I can't find a suitable (for me) alternative.

However I would prefer not to have the NAS on all the time, mostly because I only backup seldomly (since I don't really generate that much data, so losing a month or so is not that bad. Really critical stuff I backup directly to tarsnap though), and because where I live, the quality of the electricity is really bad. I get unexpected blackouts once a month at least, if not more, and voltage/current changes a few times a week, so even though I use voltage regulators and such, I like to be extra safe with my backup hardware, so the less time they spend connected to the grid, the better for me.

Maybe I'm paranoid, but I believe (can't confirm) I've lost data over the years due to electricity issues.

<comment><USER3> > _However I would prefer not to have the NAS on all the time, mostly because > I only backup seldomly (since I don 't really generate that much data, so > losing a month or so is not that bad. Really critical stuff I backup > directly to tarsnap though), and because where I live, the quality of the > electricity is really bad. I get unexpected blackouts once a month at least, > if not more, and voltage/current changes a few times a week, so even though > I use voltage regulators and such, I like to be extra safe with my backup > hardware, so the less time they spend connected to the grid, the better for > me._

In this case, why not a standard external hard disk over USB?

<comment><AUTHOR> That's basically my current setup, however since I rather have a "good" HD (currently a WD Red) as an added layer than only a run-of-the-mill USB drive (which for several reasons I've come to believe aren't as reliable), I setup a cheap Celeron-based computer for this.

I still use my USB drive, but it's used much more frequently so I fear it might break some day. That's why I opted for the NAS-rated HD as a second layer backup.

As a last resort I also use tarsnap for my very critical files though, so yeah, USB drives are good but I wanted a bit more peace of mind on top :)

<comment><USER3> What's the Celeron-based computer for?

I share the same sentiment as you regarding off-the-shelf external drives — I believe they're usually bottom-binned stuff. You could consider getting a 3.5" enclosure and installing a NAS-rated drive in it.

</comment></comment></comment></comment></comment><comment><USER17> Duplicati rules, as long as all you need are files and folders. It's no good for SQL, Exchange, Bare Metal, etc. though.

</comment><comment><USER18> I was recommended UrBackup[1] recently as a selfhosted backup solution.

However, i haven't tried it so far, so i can't really comment on it yet..

Feature-wise it seems it should fit the bill, however..

[1] [http://www.urbackup.org/index.html](http://www.urbackup.org/index.html)

</comment><comment><USER19> BorgBackup has been fast and painless for me, though it misses your UI goal.

</comment><comment><USER20> I believe Duplicati is the current tool du jour

<comment><AUTHOR> Aha!

This looks interesting.

Just to confirm, you mean this Duplicati? ([https://github.com/duplicati/duplicati](https://github.com/duplicati/duplicati))

Also, it says it's a client for backups which support cloud and local servers.

On their page it says it supports:

"Amazon S3, OneDrive, Google Drive, Rackspace Cloud Files, HubiC, Backblaze (B2), Amazon Cloud Drive (AmzCD), Swift / OpenStack, WebDAV, SSH (SFTP), FTP, and more!"

Only local options I see are SFTP/FTP. Do you know of other supported ones? I can't seem to find reference to other local solutions, so if you have more info that would be great!

I mean, setting up an FTP server is pretty simple and with such a client most of the hassle of actually backing up would be solved apparently, but are there any other options for local servers that you know of (just for comparison sake)?

Any input is appreciated. Thanks!

<comment><USER20> Yeah thats the one.

SFTP is SSH (i.e. it's not FTPS), so you don't have to stand up a FTP server :)

<comment><AUTHOR> Ah.

I always thought SFTP was FTP. Will need to read up more on that.

Thanks!

</comment></comment></comment></comment><comment><USER21> blackblaze has a backup plan now. Also I use SpiderOak One for my backups. not to bad on the pricing.

<comment><AUTHOR> Care to elaborate on the Backblaze solution?

I just gave it a cursory look at their product page, but it seems it's a cloud backup only and I'm looking for a local one. Unless I'm wrong and it does support local as well?</comment></comment>


Applications for YC W19 Are Open - <AUTHOR> https://blog.ycombinator.com/applications-for-yc-w19-are-open/ <comment><USER2> I've been applying to YC since 2013 (so this is going to be around our 10th time), although with different companies and cofounders. I've never gotten accepted, though we've made it to the interviews twice but never made it to the finish line to actually get in. Here's what I learned that could mean something:

1: Every time we got an interview we asked for recommendations. Last time we got a straight up email rejection when we decided it was probably a bad idea to ask again our network for a recommendation for the third time. If anything our startup was doing better than the last time we applied so I'm not sure how their process works.

2: We recycled our 1 min video and we got an interview. So if you're too lazy to make a new one, I guess it's fine

3: We'll apply for the 10th time sometime this weekend, and probably for the 11th.. fuck it.

<comment><USER3> I too have been applying for some time 8th application (2014 at least)...

I've been interviewed twice, had recommendations, helped a few YC companies and worked with a few YC companies.

The fact is, it appears YC's goal is to put fuel on the fire. You have to have something people want, or you have to be onto something they think people want. In addition, you are their product, so you have to be something people want as well.

They didn't accept you and your startup failed (different founders, companies, etc.) means they were probably right - likely not far enough along. I too have had my set of failures and each time they were right to reject me. Each time it's improved my business and although I haven't shifted businesses completely (and I'm sticking to my long-term 2-year plan). I believe I'm on the right track now and will apply again. Because as you said, "fuck it." The real trick is not really needing YC in the first place to succeed and that's when you'll be accepted.

One thing that's different for me now, is although I'm a solo founder, I have experience, a team of seasoned entrepreneurs advising me, some income.

I always tap my network, and I'll buy them all lunch, dinner, coffee or beer if I can. I also return the favor where I can. I intro startups to other founders or companies I know wherever possible. I assume, that we'll all pay each other back eventually, and I know I've brought in large contracts from my introductions - so I assume they've been happy to review my application.

Reach out and I'll be happy to review your application. Perhaps one day, you can return the favor as well :)

<comment><USER4> Demo day is the point of YC because it flips the tables and makes VCs compete for startups, as i understand it. YC is a good fit if you are positioning for a seed round. The best advice I ever got is that YC is just another VC underneath a bunch of hacker branding. You're either raising or building, you can't do both at once, so if you're not ready to raise, why talk to YC?

</comment></comment></comment><comment><USER5> I think I applied 4 times for [https://micro.mu](https://micro.mu) in some form or another. The first time was just an idea. The next an open source project. The next sponsored by a large corporate. The next used by dozens of large reputable companies. I don't bother applying anymore but it's interesting to see the progress in all that time.

I know I'll succeed. I don't need YC for that. But I'm sure things would be different if I did have their help.

<comment><USER6> you have 4.6k stars on github! Well done.

Is your service something that turns a normal application into API exposed services? I have been looking for something like that for a long time to expose some of my internal java applications as external API

Sorry if this is a silly question

<comment><USER5> The toolkit includes an API gateway which would allow you to serve public facing http and direct requests to internal services that may speak a different protocol such as RPC. It's highly flexible and pluggable.

<comment><USER6> Awesome. This is kind of what I was looking for. I will give it a shot!

</comment></comment></comment></comment><comment><USER7> I'm a YC founder from the S15 batch and worked as an early employee at another company from W12.

Happy to review your application or answer any questions from a founder perspective.

Email is in profile.

<comment><USER8> Hey there, I am another startup founder for this deployment application for php and other tech stack like python, java. No scripting required. Just signup and start using.

Also others can give feedback of the app too. [http://grandappstudio.com/roll- out?utm_source=news_yc](http://grandappstudio.com/roll-out?utm_source=news_yc)

I am giving completely free for the first project for first 100 signups. Please make the best use of this opportunity too.

</comment></comment><comment><USER9> The misconceptions page is interesting i.e. almost all companies were incorporated, half had revenue, almost half had recommendations from alumni and almost half were responding to an RFS.

<comment><USER6> By itself they are true. But they most likely look at the trailing years for revenue. We had zero revenue at conception and got interviewed but 2 years later our revenues was around $5k per month and we didn't even make the initial cut.

</comment></comment><comment><USER10> I heard YC made / considered to make moving to SV full time optional. Coming for 1-2 days per week could be acceptable. Is this true or did I make it up?

<comment><USER11> Founders should be where their customers are, so if your customers aren't in SV, then you probably should be elsewhere. We work with with each team to figure out what the ideal arrangement should be.

</comment></comment><comment><USER12> I am going to apply, but currently looking for a cofounder[1] after my previous cofounder left. Is it advisable to wait until I've recruited a new cofounder to submit the application?

[1] - [https://angel.co/imersme/jobs/386205-co- founder](https://angel.co/imersme/jobs/386205-co-founder) details about co- founder position (sf bay area) if anyone is interested. Reach me at "me" at my website (in profile) or reply here.

<comment><USER13> I'd probably wait until the application deadline, but if you don't have a new cofounder by then, I'd just submit with what you have.

It's true we're a little less likely to accept single founders, but it's only one of many factors and the probability delta not that large. Particularly if you are a technical founder, which I see you are.

<comment><USER12> Thank you, snowmaker, for the advice!

</comment></comment></comment><comment><USER14> I'm going to apply again. It will be my 8th time. But this will be my first time applying with a co-founder, live product and paying customers. If you are a YC alumn, would love to ping you so you can check out our application. Thank you and good luck everyone!!

Ninja Edit... We are looking for a cofounder:[https://angel.co/roboamp/jobs/331401-cofounder](https://angel.co/roboamp/jobs/331401-cofounder)

</comment><comment><USER15> YC Bio Application idea: The Artificial Human Womb

Prompted by two considerations. Surrogacy centers throughout Indian and Southeast Asia are shuttering as legal regulation catches up with a grey market that often lures young unskilled women with promises of life-changing compensation. Only to deliver much less upon delivery of a newborn infant for adoption. Demand among infertile and / or non-traditional first world families for reproductive solutions creates a window of opportunity for innovation and investment. Public perception is evolving. After all, even thirty years ago so called "test tube babies" once condemned by church doctrine, are now seen as a miracle technology.

The other belongs more to the realm of sci-fi or speculation. In the event of a mass depopulation event. Either human-made or environmental. It may become essential to rapidly re-populate the earth. Or off-planet colony. Beginning an artificial womb project today, may yield the fruits necessary a generation or two down the road.

To be clear, this is an artificial womb for gestating humans. We don't wish to begin with Mus and work our way up. Funding (ask $1M) would be used primarily to attract the team and begin feasibility study and simulation toward a goal of version one prototype.

<comment><USER13> I do think this is an interesting idea.

</comment></comment><comment><USER16> How different is the YC non-profit application from the usual route? Do they look for an existing established product or bet on new ones like the company route?

</comment><comment><USER17> FYI there is a typo in the application:

"Do you generate direct program revenue or does it comes from donors? If both, what's the split?"

comes -> come

</comment><comment><USER18> Did we ever get an update on the online YC batch?

<comment><USER6> I am part of the first startup school by YC. I think it's just few of us survivors left.

My company aihello.com is doing good although AI in production environment is extremely hard. Took us more than a year to just get "good enough" results.

<comment><USER19> My company was in the Startup School also. We were accepted into YC when we applied after finishing the Startup School (applied twice before, no interview). Interestingly I know other founders from Startup School that were at the demo day as investors!

<comment><USER6> What's your startup?

<comment><USER19> Plexus, high-performance haptic gloves for AR and VR

</comment></comment></comment></comment></comment><comment><USER20> It's always fun to read the original Dropbox YC application. So well thought out and written.

[http://www.businessinsider.com/dropbox-y-combinator- applicat...](http://www.businessinsider.com/dropbox-y-combinator-application- from-2007-by-drew-houston-2013-9)

Are there any founders from recent batches than can still vouch whether YC is still worth it?

With insane SF rent prices, one has to burn a big chunk of that 120k in 3 months by just trying to stay alive.

Add that to the fact that YC batches are pretty big right now. Do you get much in return other than the YC bragging rights?

Would love to learn about the experiences of existing/past founders.

<comment><USER21> YC is located in south bay which is expensive, but not much different than many other cities in the US. If comparing to a suburb it will not be cheap, but there are no VCs in suburbs.

An extra few $k in rent is not going to make a difference in the longrun.

<comment><USER22> I think that depends on whether those extra few $k mean the difference between needing to move back home and staying out in SF</comment></comment></comment>


Game of Life Rebooted - <AUTHOR> https://repl.it/talk/challenge/Game-of-Life-Reebooted/13089 <comment><AUTHOR> A quick and dirty implementation of a stochastic version of Conway's Game of Life. Uses Poison distribution to update cell state.</comment>


Show HN: Docdown – Manage Your Web Content with Google Docs - <AUTHOR> https://docdown.co <comment><USER2> Does it load the doc with Javascript to a site? It seems like that because the page mentions an x number of requests and OAuth (that's bizarre, you have to sign in to view the website?).

</comment><comment><USER2> Basically you're embedding Google Docs in webpages, but in a more fancy way with Javascript?

</comment><comment><USER3> Well this is cool. I've spent hours last week tweaking stupid little content changes for clients. Can't wait to try this out.</comment>


Using Ruby in 2019 - <AUTHOR> https://jasoncharnes.com/using-ruby-in-2019 <comment><AUTHOR> I'm 100% agree with the author of this nice post</comment>


IF-less programming - <AUTHOR> http://alisnic.github.com/posts/ifless/ <comment><USER3> This is getting ridiculous

" ifs are a smelly thing in a Object Oriented language."

What's smelly is such a absurd assumption. Yes, let's replace every small decision in our program with inheritance and another level of abstraction, that will work out swell

Please go read an Assembly manual because you have obviously forgotten what a computer is and does

And then we end up with unmaintainable systems with a class hierarchy higher than the Empire State.

Of course, as mentioned, replacing an if with a "software structure" (like pattern matching in an functional language) is beneficial, but to call it a code smell is ridiculous

<comment><USER4> > And then we end up with unmaintainable systems with a class hierarchy higher > than the Empire State.

Perhaps, but I would rather have testable code than untestable code that is nothing more than a series of unnecessary, nested if blocks. We have all seen code that has a structure like

        if (depObj1.isSomething()) {
            if (depOboj1.getAttr() == CONST1) {
                // Do something
            } else if (depObj1.getAttr() == CONST2) {
                // Do something different
            }
         } else if ... {
            // repeat with minor differences
         }

Most of the time the above structure can be abstracted. Abstracting It also has the benefit of making this code more testable: you don't have to set up many different objects, just one.

The OP is correct: in OO languages if statements are a code smell. Like all smells, though, they are not hard and fast rules, but rather indicators that things could probably be done better. No one, certainly not OP, is recommending abandoning if statements. What he is recommending, and I agree with, is that they can and should be avoided, and certainly not turned to as a primary tool in the toolbelt.

<comment><USER3> It's irrelevant if you're using ifs or different objects, the number of conditions/tests needed for what you are testing is the same.

Now, you could make depObj1 of type Obj1 and Obj2 to replace the if, which _may_ simplify testing because the method is "simpler" in Obj1/Obj2/ObjBase _but in the end it isn't_!

Why? Because your test of Obj1/2 has to take care of their dependency to ObjBase. It's usually a dependency hell, needing lots of workarounds to test properly.

<comment><USER5> I might agree if that type of if statement only appeared at one point in the code, but there're normally several scattered around which all have to be updated when obj3 is introduced. Also introducing a class hierarchy often makes it easier to move responsibilities between objects as the code evolves.

For example I recently did some work on a graphics library which had a lot of ifs to do with line and fill styles. By changing those into an inheritance hierarchy I found a couple of places where clauses had been missed and so fixed some bugs, but more importantly when we needed to add new fill styles which were more complicated to draw it became very easy to turn the fill style objects into fillers which had all the responsibility for filling paths, not simply setting the graphics state.

<comment><USER3> Yes, there are situations where changing the structure of the code is better than having an 'if' like the example you gave.

But this doesn't mean that it's better to completely eliminate ifs

</comment></comment></comment></comment></comment><comment><USER6> Functional pattern matching (more rigorous IFs) is open for functions but closed for extension. You can write as many functions as you like, but you need to modify all of them if you add a new data type.

OO polymorphism is closed for functions but open for extension. You have a fixed number of functions (methods), but you don't need to update all the call sites if you add a new data type - merely implement all the methods.

The requirement for what needs to be open and what can be left closed is what determines which choice is better.

For example, a GUI framework is best left open for extension, because every application GUI usually ends up with specific widgets custom-designed for that app - sticking with standard widgets tends to make apps form-heavy and lacking in polish. But for the widgets to work in the framework, they need a fixed set of methods to be consistently manipulable.

A compiler AST is best left open for functions, because the majority of work on an AST is in algorithms that transform the AST. The language changes at a much slower pace than additional optimizations and analyses, and frequently new language additions can be represented in terms of existing AST constructs (where they are syntax sugar, effectively built-in macros). So having a more fixed set of AST node types is less of an issue.

Choosing one or the other on the basis of the orthodox religion of OO or functional programming, meanwhile, is just obtuse.

<comment><USER7> That's the classic "Expression Problem" (aptly named wrt its common appearance in ASTs).

Note that it's relatively straight forward to express the function- extensibility through the visitor pattern in an OO language; in a functional language, you could probably implement your own dynamic dispatch technique to get the type-extensibility.

In both cases, you'll end up with some boilerplate, depending on your language. E.g. for a complex language with lots of different AST node types, you'll end up with lots of tiny classes, mostly just implementing stupid constructors.

<comment><USER6> Function-extensibility using the visitor pattern in OO sucks compared to functional pattern matching. It is almost unusable except for the most trivial tree traversals.

Frequently you want to be able to pass arguments down and return values up the tree traversal. Using visitors, you need a whole separate class for each unique function arity, or you have to use tedious little data carrier instances. Sometimes you want to switch between them half-way through the traversal, e.g. use your constant-folding visitor during an optimization visit, and the visual overhead of constructing visitors and keeping track of them, making sure they're all linked together properly, is really ugly. Don't even think about matching the visitor method on more than one parameter type, like you might do with e.g. overload resolution of binary operators. I've been there working on a commercial compiler, and I don't want to go back there again.

Haskell can implement the OO style using existential types (forall), a bit like Go's interfaces, except once you put a value into an existential type variable, you can't typecast it back out again.

<comment><USER8> > Function-extensibility using the visitor pattern in OO sucks compared to > functional pattern matching.

Not only that, but using the visitor pattern tilts the extend types / extend functions into extend functions realm, soundly defeating the supposed advantage of being open to extend on types. As such, visitor pattern is precisely the same as a switch statement.

The only difference left is language specific. In Java, adding a new type will make your compiler whine if you have abstract methods in the visitor. That's because javac can't tell when a switch over enums is exhaustive.

</comment></comment></comment></comment><comment><USER9> Some of this seems petty. For example, the author gives the following "bad" example:

      def method (object)
        if object.property
          param = object.property
        else
          param = default_param
        end
      end

And suggests that this is better:

      def method (object)
        param = object.property || default_param
      end

To me, this is an example of an if statement by another name. Sure, you cut out a few lines, but it's still an if-then construct. Both examples are most likely going to be treated the same way by the compiler as well.

<comment><USER10> I disagree. Sure, the code is functionally equivalent today, but the next person touching the 'or' version might be less likely to introduce side- effecting computation. The 'if-else' version is completely open-ended.

We need to think about the effect our choices have on the next person who touches the code. Often with a different baseline people make different changes. It's a micro-form of 'No Broken Windows'.

<comment><USER11> "We need to think about the effect our choices have on the next person who touches the code."

And that next person might be the newbie on the team that doesn't have the business domain knowledge built up over years of working for This Company. So I'll use the if statement to keep intent clear.

Or maybe it'll be someone whose primary programming language doesn't use the || operator. Or maybe, for some unknown reason, it'll be a PHB. So I'll use the if statement to keep intent clear.

<comment><USER10> Setting the baseline gives you a higher probability of a better change than you would have otherwise. This assumes that not everyone on the team is a newb or a code-dabbling PHB. If they are, there's not much point in writing any code.

</comment></comment></comment></comment><comment> d--b No! This practice is absolutely terrible! Object-oriented programming _can_ allow you to make if-free programs, but it will cost you readability/maintainability. Many people have been fighting against the overuse of inheritance and oo patterns that emerged in the 90s. Do not fall in the trap again!

<comment><USER12> I think this is (once again) just a question of finding the right balance. Using polymorphism to avoid manual conditionals is a practice that can often improve readability and maintainability. One just shouldn't drive it too far.

I do agree that people are massively overusing inheritance. In particular its often used as a means for code reuse, not for polymorphism. In most cases composition should be favored over inheritance.

<comment><USER10> I don't advocate a completely if-less style, but I do often grep and count ifs and elses in a code base before digging in, just to get a sense of what sort of developers have been there.

I think the if-less style is great kata material. You learn a lot when you apply it on a toy project rather than a real one. Sometimes you need to overdo things in order to understand what their limitations are.

</comment></comment></comment><comment><USER13> You know whats a smelly thing in OOP ? Overblown abstractions, design patterns and stuff for the sake of flexibility which in the end mostly will never need that kind of flexibility but in turn readability and clearness suffers instantly.

I am all for Design Patterns and abstraction, but only when it makes sense.

<comment><USER14> In full agreement.

We have a rule about only using patterns if they become apparent rather than selecting a pattern up front.

<comment><USER15> I guess I don't see the harm in spending a little extra time up front to design things properly rather than just jumping in and writing code, hoping to stumble upon the correct design pattern. I've found it much easier to find and solve problems up front rather than waiting for potential landmines, at least, the time required to fix those problems is less if they're exposed earlier in the process. It's certainly possible to over-engineer a solution if you select a design pattern up front, but maybe you'd be better suited by having a rule against over-engineering.

<comment><USER16> It's hard to define a rule against over-engineering. The only approach I've seen that has any success is to ban any and all design up front, and only ever write code to implement user-facing features.

</comment></comment></comment></comment><comment><USER17> In general, this kind of don't-use-this patterns are not very constructive. It reminds of this obsession of not having global objects at all cost. And we end up with singletons, static classes, etc. that are all just global objects in disguise. If I need a global, I use a global and call it that, same if I need an if/else statement.

It's an interesting article though, especially the conclusion: "Any language construct must be used when it is the more reasonable thing to do. I like the fact that the presence of if-s can indicate a bad OO design."

<comment><USER18> I think your quote sums up the intention of this article and most of the "don't do this" posts.

What they all are getting at I think is that constructs in a language can be "abused" or used less than effectively either in terms of processing efficiency or user/programmer interaction.

So when they say "don't do this" it's more to show cases where doing whatever "this" is can be bad. Not that it's always bad and should never be used.

Also, the "don't do this" mentality can be a useful exercise to teach yourself alternative ways of getting things done.

<comment> d--b Fine, but the point is that the guy is only half-way through his reflexion. OO programming is an effective way to organize the business logic. And that logic should be coded in a sequential fashion to be readable and maintainable. Finding the right balance would be a much more interesting subject than to say 'ifs suck'

</comment></comment></comment><comment><USER19> Yeah, I've seen people go down this path. In the next step they realize they need an if-statement to determine whether to instantiate a PDFPrinter or a MSWordPrinter. Which they conveniently hide inside an AbstractPrinterFactory or a ComplexPrinterBuilder. This is probably how the whole Enterprise Java thing got started.

<comment><USER20> My own pet theory is that 95% of the enterprise code carefully architected to be extensible is never extended.

<comment><USER21> Similarly, when there are no extension points, extension get hacked in (= "if" everywhere !)

Here is my experience with architected extension points:

1\. Generally the first extension point used set the trend, other developers will follow the "pattern" blindly. Hacking to make it fit rather than use another more appropriate extension. That is both bad and common (everyone has had to work with too little time)

2\. There is often a sharp refocus close before or after release 1.0. A lot of the extensions disappear at that stage (demo, experimental feature, cross- platform/framework support, performance targets are set, security infrastructure is decided, server setup, integration test env. available instead of simulated, ...). Structural change (like removing extension point) become very difficult to justify after release 1.0.

3\. Technical debt is very often called "selling feature" at management level.

But yeah, real world code sucks.

</comment></comment></comment><comment><USER22> This is an interesting idea and I think it's interesting to have it somewhere in mind while programming.

A few thought though :

\- If you really push this to the extreme, you'll end up with all the logic hidden in the classes inheritance hierarchy. I'm not sure this is more readable/extensible than if/else statements.

\- Most of the example given by the author to use "language features" are just syntactic sugar. Using collection.select instead of collection.each or || instead of if else is really just a matter of notation. I doesn't reduce the number of test cases required for your code and it might lead to "magical" one-liners that you have to read 20 times to understand.

</comment><comment><USER23> For those who have never used a functional programming language, those often allow you to do "if-less" or at the very least "if-lite" programming via pattern matching.

<comment><USER24> Is pattern matching really that different from switch statements, which are really just fancy if statements?

Trying not to sound sarcastic, but if people are for if-free programming, pattern matching does not seem to be the answer for me. When I add a new type in haskell, I usually find myself having to look through all my pattern matchings.

<comment><USER25> I second the question, pattern matching is cool for destructuring or for completeness checking (not sure those are fundamental properties of pattern matching though), but it does not solve the problem of adding new behaviour without changing existing code any more than an `if` does.

<comment><USER26> This is not a bug - its a feature! Pattern matching/ifs are good for creating new functions, while OO style makes it hard to add new methods.

</comment></comment></comment></comment><comment><USER27> Those who use _if_ are obviously too flimsy to decide what their programs should do. I would not trust such persons to write any code at all.

</comment><comment><USER28> It's not just an OO thing. If you're using conditionals, you might actually want something else - a dispatch table, for example. Thinking about alternatives to conditionals will probably result in better code most of the time, but actually trying to go if-less seems forced.

</comment><comment><USER29> Replacing a switch statement or large if statement with a virtual call (enum -> interface refactoring) can definitely be very beneficial. It can turn [crimes against humanity]([https://github.com/aidanf/Brilltag/blob/master/Tagger_Code/f...](https://github.com/aidanf/Brilltag/blob/master/Tagger_Code/final- state-tagger.c#L145)) into perfectly respectable code.

But, obviously, don't take this too far. If you find yourself not using an if statement (or ternary operator) when writing the absolute value (for non- optimization reasons)... you've gone too far.

        int UnclearAbs(int value) {
            return value * (value >> 31);
        }

<comment><USER16> Abuse of bitwise operators is an abomination, but I'd instinctively write "value.abs" (scala), which is clearer than an if.

Obviously many things are ultimately implemented using if, but it's too low- level a construct to be using for day-to-day work.

</comment></comment><comment><USER30> This is an aside, but don't use the ruby "to_proc" approach that listed in the article. i.e:

      result = collection.select(&:condition?)

The "&:proc" methods are (very, very likely) slower and they also "leak".

When I say "leak", the VM doesn't Garbage Collect the parameters of the proc until it is used again. Most of the time this is fine, but when it's not, you're wasting considerable amounts of memory. This is known and is considered within the spec.

I know they are semantically equivalent, but the MRI is doing something weird internally. (ps. Learnt this the hard way).

</comment><comment><USER31> This is a terrible example of IF-less programming. The conditional is still here, it is just implied.

IF:

            def method (object)
    	  if object.property
    	    param = object.property
    	  else
    	    param = default_param
    	  end
    	end

Claimed to be IF-less:

            def method (object)
    	  param = object.property || default_param
    	end

It may be easier to read, but in the end you are still writing an IF statement.

<comment><USER32> It's not only easier to read, but it clearly shows the intent, that it is only an assignment. It's faster to comprehend too, you don't even have to look at the right hand side if you're not interested. The first example obfuscates the intent a bit. Also, in other languages, you'd have to declare the variable first and that's even more lines of code.

<comment><USER33> It would be just as clear in expressing that the intent is an assignment (and more clear what is being assigned, since it avoids the coalescing-OR) though less concise to leverage the fact that Ruby's "if" is an expression not a statement:

<code> param = if object.property then object.property else default_param end </code>

Though, actually if you want to do what the description says (use the default if the property is unassigned, represented conventionally in Ruby by the accessor returning nil) rather than what either the good or bad code does, you probably want:

<code> param = if not object.property.nil? then object.property else default_param end </code>

(The difference between this and the other versions shows up if the property is assigned, and its value is false.)

<comment><USER31> The code tag does nothing, do this instead:

 _Text after a blank line that is indented by two or more spaces is reproduced verbatim. (This is intended for code.)_

<http://news.ycombinator.com/formatdoc>

</comment></comment></comment></comment><comment><USER34> As an example of taking this to an extreme, I was at a coderetreat where we had to implement Conway's Game of Life without any if statements (or similar, such as switches) -- we had to use polymorphism instead. The result was that my partner and I ended up reimplementing a subset of the natural numbers as distinct classes.

[http://mike.zwobble.org/2012/12/polymorphism-and- reimplement...](http://mike.zwobble.org/2012/12/polymorphism-and- reimplementing-integers/)

I'm definitely not advocating this as good programming practice, but the point is that if you're used to always using if statements, then it's hard to learn alternatives. By forcing yourself to use the unfamiliar, you might find some situations where polymorphism is better suited to the problem, whereas you would have previously defaulted to using ifs.

(barrkel has already left an excellent comment on when the two styles are useful, so I won't repeat it:

<http://news.ycombinator.com/item?id=4977487>)

</comment><comment><USER35> The first example is an actual example of how removing ifs can reduce complexity, but the last few seem misguided. It is no easier to test `collection.each {|item| result << item if item.condition? }` than `collections.select(&:condition)`; they are all but equivalent. The exception handling example doesn't actually show the benefit of not using ifs, it shows the benefits of using exceptions over return values. Setting up default values via || is also a nice trick, but it hardly makes a macro difference.

Also, "# I slept during functional classes"? I don't know ruby, but the `each` method seems to be just a variant of map, which is a pretty fundamental functional construct.

<comment><USER36> each is basically an entirely non-functional variant of map if functional is defined as no side affects.

</comment></comment><comment><USER37> One reason why "ifs are smelly" has become a maxim in some circles is because they represent an under-tested code path. In such areas as safety- critical/life systems, where a different codepath can be taken on the basis of a single var, this can be a very, very dangerous practice. Certainly in safety-critical, a reduction of "if"-based codepaths represents _higher quality software_ in the end.

I have seen cases of radiation-derived bit-rot which don't manifest in any way until a certain "if"-path is evaluated by the computer - this seriously does happen and can still happen in modern computers today.

Having an abundance of such code switch points in a particularly large codebase can be a degree of complexity that nobody really wants to manage - <USER2> in the case of disaster, be responsible for .. so this maxim has been pretty solidly presented in industrial computing for a while. Make the decision- making as minimal as possible to get the job done, and don't over-rely on the ability of the computer to evaluate the expression in order to build robust software.

Now, its sort of amusing that this has propagated into the higher-order realms of general application development by which most Class/Object-oriented developers are employed .. but it is still an equally valid position to take. State changes in an application can be implemented in a number of different ways, "if" being one of the more banal mechanisms - there are of course other mechanisms as well (duffs devices, etc.) which are equally testable, yet more robust - simply because they break sooner, and can thus be tested better.

I take the position, however, that a well-designed class hierarchy won't need much navel-gazing decision-making, which is what the ol' "if (something == SOMETYPE)" statement really is: a kind of internal house-keeping mechanism being done by the computer at runtime, instead of at compile-time.

So there is a balance to this maxim, and the key to it is this: how complex does it need to be, versus how complex can the codebase be before it becomes unmanageable. If you're not doing full code-coverage testing with 100% testing of potential codepaths, then every single if statement represents a potential bug you didn't catch yet.

</comment><comment><USER38> A nice blog series on if-less programming (in Portuguese): <http://alquerubim.blogspot.com/search/label/ifless>

</comment><comment><USER25> Not endorsing, but much more expanded by the Anti-IF campaign <http://www.antiifcampaign.com/> (which focuses on "bad IFs")

</comment><comment><USER39> I'm a little surprised nobody is lamenting the performance hit this kind of technique will incur vs just using an if statement.

(reaching into my way back machine, ifs essentially compile down to a few comparison instructions (which are often just subtractions) and a jmp instruction (depending on the platform), it's literally built into the processor! For a simple if statement we might be talking a handful of cycles to eval the if vs an extended call stack pumping and dumping exercise)

<comment><USER40> For inner loops etc., having less branch prediction misses or none at all can actually outweigh having to do slightly more complex calculations.

<http://stackoverflow.com/a/11227902>

<comment><USER39> I'm actually curious about the internals of how a modern OOP system works internally once it's boiled down to the CPU level. I'd imagine there's still lots of branch prediction issues in complex OOP systems.

<comment><USER40> Well, that you don't use OOP for those inner loops is kinda taken for granted I think. That is, you certainly don't program for code beauty first and foremost -- OOP may not hurt in a particular case, but if it does, code beauty may have to go... example: <http://www.particleincell.com/2012/memory-code- optimization/> (which is not about OOP per se, and not about branching, but illustrating that knowing what the CPU actually does (not just what it did decades ago) is really important when talking about performance)

</comment></comment></comment></comment><comment><USER41> 2001 called, it wants its debate back. For all the new kids on the internet: OO doesn't enable re-use, inheritance generally sucks, and bloating your code with new types just to solve something three lines of if/then/else could solve isn't worth it.

</comment><comment><USER42> If you're doing "ifs" on the same condition sets in various functions then you should consider encapsulating the condition in class hierarchy. If there is just one if for a condition set, introducing a class hierarchy is just bloat.

</comment><comment><USER43> how does "try to use less X because Y" become "don't use X"? and why is this considered good?

to clarify: my question "why is this considered good?" isn't about "if-less programming", but about taking ideas to dumb extremes.

<comment><AUTHOR> You did not read the article, by no means I suggest to get rid of the IFs completely.

</comment></comment><comment><USER44> Replacing static decisions with polymorphism is indeed often a good idea, but there's nothing wrong with using if when it's appropriate.

</comment><comment><USER45> The problem isn't if, it's "else if".

If-then-else ladders tend to evolve to be very difficult to understand, maintain and debug

</comment><comment><USER46> An often better alternative to inheritance for conditionals is configuration with functions as values.

</comment><comment><USER47> Don't. Just don't. Do you think Da Vinci would've painted just with oil because people think real painters work just with that? No he didn't, and so you shouldn't too.

Don't limit yourself just to blindly comply to some silly idea. Use everything you know to get the job done, and once you get it working, make it beautiful.

If statements are an incredible tool. Just ask any Erlanger and they will either tell how much they miss it, or just lie to your face. ;)

<comment><USER4> If statements are rife for abuse and can be an indicator of poorly thought out structure. This article mimics my own experiences, namely that overuse of if statements is a smell and can usually be avoided to the benefit of the code.

I long ago abandoned else clauses. It was a short time thereafter that I realized that if statements themselves weren't all that necessary, most of the time.

<comment><USER48> There is no programming construct that exists that is not rife for abuse.

</comment></comment></comment><comment><USER49> Oh great. What will you people come up with next? Variableless programming?

<comment><USER50> Erlang is mostly IF-less (destructuring pattern matching in function heads) and doesn't have variables.

A = 1,

A = 2, % fatal error because 1 != 2

So, yeah, variabless programming FTW!

<comment><USER33> Erlang has mutable variables (the process dictionary), it just makes you do more work to get at them instead of immutable ones and prevents them from being directly shared and causing synchronization problems.

<comment><USER50> No, the process dictionary is not a mutable variable - there is no natural idiom to use values stored in the process dictionary as variables in code, you have to get them out and put them in via immutable variables.

Any given Erlang process has meta-information about itself, how many reductions it has, how big its heap is, which flags are set. These are the global state of the process.

The process dictionary allows you to store and manipulate your own global state of the process - and the people (hands up, that includes me) get smart and use it as local state of the programme and then get their bum bitten badly and swear never to dance with the dark side again... :(

Not bitter :)</comment></comment></comment></comment>


Xenko 3.0 is now free and open-source - <AUTHOR> https://xenko.com/blog/xenko-opensource-mit/ <comment><USER2> This looks amazing, honestly. I can't believe that such tools are now given away for free and open source. I remember Unity was stuck with a very old version of C# (due to Mono licensing issues), Xenko looks to be C# 7.0 from the ground up, amazing.

</comment><comment><USER3> this looks great. seems like there's many c# scripting game engines but from what i'm reading the entire engine was written in c#?</comment>


Is Cuil Killing Websites? - <AUTHOR> http://www.techcrunch.com/2008/09/01/is-cuil-killing-websites/

<comment><USER2> I want to send TC an anonymous tip saying that the Reddit founders are having kittens fights to motivate employees.

Who needs sources?

Apparently, all those sites owners that got hit by Cuil need to stay anonymous... the Cuil bot might eat their site to get revenge. Or maybe it just makes good press.

<comment><USER3> You think the linked thread is filled with false reports?

Often webmasters prefer not to reveal their exact sites the same places they trade SEO and monetization tips. Some forums even prohibit naming sites in their ground rules.

<comment><USER2> I was just taking a jab at the "anonymous tipster" that TC wrote about on the first line of the post.

If you check the forum thread, of the 4 people who mentioned they had conflict with Cuil, only 1 had actually posted on that forum before... the other 3 were new accounts. I don't see how the forums are "abuzz" with only one thread either...

Further down one member with 3000 posts said, "I get occasional visits from twiceler showing up in my logs but I'm certainly not being pounded."

</comment></comment></comment><comment><USER4> 2 _packets_ per second?

If someone is thinking about traffic on their website in terms of individual TCP/IP packets then either they've got much bigger problems with their bandwidth than mere search engine crawlers, or a non-tech is trying to spread a little bullshit.

</comment><comment> patrickg-zill Not cool (cuil?) .</comment>


A Conversation with John Knoll (1998) - <AUTHOR> http://www.drdobbs.com/a-conversation-with-john-knoll/184410606 <comment><USER2> > As I said, when I was a kid, one of my hobbies was model making. I got to be > fairly good at that and it got me into the industry. But when model making > turned into a profession, it sort of killed it as a hobby. It's not much fun > to build models all day, then go home and build more models.

> Since I was interested in motion control, I got a computer and started > building motion-control systems for it. That became my new hobby. Because I > knew people who were shooting motion-control elements with the models I was > building, I began getting work as a camera assistant on motion-control > stages. Then I got hired as a motion-control camera assistant at Industrial > Light & Magic (ILM). Pretty soon I was doing motion control full time and > its appeal as a hobby was greatly diminished.

> I started at ILM in 1986 and had just gotten a Macintosh, my first > sophisticated computer, and started writing little graphics programs as my > new hobby.

...And created Photoshop. You know I think this guy should definitely be encouraged to change hobbies as often as possible.

<comment><USER3> Rumor has it that he decided to take up writing as a hobby, which resulted in a movie script called "Rogue One."</comment></comment>


Ask HN: Any HN'ers in Tokyo/Yokohama? I'm visiting next week - <AUTHOR>

Hi There!
I'm visiting Tokyo/Yokohama next week. Wondering if there are any HN type meet ups or coders that would have a drink with me after work. <comment><USER2> Perfect opportunity to take up patio11 on his "standing invitation"

 _I like meeting people in Tokyo. As of August 1st 2014, I live close to Nakameguro Station in central Tokyo. We'll have to see if this is sustainable, given that I expect the number of people passing through Tokyo is rather larger than that passing through Ogaki, but for the time being my usual offer applies: if you are in Tokyo and want to talk software, I'll buy you coffee, no questions asked._

[http://www.kalzumeus.com/standing- invitation/](http://www.kalzumeus.com/standing-invitation/)

<comment><AUTHOR> sending email now to patio11 thanks for forwarding this.

</comment></comment><comment><USER3> I spent October and November in Yokohama and Tokyo. I tried out a few coworking spaces in both places. You will find quite a few events/meetups through such places.

Co-Edo Kayabacho Tokyo [https://www.facebook.com/CoWorkingSpaceKayabacho](https://www.facebook.com/CoWorkingSpaceKayabacho) Mass Mass Kannai [https://www.facebook.com/massmasskannai](https://www.facebook.com/massmasskannai) Sakuraworks [https://www.facebook.com/yokohamalab](https://www.facebook.com/yokohamalab)

Co-Edo has investor pitch event every Monday morning, also Ruby and Wordpress UG meetings. Also check out meetup.com.

</comment><comment><USER4> There's a semi-regular HN meetup in Tokyo, but there's nothing scheduled for this week. You can take a look at the upcoming meetups, though unsurprisingly the majority are Japanese-language events.

[http://hntokyo.doorkeeper.jp/](http://hntokyo.doorkeeper.jp/) [http://www.doorkeeperhq.com/events](http://www.doorkeeperhq.com/events)

You could also look up Meetup.com.

And feel free to contact me if you just want to go for a drink in the Shibuya area (email address is in my profile).

<comment><AUTHOR> Thank you, Had checked doorkeeper, didn't know how up to date it was since the holidays.

</comment></comment><comment><USER5> I'm visiting Japan as well currently - for the whole month in January. I am in Tokyo right now, you can contact me for a drink somewhere...</comment>