Seemingly impossible functional programs (2007) - <AUTHOR> http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/ <comment><USER2> This code combines several tricks having to do with lazy evaluation. We can define a type that requires a lazy function to ask for each bit of its input argument one at a time, in whatever order decided by the function's implementation. Furthermore, we can partially evaluate any number of lazy function invocations in parallel without finishing any of them that we don't need.

As a result, laziness reveals information about a function's implementation in a way that strict evaluation does not. It matters which parts of the input a function actually reads.

Similarly, in non-lazy languages, functions that take callbacks reveal information about themselves by calling the callback (or not). We can write tests demonstrating the order in which a function calls its callback.

<comment><USER3> This is exactly right. The lazy version seems like magic, but it's really just exploiting the fact that if computing p(a) never evaluates a(n) for n >= m, then p(b) = p(a) whenever the first m elements of a and b agree, so you can cut off an infinite portion of the search space without checking them all.

I wrote up a Python gist ([https://gist.github.com/evanpw/d69f1ccb5edd0b672e9e](https://gist.github.com/evanpw/d69f1ccb5edd0b672e9e)) which performs this same trick by explicitly snooping on the callbacks. It seems a lot less magical than the Haskell version.

EDIT: The main "cheat" seems to be the ability to identify the predicate which returns false on every input (e.g., by seeing if returns false without evaluating its argument). The continuity argument described in the article basically says that if p is not always false, then there's some input a with a(n) = 0 for all sufficiently large n that causes p to return true, so you could just enumerate all such inputs until one returns true.

</comment></comment><comment><USER4> I don't understand how this program can ever terminate, since there is no base case. Every invocation of find_i starts by calling forsome, and every invocation of forsome calls find_i. How can it possibly end?

Perhaps this relies subtly on Haskell's laziness? If so, I don't think there is a "quick translation" to ML or OCaml.

<comment><USER5> Not every invocation of forsome calls find_i. It calls p(find_i(...)), but p can return a value without actually evaluating the inner find_i. So yeah, it relies on laziness, though you can translate it into a strict language by inserting lambdas in a bunch of places.

<comment><USER4> Thank you. How does Haskell manage to avoid evaluating find_i(...) before invoking p? Since the inner value is the argument to p, it's hard to imagine how p can do anything until it has that value.

EDIT: I think I see the light. The result of find_i(...) is not what's sent to p. Instead, Haskell passes a thunk that might never need to be evaluated.

<comment><USER6> Exactly. If I write

        let f x = 1

        print (f (g somethingelse))

then the call to g is never evaluated. f returns 1 immediately.

</comment></comment></comment></comment><comment><USER7> I have read this some years ago. I really enjoyed diving into this subject. My favourite part is:

> Common wisdom tells us that function types don't have decidable equality. In > fact, e.g. the function type Integer -> Integer doesn't have decidable > equality because of the Halting Problem, as is well known. However, common > wisdom is not always correct, and, in fact, some other function types do > have decidable equality, for example the type Cantor -> y for any type y > with decidable equality, without contradicting Turing [...] This seems > strange, even fishy, because the Cantor space is in some sense bigger than > the integers. In a follow-up post, I'll explain that this has to do with the > fact that the Cantor space is topologically compact, but the integers are > not.

</comment><comment><USER8> > It is natural to ask whether there are applications to program verification. > I don't know, but Dan Ghica and I speculate that there are, and we are > planning to investigate this.

I wonder if they got any interesting results from this investigation. There are some practical applications which works on infinite data (such as streams), but I don't see immediately how this applies there.

</comment><comment><USER9> > The next version of the definition of Haskell will have a built-in type of > natural numbers.

Did this ever happen? I haven't seen it.

<comment><USER10> It's been there for a while, although not intensely advertised: [https://hackage.haskell.org/package/base-184.108.40.206/docs/Numeri...](https://hackage.haskell.org/package/base-220.127.116.11/docs/Numeric- Natural.html)

</comment></comment><comment><USER11> >I will use the language Haskell, but it is possible to quickly translate the programs to e.g. ML or OCaml.

The article predates C++11 by many years, and with functions-as-values and lambdas now in the language, would be interesting to see if it could also be translated to C++.

<comment><USER12> C++ still doesn't have (tagged) union types so you'd have to implement Maybe by hand, which is a little tedious. But I don't see anything in this code that requires laziness or the Haskell type system, so you can translate it pretty directly into pretty much any language (though as sibling mentions, in a language without TCO you might have to manually trampoline it - again tedious, and unperformant).

<comment><USER11> Tagged unions are a pretty common exercise in C++, they don't require much code to implement.

As for Maybe, if it is basically an "optional" as in other languages, then the newer c++17 has <optional>, if I'm not mistaken.</comment></comment></comment>


Why aren't developers interested in Ada? - <AUTHOR> http://www.embedded.com/columns/breakpoint/212902632

<comment><USER2> OK, so I read this article and I want to give this Gnat thing a try. I go to this AdaCore company's homepage and I'm looking for a place to download a batteries-included Ada distribution. Where? Where?

Finally I click "pricing" and I find a ridiculously long survey form of some kind I'm supposed to fill out. At that point, I'm gone and I'm never coming back.

That is why developers are not interested in Ada.

Compare the experience to getting Python: go to Python.org, click "download" on the left-hand menu, click an appropriate installer. Or if you're in Linux, fire up a package manager, type "python", see it's probably already installed, open up a terminal, type "python", type "2+2" at the REPL and see that you get "4" back, and go from there.

<comment><USER3> In all fairness, you can do apt-get install gnat, too.

<comment><USER4> Yep, yast and yum will do it too.

There is also the Hibachi plugin for Eclipse.

</comment></comment></comment><comment><USER5> i've written lots of code in ada (dod related airplane systems). at the time, i was a student, and pretty sure i was programming myself in to a dead end skill.

ada, for me, was like a teacher who taught the entire class at the speed of the slowest student. it tries to prevent you from doing anything marginally likely to cause a bug, at the expense of speed or creativity. it assumes the worst in a programmer. good programmers are forced to program simply so that future generations of bad programmers can read their code.

(i'm very glad to never touch it again)

<comment><USER6> _good programmers are forced to program simply so that future generations of bad programmers can read their code._

Is this necessarily a bad thing? I generally try follow the "code such that nearly anyone can understand" mantra. Helps keep things simple and concise.

<comment><USER7> I actually don't like forced readability like the python whitespace as I think it stifles creativity, and the only way it makes code better to read is by forced formatting (the forced white space) while your code can still have hard to read logical loops, blocks, variables.

In a way, it stiffles creativity just for a small gain of formating/readibility.

Plus, with modern IDEs it is very simple to format the code the way you want. In eclipse you have RightClick -> Source -> Format then viola, your code looks the way you want.

Having worked with both python and java, I have enountered more hard to read code in python than in java, (maybe this is due to the superior tools/IDEs in java).

As for ada, i thought it was a great language to start learning programming. Exceptions are verbose, and it is an easy language to pick up, as it looks a lot like Pascal. I learned it my freshman year, but I never used it in a production capacity and I wouldn't consider doing anything serious with it right now.

<comment><USER8> 'and the only way it makes code better to read is by forced formatting (the forced white space)'

Indentation is required when writing in any language as a matter of courtesy. Python just doesn't ask you to delimit your blocks of code a second time by unnecessarily requiring brackets.

<comment><USER9> at the high cost of crippled one line lambdas, no thanks

<comment><USER10> I'd argue that there is nothing crippling about it. You can define functions anywhere, if you need a multi-line lambda just define a function and be done with it. Multi-line lambdas are messy... this constraint keeps your code sane.

You can nitpick all you want, but the fact is I can start reading just about anyone's python code and feel like it's my own because styles are consistent across the board. A lot of this has to do with the tight community, but the fact that it's all reinforced through syntax constraints is a huge plus.

</comment></comment></comment></comment></comment></comment><comment><USER11> * Because there's a ton of C/C++ code out there. As such, there are lots of jobs asking for C skills. As such, lots of people learn C. As such, lots of schools teach C. Ada never hit that critical mass (as Java and C/C++ did) where people learned it because so many other people knew it rather than because it was cool. Why does everyone in the world learn English? Because more of the world's money speaks English than any other language. So, if you want one of those C++ jobs, you'd better know C++ - not because it's good, but because so many other important things use it.

* Because Ada isn't that fast. It's significantly slower than C according to the language shootout (<http://shootout.alioth.debian.org/>). It's one saving grace is that it's decently efficient on memory - not as efficient as C, but efficient enough that it can be used for things you wouldn't want to use Java or Lisp for.

To an extent, it was too little too late. C was introduced in 1972 and quickly gained fame. Ada, a decade later in 1983, does have dome value, but it also has things many programmers would find annoying (like a syntax that requires more typing). Sometimes, you need to provide enough reason for people to switch. A tiny enhancement isn't always enough. Plus, companies like C because it's everywhere and easy to find programmers (whether that argument holds true or not is debatable, but companies still base their decisions off it).

There might not be anything particularly wrong with Ada, but that can still leave no catalyst that is getting programmers to learn it. There aren't a lot of things written in Ada (compared to C/C++/Java) and so it isn't the "I'll get a job with it" excuse. It isn't cool like Python/Ruby/etc. It isn't widely used in academics like Lisp and Scheme. Ada became widely used in defense and aerospace, but it hasn't created enough of a catalyst.

<comment><USER4> Ada is a fine language. For those of us that did the Turbo Pascal thing and enjoyed that Ada isn't that far off. There was this odd sort of period in my life, I learned Pascal and took classes that used it and wrote fairly complicated programs that by in large worked. Most of the debugging I did was really logic debugging. Then I switched to C and between the esoterics of doing C on a DOS x86 machine (anyone remember the difference between ASCII files and binary files?) and the language itself I started spending a lot more time debugging C and I put a lot more effort in to making programs radically more simple just to avoid complex debugging. At times I kind of pine for those old Pascal days... Had I not experienced that era, I might have gone in a different direction entirely.

Through out the 90's I tought C++ to undergrads for a couple years and there was this disease of sorts, some went though so much pain trying to make C++ do simple things (and they had no understanding of what the machine was really doing, they were trying to just learn a language) that they either a) would drop out of computer science all together or b) they'd have such a better taste in their mouth that they'd never fully learn Lisp or ML or really anything else and always revert back to C++. Ada is quite similar to Pascal in syntax and sort of behaves the same way. FWIW, Ada is kind of interesting, if you've ever wasted a lot of time tracking down where you C program bumped the stack or leaked memory or something then the things Ada requires of you are kind of nice in a way.

Seems Ada missed the timing on a number of issues. First Ada compilers were built to be sold to the feds, they essentially designed the language and they mandated its use and so compiler writers assumed that they could charge $20,000 a seat type prices. Completely missed the market, largely due to costs. This put a very serious damper on things.

The other thing that they missed on was tooling. When Java first came on to the scene there was a vocal group of folks that were used to teletypes and modems and such and the difference between "{" and "}" and "BEGIN" and "END" was substantial to them. If they have a Visual Studio or Eclipse like programming environment, those differences kind of vanish but that argument took place in the early and mid 1990s, there are still people that feel that their coding ability is strongly related to their typing ability.

By the time tooling caught up and the GNAT compiler was around Ada had accumulated a huge perception deficit. Also the world has moved on and a lot of developers want protected runtimes, like a JVM or CLR or the interpreter of Ruby, Perl and Python. There are still efforts to create higher level C competitors, the D programming language, the Eiffel programming language, Modula-3 as one, it just seems that not that many people are interested.

I like to look at Rails and I think a big part of its success has nothing to do with any technology so much as the effort they put in to teaching their users a good and working structure to build web apps, they will automatically generate the skeleton and you fill it in; by the time you've done a real world production Rails app, you've done everything yourself and don't even realize it because they got you started. Ada and Pascal sort of provided that structure to building machine code applications, people really rebel against that structure unless you sort of trick them into it like Rails does.

<comment><USER12> One thing I would add to that is that Ada at that time (Ada83, that is; Ada95 fixes this) lacked function pointers. There was no mechanism in the language to support the runtime selection of behavior that function pointers allow. Such a feature was intentionally left out of the language in order to facilitate static analysis.

For the class of problems where you are willing to accept decreased expressiveness in order to get increased reliability (e.g. missile guidance software), Ada is great. But in a lot of application development scenarios, expressiveness is important.

As I said above, Ada95 fixed this, but it is still a bit cumbersome and before one could reliably use Ada95, it was necessary to indirect through C to do things dynamically.

</comment></comment></comment><comment><USER13> Somebody wrote this comment on the original page

"Ada enforces the engineering principles that we should be following but the hacker mentality the dominates this field pushes back against that since they have a cheap & "easy" language like C to use instead."

What do think about this "engineers versus hackers" debate?

<comment><USER14> I think the target environment makes a big difference. Quick iterations, hacks and experiments are nice when creating a web app or an application prototype which can be refined iteratively. However, if you program a spaceship or nuclear missile, you have to get it correct the first time, and the program have to work correctly under any concievable input. I think this calls for different approaches and different languages.

<comment><USER15> I actually think the bounds checking etc of Ada is good. If you put that in a very C like language it would have been better accepted. Instead it had a bunch of readability 'improvements' that turned programmers off.

</comment></comment></comment><comment><USER16> For me, personally:

        No guaranteed memory safety.
        No discriminated unions.
        Verbose syntax
        No metaprogramming/macros.
        Costly polymorphism (compared to templates, but not as bad as Java)
        Few employment opportunities compared to the mainstream.

</comment><comment><USER17> One reason Ada is not used instead of C on embedded platforms is it's RAM requirements. Many embedded platforms have 3000 - 8000k of RAM. Ada's runtime uses something in the range of 100k.

</comment><comment><USER18> ADA advocates always talk about these safe guards but if its so easy to see how much better and safer it is show us some code. It is telling that the only snippet we see is from c.

<comment><USER19> The impression I get is that Ada's benefits are most apparent when implementing safety-critical _systems_ , so it's hard to find individual snippets that show it off. Here is an open source project that supposedly demonstrates good Ada development practices:

<http://www.net-security.org/secworld.php?id=6619>

(The cynic in me wants to point out that the only snippet we see in the article is _buggy_ C.)

</comment></comment><comment><USER20> The last time I looked, there were no advanced tutorials on the net (this chimes in with the "don't only talk, show us the code demonstating the benefits" and the cheapest book on the market was $130. That was when I gave up, even though I suspect that it is an interesting language with things like calculating with dimensional quantities (you will notice that half of your team uses imerial units when you compile the code, not when your probe crashes into another planet).

Maybe I wouldn't like the style of the language or maybe I would, but my limit for books about languages I am not sure I even want to know is well under EUR 100.

<comment><USER21> There is the Wikibook on Ada programming:

<http://en.wikibooks.org/wiki/Ada_Programming>

That's about as free as it gets. I have the "Programming in Ada 2005" book by John Barnes. I use both it and the Wikibook.

</comment></comment><comment><USER21> Ada has had a high level interface for multi-tasking for a long time. I'm surprised that doesn't get mentioned more often.

</comment><comment><USER22> Dijkstra talks about it: [http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EW...](http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD898.html) . It seems that without DARPA, Ada would have faded away. Perhaps things have changed from his time, but the problem still remains: Ada appears to have something of a bad name.

</comment><comment><USER23> Ada was the first language I learned in college. Our CS professor at junior college was a DOD programmer by day (most of our CS courses at the JC were at night).

Looking back, I think it was a good language to start with at the time (this was '94). Plus, it was nice having a professor who actually had current, real- world experience as a software engineer.

</comment><comment><USER24> I had the unfortunate experience of being forced to use Ada as my primary programming language for three years during college. I hated it with a passion, though I can't tell you exactly why at this point.

Ada took all the fun out of programming. I think the major problem was that there weren't any good GUIs that supported it. The one we used was ugly and counterintuitive. Additionally, the compiler was very strict and the error messages it spit out were cryptic. We spent so much time just trying to get the syntax right that it discouraged us from exploring and trying new things, the exact opposite of what a good programming language should do.

Not only that, but only a few few organizations actually use Ada. We graduated with an expertise in a programming language no one used. A year later someone made the decision to stop using it and to switch to Java. I think that person deserves a medal of some kind :)

<comment><USER25> I worked at a company where we very seriously talked about adopting Ada. Let me tell you what else takes the fun out of programming besides an overly strict language: knowing that if the customer encounters a bug, he will send you an email, stop using your software, and use a competing solution until you ship him a new release.

At that job I shipped the least-buggy, most-correct code I have ever shipped in my life, yet I also had the highest sense of incompetence and failure I've ever had. The stress level when making code changes was incredibly high, especially since the code was mostly legacy (i.e., lacking documentation and tests) and introducing even rudimentary testing required rewriting large parts of the system -- which of course created bugs and made regression tests rather less useful than they should have been.

I even had a dream once about reading the gcc manual and finding a new warning flag, -Wsomethingorother. I was really excited. Then I was really disappointed when I woke up.

I REALLY wish that codebase had been writting in Ada. The code was mostly correct (though hideously designed) when I inherited it; if it was written in Ada, the runtime checks would have caught a lot of cases when an innocuous- looking bugfix in one part of the code caused another part of the code to start dereferencing stale data and mixing a subtle spurious signal into the customer's results. In the worst case, we would have had an immediate failure with a good head-start on debugging. Ada might have actually preserved some of the fun of programming for me.

Nothing else I've worked on has called for Ada, though. It's a niche language and should definitely be considered whenever writing a mostly-static system where you're willing to invest a lot of time per loc to avoid bugs.

<comment><USER26> _...if the customer encounters a bug, he will send you an email, stop using your software, and use a competing solution until you ship him a new release._

What kind of software was it?

<comment><USER25> The software was part of a scientific computing system. We were an upstart product competing against a decrepit seventies-era product with an eighties- era interface. The competition was markedly inferior in performance and usability, but it was a known quantity and thoroughly integrated into the customer's workflow. By comparison our product was faster and usually more accurate, but less predictable. Our new bugs were much more disruptive to workflow than the existing product's old, well-understood bugs.

</comment></comment></comment></comment><comment><USER27> "It makes one work very hard to get a compileable source file."

That seems to be a sufficient explanation to me... (Haven't tried it myself).

</comment><comment><USER28> my list of least favorite languages:

Pascal, Ada, Mumps in that order, but mumps has a few saving graces, it's quirky enough that you get some insights that you would otherwise never have.

To me ada is like esperanto, it's designed to be universal but in the end that means it fits nowhere really well and it doesn't feel natural to anybody.

</comment><comment><USER29> Because it writes like BASIC and C had an unholy love child--vaguely C-ish in style, but it lacks case-sensitivity and uses stupid stuff like BEGIN and END.

Note that I've never done straight-up Ada, just the derivative VHDL.

<comment><USER19> In other words: "I don't like the syntax."

I'm always skeptical of this argument; every programmer has a favorite syntax -- some prefer C-like, some prefer Pythonic, some prefer Lispish, etc. In most cases, it's not the syntax they first learned, but it's the syntax in which they do the majority of their work. This suggests that familiarity is the basis of syntax preferences, which supports the "you'd like it if you gave it a chance" school of thought.

<comment><USER30> I assume you mean that syntax is less important than other language features, and I mostly agree. However, while there are of course many variations of syntax on the same basic set of features, some variations are better than others. It may be difficult to say whether Python, Ruby, or C syntax is best, but that doesn't mean that some aren't better than others.

For instance, terse languages, as long as they remain understandable, generally seem better. Whether to use braces or indentation may be a matter of preference, but few would argue that a COBOL-like syntax is preferable.

</comment></comment></comment><comment><USER31> Ada _does_ have a huge following... In its incarnation as Oracle PL/SQL.

<comment><USER32> Albeit PL/SQL is a subset that gives you only a flavor of Ada.

I think Ada just plain did not gain momentum at a time when developers looked for a new paradigm to aid in building larger, more complex systems. The nod went to OO and C++ was the lucky recipient of attention because of its relationship with C.

Now that OO, as implemented by C++ and Java, have not proven to be the Holy Grail, developers are looking for another paradigm. It appears to be a dog fight now between dynamic and functional languages for the nod.

Not to stray too far off topic, but Lisp seems to have not gained momentum for almost the polar opposite reason as Ada. Ada's OO stuff was a little late to the table when OO got the nod; Lisp was too far ahead of everything - programmers were too used to the machine level interaction and were not ready for high level abstractions. (Mind you I am coming at Lisp as a newbie who looks at what it offered for decades and shake my head that we passed it up.)

Languages often do not get a second chance but Haskell and Lisp, as implemented by Clojure (or Arc), may actually become mainstream.

Ada falls into the same category, for me, as Eiffel. I know intuitively that they could reduce some common errors but they're just not interesting.

</comment></comment><comment><USER33> Ada was adopted by the D.O.D because it fit their needs.

I heard once that Ada experience + US DOD Secret or higher security clearance was life-long job security.

<comment><USER34> "Ada was created for the D.O.D according to their needs."

Fixed that for you.

<comment><USER35> The fix is correct. I was there at the time, but not directly involved. There was a competition to design a language to replace the large number of languages and variants used by the military. Pascal was in vogue at the time and 3 of the 4 proposals were Pascal derivatives. OO pretty much didn't exist. Simula and Smalltalk were there but nobody in the competition was paying any attention. The requirements documents were a laundry list of things from every language but Cobol, including a number of ideas that had never been implemented in a production language. Rendezvous comes to mind. The compiler for language turned out to be extremely difficult to implement and it took much longer than expected, not a first for the military. The colonel in charge was insistent that there be no subsets. When it finally arrived, the world had passed it by.

</comment></comment></comment><comment><USER21> Perhaps ADA could be thought of in terms of Battlestar Galactica. ADA would be like a Centurian, clunky and mechanical. Lisp would be more like a "Six", organic and capable of independent though. :)

</comment><comment><USER36> Because it's far away, oh, what?</comment>


The Wisdom Race Is Heating Up - <AUTHOR> http://edge.org/response-detail/26687 <comment><USER2> Hey look Ma! A physicist who also happens to be a social sciences expert! /s

Ultracrepidarianism: When a source is quoted outside their expertise, as if expertise in one field extended to another.

I'm no _expert_ on logical fallacies but Edge.org smells like it's chock full of bullshit artists.

See Also:

\- a zoologist who is also an expert on religion

\- an astrophysicist who is also an expert on evolution

\- a linguist who is also an expert on capitalism</comment>


Ask HN: How do you make a profitable business out of an open-source project? - <AUTHOR> I've recently published a note-taking app [1], which I open-sourced right way, and it amazingly got a lot of interest from the community.
I'd like to make the best possible note-taking experience out of it, that implies developing a web-app, mobile-apps and generally putting considerable resources into the project.
I think the best way to ensure all this will come to fruition is if the app/service itself was profitable, ideally I would like for it to pay for itself and also provide enough funding for future projects of mine.
I'd like the business to be defensible, but also avoid making the app closed-source. I'm not sure how I could avoid having the (probably simple) server reverse-engineered at some point in the future in order to avoid paying for an eventual subscription fee though.
What do you think is the best way to achieve profitability?
[1] https://github.com/fabiospampinato/notable <comment><USER2> Don't worry about making the business "defensible". Worry about making the business work in the first place.

If a competitor comes in and takes 50% of the market, that might be frustrating, but it also means there's a market to fight over.

Look at wordpress -- they probably make a lot of money with wordpress.com. But there are also 1000s of other wordpress hosters out there. That doesn't harm Automattic -- on the contrary, without the huge ecosystem around Wordpress, nobody would know that it existed in the first place.

</comment><comment><USER3> I wouldn't know how to find it, but one of the better ideas I've seen suggested is from patio11. He suggested you make it easy for businesses that use your product to get an invoice for monies given to you. He won't "donate" money to open source because he needs to justify his business expenses, including on his taxes, which means explaining it the government. But if he uses the service for his business and can get an invoice, he's happy to pay you money in exchange for a document that he can put on file showing it's a legitimate business expense.

<comment><USER4> This is along the same lines, I think:

[https://twitter.com/patio11/status/1067695403255029761](https://twitter.com/patio11/status/1067695403255029761)

Which is quote-expanding Swift On Security:

[https://twitter.com/SwiftOnSecurity/status/10676827595928698...](https://twitter.com/SwiftOnSecurity/status/1067682759592869889)

<comment><USER3> Thanks.

I'm pretty sure I originally saw it as a comment on HN in which he talked about giving a project apparently a somewhat sizable amount of money in exchange for an invoice. I have no idea how to find that. But his tweets on the topic are what other people typically supply when I mention this detail.

</comment></comment></comment><comment><USER5> I am not sure making an open source product defensible is the right idea. I'd monetize in one or more of the following ways:

1\. Extend the open source product in ways which makes it more valuable for specific groups of people, sell licenses to those people. As the product matures and you add more new features, maybe some of the early extended features get pushed into the open source product.

2\. Offer monthly/annual support agreements to people who sign up for a licensed version.

3\. Offer to make custom modifications for a fee for specific clients (this might be a way to help start doing #1 too).

A lot of this will boil down to marketing the benefits to the right groups of people and finding features which are valuable to businesses over the open source edition -- this is true for open source just as it is to proprietary products. I don't see how (not to say it is impossible) Patreon or similar platforms will lead to enough income to make this a profitable project, although they may help validate people are willing to pay something for the product.

</comment><comment> open-source-ux It is very difficult for a solo developer to make a full-time living from their own open source product.

These are some possible options:

\- Open-core (e.g. Gitlab): Some code is closed source but adds extra features not available in the open source core.

\- Support/consultancy

\- Sponsorship or Patreon (not realistic or sustainable as a long-term solution for the industry as a whole)

\- hosting and online accounts for software that runs in the cloud

The problem is: what if you don't want to do any of the above? I bet there are many developers who are put off by all the above.

What if all you want to do is just sell your product for a fee to users, but with the source available? Impossible with open source. (Doing that is a "source available" option but it's no longer an open source solution.)

The uncomfortable truth is that, despite decades of open source software, no- one has figured out how to make money from an open source product if all you simply want to do is just sell your open source app.

If you find a suitable option for your app please let us know and I wish you lots of success :-)

<comment><AUTHOR> Somebody suggested to take a look at bitwarden's business model, it sounds like something I could transition too and it seems it's working for them.

Fortunately the extra work of building an hosted solution or some business- oriented features doesn't put me off.

</comment></comment><comment><USER6> Patreon ([https://www.patreon.com/](https://www.patreon.com/)) may also be an option for this. I'm currently using Joplin ([https://joplin.cozic.net/](https://joplin.cozic.net/)) for note-taking. It has similar popularity on Github as Notable, and developer has a patreon account for ~$130/month.

While that's not full-time, it's a start of a paying community, which is very valuable in itself.

Once a community like that is established, you can implement other suggestions like selling packages, hosted versions etc. with discounts for your patrons etc. Many ways to go about adding value (and getting paid for it), once people trust you with their money.

<comment><AUTHOR> IMHO it's next to impossible to completely fund the project via Patreon or similar, if Joplin's developer after all this time is only receiving ~$130/month I think it would make more sense to me to self-fund it until it's profitable.

<comment><USER6> Exactly. Patreon may not be a full time income, but it's starts your paying community, which is a valuable step in the right direction.

</comment></comment></comment><comment><USER7> Wow you got more than 4k stars in 11 days ? Is this a record on github or more common than I think ? Congratulations on that. In terms of monitizing, a lot of folks talk about sidekiq (a ruby project) that makes good money while being open source.

<comment><AUTHOR> I'm just as surprised as you honestly :) Thanks for your message, I'll definitely check out sidekiq, any successful open-source business I can find is of big help.

</comment></comment><comment><USER8> One other resource that a lot of people miss but is quite profitable is selling packages relating to your niche.

I haven't tried your app but let's say your app helps people better manage time, then you have a perfect audiende that may be interested in buying a small ebook about productivity and how your app can be used to double it. You already have a list of prospects who trust you and use your product. Upselling them is easy if you can create a great resource that will help them get the most out of your app and achieve the goal (for which they're using your app) more quickly or lazily

<comment><AUTHOR> I don't know I think there's so much to do in the note-taking arena alone that selling a book about productivity or something along that line instead may be a bit too unrelated.

<comment><USER8> Not sure who the target market is but IF your audience is developers then you can definitely sell something on the lines of training to create your own popular app and you can obviously use your app as an example and qualification.

</comment></comment></comment><comment><USER9> For enterprise (or even SMBs) open source builds trust but having a paid service is convenience. I say just offer a ready to go, out of the box service for the open source code. Most companies won't bother hosting themselves but they will like that it's open source "because they could host it if they need it".

I don't think this forums audience is indicative of your actual market. I think your actual market is not tech savvy. They want to use notes across multiple devices and teams without thinking about it. Offer them that convenience. They will pay for it.

<comment><AUTHOR> Thank you for your comment, I think you're right about convenience.

</comment></comment><comment><USER10> Offer a pro/paid account.

Mention your story, perhaps offer a few extra features if you'd like, and as other said you may want to offer hosting too (but that's extra work/cost for you). My recommendation would be to just have one simple monthly price = easy y/n decision.

Some people will start paying, and talking to these you'll figure out why, and how to convert more.

Check out how others are doing, on top of my head I can think of bitwarden (not affiliated).

<comment><AUTHOR> bitwarden is a very interesting example, thank you so much!

</comment></comment><comment><USER11> Wow that is amazing that your project got 4k stars on Github!

If I were you, I would be looking at WordPress for inspiration. They have many sources of revenue:

\- Hosted version (monthly fee)

\- Marketplace for add-ons

\- Support

It seems like you have created a community, so to create some kind of extension system would be a way of generating revenue and encouraging people to develop on your platform.

</comment><comment><USER12> My Sidekiq project makes over $100,000 per month. I'm happy to video chat with anyone weekly at my Happy Hour if you want to discuss business and sustainable OSS.

[https://sidekiq.org/support.html](https://sidekiq.org/support.html)

</comment><comment><USER13> Perhaps offer cloud based backups/syncing of notes across devices. You could use git to track history of changes over time on the server. Charge a monthly fee for this feature to cover hosting + profit.

</comment><comment><USER14> This excellent article reviews the 5 types of open source business models. Maybe it can help you choose.

[https://sfosc.org/business-models/](https://sfosc.org/business-models/)

<comment><AUTHOR> Very helpful, thank you!

</comment></comment><comment><USER15> Off the top of my head:

\- Paid support from the official development team.

\- Paid features, plugins, or addons that primarily serve enterprise users.

\- Paid hosting

\- In-app advertising

<comment><AUTHOR> Thanks for the suggestions. I'd rather not deal with advertising if at all possible, but the other suggestions sound interesting to me.

</comment></comment><comment><USER16> Offer a hosted version.

<comment><AUTHOR> Thanks for the suggestion, that's definitely something I'd be interested in implementing.

</comment></comment><comment><USER17> support, support, support...

<comment><AUTHOR> Selling support is a bit alien to me, do most companies buy support just to have someone to call in case anything breaks? Do they want their features requests or issues reports to be prioritized?

If you could share your experience about this it would be very helpful, thank you!

<comment><USER2> If your app doesn't actually need support, companies won't buy support. Nobody has ever asked for a support contract for any of my desktop apps.

It's also hard to sell extensions... I've had a couple of people email me with suggestions for paid feature requests, but nobody ever followed up when I made an offer and quoted the actual cost. Maybe I'm just not good at selling, though.

(People do offer to buy group licenses if you add a feature, but that only works for minor features you wanted to add anyway, and doesn't work if your product is free anyway...)</comment></comment></comment>


Ask HN: Making an information site for Computer Engineers? - <AUTHOR>

I'm a computer engineering student, in my 4th year. While doing some lab work the other day, my friends and I were struck yet again by how little useful information is available to CE students online. We needed schematics for a Brent-Kung adder, but we couldn't find anything. The same thing happens when you search for info on, say, VHDL.
This gave me an idea. "I've got four years worth of notes and knowledge, as do my friends in the program. Why not put them online, aimed at CE students?" All the info would be checked and approved before going online.
My question is, how should I structure things? I like simplicity--I write C, I use Plan 9, I write my papers in troff. That makes me want to write an HTML site, static, with subsections put together by myself or other approved creators. Since my intention is to provide the notes and useful information from myself and a few friends, this does not seem unreasonable.
I know what you're all thinking right now--"just make a wiki". Well, I've also considered doing that, but it just doesn't seem like the right fit, for reasons I can't quite explain.
As someone who typically doesn't worry about the web, I'd appreciate any suggestions on how to do this, what sort of technology to use, etc. <comment><USER2> What about six months down the road when you want to add a new section to the bottom of every single page, or when next year rolls around and you want to change the 'copyright 2009' to 'copyright 2010'?

Realistically, you're going to need some kind of basic dynamic capability, and once your site grows beyond 20+ pages you'll save more time than the time it takes to learn it.

Sounds like you don't need much, and PHP (or really any dynamic language I've seen) has an 'include' directive for adding headers and footers and would take you all of two seconds to learn (beware, there's a ton of bad code out there. The good resources have been discussed in many other HN posts.)

For the super-basic stuff any dynamic language will do fine, so just mark it up in whatever stack you're comfortable with the tools for (I'd recommend PHP, Python, or Ruby in increasing orders of complexity for a basic site.)

You might also consider a real CMS in case you want to bring more non- technical people on, or add authentication later. Wordpress is fairly full featured on the editor, has user privileges, and I believe it has plugins to support LaTeX and other Math markup easily. Again, any leaders in the space should be fine for what you want to do.

On the actual code side, mark it up in strict html or xhtml, test it in at least FF/IE6/IE7/Safari, and try to seperate your CSS into classes in external file(s) as much as possible so you can change your design later with less headaches. If things are set up right, adding a css stylsheet for mobile would be trivial, which might be nice for times when you need a formula at the library.

I hear good things about the book 'Head First HTML' from beginners, and if you're at any high level with computing you should breeze through it. Alternately, just get a CMS and file a style you like and be done with it.

In your case, I'd argue that there's an explicit tradeoff between simplicity of the code and simplicity of the final implementation. If you want a basic site with slim, clean code, you're going to have to do some learning. If you want a quick deployment that 'just works', you could do it in a few hours, but have less control over the elegance of the solution.

P.S.: Cool idea. I'd bet you could even charge for some of it, if you were so inclined.

<comment><USER3> _I hear good things about the book 'Head First HTML' from beginners, and if you're at any high level with computing you should breeze through it._

I whole-heartedly recommend this book as an introduction to HTML. It covers HTML, XHTML, and CSS in enough breadth and depth to get you started for most applications.

Of course, it won't make you into the best web designer out there, but it's a wonderful resource for edification purposes.

</comment></comment><comment><USER3> When you say "approved before going online" do you mean you will get permission from the professors? I believe some legal issues may arise when you publish the notes from a college class you paid for.

Though most, if not all, of my professors don't mind if we put our notes out there, there may be eventualities you'll want to consider before doing this ostentatiously good deed.

 _Edit: I was referring to this:<http://blog.wired.com/27bstroke6/2008/04/prof-sues-note.html> _

<comment><AUTHOR> No, I meant approved by me, as in I check to make sure the info is ok.

To the best of my knowledge, nothing stops you from walking into any lecture and listening. There are no rules (at least at any sane school I know of) against sharing notes. I don't intend to say "This is from course 0306-123, Computer Engineering on Rails", just have sections like "VHDL" and specific informative bits under that.

</comment></comment><comment><USER4> I like this idea! I am going through a computer science and engineering curriculum at university right now and this type of site with VHDL and other CE subjects would be very useful. Maybe have some kind of forum as well so that some kind of discussion could take place? After you find a post that is worthy of a sticky you could then put it up as part of the main site.

</comment><comment><USER5> You're right there isn't much information. However, the homebrew computers/electronics scene unfortunately hasn't regained its earlier interest levels.

Why? Tools that CEs use largely aren't available to the general public, and the learning curve for electronics (and expense required for materials) is higher than most are willing to undertake.

<comment><USER6> You can download Altera Quartus II Web Edition for free. Which is VHDL and Block Diagrhams and chip programming(if you have the chips) and a ton more then I even know about.

[http://www.altera.com/products/software/quartus-ii/web- editi...](http://www.altera.com/products/software/quartus-ii/web-edition/qts- we-index.html)

</comment></comment><comment><USER7> If you only want to share this with a few people, try Google sites or docs.

If you want many people to find and use your information, put it on Wikipedia.

Both of these are free, easy and the information won't disappear when you get bored of the project.

</comment><comment><USER8> I love it! I'm a computer engineering student, as well, and I would even pay for such a resource.</comment>


Opportunity Cost - <AUTHOR> http://jmarbach.com/opportunity-cost <comment><USER2> I didn't think the post was particularly useful for startups, so here's my take.

Opportunity cost is basically what you give up when you decide to take one option over another. Costs aren't limited to literal cash outlays, but usually more importantly include costs regarding time, focus, and lots of other intangibles. For example, lets say you decide to go to grad school instead of taking a job. An opportunity cost analysis shows you'd might be giving up a $60k/year job, an experience working with a top firm, networking opportunities with colleagues, ability to own a car, affording rent to live on your own, etc.

For early startups, you can use opportunity cost to help weigh which direction to take your company. Using opportunity cost can help you look at what your giving up when you forgo one option for another. Its really the strategic non- tangibles that matter most, so don't forget to consider things like happiness, employee morale, product focus, etc.</comment>


This Swedish Automated Store Is Run by a Smartphone App – Digital Trends - <AUTHOR> http://www.digitaltrends.com/cool-tech/sweden-app-enabled-automated-store/ <comment><USER2> This idea has been thought of before, probably by the big supermarkets themselves.

The problem? Not everyone would be as honest as the village-Swede.

<comment><AUTHOR> How about if customers don't get to touch the goods till they buy them?

Imagine Amazon instant delivery shop. You can do your shopping from the house to make sure it's available. You walk into the store, do something with the phone, get your stuff and get out.</comment></comment>


Chomsky: If capital can be moved freely, it undermines democracy - <AUTHOR> http://youtu.be/xZCt3kL2s8U?t=10m48s

<comment><USER2> That's a misleading way to put it. What it really undermines is the power of governments, regardless of the type. And that probably net promotes democracy, actually.

<comment><USER3> I agree with the second sentence but I don't see how history shows the third is true. Foreign interests have undermined both democratic and non-democratic states... any time a nation has taken control of its interests and resources (either democratically or not), powerful outsiders tend to put a stop to it. How does that promote democracy?

</comment></comment><comment><USER4> He argues that allowing people to move their money freely undermines democracy because the movement of money without the permission of the government restricts the ability of the government to set policy. He says that the people moving the money can "de-fund a country". This is the "two wolves and a sheep deciding what's for dinner" theory of democracy.

</comment><comment><USER5> Chomsky is someone who I am really disappointed in. He is obviously very smart. He always seemed to me like the person with exactly the right mind for the tasks he set out to take on.

He seems to fall in to the same trap as the people who aren't.

</comment><comment><USER6> Does this linguist really think higher interest rates will drive away capital in an open economy?

</comment><comment><USER7> Flagged. Chomsky is a tool.</comment>


Stack Overflow was down - <AUTHOR> http://stackoverflow.com

<comment><USER6> FYI: <http://www.downforeveryoneorjustme.com>

e.g <http://www.downforeveryoneorjustme.com/stackoverflow.com>

<comment><USER7> If the long name is too hard to remember: <http://isup.me/> e.g. <http://isup.me/stackoverflow.com>

</comment></comment><comment><USER8> We're on it. We're having DNS problems.

<comment><USER9> It seems up now.

<comment><USER10> Yes. It is UP now

</comment></comment></comment><comment><USER11> When Stack Overflow went down tonight my productivity dropped precipitously. It reminds me of how grateful I am of the team at Stack Exchange. They built one hell of a resource.

</comment><comment><USER12> Looks like their stack has finally...overflowed.

<comment><USER13> good one!

</comment></comment><comment><USER14> [http://meta.stackoverflow.com/questions/164444/dns-server- fa...](http://meta.stackoverflow.com/questions/164444/dns-server-failure-for- all-stack-exchange-sites)

> _It appears the nameservers for Stack Exchange are returning SERVFAIL for > all queries, meaning most users are unable to access any Stack Exchange > site, or will shortly lose access once their local DNS caches expire._

<comment><USER15> Answer as to the direct cause (posted to that question):

"We recently relocated our NY datacenter, and therefore all the IPs in NY changed.

We didn't update to the new IP for the master DNS server (in both the named.conf and the zone files), and therefore all of our slaves hit our expiry time (one week). This is fixed now, so things should start coming back up."

</comment></comment><comment><USER16> This evening realized how dependent I am on SO. Trying to figure out how to dynamically set parameters for a CSS animation (turns out it's harder than it sounds) and the _only_ useful answers I can find are on SO. Also very glad to have Google's cached versions.

</comment><comment><USER17> Hacker News was also briefly down a few minutes earlier: <https://twitter.com/mattquiros/status/293220235702566913>

</comment><comment><USER18> superuser.com - <USER5>

stackoverflow.com - <USER5>

serverfault.com - <USER4>

cdn.sstatic.net - <USER5>

Purely a DNS issue

      dig stackoverflow.com @ns3.serverfault.com # (authoritative DNS)

      ; <<>> DiG 9.8.3-P1 <<>> stackoverflow.com
      @ns3.serverfault.com

      ;; QUESTION SECTION:
      ;stackoverflow.com.		IN	A

      ;; Query time: 400 msec
      ;; SERVER: 126.96.36.199#53(188.8.131.52)

<comment><USER19> Yeah, seems like ns3.serverfault.com was SERVFAILing its own record, so now that it has timed out all serverfault domains are down.

</comment></comment><comment><USER20> Looks like I'm finished work for the day! Time to go home

<comment><USER21> you can always use the google cache

</comment></comment><comment><USER22> yup

Server: google-public-dns-a.google.com Address: 184.108.40.206

 __* google-public-dns-a.google.com can't find stackoverflow.com: Server failed

<comment><USER23> Same for me, I'm on the east coast if that makes a difference

<comment><USER19> No, it won't, both their primary and secondary DNS are resolving it with SERVFAIL.

Pretty bad...

</comment></comment></comment><comment><USER24> Down for me, oh well!

</comment><comment><USER25> working fine now.

</comment><comment><USER26> its up now..</comment>


Show HN: Carmadillo – A Chrome and Firefox extension to locate and unlock cars - <AUTHOR> https://carmadillo.io/ <comment><USER2> I think what would be interesting is whether this could be used for doing on demand stuff for the car, like trunk delivery the way that its done here: [https://www.amazon.com/b?ie=UTF8&node=17051031011](https://www.amazon.com/b?ie=UTF8&node=17051031011)

</comment><comment><USER3> If the authors are here, you might want to add what cars are actually supported to the page. It doesn't say anywhere.

Presumably Tesla, since that's in the screenshot, but anything else? There appears to be zero documentation.</comment>


Error codes vs exceptions: critical code vs typical code - <AUTHOR> http://www.yosefk.com/blog/error-codes-vs-exceptions-critical-code-vs-typical-code.html <comment><USER3> If you use C++ without exceptions, it means you cannot use the STL or any library that throws. Pretty weak.

Additionally, almost all examples of "exceptions are bad", fall short because of RAII (at least in C++) or finally clauses (in other languages).

Good reasons for (almost) not using exceptions (in C++):

\- Performances

\- "Expectability"/readability

\- Platform-dependant constraints

There are probably others, but the article only talks about the "readability" arguments without even mentioning things such as exceptions specifications.

One thing you need to remember about exceptions: they're nothing more than a fancy goto.

<comment><USER4> What a weird claim. Not only do you not need exceptions to use the C++ standard library, but you can (or at least used to be able to) compile C++ code without support for exceptions.

Also, exceptions are not just a fancy goto, at least in C++. They're a fancy longjmp. Goto doesn't unwind the stack.

 _Edit_

Wait wait wait it appears I am wrong about this; the STL we used could be configured not to use exceptions but wow, that sucks, you need them for the standard library.

<comment><USER3> You actually need exceptions anywhere you do new, unless you exclusively use new(std::nothrow) (hint: you don't). On top of that the STL may throw exceptions such as std::out_of_range as I responded in another comment. And again, you have to review all your libraries to make sure they don't throw.

Exceptions are a fancy goto, longjmp is more accurate if you will, but it is my understanding that longjmp will not call all the appropriate destructors, it will just restore the environment which can lead to resources and memory leaks, from the standard:

 _If any automatic objects would be destroyed by a thrown exception transferring control to another (destination) point in the program, then a call to longjmp(jbuf, val) at the throw point that transfers control to the same (destination) point has undefined behavior._

Some compilers do add the appropriate clean up code to make longjmp cooperative to that aspect, so I might be just nitpicking a little bit here.

What I meant by "fancy goto" is that basically exceptions break the flow and can make the code much, much harder to review and making, solid and reliable code with exceptions is much, much harder than you might think (in C++), Raymond explained it better than me: [http://blogs.msdn.com/b/oldnewthing/archive/2005/01/14/35294...](http://blogs.msdn.com/b/oldnewthing/archive/2005/01/14/352949.aspx)

<comment><USER5> Exceptions aren't really like "goto"—they're dynamically bound, dynamically typed, nonlocal "return" statements. Which incidentally is a useless mechanism for error handling unless you have some kind of destruction semantics, which is mentioned in the article. Anyway, given the choice between exceptions and return values for error handling, I go for return values that the compiler can force me to check.

</comment></comment></comment></comment><comment><USER6> Can someone who uses exceptions in large systems offer a comment on _which_ exceptions they throw?

One of the problems I have in trying to design with exceptions is that they seem to offer a lot of potential to break abstraction layers.

As a concrete example, if you have a cacheing layer which - say - <USER2> implemented over the filesystem. In the event of an inability to access the correct location, the low-level routines might throw a permission-related exception. If you swap out the filesystem cacheing implementation with, say, one based on memcached you might instead get a network-related exception.

Neither of these types really make sense in the context of a 'cacheing layer error', they seem to leak implementation details - breaking the abstraction.

Do people accept this, or do they catch-and-rethrow new exception types at major layer boundaries? (e.g. in the above two implementations, both low-level exceptions may be caught and rethrown as "CacheInitialisationError" with some perhaps some additional diagnostic about the underlying cause). If they have such API-specific error types, do you go to the trouble of modelling an exception type hierarchy? So all your 'cache layer' exceptions inherit from 'CacheError' so a higher level can catch all "CacheExceptions" in one place? This seems like a lot of additional modelling effort, is it commonplace?

To my mind, the possible exceptions a API call may make (or equivalently, the errors it could return) are _part_ of the API, and the errors need to be at the same conceptual level as the rest of the API. (So you can't have filesystem errors in a generic cache API).

What happens in practice?

<comment><USER7> Given your scenario, you are indeed correct: throwing implementation-specific exceptions leaks internal details and further couples clients of the API. Can you imagine using such an API which forces you to continually handle new exceptions that arise from new implementations? As you suggest, it's better to create an exception for the API which then wraps the underlying exception. I would not go so far as to create a family or hierarchy of API exceptions unless there's a need to communicate each of them individually.

What usually happens in practice is a combination of none and all the above. A bit of a mess, really.

</comment></comment><comment><USER8> Example from the article criticizing exceptions:

      open_the_gate()
      wait_for_our_men_to_come_in()
      close_the_gate()

D programming language for example has an excellent support for RAII with ScopeGuard statement <http://dlang.org/statement.html#ScopeGuardStatement> The example in question will become:

      open_the_gate();
      scope(exit)
        close_the_gate();
      wait_for_our_men_to_come_in()

Then even if wait_for_our_men_to_come_in() throws we still close the gate. There is additional granularity - we can execute statement on success or failure too.

The technique was originally developed by Andrei Alexandrescu for C++ and described in [http://www.drdobbs.com/cpp/generic-change-the-way-you- write-...](http://www.drdobbs.com/cpp/generic-change-the-way-you-write- excepti/184403758)

<comment><USER9> You can do the same thing in C++ RAII with an extra function scope though. Just create a Gate object or whatever and drop it on the stack before you call the wait_for... thing. An exception thrown out of that scope will clean up the Gate object for you and close it. Or just use Java, which has a "finally" syntax that does the same thing. Or Python's "with", which match D very closely indeed.

The point is that D is hardly unique about this. And further: the fact that D _has_ syntax that makes this operation clean doesn't mean that it will be used. That first example can be written in any language, and often is. The "open/close" pair is clear and obvious in this example for didactic purposes, but in old code under maintenance that kind of assumption can be very subtle.

Syntax won't save you here. The problem being explained (which I only partially agree with) is that the whole exception model is flawed.

</comment></comment><comment><USER10> No discussion of Exceptions vs Error codes is complete without referring to Joel Spolsky's Exceptions article:

<http://www.joelonsoftware.com/items/2003/10/13.html>

Also:

[http://channel9.msdn.com/Blogs/Charles/Erik-Meijer-and- Rober...](http://channel9.msdn.com/Blogs/Charles/Erik-Meijer-and-Robert- Griesemer-Go)

Erik Meijer interviews Robert Griesemer about Go. They chat about exceptions for error codes. The exception talk starts ~8:00.

Erik is in favor of failing fast with exceptions b/c most of the time, when you have an exception in an application, you want to fail fast because there is "nothing you can do" at the point where you have an unexpected null, etc.

Very interesting discussion between two smart guys.

</comment><comment><USER11> Java world -> Aren't checked exceptions just error codes that use types instead of arbitrary values and compiler gaurantees?

And wasn't the thought that checked exceptions would be better for critical code because the compiler guaranteed that they were handled.

I'm no fan of java's error handling, but I think that the insinuation that the lack of any formal error handling makes you write less error prone code is bordering on the absurd.

Detail oriented individuals write robust code given the constraints of their environment. If its arbitrary strings that indicate error state they use strings if its integer return codes they use integer return codes.

</comment><comment><USER12> This is why I hate all modern programming languages (I'm actually writing an article on that >.>). The conclusion to this article is the same as many others. Programming language feature X is better in situation A and Programming language feature Y is better in situation B. Where the features are often incompatible (or fulfill similar areas, error handling in this case). The solution is of course to have multiple programming languages in your projects that have both situation A and situation B

But languages are so annoying to integrate (where they can call into each other and support each other's features, without ridiculous glue code. Let alone swap code in the middle of a file), unless they were designed to (e.g. python and C). It is hell to set up the library dependencies and get the compilers to cooperate with each other. Which is why most just pick the language that's best for the majority of their project (or spend large amounts of developer time integrating other programming languages (not scripting languages, that's related but not quite the point) into their project).

Which is why we need the ability to change semantic languages within the same programming system, and have the programming system resolve the differences between the semantic languages automatically. So you can have one semantic language with features designed for situation A and another with features designed for situation B and just swap between them as needed and have them compile together automatically. This is what my Masters thesis and probably what my PhD dissertation will be on.

</comment><comment><USER13> Another weak article. He never mentions

try { makeAMess() errorProneOperation() } finally { cleanUp() }

your first instinct should be to use finally, not catch, but Java brought us the tragedy of checked exceptions (in which your #1 motivation in working with exceptions is to shut up the compiler) and the bad habits have been adopted by people who use other languages that copy the (otherwise pretty good) Java exception handling style.

<comment><USER14> Another person who didn't read the whole article? ;) Near the end he mentions RAII in C++, _with_ in Python, and _using_ in C#.

</comment></comment><comment><USER15> Exceptions are far far more readable than error code handling. Exceptions allow one to separate error handling from the structure of the "mainline" execution path of an algorithm. Weaving if/else statements in and out of the mainline path of an algorithm muddies the intent. Exceptions help with this greatly. Instead of having to comprehend the entirety of the algorithm (when exception handling can sometimes take up 50% or more of the code), you can zero in on the most common execution path. Then understand the degenerate cases in turn. The fewer branches your brain has to process in any given moment is a boon for readability.

Yes, exceptions are just fancy goto's--but that is a good thing! Goto's when used sparingly can greatly increase the readability of exception handling code. Exceptions simply create a language level abstraction for this functionality.

<comment><USER16> > Yes, exceptions are just fancy goto's--but that is a good thing! Goto's when > used sparingly can greatly increase the readability of exception handling > code. Exceptions simply create a language level abstraction for this > functionality.

That is entirely incorrect, except in the odd case of Sinclair ZX Spectrum Basic, which is the only programming language that I"m aware of that allowed you to do "LET a=10: GOTO a" (all other languages with goto require a label; GCC has an extension for "indirect goto" and "label address" that is somewhat similar, although it restricts you to staying within the same function scope).

If anything, it's a fancy "longjmp", that also calls destructors along the way.

The big difference, and it is HUGE, is that when you do a "goto", you know where you the next instruction is coming from. When you throw an exception, you do not know which instruction will execute next from looking at the throw site (and in fact, you may need to conceptually inspect an unbounded number of stack frames to tell; which is different from longjmp or expression goto which only require you to examine one memory location).

> Exceptions allow one to separate error handling from the structure of the > "mainline" execution path of an algorithm

In theory. In practice, they essentially guarantee that the error handling is not properly tested, and often useless except in the case of "everyday expected errors", which are not really exceptional, but rather quite frequent.

<comment><USER15> You took my comparison with goto entirely too literal. The point was more about code organization rather than implementation details. This should have been clear from the context.

>In practice, they essentially guarantee that the error handling is not properly tested, and often useless except in the case of "everyday expected errors", which are not really exceptional, but rather quite frequent.

This hasn't been my experience.

</comment></comment></comment><comment><USER17> And C++ exceptions are the worst of both worlds (uncaught C++ exceptions have no call-stack; they are neither local, nor explicit).</comment>


AI Helps Classify Lung Cancer at the Pathologist Level - ml-engineer https://news.developer.nvidia.com/ai-helps-classify-lung-cancer-at-the-pathologist-level/ <comment><AUTHOR> Very cool! We (Paperspace) just posted a tutorial on Detecting Pneumonia from X-ray scans using PyTorch for anyone interested in building some more intuitions around this type of Deep Learning: [https://blog.paperspace.com/detecting-and-localizing- pneumon...](https://blog.paperspace.com/detecting-and-localizing-pneumonia- from-chest-x-ray-scans-with-pytorch/)

<comment><USER2> Is this in clinical use anywhere yet?

<comment><USER3> Yes, there is a whole glut of companies in this space working in close collaboration with various hospitals. I've looked at several of these and the general quality of the products is high.

</comment></comment></comment><comment><USER4> Sounds nice, and they even have the good stuff on github with an explaining how-to article on medium.

If you're into Digital Pathology and Whole Slide Image (WSI) analysis then there is a whole undergrowth of open source tools and projects to dive into. I especially like QuPath by Pete Bankhead ([https://qupath.github.io/](https://qupath.github.io/)). It has a more accessible interface than python (as in the article), it supports various machine learning algorithms and also has some nice video tutorials ([https://www.youtube.com/channel/UCk5fn7cjMZFsQKKdy- YWOFQ](https://www.youtube.com/channel/UCk5fn7cjMZFsQKKdy-YWOFQ)).

</comment><comment><USER5> I worked on this problem during my masters. I created both a deep and KNN model for early breast cancer detection, but I think the performance (accuracy and speed) is most impressive for the latter. Code: [https://github.com/jszym/pprecogg](https://github.com/jszym/pprecogg)

Thesis: [https://www.cs.mcgill.ca/~jszymb/thesis/260528685_Szymborski...](https://www.cs.mcgill.ca/~jszymb/thesis/260528685_Szymborski_Joseph_Experimental_Medicine_thesis.pdf)

</comment><comment><USER6> 143 images; and within 95%. I need to read more to work out which 5% is wrong, and what the 95% really means of course. I feel that calling this Pathologist level could be a stronger claim that I would make. I am hesitant to word things more strongly, but I feel dismay about the kind of claims of performance that are often made in these contexts.

</comment><comment><USER7> One of my college instructors talked about this back in 2005 - did it really take this long for the tech to mature?

<comment><USER8> One possible reason: pathology labeling can be prohibitively expensive. You're looking at paying highly-trained specialists to sit down and hand-segment regions of cell types on an entire slide.

<comment><USER3> That is definitely one bottle-neck, creating the labelled data-sets is very expensive, besides that there are a large number of privacy sensitive issues that need to be taken care of around the whole labeling process to ensure that patient confidentiality is maintained. Large datasets exist but in general are not available for research for that reason, only a few hospitals have made datasets available without restriction.

</comment></comment></comment><comment><USER9> What markers does a human Pathologist look for to detect Lung Cancer?

Tumors? Dark spots?

And on what type of media? Xrays? MRIs?

</comment><comment><USER10> Al does it again! Where does he find the time?</comment>


The Man Who Knew Too Little - <AUTHOR> https://www.nytimes.com/2018/03/10/style/the-man-who-knew-too-little.html <comment><USER2> I did something similar to this during the recent election cycle. I got so stressed out from the constant bickering about Trump on Facebook and Twitter that I literally unfollowed all 400 of my friends on Facebook and just left my news feed empty. The only part of Facebook that I participate in nowadays is just topical private groups with friends and family (who have a general rule to avoid politics). I also entire Twitter (unless someone direct messages me or something), and I intentionally avoid the news on television and radio.

My life is fairly peaceful, and I get to focus on the day to day things that make me happy and make life meaningful (like playing with my toddler son at the end of the day).</comment>


I'm forced to write bad code. How do I save my life? - <AUTHOR> http://programmers.stackexchange.com/questions/89912/im-forced-to-write-bad-code-how-do-i-save-my-face

<comment><USER2> It was asked almost year ago.</comment>


Auro Robotics (YC S15) Is Testing a Driverless Shuttle System - <AUTHOR> http://techcrunch.com/2015/08/13/auro-robotics-yc-s15-is-building-a-driverless-shuttle-system-for-college-campuses/

<comment><USER2> Good luck! I know how hard a problem this is, as I was part of the team that worked on the driverless taxis now operating at Heathrow airport[1] (and which have safely carried over a million people since launch).

You might also find the company's library of research papers a useful reference [2].

Looking forward to seeing your progress!

[1] [http://www.ultraglobalprt.com/](http://www.ultraglobalprt.com/)

[2] [http://www.ultraglobalprt.com/about- us/library/papers/](http://www.ultraglobalprt.com/about-us/library/papers/)

<comment><USER3> Thanks for the reference. We did talk to one of the first employees of ultraglobal once and learnt its limitations and the challenges it faced. Autonomous vehicle technology is definitely complex but deployable for low speed vehicles in controlled environments. The recent developments in the autonomous Robotics space and a significant reduction in sensor prices make this the best time for such a product.

<comment><USER3> Also the fact that ultrapods carried millions of passengers despite it's environment being constrained to rails on either side, proves the point that completely autonomous vehicles that can move freely around the campuses will have a greater use case.

</comment></comment></comment><comment><USER4> And this is the beginning of the end of bus driving as a profession. Sure, this is in well defined, short (and private) routes. First Santa Clara, then Stanford shuttles, then airport shuttles, then Googlebus drivers. Enjoy the raises while you can.

<comment><USER5> They are developing platforms that will operate inside contained environments. What you are referring to is very different from what they are doing. An autonomous vehicle that operates on a public road faces much more challenges than one that does so in a contained environment. While working on my own autonomous car (yes, I bought a car for the sole reason to try and do this), I realized that the simplest route would be to do as they did. It can operate in a closed loop, similar to line following robots. Eerily similar to automated trains in airports. Its a challenge to build a safe autonomous vehicle, a bit less so in the way they are doing it. Not trying to diminish their efforts though. I have first hand experience of how hard this simpler approach is.

<comment><USER4> I grant you that. But this is the beginning.

One obvious question, why aren't more subways fully automated? It's not like they can't implement remote control override for emergency situations... Is it still a psychological issue (with riders)?

<comment><USER6> Because most subways run on legacy infrastructure that would be difficult to upgrade/replace. RF repeaters for emergency remote control for example would need to be installed, certified and thoroughly tested.

Given that drivers aren't a big cost centre for subway operations in comparison to maintenance etc. the cost/benefit doesn't make sense.

<comment><USER4> I think the pensions are a sizable part of their expenses. If they automate their retired workforce age out and there is no endless retirement pool to contribute to. So this would be a significant savings.

</comment></comment></comment></comment></comment><comment><USER7> This is cool. Yet the primary efficiency over conventional shuttles appears to be limited to lower labor costs. Unlike the taxi market, it does not appear to reduce vehicle count or improve passenger experience via better service.

Better service in a regular route context comes mostly from dedicated right of way and platforms. The classic example is Curitiba's bus system in lieu of a subway system It could not afford. The real change for campus shuttle service will be if automation leverages itself into dedicated shuttle rights of way as a safety measure or direct commitment to improved service.

</comment><comment><USER8> It's certainly time to do this. But "Available for preorder?" That doesn't work for B2B manufactured products. They need real funding.

<comment><USER9> We do need real funding. The more we can make the sooner and better we can make things. Having lot of modules and test sites we can easily parallelize work of both testing at different sites and collecting more data and working on improving more modules at the same time. So basically we can truly utilize higher amount of funding

</comment></comment><comment><USER10> There will be an autonomous shuttle starting (testing) october 2015 in Wageningen, the Netherlands. Production use expected May 2016. Big caveats though: will drive only 25 km/h, won't operate at night or in bad weather. It'll shuttle between Ede trainstation and the WUR campus.

<comment><USER9> Fortunately we are starting at Bay area where bad weather is less frequent and we can also operate on mild bad weather and have done lot of testing at night (in fact that was our prime hours of testing). We have also worked in bright sunny daylight in scorching heats and overcome issues with sensor noise in both conditions, only hoping to make even smarter algorithms and deals with more wider range of situations and we continue our pilots and paid deployments.

<comment><USER10> When do you expect to have a ready-to-purchase product for sale? Do you target US only at first? What will your product cost, order of magnitude?

</comment></comment></comment><comment><USER11> I'm a student at SCU and I'm excited to see these on campus; it's not a big enough campus to merit having it's own shuttle system, but it should be a perfect testbed for the platform.

<comment><USER9> We will meet soon then :) .. hope you are exited to get autonomous rides. University authorities are excited to deploy such technology both to stay ahead and have cool inspiring tech in campus and also to help elderly people like some professors and visitors (who regularly come to church), or anyone who has trouble walking and they can even use it for logistics within campus. When something becomes much cheaper in the industry use-case possibilities explode. So lots of reasons even for a small campus and everyone is excited about it.

</comment></comment><comment><USER12> Good Luck Nalin!</comment>


I dumped my day-job like a stage 5 clinger. The results? Amazing - <AUTHOR> https://code.likeagirl.io/i-dumped-my-day-job-like-a-stage-5-clinger-the-results-amazing-cc9e9d46f8cd <comment><USER2> I'm sure if you're young, pretty, and can hold forth effusively on the framework du jour, you "magically" get invites to host _webinars_ all the time. But when you're old and jaded like me and have seen fads come and go -- history spitting rhymes like Eminem -- you can't muster that oh-so-marketable enthusiasm for what's hot this month, and as a freelancer you may find yourself struggling for scraps. In that context, the corporate nine-to-five starts not looking so bad. Especially if you have other mouths to feed.

<comment><USER3> I wouldn't mind some elaboration. I'm early-thirties and find myself dwelling on these issues regularly. I feel I'm at a crossroads where on the one hand I can still go for those 'hot' things with enough excitement, but on the other hand find myself tired of feeling like I'm just following trends and reinventing the wheel, instead of actually getting _better_ at my _craft_ , much as the word makes me feel self-conscious.

<comment><USER2> Technical experience and expertise is no longer enough to be successful in the software business. As a developer you are only one source of technical expertise, competing with other sources, including offshore workers and libraries on GitHub and npm. To make it you have to have well-cultivated soft skills and be exactly what your client is looking for. This is increasingly true of nine-to-fivers -- for whom an entry-level job requires at least three years' experience in whatever framework the company is using as well as "cultural fit" (a proxy for who knows what kind of discrimination) -- but it's still _especially_ true of freelancers. If you're not exactly what your client needs, you're out. And if you're in the Valley startup scene, where every new JavaScript framework has apocalyptic implications and no one over thirty is to be trusted per the words of God-Emperor Zuckerberg, then what your clients need is for you to be young, hip, and smart -- but not wise to the fact that the latest stuff is yesterday's advancements, warmed over and retooled to hide the deficiencies in today's tech. Or at least you can't let _them_ know you're wise. _Them_ being the people with the money.

If you want to make it in this world, fuck your craft. Crafts are for evenings and weekends. Work on your hustle instead. Look up some hot new framework and build a thing in it, then prepare some slides and give a talk -- to no one, in your room -- about what you learned so the words roll off easy when you're trying to impress somebody at your local meetup. Stock up on Just For Men so you can still pass for 28. If you want to be where the true advances in the field are, go back to college and get a Ph.D. or at least a master's because blockchain, AI, machine learning -- these require more math than the average baccalaureate college grad has been prepared with. (But mind your love life while there; if you fuck the wrong girl you are automatically assumed to have raped her per Title IX regulations.) And robotics and IoT require deep engineering backgrounds.

If making it in Hollywood means sucking Harvey Weinstein's dick, then you know what you've gotta do. Get on your knees, or walk out the door and do something else. It's not fair and it's not just, but this is the world we live in.

</comment></comment></comment><comment><USER4> Did we really need yet another article about this? We get it, being in a box for 8 hour sucks.

<comment><USER5> OP here. I mean, 'needing' is subjective. I just like writing stuff...what would you, specifically, want to read about? I might be working on an article now about it, to be honest (hah).

</comment></comment><comment><USER6> What is a stage 5 clinger?

<comment><USER7> It's a reference from the movie "Wedding Crashers." It basically means a person who doesn't understand that the person they're into isn't into them. They are border-line stalker/clingy.</comment></comment>


The Threat of Treble Damages versus the Benefit of Insight - <AUTHOR> http://archimedesip.com/the-threat-of-treble-damages-versus-the-benefit-of-insight/

<comment><USER2> One could argue this is yet another reason to support your local internet anonymization services - Tor, FreeNet, etc. You can freely research your patent without exposing yourself to this kind of legal mucking about.</comment>


Ask HN: How do you iterate quickly on table schemas? - <AUTHOR> When working on a new app I don't always know the exact DB schemas I need. Maybe my mind is mush, but I have a feeling lots of devs deal with this. What's your preferred way of working in this scenario? Use NoSQL and just throw everything into objects? Just write a bunch of `ALTER TABLE` commands? Let an ORM handle it? <comment><USER2> Well first of all, I agree with a book called Databases Demystified that recommends you sort out your user interface before you make your database. To a programmer that might sound backwards, because isn't the database the foundation of your interface? The reason it works is that your user interface helps you decide what is important to store. There are so many facts you could store about your subject, and if you make your database first, you likely will choose the wrong facts or format them in the wrong way.

After that, I don't change my database much. But when I do, I prefer vi and psql:

      > vi tables.sql

      begin;

      drop schema stuff cascade;
      create schema stuff;
      set search_path to stuff;

      create table blah (
          id serial primary key,
          name text unique not null,
          kind int not null references kinds
             on update cascade,
          color int not null references colors
             on update cascade
          note text
      );

      rollback;

      > psql
      psql=> \i tables.sql  # yay, no errors
      psql=> \q
      > vi tables.sql  # change rollback to commit
      > psql
      psql=> \i tables.sql  # table created

Whenever I want to make a change, I use vi to edit tables.sql. Then I run psql and its \i command to run the stuff in the file --- which drops the schema and all its tables, and recreates everything again. I don't know if any other database treats schemas as Postgres does though, as folders for tables.

By the way, you only want to do this on your test database, while making it, before users start using it, because it drops all the tables and their data. After you've gone live, it's alter table, baby.

Even after go-live this technique is useful for idempotent commands like creating views and functions. But instead of the drop-schema-cascade command, you have to put commands at the top to drop each of the views or functions, usually in the opposite order you create them, in case there are any dependencies.

If you like GUIs or are new to SQL, this way is daunting. I think it is the happiest way long term, though.

<comment><USER3> I would say just the opposite. Model your domain first. Why tie your database to your user interface? Your user interface may change. You may write a separate API to be consumed by another team, etc.

<comment><USER4> This is the answer that I would give. Over time, my development has shifted to modeling the domain first, including simple APIs that use those domain models well before I intend to write a table.

To answer the question as asked, I use pgadmin or the corresponding database management tool to update the database. My first actual migration is a stable version of the database.

</comment></comment></comment><comment><USER5> ORM and auto migration files. This is super easy in Django for instance, just:

        python manage.py makemigrations
        (commit them)
        python manage.py migrate

[https://docs.djangoproject.com/en/2.0/topics/migrations/](https://docs.djangoproject.com/en/2.0/topics/migrations/)

</comment><comment><USER6> Never use an ORM that wants you to define your schema anywhere except the database. Never use NoSQL just to avoid writing SQL. (There are lots of valid reasons to use NoSQL, but that is not one of them).

First week or so: Change the DB as much as you like, directly, using the visual tools or create/alter statements as you see fit.

Once you're ready to do things right: Use change scripts. Save every create/alter statement, as well as data population and modification queries into a .sql file in a directory, named sensibly so that you can run them in order to exactly reproduce your schema at any point, on any machine.

Important to note: This is not hard. SQL is not hard. Avoid tooling written by people who think SQL is hard, that therefore build elaborate workflows that are in fact hard in an effort to shield you from having to touch the database.

<comment><USER3> He never said anything about SQL being hard. In fact, I think MongoQuery is much more obtuse than SQL.

That being said, when you don't know what your schema is going to look like, why not use a Nosql solution - either a pure nosql solution or the JSON support built into modern databases? If you write your code correctly and have one module retrieve for one domaim, you should be able to isolate changes.

But, if I do have to use Sql, I agree, put all of your changes in sql files numbered and have a "database version" and find/create tooling that can automate running the Sql scripts and run it as part of your CI/CD.

<comment><USER6> _when you don 't know what your schema is going to look like, why not use a Nosql solution_

Because one day soon, you _will_ know what your schema is going to look like. And the next 10 years of your business will be a lot more pleasant had you optimized for them rather than the first week of greenfield development.

<comment><USER3> And there are all sorts of well known solutions that let you create separate solutions for OLTP and OLAP. You don't have to have one type of data store to rule them all.

</comment></comment></comment></comment><comment><USER7> Put reads behind a view, put writes behind a stored procedure.

<comment><USER3> That makes it a lot harder to deploy and rollback. Your business logic is in two separate places - the stored procedures and the code. Then you see stuff like

UpdateCustomer_1

UpdateCustomer_2

<comment><USER7> Not sure what you mean about deploy/rollback difficulties. It is of course something to consider, but generally speaking modern rdbms have the most sophisticated tooling around this in the ecosystem.

Versioning and compatibility are of course concerns but that is true of _any_ scheme you come up with.

If you think you haven't exported "business logic" to your data store in any case you are wrong.

<comment><USER3> If all of your business logic is in your code, there is one source of truth. I know when I deploy code from a certain branch or tag, all of the logic is right there.

My build process creates an artifact and that artifact gets deployed through the entire pipeline - Dev/Qa/UAT/Prod. There is one source of truth.

But when half your code is in stored procedures and the other half is in code, how do you keep them in sync? If I need to redeploy an older version, it's a simple matter of redeploying the artifact from v1. How do you make sure the code stays in sync with the stored procedure?

I can honestly say, that any system I've designed from scratch has no business logic in the data store.

<comment><USER7> Do you have types in your schema? That's a business rule. Do you have columns, business rule.

Those might be business rules you are ok with having in your data store, but they are a point of sync between your code and the store that you have to manage.

If your stored procedures are their to abstract your table structure for write operations they act as a way to make that sync easier not harder.

<comment><USER3> How often do types change? Changing schema usually involves adding columns not deleting them. I'm not aware of a realistic scenario where adding a column isn't backwards compatible.

As far as writing your domain model to a relational schema, you should be doing that as a single module (in process) or micro service (out of process) that all other code calls. Meaning changing the representation of a domain model should only require a change in one place. For a monolith it means redeploying one artifact. For a microservice, it means deploying that microservice.

Even better with a nosql solution like Mongo, if you are using a strongly typed language. Your domain model is your schema. You change your schema and the data model changes.

With some ORMs you can just change your object and it creates alter table statements for you - I personally don't trust them but it is an alternative.

</comment></comment></comment></comment></comment></comment><comment><USER8> What's wrong with alter table? It's not like you have to manually re-enter rows. And this is during development, right?

</comment><comment><USER9> Just adding that I feel this as well and would love to know the same.</comment>


No, I'll tell you the answer - <AUTHOR> http://blog.asmartbear.com/advice-from-internet.html

<comment><USER2> This is a really good article. There's no exact path, though startup media likes to make you think there is. Raise tons of money? Raise no money? Ad supported? SaaS? Is this trend over? None of it really matters. Go for what you will commit yourself to, put a plan to it, and make sure that you're happy with what it can produce. That's the biggest issue. Many founders will start lifestyle businesses, want to turn them into VC backed ones, and start to mutate what they're working on. During that mutation things go very awry. Know who you are and embrace it.

<comment><USER3> Great post. This reminds me of Tim Ferriss' description of identifying good business ideas and / or approaches to learning new things (like languages). Three simple questions (which I've defined in terms of business, but they are broadly applicable):

1\. Effective - will the business actually make money?

2\. Adherence - is it a business you can stick with and commit to over the long haul?

3\. Efficiency - will the business make you money in a way that uses time efficiently.

Listed in priority order. Great way of evaluating potential business ideas for me. #2 is particularly useful as a filter, as there are LOTS of ways to make money, but a much more limited set of ideas that you actually want to do long term.

</comment></comment><comment><USER4> Good article highlighting the equally valid modes of rationalising different options.

A useful book that can help one think through these (and many more) types of decisions is "The Founder's Dilemmas"[1]. In it, Wasserman (former professor of mine) explores the trade-offs one must make in founding, with examples. Very helpful.

[1] [http://www.noamwasserman.com/book/](http://www.noamwasserman.com/book/)

</comment><comment><USER5> I like this a lot. I'm really sick of the debates regarding appropriate motivations that are so common on this site. It's not that motivation doesn't matter, it's just that it's different for everybody. The one part of a start- up that gets to be personal that gets to be yours, no matter what, is why you're doing it. Everything else is icing on the cake.

</comment><comment><USER6> I am going to be a part of a startup in the near future (really the "near" future.. 1-2 weeks to say) and the numbers although haven't deterred me, but I will admit, I am a bit scared. So, I am just going to finally ask this. What percentage of startups fail? I know that it is more likely I will fail rather than succeed, but I would really like to know the odds.

<comment><USER7> It's irrelevant to you. Even if 99.999% of risks fail, your chance of success is independent of the the failures of other people.

The question you really want to ask is: what's the expected risk/reward ratio? And if you're in any kind of demand for your professional skills, your risk is your opportunity cost (which you can reasonably well predict), plus the small chance of some horrible disaster that leaves you unable to finish (which you can't predict, but applies mostly independently of the amount of career risk you're taking). Then there's the the thing that people get hung up on: the risk that the project will tank, and you'll have an inexplicable gap on your resume. If you're in a place like the valley, this risk is largely imaginary -- as long as you comport yourself professionally, taking a chance on a startup isn't going to hurt your career.

Initially, assume your expected reward is near zero. You're walking on to the casino floor, and you're there to have a good time. You want to keep the game going as long as you can, but you're not prepared to gamble more than you can afford to lose, and you assume that the house has the odds. Your calculation is: how much am I willing to lose on this activity?

Later, if you achieve some success, you can modify your risk/reward calculation. Is your project growing? Bump the expected reward. Did you raise money, and can now afford to pay yourself? Reduce the risk. Decide where your personal loss threshold is for this particular bet, and when you cross that line, stop.

In my opinion, the thing you should worry about is not financial risk, but _life_ risk: is this what you _really_ want to do with your one-and-only youth? It's a much harder question to answer, but a good place to start is: do you really, honestly, truly give a shit about the thing you're planning to build? If not, stop now. No amount of "success" will make it worth the pain you're going to endure. So if what you really want is comfort and a peaceful life, get a job somewhere, and don't regret your decision. Otherwise, proceed forward with the knowledge that you're doing something you _have_ to do, even if only for a little while.

</comment></comment><comment><USER8> They are all correct, and would all be interesting lives to lead, which is most of the goal to me.</comment>


Ask HN: (off topic) Summer school for my 6yo - <AUTHOR>

I'm planning to be in SV this summer. I'm looking for an English Lang. School (for Int'l) for my 6yo daughter. Any suggestions? <comment><USER2> Ask my friend Gunilla Leavitt; she's a Swedish immigrant. Both her daughters are grown now but they were very young when they came to America.

[http://thegoldenfleece.com/](http://thegoldenfleece.com/)

<comment><AUTHOR> Thanks a lot...</comment></comment>