Ask HN: How do you build your freelance work portfolio of closed source apps? - <AUTHOR>

I have worked as a software developer for several years in a corporate environment. All of my work has been closed source development making CRUD apps for enterprise companies. Recently I started working on my own. I got few projects but they are still for enterprise companies and I'm developing their intranet webapps or their behind the login web apps. I'm wondering what is the best way to include them in my work portfolio. The best I can imagine is to link to my work that is online (But it would be behind the login and all anyone would see is their landing page). I think making a video and/or saving screenshots would be some confidentiality breach? Any suggestion or how you have done it for yourselves?<p>Edit: Just wanted to clarify what work I'm doing as a freelance developer. I'm doing full stack development. I use bootstrap with JavaScript MVC framework and Python or Java for backend. <comment><USER2> Usual disclaimers apply... speaking within US jurisdictions... based upon advice I received earlier in my career when asking the same question... and so on:

I created a personal website to which I would grant limited access to select portions and only to those potential employers for which I was actively considering. Not being public, there were no issues.

Alternatively, go old school and bring the copies with you on an interview. This might be hard copy screenshots, or connect your laptop to their projector during an interview such that you always retain control over the material. Then, if you can't click-through to a certain portion due to it being an unreleased feature, patent papers not yet filed, etc., you have the control to navigate to away from there.

As another person commented here, some content on my personal website were anonymized screenshots organized as a storyboard; others were full replications of the entire system's UI and server, complete with documentation and including the original company's name & logo.

Sometimes the intent to have a portfolio begins when you start the project.

Depending upon nature of your project, you may be able to create it in a way that easily accommodates an anonymous version.

For example with one particular project, I kept all of the corporate colors and logos within CSS of course but intentionally kept it isolated to a single style.css file to make it trivial to change. It was essentially a "white label" system to accommodate re-branding, co-branding, etc. (Of course, no potential employer was interested in an end-to-end recommender system with mix & match algorithms-- think: compiling regular expressions-- so I've never shown that one-- oh, the irony!)

Even if you are concerned about nondisclosures and noncompete agreements:

You can demonstrate what work you have done despite most wording within agreements because they cannot prevent you from continuing to work within your field or prohibit you from earning a living after providing labor/services under those agreement-- with a few obvious caveats.

Those caveats include explicit statements about specific items to which you have agreed, and even in some of those cases, you may still be OK based upon local laws. But you should know when you're in that situation and would of course talk to an attorney and/or your original employer.

<comment><AUTHOR> > "white label" system

That's a great idea. It would involve certain efforts and upfront negotiation with clients but certainly doable.

</comment></comment><comment><USER3> Unless you're a front end developer, what the end product looks like is of little consequence. If you're a back end developer doing mainly closed-source applications, a portfolio is not a good way to showcase your work, since by definition there will be little or nothing you're legally allowed to showcase.

Instead, focus on other ways to show what you've done and - more importantly - what you know. Blog posts are easy but it's unlikely prospective clients will dig through blog archives to find a problem relevant to them. Instead, you could likely discuss an application in vivid technical detail without mentioning the client and not be breaking any NDA or contract rules. Think of it as a white paper to host on your site as something a little more in-depth than a blog post.

<comment><AUTHOR> > Unless you're a front end developer, what the end product looks like is of > little consequence.

I'm doing full stack development. I use bootstrap with JavaScript MVC framework and Python or Java for backend. So I guess prospective clients might be interested in seeing what I have built in the past.

> Instead, focus on other ways to show what you've done and - more importantly > - what you know.

I'm afraid this is the tricky part because I will have chance to show my experience only after clients have seen my portfolio and contacted me to show their interest to work with me. This makes me envy front-end devs and graphic designers as they can showcase their work in all the glory. You idea about discussing this possibility of hosting a white paper or case study of the app is a great suggestion, thanks.

</comment></comment><comment><USER4> Are screenshots really that useful or interesting? I'm not being snarky, I'm genuinely interested.

99% of the software I've written has been embedded deep inside some expensive piece of machinery. A visual portfolio would be useless since it would consist of photos of the machine, which would offer no insight. Instead I describe what I've done, how it works, problems I had to overcome, etc.

I've interviewed people for many types of positions, and I can't think of a single time when the ability to answer questions about the software they've written wouldn't have sufficed. As it is, I rarely even get that :-(

<comment><AUTHOR> > Are screenshots really that useful or interesting? I'm not being snarky, I'm > genuinely interested.

I'm not sure myself if screenshots are useful. They would be for a front end developer. I have done full stack app development for enterprise where either the UI was minimal or it was done by a graphic designer on their team.

> I can't think of a single time when the ability to answer questions about > the software they've written wouldn't have sufficed

I'm glad this is your experience. I would imagine this is the case too.

</comment></comment><comment><USER5> Have you considered customer stories and testimonials as well? In addition to the points raised here, the question you ask is similar to questions that one could ask of another professional service. They showcase their expertise through customer case studies, testimonials about their work etc.. I also find LinkedIn connections and testimonials useful in some scenarios.

<comment><AUTHOR> > customer stories and testimonials

great suggestion.

> LinkedIn connections and testimonials

Yes, this I already do and seems very useful.

</comment></comment><comment><USER6> I've seen people take anonymized screenshots of the app in a test environment and then write a case study explaining the app. I think it's something you could write into a contract or politely request from past clients.

<comment><AUTHOR> > anonymized screenshots

> write into a contract or politely request from past clients.

True, thanks for the suggestion.</comment></comment>


An answer to the "Sell Me This Pen" interview challange - <AUTHOR> http://senatorclub.co/best-answer-to-sell-me-this-pen-i-have-ever-seen/ <comment><USER2> Fuck selling pens.

Give him the pen, then sell his mailing address to a paper manufacture.

Then cap his refills at 1 per 3 months, but for a low monthly subscription offer to give him all the ink he wants, and all the new pen models as they rollout.

Hard selling of ubiquitous consumables in highly competitive markets has no place in the SaaS world.

<comment><USER3> Unlimited ink? How do I ask for a shipment- through a form or a human? What happens when I request to much ink or pens? Do you conveniently forget to place my order?

How hard is it to cancel? What does the price tiering look like? When you are acquired, will I still receive my shipments?

All of these are arguments for why the "subscription market" is absolutely bogus

<comment><USER2> Which is why every major operating system (except iOS) in the world is now free, has free upgrades and updates and if it wipes your system, well tough, that's in the EULA.

Cancel? You can't, you can only revert your account to the unpaid plan.

We also reserve the right to take our pens back whenever we want.

Now, we could setup a special "enterprise-level" plan for you, with onsite production, dedicated management, and pen and ink manufacturing which you'd own after you paid off the terms, but that'll be a bit pricey.

<comment><USER3> The only solution to all of this is libre/gratis hardware, software, hard work, and delayed gratifcation ^.^

</comment></comment></comment></comment><comment><USER4> [http://webcache.googleusercontent.com/search?q=cache:DMJo55d...](http://webcache.googleusercontent.com/search?q=cache:DMJo55d2yPAJ:senatorclub.co/best- answer-to-sell-me-this-pen-i-have-ever-seen/)

</comment><comment><USER5> That's a terrible answer and to be honest, I don't particularly believe this actually happened.

I was once asked to sell a pen to an interviewer and the first thing I asked them about was their pen use. After that, I pointed to things on the pen and told them about the benefits of it and why it was a good choice. he stopped me and said he heard enough because I established need, and then translated real features of the product into benefits of the customer.

<comment><USER6> On top of all of that, it's titled "The Best .. I've Ever Seen" and it's his own anecdote. That's up there with Trump's "I have the best brain." crap. Terrible.

<comment><USER7> > _it 's titled "The Best .. I've Ever Seen" and it's his own anecdote_

Obviously "the best (his) ever seen" would be "his own anecdote". How else could it be?

<comment><USER6> What? First of all, ignoring the semantic argument of whether saying you've "seen" your own anecdote is proper; if you refer to yourself as the best ever for anything you better be world champion class at that thing or you're either a liar or really ignorant.

Based on the anecdote, the author one of the last two.

</comment></comment></comment></comment><comment><USER8> > Actually. You know what? Just this week I shipped ten new boxes of these > pens to Elon Musk's office.

An example of sales people having no issue with casually slipping in outright lies?

<comment><USER9> Elon Musk sells luxury cars to people who are aware of climate change and also love technology. He uses that money to build more and cheaper cars, moving towards mainstream, because existing car manufacturers didn't really move toward electric. Elon Musk solves a problem for his buyers. It's frustrating to see his name used in a sales pitch that is driven by a "Vitamins" approach rather than a "Painkiller" approach. Fighting climate change isn't optional.

</comment></comment><comment><USER10> Pretty sure the most common answer to "When was the last time you used a pen?" is "I don't remember.". Then what?

<comment><USER11> Then you don't get to write a blog post on how awesome and smart you are.

<comment><USER12> Sure you do. Only the details change.

</comment></comment></comment><comment><USER13> The page is not loading. 25 years ago, a response could be: you don't need a pen, you need a 3000 USD IBM-compatible PC! :-)

<comment><USER14> I was kind of hoping for a response where they talked the pen up a bit, gave the interviewer the pen, then used the gained social capital to get the interviewer to listen to their real pitch (ie. why you should hire me.)

</comment></comment><comment><USER15> This is a lovely anecdote, but it's largely irrelevant to modern sales. There's no margin in consumer goods to sell directly any more. The cost of each sale would be too high[1]. If it was an enterprise product the person buying only really cares whether it works better than the competitor product and how much it costs, so a personal approach is a waste of time (beyond getting the customer to talk to you in the first place).

[1] Every sale would end with "What a brilliant pen. You've made it sound incredible. But I won't buy it right now; I'll check the price on Amazon when I get home."

<comment><USER16> The fundamentals of sales are the same whether you're selling pens or $10m enterprise widgets -- you need to understand the customer and the product and how to fit the two together. It also applies in marketing, a closely related field -- you have to understand the needs of abstract groups of customers, and how pitch your product to those groups.

The pen is just a simple object to arrange a quick role play around.

</comment></comment><comment><USER17> Looks like Senator Club's Wordpress wasn't expecting to get hit quite so hard. I don't suppose anyone has the text/transcript of this to hand?

<comment><USER18> [http://archive.is/UJ2fK](http://archive.is/UJ2fK)

<comment><USER19> This archive link retains the images and formatting properly

</comment></comment></comment><comment><USER20> Cool but... I read the entire article expecting a really good answer.

</comment><comment><USER21> When they ask this question, what kind of pen is it? The author's pitch compares against a cheap Bic (which I imagine is something like this [1]), so I assume it is usually something fancier and/or more expensive, but are we talking a Uni-ball micro roller [2] level of fancier, or a Montblanc Meisterstück Moon Pearl LeGrand Rollerball [3] level of fancier?

PS: so, what pens do other HN readers use? I used to use the Uni-ball micro roller pens, but I've since switched to the Pilot G2 gel roller with the ultra fine (0.38mm) tip. I switched for the ultra fine tip, which makes superscripts and subscripts easier. There are Uni-balls with ultra fine tips, but last time I bought a few boxes of pens they were harder to find.

For pencils, I use a Uni-ball Kuro Toga [4]. It has a clever mechanism that slightly rotates the lead every time you put tip to paper, so that it wears evenly from all sides, keeping the look and feel uniform throughout your writing. Here's a video showing how it works [5].

[1] [https://www.amazon.com/BIC-Cristal-Stic-Medium- Point/dp/B000...](https://www.amazon.com/BIC-Cristal-Stic-Medium- Point/dp/B000F2RGSW/)

[2] [https://www.amazon.com/dp/B00006IE8R/](https://www.amazon.com/dp/B00006IE8R/)

[3] [https://www.amazon.com/Montblanc-111694-Pearl-LeGrand- Roller...](https://www.amazon.com/Montblanc-111694-Pearl-LeGrand- Rollerball/dp/B01N4F4482/)

[4] [https://www.amazon.com/uni-ball-KuruToga-Mechanical- Pencil-0...](https://www.amazon.com/uni-ball-KuruToga-Mechanical- Pencil-0-5mm/dp/B0026ICM1E)

[5] [https://www.youtube.com/watch?v=80k7Jl1o8Lc](https://www.youtube.com/watch?v=80k7Jl1o8Lc)

<comment><USER22> I use a Zebra 402 0.7mm

Compared to kids these days, I used to write a _lot_ in high school and college and the only memorable pen in terms of comfort, color and thickness that stood out was the Zebra. I write much less now and mostly use it for quick notes and back of envelope schematics.

My #2 choice would be a Parker Jotter ballpoint, which is quite similar in form and weight.

I absolutely hate gelpoints and any other sort of gel pens.

</comment></comment><comment><USER23> Seriously? All he managed to sell was the aesthetics feel. It's like selling email marketing software solely for the design. How about selling a pen by pitching the frustrations it solves? Pens get lost. Pens stop working randomly. Pens finish without much of a warning. If you're using it after a while, you have to rummage for a paper to scribble before you use it.

It's hard to recall any pen which solves any of these. So, in the end, selling a pen becomes a marketing problem, not a sales problem.

<comment><USER24> I have a clear fountain pen. It solves most of the issues. It can still get lost, but because it's more expensive than a disposable I'm more careful with it. If it stops working it's probably clogged, the nib is easy enough to wipe off to clear the clog. If it's really bad an alcohol swab might be needed. It's clear, I can see the ink level. The "scribble before use" thing is because ink on the ball dries out. Not so much an issue when there's no ball.

And of course there's the classic issue of people stealing your pen, but most people don't know the technique to write with a fountain pen so it rarely gets borrowed.

</comment></comment><comment><USER25> > Sell me this pen

You don't need a new pen, sorry for wasting your time.

</comment><comment><USER26> The page asks for a captcha. Here is a copy [http://archive.is/UJ2fK](http://archive.is/UJ2fK)

</comment><comment><USER27> Coincidentally I wrote about this same subject this week. But I went a step further than that. It's not about the pen.

[http://www.akitaonrails.com/2017/06/01/conference-talks- inte...](http://www.akitaonrails.com/2017/06/01/conference-talks-interviews- and-the-pen)

</comment><comment><USER28> This is a limp answer, he seems to be selling _another pen_ , not the one in his hands. After all, if it's really important what pen you use to sign contracts, why would the one on the desk suffice? Why not get a beautiful bimetal nib fountain pen with navy ink?

<comment><USER29> > This is a limp answer, he seems to be selling another pen, not the one in > his hands.

This answer is not enough "out of the box".

> Why not get a beautiful bimetal nib fountain pen with navy ink?

This answer is too much "out of the box" for most CEO's.

<comment><USER28> That's what I mean, he starts by saying that it matters what type of pen is used, which is why I say "why not", as in, if you're going to tell me I need an _important person 's pen_, why stop at the pen I already have?

</comment></comment></comment><comment><USER9> Sales, then and now, 10-minutes exercise comparing two links. How we approach sales in innovation and startups has changed a lot recently, but not for everyone. Enter the "sell me this pen" as seen in "Wolf of Wallstreet". It's a sales classic. You inspire desire in your customer in your sales pitch, and quickly he wants to buy, at any price. I frequently talk to startups about sales, but coming from a product management perspective.

The closest thing to selling in strategic product management is "solution selling". As the name suggests, it's about identifying a problem the customer actually has, then understanding how big the problem is. So when talking to the sales people at startups, we talk about pricing, job-to-be-done, and unmet needs of the customers. What kind of product do you have, in the eyes of your customers? Is it a nice thing to have once the customer learns about its existence, a "Vitamin"? Or is it something the customer really needs, a solution to an existing problem, something the customer already needed before he learned that there is a solution to the problem, is it a "Painkiller"?

If your product is still a Vitamin, it will be hard to sell, you will see a lot customer churn, customers quitting soon, instead of staying for the long run, and no recommending of your product to other people in the industry. To transform your product from a Vitamin to a Painkiller, you need to understand your customer's pain point. That's very close to S-P-I, "situation", "problem", "implication" in the SPIN-selling system that we use in solution selling.

Do this little test: Read a very short description about Vitamin vs Painkiller, and then read through a sales pitch (which is described as "the best" by its author) and note which parts are addressing a need for a Painkiller, and which address the wish for a Vitamin.

\- Intro Vitamin vs Painkiller: [https://www.entrepreneur.com/article/230736](https://www.entrepreneur.com/article/230736)

\- "Sell me this pen" sales pitch: [https://www.linkedin.com/pulse/best- answer-sell-me-pen-i-hav...](https://www.linkedin.com/pulse/best-answer-sell- me-pen-i-have-ever-seen-prashant-dedhia)

When you compare those two, you will see that the "sell me this pen" pitch is based on a Vitamin product. Most pens are Vitamin products to most customers, no matter how brilliant your sales pitch is. You can't use sales skills to fix a lack of product management.

<comment><USER16> The examples given for "vitamin" and "painkiller" are poor, or at lease not describing differences in products, but in marketing strategy. Also, the idea that "vitamins" are poor product is betrayed by the success of many, many madly successful "vitamin" products, not least including literal vitamins.

The product-load-feature that is described in the entrepreneur.com article as a "vitamin" mere seems poorly marketed. Keeping your e-business platform up- to-date with your products is very much something that can raise revenue or lower costs (or, if not, it's not actually a product at all, vitamin or not). On the other example, the healthcare payments solution, why would you _not_ expect the provider of the existing invoicing solution to "just" enable some sort of upfront payment to lower bed debts, if this is really a problem?

(Also, dismissing business ideas on the basis that someone else would already be doing it if it's actually a problem seems to be a great way to never be successful in business)

<comment><USER9> When you look at how the actual vitamins are marketed in many countries, you discover it's not so rare people claim it is actually a painkiller: [http://www.economist.com/news/business/21665064-despite- scan...](http://www.economist.com/news/business/21665064-despite-scandals-and- scepticism-americas-supplement-industry-looks-healthy-miracle-healers)

<comment><USER30> Well, if you compare with what used to pass for health scams, it's quite a good deal :

[https://en.wikipedia.org/wiki/File:Radithor_bottle_(25799475...](https://en.wikipedia.org/wiki/File:Radithor_bottle_\(25799475341\).jpg)

These were outlawed when, after being marketed as improving male libido, someone drank 1400 of these and died. But he did not die before getting a horribly disfigured jaw that actually fell out before the eyes of the doctor. He was buried in a lead lined coffin, after an agonizing death.

I must say I am a bit worried about "poly-unsaturated fats", which I must say I'd be amazed if they weren't bad for you (they result in a great many secondary chemicals, and if just one of those is dangerous, ...), but I doubt they'll make anyone's jaw fall off before slowly and painfully killing them.

</comment></comment></comment></comment><comment><USER31> Link not working. Responds with 500 (Internal Server Error).

<comment><USER32> Read the other comments here - there are multiple links to cached versions.</comment></comment>


San Bernardino iPhone Password Changed While in US Government Possession - <AUTHOR> http://www.usatoday.com/story/tech/2016/02/19/iphone-passcode-changed-government-possession/80632962/ <comment><AUTHOR> Page 18, footnote 7 of the government brief seems to explain this better [http://www.politico.com/f/?id=00000152-fae6-d7cd- af53-fafe53...](http://www.politico.com/f/?id=00000152-fae6-d7cd- af53-fafe53bb0002)

Edit- the title of this article is possibly misleading, it appears to be the iCloud password (not phone passcode) that was reset, which rules out the possibility of getting the phone to automatically back itself up while locked in a known wifi network.

<comment><USER2> This footnote says that the owner of the phone reset the password remotely after the attack. The USA Today article says who reset the password is not clears. What accounts for this contradiction?

<comment><AUTHOR> The "owner" in that paragraph seems to be local San Beradino government</comment></comment></comment>


Cache-optimizing a priority queue - <AUTHOR> http://playfulprogramming.blogspot.com/2015/08/cache-optimizing-priority-queue.html

<comment><USER2> There is a well-known memory layout technique for a cache-oblivious tree called van Emde Boas layout.

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

</comment><comment><USER3> On a related note, the source code for Python demonstrates a practical way to cache-optimize the heapify() operation for the garden-variety heap implementation of a priority queue:

[https://hg.python.org/cpython/file/6fd69aeb8a3b/Modules/_hea...](https://hg.python.org/cpython/file/6fd69aeb8a3b/Modules/_heapqmodule.c#l272)</comment>


Spaghetti Sort (2018) - <AUTHOR> https://advent.morr.cc/2018/15 <comment><USER2> My favorite "analog computer" example is finding the balance point of a broom or mop.

Start by holding the broom horizontally (so that the shaft is parallel to the floor) and support it between the thumb and fingers of each hand with your hands held about a meter apart. The palms of your hands should be facing each other, fingers and thumb flat in vertical plane, with the thumbs sticking out to make cradles for the broomstick.

         side view

              ////
          /\o////
          \    /
           \  /

Once it's set up, all you do is gently bring your hands towards each other until they are touching, palm to palm. The broom will remain balanced on your hands the entire time.

As you draw your hands together there will be an unequal amount of friction between the broomstick and each hand. The side that is further from the center of mass of the broom will have less friction. The side with less friction will slide. This changes the weight distribution between your two hands until the friction on the sliding hand has increased [enough] past the friction on the non-sliding hand. When that happens, the sliding hand stops sliding and the non-sliding hand starts sliding. The process alternates from hand to hand until, at the end, your hands are touching and the center of mass of the broomstick is [close enough to exactly] between them.

\- - - -

Derp, it's on the youtube: [https://www.youtube.com/watch?v=B4axmjVFsK8](https://www.youtube.com/watch?v=B4axmjVFsK8)

Stephen Fry...

</comment><comment><USER3> This reminds me of my favorite joke algorithm, sleepsort[0]. A trivial implementation looks like this:

        #!/bin/bash
        for int in $@; do  # input must be a list of positive integers
            (sleep $int; echo $int) &
        done; wait

I'm not quite sure how to describe it in terms of big O notation.

[0] [https://rosettacode.org/wiki/Sorting_algorithms/Sleep_sort](https://rosettacode.org/wiki/Sorting_algorithms/Sleep_sort)

<comment><USER4> It should remind you of sleep sort, because spaghetti sort is the spatial version of sleep sort.

For sleep sort, the time taken is a constant function of the size of the list; it only depends on the value of the maximum element of the list. T = max(list) + smaller terms associated with scheduling timeouts. So, it's O(max(list)). Although, the "smaller terms" I'm ignoring blow up when the size of the list exceeds your computer's resources. I'd guess that spaghetti-sort is O(sum(list)).

<comment><USER3> Aha so a sleep sort is translating the operation into the time domain In essentially the same way that spaghetti sort translates into the spatial domain! Thank you.

</comment></comment></comment><comment><USER5> Linear time O(n) means that as you keep adding numbers to sort, the time taken is bounded by a linear function of how many numbers you have. Since there is an upper bound on the number of spaghetti strands you can hold in your hand, eventually you need to "Slam their lower sides on the table" in batches, and then merge sort the results. However because unlike in merge sort there is an upper bound on the size of the sub lists you use spaghetti sort will actually be O(n^2) instead of O(n log(n)).

If you ignore the usual meaning of linear time and restrict yourself to sorting lists of numbers that will fit in your hand, then spaghetti sort always runs in less time that however long it takes to sort the maximum amount of spaghetti you can hold in your hand. i.e. constant time.

<comment><USER6> You can replace the hand with any device that holds the spaghetti. This really is an O(n) algorithm.

Spaghetti sort seems to be an analogue variant of radix sort.

<comment><USER7> I suppose one could add a step 0 to the algorithm:

0: Manufacture a pair of hands big enough to hold all the spaghetti you'll need in the later steps.

Does this step take linear time as well?

<comment><USER6> Does it take O(n) time to manufacture computer memory? I don't know, but it doesn't affect the runtime of algorithms.

<comment><USER7> But many sorting algorithms work in-place, so they don't require extra memory beyond a small O(1) or O(log n) amount for bookkeeping.

When algorithms do require extra memory, they state this requirement as the space complexity.

</comment></comment></comment></comment></comment><comment><USER8> As an exercise, when could spaghetti sort beat computers?

As others have mentioned, your hand can only hold so much pasta (about 10^2). For n=10^2, a computer will easily win. So I'll need to abuse logic a bit...

Let's assume \- The hand is large enough to hold all the pasta. \- The linear time operations take about 1 second total (breaking, removing, transcribing).

Benchmarks[1] for sorting show TencentSort (which looks like it's based on a O(n _log(n)) merge sort[2]?) can sort 100TB in 100 seconds, for 100 byte records. So about 10^12 records /minute.

      c*(n*log(n))=time
      n=10^12
      time=1min
      c~=1/10^12 minute

(assume log base 2)

Solving:

      (1/10^12)*n*log(n)=n
      (1/10^12)*log(n)=1
      log(n)=10^12
      log(n)=1,000,000,000,000
      n=2^1,000,000,000,000

How big is that?

A piece of spaghetti is about 1 gram. 2^1,000,000,000,000 grams is significantly larger than the mass of the observable universe. (10^56 grams, or 2^186 grams).

How long is that?

2^56 seconds is the age of the universe.

Intuitively, this sort of makes sense. For extremely large values of n, log(n) is dwarfed by n so much that it looks like just n. A computer performing a single step of the sort operation is several orders of magnitude faster than any of the human operations. It takes insanely long, and an insanely large n for spaghetti sort to catch up.

[1] [https://sortbenchmark.org/](https://sortbenchmark.org/) [2] [http://sortbenchmark.org/TencentSort2016.pdf](http://sortbenchmark.org/TencentSort2016.pdf)

</comment><comment><USER9> Sometimes it might not be possible to easily determine which is the longest piece. For inctance if the pieces are on opposite sides ov the bundle, and are very close in height.

Also, if you have lots of tiny pieces, and some longer pieces, the bundle won't form a nice column. You'd have to have a minimum length to help form the bundle, then add your number to that minimum length.

It seems so strange to me that there are so many algorithms that our brains use, that we don't fully understand yet. I self reflect all the time about my own decision making, and the way I see, hear, think, and remember. We all do these things, but what are the underlying algorithms? What data is being stored, how is it represented, and how is it being compared, manipulated, and updated?

</comment><comment><USER10> Isn't there also another IRL sorting algorithm that works with beads and gravity?

EDIT: I thought couldn't remember the name, turns out it's actually _bead sort_ aka _gravity sort_. Sometimes things are as simple as they seem.

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

</comment><comment><USER11> I believe the worst-case asymptotic time complexity of spaghetti sort is O(n^2).

The algorithm works for any input list, so I will pick a hard class of inputs: The list shall be some permutation of [1, 2, 3, ..., n].

The sum of the spaghetti lengths is 1+2+3+...+n, which is in O(n^2). You need to spend O(n^2) effort to gather the flour to make the spaghetti. Hence this sets a lower bound on the overall algorithm.

</comment><comment><USER12> I was thinking about how this (and other "physical sorts" mentioned by commenters) sorts instantly by using a physical property of the members, and I began to consider what the computer equivalent would be of "physical sorting".

I think you could take the sort values, use them as memory addresses (or array offsets), and write the original index of each value into its corresponding pointer, then go back and iterate through that entire chunk of memory to find each of them. That might technically be linear time? Really N + M, where N is the number of values and M is their full range. It would have hilariously inefficient usage of memory and a pretty low cap on the range of possible sort values, but still.

<comment><USER13> This is basically a 1-deep radix sort, where each memory location is a bucket.

</comment></comment><comment><USER14> Also notable as likely the only known sort algorithm that's prone to breaking the items being sorted.

</comment><comment><USER15> This reminds me of an algo to find the 2 points farthest away in a graph.

Imagine the graph is drawn on an handkerchief. Pick any vertex of the graph and let the handkerchief "fall" around it.

Now, with your other hand, pick the point which is the lowest (farthest away from the one in your hand). The handkerchief falls again around that new point.

Again, with your other hand pick the point which is the lowest. The two points in your hands are those farthest away.

(didn't find the reference of this algo, so it may be wrong; just correct me if it is)

<comment><USER16> Your algorithm doesn't really work for graphs - it actually treats the vertices as a set of points (the edges are not taken into account, you're just looking for the largest Euclidean distance between two points).

Unforunately, it is not correct even then. Here is a counterexample:

        A
        |
      B-C-D

You have points laid out like this, and: AC > CD=BC, AD=AB < BD. If you start from point C, you will pick A as the lowest point, then B/D, giving you the pair AB/AD as the result. The correct result is BD.

Was fun to think about, though!

<comment><USER17> Are you supposed to keep going until you go back to the same pair? So you would go C, A, B, D, B?

</comment></comment></comment><comment><USER18> This is silly. The linear parts are just I/O, and the actual sorting happens in constant time by magic.

<comment><USER19> The sorting doesn't happen in constant time. The actual sort happens by hand as you take out the largest pieces first. Until you do that, they aren't in linear order.

<comment><USER20> They are linear in order – from the top. The final step is simply reformatting the results.

<comment><USER21> They're not in order, they're just in a data structure where the largest remaining element can be extracted in O(1) time. One can't say anything useful about any other elements of the list.

<comment><USER16> It's fun to think about: you have a structure which allows you to iterate all elements in order in O(n) time. Isn't this in many ways equivalent to the structure being "sorted", even if it doesn't have all the properties of a sorted array (like being able to get the nth element in O(1))?

For example, a sorted linked list behaves almost exactly like this spaghetti column.

<comment><USER22> Interesting remark. So, a "data structure where the largest remaining element can be extracted in O(1) time" can be turned into a sorted list in O(n) time.

So, under the assumtions, the overall algorithm does complete in constant time.

</comment></comment></comment></comment></comment></comment><comment><USER23> I loved the original article in Sci-Am. I believe there were at least two articles on these "analog gadgets".

Found one: [http://www.softouch.on.ca/kb/data/Scan-130202-0003.pdf](http://www.softouch.on.ca/kb/data/Scan-130202-0003.pdf)

Also: [http://dataphys.org/list/dewdneys-analog- gadgets/](http://dataphys.org/list/dewdneys-analog-gadgets/)

</comment><comment><USER24> Related: One of my favorite realizations back in college was that insertion sort in real life is an optimal sort. The inefficiency in computers is that you need to slide all of the values down a place one by one as you insert numbers. In real life, the values just get shoved down in parallel.

Helped me understand why people default to such an inefficient algorithm when learning about sorting.

<comment><USER25> Sorry mate but that's just plain wrong... What takes quadratic time in insertion sort is not the insertions but all the comparisons. Otherwise we'd have linear time sort using linked lists.

<comment><USER26> Probably depends what you're doing with it, physically, but if you were running insertion sort manually it'd be very intuitive to do something like binary search to find the correct insertion point. That would make it O(n lg n).

</comment></comment></comment><comment><USER27> Has someone calculated at what n I will sort faster than my PC?

<comment><USER28> Pretty big. You're comparing quicksort at O(n log n) to hand at O(n). A computer is about a billion times faster per operation, so log n = 1 billion, or n = 2^billion.

<comment><USER29> Hey, but you don't need to do it by hand, you can simulate physics of spaghetti, right? :)

<comment><USER22> Reminds me how you can compute pi in a hilariously inefficient yet very interesting way with a physics engine by counting collision of 3 blocks bouncing with one another: [https://youtu.be/HEfHFsfGXjs](https://youtu.be/HEfHFsfGXjs)

</comment></comment></comment></comment><comment><USER30> Reminds me of Dijkstra's algorithm explained with threads and beads. The nodes are represented by beads and the weighted edges are represented by threads between the beads with lengths equal to the weights of the corresponding edges. You put down all the beads on a table close to each other and you start lifting up one of the beads. The order the beads leaving the table is the same as the order of visited nodes in Dijkstra's algorithm.

</comment><comment><USER31> So radix sort IRL.</comment>


Benevolent sexism: Men who open doors for women as sexist as those who are rude - <AUTHOR> http://news.nationalpost.com/2015/03/11/benevolent-sexism-men-who-open-doors-for-women-can-be-as-sexist-as-those-who-are-rude-to-them-study-finds/

<comment><USER2> Full paper is here:

[http://link.springer.com/article/10.1007/s11199-015-0451-7/f...](http://link.springer.com/article/10.1007/s11199-015-0451-7/fulltext.html)

It doesn't really draw the sensationalist conclusions that the media is claiming.

<comment><AUTHOR> As is always the case when the media writes about a scientific paper it seems.

</comment></comment><comment><USER3> Having manners and tact are now things that can get you grouped with the same animals that you are trying to distance humanity from. Well one step closer to idiocracy...</comment>


Apple's Radical MacBook Pro Will Supercharge Windows 10 - <AUTHOR> https://www.forbes.com/sites/ewanspence/2020/07/04/apple-macbook-pro-macos-bigsur-arm-intel-microsoft-windows-10/#5091f31d1aa8 <comment><USER2> I guess I'm missing something because I don't see how Windows 10 on Mac+ARM is ever going to happen.

\- Will it even boot Windows (or any non-Mac OS. I suppose someone will write Linux support eventually.) ?

\- Custom Apple GPU. Apple is not going to write drivers for Windows for it. Microsoft certainly will not.

\- x86 only emulation. What are these 32-bit Windows apps (Other than visual studio, maybe by developers) that are widely used by Mac owners ? Games ? See GPU above.

I personally think this marks a permanent split of Mac and PC.

Would love to hear other takes.

<comment> yjftsjthsd-h > Will it even boot Windows (or any non-Mac OS. I suppose someone will write > Linux support eventually.) ?

If other operating systems are allowed, then there's no reason that Windows can't work; it runs on ARM - consider that [https://www.windowslatest.com/2019/03/08/windows-10-arm- nint...](https://www.windowslatest.com/2019/03/08/windows-10-arm-nintendo- switch-boot/) exists! Granted, drivers are an issue; if Apple decides to support this, then I expect them to either straight up write the drivers, or release enough information for someone else to do it.

If, on the other hand, other systems are not allowed by policy, there is very little chance that Linux or anything else will be an option. That would be more like an iPad; sometimes jailbreaks happen, but it's generally "protected" against execution that Apple didn't approve.

</comment></comment><comment><USER3> Alternative link: [http://archive.today/HOM6E](http://archive.today/HOM6E)

</comment><comment><USER4> I expect Intel will start producing ARM chips if the market heads that way. Consumers couldn't care less.</comment>


The Open Wireless movement - <AUTHOR> https://openwireless.org/ <comment><USER2> I can't see the huge German Freifunk movement in the list of supporting organizations. Does anyone know why?</comment>


Ask HN: What laptop should I get with a $2,500 budget? - <AUTHOR>

I am mostly doing software development (Salesforce, Java, PHP, etc). My current laptop (3rd gen Intel + 16GB RAM + 1TB HD)  has Windows but I mostly work inside a Linux VM (Xfce Mint 64). People tell me to move to Mac (terminal + a GUI that just works). Nevertheless, I don't want to buy Mac specific hardware (Ex. Mouse, keyboard, screen) and I like being able to download software and use it without having to pay (I contribute to OS with my own OS software).<p>Should I move to Mac or just buy a good Win Laptop (Ex. Razer Blade) and place a good linux distro in it? Thanks for your comments :) <comment><USER2> If you mostly work inside a Linux VM, I see no reason for you to get a Windows machine.

I'd recommend a nice customized Macbook. You can probably get away with using your current hardware with it (definitely your mouse, you're probably going to need an adapter for your monitor, dunno about the keyboard). The "just works" factor might not sound like much for people that have never worked on a Mac before, but it goes a long way productivity wise. You'll definitely appreciate it over getting a good Windows machine and installing a Linux distro on it, which if you don't plan appropriately can have a whole host of driver and setup issues.

<comment><AUTHOR> Correct me if I am wrong, but using a Windows keyboard with a Mac, although possible, may not be the best user experience. Also, I have seen that people use a lot of "gestures" on Mac OS. Using a regular mouse may not allow you to do the same and you may endup losing "some" of the productivity edge.

</comment></comment><comment><USER3> I would put down a list of hardware requirements: CPU, Memory, Disk (speed/size), screen, connectivity.

wrt Mac: It just works and most of your unix tools are there. You might still need a VM depending on the task as OS X is not Linux.

My current setup (around 2,500$): mbp 13' retina, 16g ram, 256g SSD. Asus PB278Q, CM quickfire keyboard, apple mouse

I would also consider Dell XPS 13, although it is at the same price range as mbp retina.

<comment><AUTHOR> On my present machine, I am using 16GB of RAM and a 1TB disc. I would say my next machine will need at least the same 16GB of RAM (Dell XPS 13 won't do because of this) and I could use less HD space to get a fast SSD. About CPU, I don't think the 3rd gen i7 I am using right now is a bottleneck at all. So most probably, a 5th generation wouldn't hurt either. About the screen, I have been trying to avoid HD screens if only because lots of programs look awful (or too small) on them. Also, linux does not provide good support for them yet.</comment></comment>


For Today's Graduate, Just One Word: Statistics - <AUTHOR> http://www.nytimes.com/2009/08/06/technology/06stats.html

<comment><USER2> This is a question I've been meaning to ask on here, but didn't think it warranted its own "Ask HN": What's the best way for someone with an otherwise decent math background, but no statistics, to get started on the topic? Any particular books, websites, etc that people recommend?

<comment><USER3> The key is to come up with a well-formulated question, such as "I wonder if I can predict stock trends." Then in doing so, you'll search the web and come across predictive modeling, which will lead to machine learning techniques, which will lead to good resources. Within those machine learning sources, search for chapters on prediction and classification, and you'll come across regression techniques, support vector machines, relevance vector machines, etc. Then you'll wonder, "ok, how do I actually solve this problem" so you may search for "SVM implementations" and find Steve Gunn's for Matlab for example. Then after much codebanging, you'll realize that inorder to solve this problem, you need a good dataset, so you go to Yahoo finance and see if you can download some data for IBM.

This is usually the process one needs to follow, albeit with some intermediate steps switched out for others here and there.

<comment><USER4> it seems like if he did that, he'd be biting off WAY more than he can chew at the present time.

If you want to learn statistics, it's probably better to start at the beginning (_Cartoon Guide to Statistics_, O'Reilly's new _Head First Statistics_, or Huff's _How to Lie With Statistics_) than to leap headlong into a huge, mostly intractable problem and pagefault in knowledge at each point you come across something you don't know how to do.

<comment><USER3> I agree, but at the same time, you only learn by doing. In my experience, even when you dive in way over your head, you tend to pick up the information rather quickly. I took a machine learning class with no statistics background and after a few weeks of floundering and learning terminology I was fine. The benefit of forming a problem first gives you an ultimate goal of which to work towards.

Don't tell Google that it's slogan ("Organize the world's information") is biting off more than it could chew.

<comment><USER4> _I agree, but at the same time, you only learn by doing._

This is true, but I think in the original poster's case it could be much more easily and reliably be accomplished by continually giving him problems that are within (or more ideally, _just_ outside) his circle of competence, rather than a problem like "predict stock prices" which isn't in _any_ human being's circle of competence. Moreover, with the latter problem, he'll get virtually no feedback as to whether his answer was correct, because a correct answer for "use statistics to predict stock prices" doesn't exist. Odds are that if he follows that path he'll quit before making any progress, or at the least he won't be able to close the feedback loop that is so vital to gaining expertise.

I think that if he's starting from ground zero and wanting to learn statistics, he'd be much better served by sitting down with The Cartoon Guide to Statistics and a deck of cards and set of dice first. He can work his way up to conquering the stock market :)

 _Don't tell Google that it's slogan ("Organize the world's information") is biting off more than it could chew._

I think that's apples and oranges - he's trying to learn statistics, not trying to convince potential clients or investors that he's already an expert. I don't think it would be harmful at all for him to have a lofty, far-out goal like "predict stock prices" to aim toward, but I do think that if he starts out trying to learn statistics by typing "statistical stock prediction methods" into Google, he will burn out rather quickly. Pagefaulting in knowledge when you need it is probably optimal for something where you just want to make sure your knowledge is passable, but if he wants to truly know his domain, he's gotta get out the marbles and urns. :)

</comment></comment></comment></comment></comment><comment><USER5> I completely agree. Statistics is what I most wish I had studied more intensely in school. And not just so I wouldn't have those poor marks on my transcript.

<comment><USER6> Well, school may be over, but life is not :-)

</comment></comment><comment><USER7> Stephen Baker's book, the Numerati, covers what data geeks are doing with stats, data mining, semantic analysis, machine learning...

Here's a link to some of his talks on the subject: <http://thenumerati.net/index.cfm?catID=4>

<comment><USER8> I have some background with machine learning and I'm reading this book now. It doesn't seem like way a good way to learn much about applied statistics, but it does a good job of illustrating how data mining impacts people's daily lives.

There's an "aren't you shocked that they're gathering all of this data?!" tone that gets old as the book goes on, but it's generally a good read. He even describes some of the major algorithms (support vector machines and clustering) in layman's terms.

<comment><USER9> SVM's and clustering are AWESOME. My housemate uses both to analyse EEG data and his classifiers are absolutely amazing. Looks like his work may end up being used by the european space agency too.

</comment></comment></comment><comment><USER10> Or, instead of statistics, you could study it's sister field: Machine Learning.

Robert Tibsharani provides the following comparative glossary for machine learning and statistics: [http://anyall.org/blog/2008/12/statistics-vs- machine-learnin...](http://anyall.org/blog/2008/12/statistics-vs-machine- learning-fight/)

                            Glossary

      Machine learning              Statistics
      network, graphs               model
      weights                       parameters
      learning                      fitting
      generalization                test set performance
      supervised learning           regression/classification
      unsupervised learning         density estimation, clustering
      large grant = $1,000,000      large grant= $50,000
      nice place to have a meeting: nice place to have a meeting:
      Snowbird, Utah, French Alps   Las Vegas in August

</comment><comment><USER11> So, for those of us who have mostly forgotten math that doesn't get used regularly, what's a good way to get an overview of at least what's _possible_ , and where it's applicable? Enough to get an idea of what to go study in further detail in order to accomplish something, or at least ask for help/hire someone.

<comment><AUTHOR> <http://www.mrderksen.com/textbooks.htm>

These books have good indexes leading to statistics issues in particular fields of research or applications.

</comment></comment><comment><USER12> this article make statustics really cool, i want to learn it now, anyone know how hard could it be?

</comment><comment><USER13> Just like: Plastics

Of course, should add the obligatory remark: Lies, Damn Lies and Statistics.

<comment><USER14> I was worried that nobody else here would get the reference. Whew!

</comment></comment><comment><USER15> Anyone who wasn't registered keep getting pushed off the site? F-that.

<comment><USER16> Just google for name of the article go to the site from this point. Site never blocks traffic from search engines :)

</comment></comment><comment><USER17> Gotta love the T-shirt...</comment>


Kotlin: A New Hope in a Java 6 Wasteland - <AUTHOR> https://realm.io/news/droidcon-michael-pardo-kotlin/ <comment><USER2> I haven't worked with Android or Java that much, but I tried out Kotlin a few months ago, and my impression was that it takes Java from several steps behind C# to several steps ahead as far as being a high-quality, efficient strongly- typed language. I also liked how simple it seemed to be to get it going on Android.

The only downside is that it seems to be immature and not very widely adopted yet, but at least it has a strong backer in Jetbrains.

I would like to hear what people with more experience in the Java world think of it versus other alternate JVM languages.

<comment><USER3> It feels to me like a better Java, but still very limited compared to Scala. It stays very much in Java's paradigm.

So while Scala doesn't have to fear Java's evolutions, Kotlin seems to be risking obsolescence when Java gets good enough - and it's already happening with Java 8. Just look at the article: they talk about Kotlin as a good language for people stuck with Java 6.

<comment><USER4> > but still very limited compared to Scala.

The fact that Kotlin has fewer features than Scala is what makes it appealing to me.

Scala has become a kitchen sink with too many features, it's kind of the C++ of the 21st century in that respect.

<comment><USER5> I'm a Scala developer and personally I believe that such claims are unwarranted, mostly coming from beginners with a superficial understanding of the language. Not only is Scala not a kitchen sink, but it actually cuts down on Java features that were a bad idea.

This misunderstanding mostly happens because some people start learning Scala in the hope of finding a better Java. But Scala is not a Java++, but something else entirely, being the kind of language that makes sense outside the boundaries of the JVM.

As a piece of advice, if you aren't interested in trolling, you might want to name actual things that you don't like, as in things that you can talk about, instead of things that are non-falsifiable. That way, in case you have a point, then other people or even Scala's or Kotlin's language designers can learn from your feedback. And if you don't have a point, then you might get some useful piece of advice.

On Kotlin - I don't like that it doesn't diverge enough. This is because when picking a non-mainstream language, you lose the advantages of mainstream languages, like easily available documentation, copy/paste-able samples, big developers pool, etc, etc... so the advantages of the non-mainstream language would better be worth it to balance the disadvantages ;-)

<comment><USER6> C++'s goal was to introduce a newly popular paradigm (oop) on top of an existing rich ecosystem (c). Scala's goal was to introduce a newly popular paradigm (fp) on top of an existing rich ecosystem (java). They both suffer from poor tooling, long compile times, and feature bloat with several predominant styles of writing it.

To dismiss the similarities is disingenuous.

<comment><USER5> Yeah, both are programming languages. Objective-C was also built on top of C, with the same original purpose as C++, yet you couldn't find two other mainstream languages that differ so much.

I can't really answer to your argument because it is superficial and there isn't anything in there to answer to. Whenever I ask folks what makes Scala complex or bloated, or what the conflicting " _styles of writing it_ " are there, they always shy away. Because it's easier to be handwavy than it is to construct a good argument.

Unfortunately handwavy arguments are subject to marketing and social forces. This is how people end up worshiping Python's spirit and included batteries, which must be some of the biggest lies in our industry, since I can name more non-orthogonal and half-baked features in Python than in Scala, plus several clusterfucks in its standard library and ecosystem, starting from the build management tools, the async-I/O libraries and the web libraries, all of them screaming anything else but "there is only one way to do it". But that's just the herd mentality in action.

<comment><USER7> If you would like a specific, concrete issue with Scala, I find its documentation to be extremely poor compared to Kotlin.

<comment><USER8> It's easy to say "Kotlin has no projects with poor documentation" when it doesn't have many projects at all. :-)

I think Scala library authors would love some links to those things where you consider the documentation to be lacking.

<comment><USER7> I wasn't talking about projects written in the language, I was talking about the language itself.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> The most important thing about Kotlin is a bit hard to find — it's licensed under the GPL-compatible Apache License 2.0: [https://github.com/JetBrains/kotlin/blob/master/license/LICE...](https://github.com/JetBrains/kotlin/blob/master/license/LICENSE.txt)

Now that I know that, Kotlin looks pretty cool! It proposes solutions to a lot of the most painful problems in Java.

I'm not sure the solutions are always correct, though. When I hear "null safety", I think "pattern matching on a Maybe sum type to statically ensure non-nullness", but what the talk says Kotlin actually provides is pressuring you into writing a bunch of your code in the Maybe monad, thus spreading nullness far and wide. The talk example is "println(a?.length())".

Maybe that's the best pragmatic solution in Kotlin, or maybe the talk oversimplifies what Kotlin actually gives you, but it kind of seems like the wrong direction to go in to me (most of the time!)

<comment><USER2> I think the point isn't the Maybe stuff - Int? - but the non-nullable reference types. In conventional Java, every reference type is always nullable, so there's no way to strictly differentiate between things that couldn't possibly be null, and so don't need checking, and things that have a valid reason for being null, and should be checked and handled properly.

Kotlin allows non-nullable reference types, so you can declare a method as taking a non-nullable reference to an object. Now within that method, you know that reference is never null, and don't need to check it. When you call it, you have to either check for null beforehand, or pass something that is already guaranteed not to be null.

It's kind of like it builds a wall between things that could be null, and things that can't be, instead of having theoretical potential nulls all over your code. When you think about it, it seems like a pretty natural thing for a strongly-typed language to do.

<comment><USER9> I agree that non-nullable reference types are a big advantage. (People who haven't programmed in Java might underestimate how big a problem null pointers are in Java.)

</comment></comment></comment><comment><USER10> > Adding to your Kotlin to your project is pretty easy as now you can just > have it mixed in with Java classes. You'll need to add the gradle plugin to > your build script, apply the Kotlin Android plugin, add your source > directories, and include the standard library.

Wanted to ask for a step-by-step guide for awfully lazy developers, but found one myself. I suppose I'll leave a link here: [http://blog.jetbrains.com/kotlin/2013/08/working-with- kotlin...](http://blog.jetbrains.com/kotlin/2013/08/working-with-kotlin-in- android-studio/) (haven't tried that yet, though)

</comment><comment><USER11> Between Kotlin, Ceylon [1] and Xtend [2], all recent JVM languages that aspire to be an improved Java, which one would you bet to come out on top in the long run?

[1] [http://ceylon-lang.org](http://ceylon-lang.org)

[2] [http://www.eclipse.org/xtend/](http://www.eclipse.org/xtend/)

<comment><USER12> Java 8

<comment><USER13> By default, it's the weakest of the bunch but everyone uses it because everyone else is using it.

</comment></comment></comment><comment><USER14> I love how fast you can get productive in Kotlin. With

[https://github.com/jetbrains/workshop- jb](https://github.com/jetbrains/workshop-jb)

and some glimpses into the documentation you can get productive within a day or two.

It may not be as expressive as Scala but still is a huge improvement over Java (or even Groovy).

</comment><comment><USER15> I like what I see, though there seems to be significant overlap with Scala. Though I suppose Scala has never had much uptake in Android-land.

[http://kotlinlang.org/docs/reference/comparison-to- scala.htm...](http://kotlinlang.org/docs/reference/comparison-to-scala.html)

<comment><USER16> The big issue with Scala on Android is the size of the Scala runtime, which is around 5 MB. Kotlin's is about 900 KB if I recall correctly. I like to see it as a "mini" Scala for Android. Just like Scala, it's a pleasant language to write in.

<comment><USER3> Yes, you pretty much have to use proguard when programming in Scala on Android.

The other problem I had using Scala on Android is that the very nature of the Android SDK forces you to work in a way that is very Java-ish. There are some libraries that try to provide a nice Scala layer on the top of the Android SDK, but it never covers everything so you always end-up writing ugly Javaish Scala code.

<comment><USER16> I faced the same problem with JavaFX. .asScala calls everywhere!

</comment></comment></comment></comment><comment><USER17> How come one can use other modern jvm languages on Android, but not newer Java? E.g., if you can make Android support Kotlin, why cannot Java8 be introduced the same way?

<comment><USER18> Kotlin compiles to jvm 1.6 bytecode, so even though it is a different language it runs the same as Java 6 on the devices.

Supporting Java 8 requires updating the vm & OS, which is difficult to do in the Android ecosystem. It may happen in the future but backwards compatability will be tough since the phone manufacturers lag so badly on platform upgrades. I'm not even getting into the Oracle v Google spat that may slow down adoption of a newer version of Java.

For that reason Kotlin is a lot more viable today than Java 8. Maybe someday Java 8 will make it to Android, but that day is definitely not today. Even after it is released in the newest devices, it probably won't be widespread for 18+ months.

edit: no one should downvote the parent question it is a legit technical ask without an obvious answer.

<comment><USER19> It might be a stupid ask, but: What would it take for Android to start support for a different dev language (being able to write an app in js or Swift for example)? Also, is it never the case that when a new language is released (Java 8 for example) there is usually a strong emphasis on backwards compatibility (compiling into all or a few previous versions' bytecodes)?

<comment><USER20> You can get Java 6 bytecode from a Java 8 compiler but it will fail to compile if you used Java 8 features:

        $ jdk-1.8-64/bin/javac -target 1.6 -source 1.6 LambdaTest.java
        warning: [options] bootstrap class path not set in conjunction with -source 1.6
        LambdaTest.java:16: error: lambda expressions are not supported in -source 1.6
            Runnable r2 = () -> System.out.println("Hello world two!");
                             ^
          (use -source 8 or higher to enable lambda expressions)
        1 error
        1 warning

Trying to heed the error:

        $ jdk-1.8-64/bin/javac -target 1.6 -source 8 LambdaTest.java
        javac: source release 8 requires target release 1.8

</comment></comment></comment></comment><comment><USER21> Kotlin is my favorite JVM language by far, it's like Scala-lite. It has great tools thanks to IntelliJ. It's great how easily you can substitute Kotlin for Java in most projects, doing so with Dropwizard was quite easy: [https://github.com/doomspork/kotlin- dropwizard](https://github.com/doomspork/kotlin-dropwizard)

</comment><comment><USER22> I really didn't understand why they didn't started to work at scala and make it better?!

Like modularize it more so they can have a subset working on Java and make the compiler faster / better / more tooling support.

That would've been better with yet another JVM language. The community is splitting and splitting and still most people think in the same niche, but they always use their different syntax.

I mean kotlin does a lot of things like scala but still tries to be his own language and doesn't use as much fp as scala does. it also uses 'it' instead of '_' not sure why they came to 'it' also the data classes so much work around stuff, thats just aweful.

Hopefully Java will get more functional so that we don't get a too fragmented community.

P.S.: Yes everything has it's place i just dislike whats happening in the it, so that everybody wants to do his own thing instead of working together.

<comment><USER23> Kotlin brings few very clear improvements to Java, while Scala is a completely different language. There is no single "make it better" that would work for both.

> Hopefully Java will get more functional so that we don't get a too > fragmented community.

Java did so much harm to programming community, it basically destroyed reputation of strong static typing as something considered "fun". Maybe it's time to move on, to split into better, more modern, elegant and expressive languages.

<comment><USER8> As we have seen in most milestones, Kotlin is gradually moving closer and closer to Scala, because even they realize that "a slightly better Java" won't cut it in the mid-/long-term.

<comment><USER23> > a slightly better Java

I wouldn't call it "slightly better". It is much, much better. There aren't that much changes to your programming habits or architecture, but improvements which Kotlin brings are huge.

Absence of nulls, type-inference, top-level functions. All this would make a huge difference, not "slight" one.

<comment><USER8> If you consider these things huge, you never looked over the rim of Kotlin's tea cup.

You would be surprised what's out there.

</comment></comment></comment></comment></comment><comment><USER24> Great slides! I hope we'll be able to adopt this style for our introductory materials

</comment><comment><USER25> I just wish there was an officially supported way to get set up with a kotlin- first Android project from the command line. So far the best documentation I've seen is:

[http://kotlinlang.org/docs/tutorials/kotlin- android.html](http://kotlinlang.org/docs/tutorials/kotlin-android.html)

Which a) requires one use the IDE. Maybe not surprising from a company that sells IDEs, but it's not my dream environment. b) Even then, one is asked to manually "replace java kode with kotlin" (with help of a wizard). Couldn't we just get a script/function that'll set up a project targeting the desired Android API level?

It'd be nice if kotlin provided a script/command-line utility that basically allowed the equivalent of:

      android create project -a Main -p hello \
       -k com.example.app
       -t android-15 -g -v 1.3.1
      cd hello/

      # Note that even android sdk is broken,
      # one needs to manually change:
      #
      #  runProguard false
      #
      # to
      #
      #   minifyEnabled false
      #
      # in build.gradle

      gradle build
      # Start emulator (android avd...)
      # possibly (re)start adb server
      #
      adb install ./build/outputs/apk/hello-debug.apk

I'm still figuring out the Android/java command-line/build workflow, but I suppose one _should_ be able to drop the kotlin.jar somewhere, and add something to build.gradle. I've yet to find any documentation how how to do that (official or otherwise).

Am I really the only one that wants a predictable, scriptable environment in which I can both initiate development from scaffolding supported by upstream, and have a reasonable grasp over the entire build process?

I mean, we all want to automate this for Continous Integration, right?

<comment><USER26> Here's the reference for building for Android with Gradle: [http://kotlinlang.org/docs/reference/using- gradle.html#targe...](http://kotlinlang.org/docs/reference/using- gradle.html#targeting-android)

And other build tools: [http://kotlinlang.org/docs/tutorials/build- tools.html](http://kotlinlang.org/docs/tutorials/build-tools.html)

<comment><USER25> Thank you for the reminder, I'd looked at that, and forgot while figuring out why the "android sdk" skeleton didn't work (see note above about manually patching the build-file).

At least now I should be able to get a proper java skeleton, fix the build, add support for kotlin. Only missing piece would be a supported "pure" kotlin Android project/skeleton generator.

At some point I also looked at the Android example at the bottom of that page: [https://github.com/JetBrains/kotlin- examples/tree/master/gra...](https://github.com/JetBrains/kotlin- examples/tree/master/gradle/android-mixed-java-kotlin-project) \-- that is also IDE centric, and hasn't been touched in a while. Which doesn't leave me very confident that it's been tested with Android 5.1 and/or 6 alpha.

I suppose I'll just have to push out a "howistart"-article if/when I figure out a process that is both easy and repeatable, and hope someone will help with filing bugs as it inevitably drifts towards being outdated as the android landscape changes :-)

</comment></comment></comment><comment><USER18> I saw this talk in person and it was really good, I would highly recommend the time to watch the video.

</comment><comment><USER27> Does JetBrains have any way to make money off of Kotlin? Most people use the free version of IDEA nowadays. Do they have consulting services for Kotlin? Seems especially strange since they seem to be admitting it will be irrelevant once Java 8/9 get on to Android.

<comment><USER28> I'm no longer holding out hope that Java 8/9 will _ever_ get to Android.

I think it's more likely that we'll see Go, Dart, JavaScript, or even Swift become a first-class development option on Android.

Swift would be especially nice. How fantastic it would be to be able to use the same language to target the two most popular mobile platforms? Of course Swift is also probably the least likely since Google is still smarting from the Oracle/Java debacle. The last thing they need is another decade-long copyright infringement fight with the richest company in the world...

<comment><USER29> > I'm no longer holding out hope that Java 8/9 will ever get to Android.

That would be a little foolhardy on Google's part, don't you think? Considering the ongoing 'API copyright' wrangle that is Oracle v. Google

<comment><USER28> Not really. Their fight with Oracle would be entirely justified to avoid paying the largest copyright damages award in the history of software.

<comment><USER30> This. Google is in a very ugly place with Oracle right now. Being able to jump ship might save them, but I'm not sure if Kotlin avoids all the legal troubles here.

I do believe that Google will continue to lose as the history of the East Texas juries for IP is almost always gifting the patent/copyright holder. I wish our system had some kind of venue randomizer. Its clear that this district is a moneymaker for IP holders.

<comment><USER31> Google could have avoided all of this if they hadn't try to screw Sun.

So now we have J++ on Android.

<comment><USER32> > Google could have avoided all of this if they hadn't try to screw Sun.

Or, conversely, if they'd bought Sun instead of letting Oracle do so, stripped interesting IP (particularly, Java), and sold the rest back off (see, e.g., what they did with Motorola Mobility.)

<comment><USER31> Yes, that might have been a better solution.

But given Dart and Go I am not sure if it would have been a good idea in what concerns language evolution.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER33> I'm not a Java guy but I remember checking the language a few months ago and really enjoying it. I wouldn't mind if Java dies and people adopt languages like Kotlin and Scala instead. Of course, Java will never die, because of BUSSINESS APPS!

</comment><comment><USER34> What is with languages that swap args and type? It looks cooler? It says, "Hey look at me, I'm not like those languages your dad used, tee hee!". If I want a simple and clear to understand script language on the JVM I'd choose Groovy, in fact, Grails is a pure joy to develop with I've come to find out.

<comment><USER35> I think it's because Kotlin and Scala infer types so it's more convenient to write it afterwards, as needed, hopefully not to often.

<comment><USER36> That's an excellent point: optional bits come last.

</comment></comment></comment><comment><USER37> Interesting that this is being "introduced" now given that it's been around for several years.

<comment><USER38> It's still not at 1.0.

</comment></comment><comment><USER39> I'm going to be using Kotlin for my next hobby project. Really excited about this language!

</comment><comment><USER40> What are the well known kotlin shops? Are there any companies hiring explicitly for kotlin?

</comment><comment><USER41> Here's a sample webapp using Kotlin, Spring Boot and React.js:

[https://github.com/winterbe/spring-kotlin-react- demo](https://github.com/winterbe/spring-kotlin-react-demo)

</comment><comment><USER42> I can't seem to find anything on the Kotlin Github repo that implies code like this:

        ints.filter { i -> i > 0 }.map { i -> i*i }

will use deferred execution. Is this correct? If so, why?

<comment><USER43> The type of 'filter' and 'map' should tell you whether they are eager or lazy. If they return something iterable and uncountable except by consuming, then they're probably lazy. If they return something array or collection-like, they're probably eager.

I had a quick scan of the Kotlin repo, and I think it depends on the type that you start out with. The sequence stuff is lazy; the map stuff is eager.

<comment><USER42> Looking at the docs on Iterable, map and filter return List<T>, not another Iterable. I imagine this isn't a concern when you've got small data sets, but I wouldn't feel safe using this when performance is a concern.

<comment><USER44> I haven't played with Kotlin in a while but if you want collection operations to be lazy you have to explicitly convert it to a sequence. So your example would be something like:

        ints.asSequence().filter { it > 0 }.map { it * it }

and then you can convert it to a concrete collection type with toList, toHashSet, toArrayList etc.

<comment><USER42> That's just baffling to me.

Why would they advertise chaining together sequence operations like this as being LINQ-like (or like Clojure and other functional languages) when it's eager by default? What is gained by making these eager by default?

It just seems like a poor choice to me. That's a shame, because I feel like it's otherwise a pretty well-designed language.

<comment><USER45> Plenty of functional languages do not have lazy sequences by default. Haskell does because the entire language is lazy by default, and Clojure does as a conscious design decision (one that is not shared by its Lisp, Smalltalk, Ruby, and ML influences). There are plenty of hardcore functional programmers who will argue that strict by default and lazy by choice is the preferable option.

The reason Kotlin sequence operations aren't lazy by default is probably because Java collections aren't, and Kotlin code is going to spend a lot of time dealing with Java collections. And, frankly, it's always a tradeoff to implement lazy collections in a strict language -- people using them need to become intimately aware of exactly which operations are lazy and which are eager.

</comment></comment></comment></comment></comment></comment><comment><USER46> What was wrong with Groovy?

<comment><USER47> Did you know Groovy was booted off the Codehaus hosting service and its 3 developers retrenched by Pivotal,Inc last January? And Groovy's backup plan to join Apache via its incubator is a hoax, just providing a cover story for a non-technical person to run the show in the background. Virtually all the links at Groovy's page at Apache redirect to "groovy-lang.org", which is privately registered to Registrant Name "Guillaume Laforge" and blank Registrant Organisation. This individual controlling this domain and holding passwords to other non-Apache infrastructure for Groovy is a non-technical person pretending otherwise. Looking at today's emails on the Groovy _dev_ list, we see Cedric Champeau giving two examples of "non code committing" committers, but this Laforge would be a far better example as he doesn't have even _one single email_ in the entire 6-month history of the _notifications_ or _commits_ lists for Groovy at Apache. Until "Apache Software Foundation" is listed as the Organisation, the incubation process isn't real. Even better would be if the technical people who actually built and tested Groovy took over. The only real reason they haven't tried is they know a worse predator lurks over at the Grails ecosystem ready to pounce if Laforge is toppled.

<comment><USER31> I guess if it wasn't for Google forcing Gradle upon us, Groovy would no longer be relevant.

<comment><USER47> Groovy's always been good from the very beginning for quick and dirty Java class manipulation, such as test scripts. It found use in Grails when they added a MOP to simulate Rails's ActiveRecord, but Grails is declining quickly -- people aren't starting new projects with it or upgrading to Grails 3.x. Gradle provides it as a configuration language but its typical use is for 30-line build scripts using the declarative DSL only, not the actual language. Gradleware no longer mentions Groovy in any of their promotional blog posts and announcements about Gradle -- it's like they're embarrassed of it -- so I suspect there's changes coming soon in that area.

</comment></comment></comment></comment><comment><USER48> How come noone mentioned Xamarin? Coming from a C# background it's definitely the choice; even coming from a non-Java and non-C# background seems a better choice nowadays.

</comment><comment><USER49> I really appreciate that the page has a transcript and doesn't force me to watch the whole talk!

</comment><comment><USER50> after seeing the information about Kotlin, I think 'coffeeScript' which is more convenient, concise, easy to read than javascript. time is only one problem, it is immature

can Kotlin support 'Spring framework ?, if can, it is more attract for Java developer

</comment><comment><USER50> what's difference beetween Kotlin and Scala??

<comment><USER26> [http://kotlinlang.org/docs/reference/comparison-to- java.html](http://kotlinlang.org/docs/reference/comparison-to-java.html)</comment></comment>


Bill Gurley is most unselfaware man on planet or he wrote open letter to Uber - <AUTHOR> https://pando.com/2016/04/21/bill-gurley-either-most-unselfaware-man-planet-or-he-just-wrote-open-letter-uber/ <comment><USER2> paywall</comment>


Ask HN: Can Airbnb hosts reject you based on your marital status? - <AUTHOR> My friend just told me she was trying to get an Airbnb in Norway. She was rejected and the host wrote "I am not able to take unmarried couples". Is this allowed? <comment><USER2> Is this allowed or is this allowed by Airbnb and will this host be subsequently removed?

I would imagine the answer to the first question is, well yes of course it is allowed. They own (or have some right) to the property they are lending so they can decide on any number of arbitrary factors whether or not to lend to a particular borrower.

Is it against Airbnb's rules and policies? Actually, from everything I can find, no. This is absolutely fine. You can, as a lender, make any number of "house rules" in a "house manual" as long as you state your rules upfront. Maybe this lender feels that married couples take better care of the house in question. Or maybe they have religious beliefs about unmarried couples. Or maybe they just hate people who are dating. As long as the rules are stipulated up front and not in a rude way, it seems just fine according to the rules.

Now, will this help them lend their place? Hard to say. The market will drive that entirely. But as for "allowed" the answer seems to be a clear, yes.

</comment><comment><USER3> [https://www.airbnb.com/help/article/483/anti- discrimination-...](https://www.airbnb.com/help/article/483/anti- discrimination-policy)

Seems like they will only intervene if the host doesn't comply with local discrimination laws.So I guess she should find if Norway has any anti- discrimination laws with regards to housing and martial status.

And if it's specified in the listing itself they might intervene regardless of local law if I understand it correctly.

</comment><comment><USER4> While companies like Uber and Airbnb cut through regulations that create artificial scarcity, they also cut through protective regulations.

</comment><comment><USER5> I believe the host is given a lot of discretion when it comes to bookings. Our recent host was very nice but required a lot of hoops before she would confirm the reservation. This was not in Norway but she was Norwegian.</comment>


IDEO to redesign BugBase user experience - <AUTHOR> http://bugblogger.com/bugideo-reinventing-the-bug-ui-with-your-help-298/ <comment><USER2> It is supposedly to be done in the open, not sure what that exactly entails.

There are some posts from the previous company that designed it ecco [http://community.buglabs.net/kashif/posts/55-Designing- for-B...](http://community.buglabs.net/kashif/posts/55-Designing-for-Bug-Labs) [http://community.buglabs.net/Bradley/posts/56-more-on- Design...](http://community.buglabs.net/Bradley/posts/56-more-on-Designing- for-BUG)

</comment><comment><AUTHOR> not sure how familiar people are with IDEO - they were founded(?) by a group of designers, including the fairly famous Bill Moggridge.

They have some really inspiring videos on the net, I really recommend people check them out!

<comment><AUTHOR> aww, okay, I couldn't stop thinking how cool their videos were so I did some hunting.

Good list here: <http://delicious.com/popular/IDEO>

Guardian article on IDEO : <http://www.guardian.co.uk/inspire-innovate>

Method Cards have been really sucessful in ther design consultancys to "replicate" IDEOs approach. : <http://www.ideo.com/methodcards/MethodDeck/index.html>

oh, and : <http://www.ideo.com/work/> \- case studies :)</comment></comment>


Reasons Why Handheld Devices Should Be Banned for Children Under the Age of 12 - <AUTHOR> http://www.huffingtonpost.com/cris-rowan/10-reasons-why-handheld-devices-should-be-banned_b_4899218.html

<comment><USER2> > there is no future for children who overuse technology

That right there is laughable. There is no future if our children don't use technology to solve a wide range of problems.</comment>


Ask HN: Do you keep a copy of your source code when you quit your job? - <AUTHOR> Maybe it sounds unethical but once you leave your job for another one, do you keep a copy of the code you were working on? <comment><USER2> In all of the positions I have been in this is considered Corporate Theft. The code I was paid to write is fully owned by my employers.

I have heard of some less restrictive contracts, but I have never seen one myself that grants me the right to take the source code with me, even if it is only the code I wrote.

This answer explains it very well: [https://softwareengineering.stackexchange.com/questions/1541...](https://softwareengineering.stackexchange.com/questions/154155/should- you-keep-a-copy-of-all-the-code-you-write)

</comment><comment><USER3> I guess it depends, if you are keeping it to reuse in while it may be an issue. To use as a reference for future work isn't terrible as long as you aren't directly lifting code someone else wrote and putting it into your new employees codebase (thats what stackoverflow is for). My employer has us out everything on a public GitHub repo so access isn't really an issue but with corporate sensitive code it is a more difficult issue.

<comment><AUTHOR> I agree, and even if one does not keep a copy of the code, the techniques one develop for coding or optimizing the code cannot be erased from the mind of who created them

</comment></comment><comment><USER4> I have kept copies of code and email from every job since the 1980s. Some of it is now hopelessly unusable since codepoints have drifted (I mean, the raw data is still there but the characters are garbage in ASCII, are probably badly transcoded EBCDIC).

</comment><comment><USER5> No - I don't like the taste of prison food.

</comment><comment><USER6> no, because that's theft; would anyone hire you if they knew you had a history of stealing IP?</comment>


Installing Turbo c++ On Windows 64 bit - <AUTHOR> http://tronzone.blogspot.com/2012/03/installing-turbo-c-on-windows-64-bit.html

<comment><USER2> Wow, this post even links to a pirated version of VMWare :/</comment>


New York's Attorney General Opens Inquiry into Equifax Breach - <AUTHOR> https://www.nytimes.com/2017/09/08/business/equifax.html?rref=collection%2Fsectioncollection%2Fbusiness&action=click&contentCollection=business&region=rank&module=package&version=highlights&contentPlacement=2&pgtype=sectionfront <comment><USER2> Comments moved to [https://news.ycombinator.com/item?id=15200955](https://news.ycombinator.com/item?id=15200955). (Although the stories aren't identical the discussion was clearly the same.)

</comment><comment><USER3> ....good.

<comment><USER4> Hopefully something actually comes of this.</comment></comment>