The two cultures of mathematics and biology - <AUTHOR> http://liorpachter.wordpress.com/2014/12/30/the-two-cultures-of-mathematics-and-biology/ <comment><USER2> >The result is that biology loses out due to the minimal real contact with math– the special opportunity of benefiting from the extra sense is lost, and conversely math loses the opportunity to engage biology

When I was a biology grad student, I was the only person in the department that tried to do active collaboration with the math department. I took more math classes during my graduate program than biology classes.

On the biology side, I got ridiculed for all the 'hand waving' that seems to happen with the math. Biologists want to see concrete experiments and results.

On the math side I found people to be much more open and fascinated by the biology, but they had a tough time explaining what they were doing to a lay audience.

No easy answers, but I think more programs should graduate people with dual skills in both subjects(and of course have job opportunities for those grads, instead of having them jump into industry like I did).

<comment><USER3> Biology is enormous, as the author pointed out. Our understanding in biology at present might be less than 1% than the whole knowledge. For most biological research, it doesn't require any advanced knowledge in math beyond basic statistics.

For example, many labs have been studying an important gene and how other genes are functionally related to it for more than 10 years. The research involved are simply tedious, but indispensable, biological experiments. It is a waste of time to study math for this work, because it doesn't apply, except some basic statistics on data analysis.

Disclaimer: I have advanced degrees in both biology and computer science, and has multiple years of biomedical research experience. I have met exceptionally smart people working in both biology, CS, math, and physics. Yes, these smart biologists don't understand advanced topics in math and physics. I believe, however, if they had studied math or physics, they would have been excellent mathematicians or physicists.

<comment><USER4> Wouldn't it be entirely useful for biologists to know more advanced statistical methods?

<comment><USER3> It is, for sure.

There are some other points to consider. First, the dataset sizes for most biomedical research are very small. Most advanced statistical methods don't apply. Due to curiosity, I took some advanced stat courses and tried to apply the methods to our lab's data. It didn't provide any significant improvement compared to basic ones, like linear regression, logistic regression, etc.

Second, biomedical research is highly collaborative these days. For some research that generate a large amount of data, either the researchers themselves understand statistics very well, or they collaborate with statisticians very closely. There is a field called biostatistics. Most biostatistics professors are either math or stat major, and many of them are adjoint professors in biomedical departments.

Biomedical research is really tedious and time-consuming. The professors I knew when I was doing biomedical research worked more than 60 hours a day, and they wish they had more time. One young woman professor came to the lab at 8am, left at 6pm, spent some time with her 4 children, and came back to lab at 9pm again, and worked until midnight, on every weekday. She brought her children to the lab on Saturday, and worked the whole day. IMHO, it is better for her to focus all her energy on the biomedical part, which she is best at, and collaborate with statisticians.

<comment><USER5> This is a very important point I think - only in very rare cases have I found my research actively improved by having a more sophisticated method available, and most projects have a statistician as a collaborator already. If not, they're readily available. It benefits a biologist to know what the statistician is talking about, and not just treating the analysis as a black box, but there's a reason we have subject matter experts. Sometimes, someone saying "Make sure to use robust variance" is enough information.

</comment></comment></comment></comment></comment><comment><USER6> I once was on a workshop organised by and for mathematicians which supposed to be about biology. There was a talk where guy was discussing PDE system describing some colony growth; at some point near the beginning he concluded that the results for real input are "boring", and one can get "intriguing chaotic behaviour" with negative cell number, and continued with that assumption (;

<comment><USER5> Many similar experiences, from having someone say "I was under the impression this was interesting for its own sake" at an applied math talk, or asking a group of mathematicians how to actually implement their biologically (and logistically) impossible solution to influenza containment.

</comment></comment><comment><USER7> Perhaps even more interesting is the gap between mathematicians and medical doctors. Disclaimer: I was a math major who went to medical school.

There is age-old question of, "What should I major in if I want to go to medical school?" Turns out that mathematics majors have the following statistics:

1\. _Highest_ average MCAT Physical Sciences Scores 2\. _Highest_ average MCAT Biological Sciences scores (higher than biosci majors) 3\. _Second-highest_ MCAT Verbal Reasoning scores (second only to Humanities majors) 4\. _Highest_ overall average MCAT scores. 5\. _Second-Highest_ average Science GPAs (biosci majors are 0.02 higher) 6\. _Highest_ average Overall GPAs

Source: [https://www.aamc.org/download/321496/data/factstable18.pdf](https://www.aamc.org/download/321496/data/factstable18.pdf)

'Course, math majors make up < 1% of medical school applicants (0.81% to be exact), so this very well may be selection bias. Still, it seems as though what medical schools are looking for are individuals with analytical (mathematical) reasoning skills.

EDIT: It's also worth noting that in many countries an undergraduate education is not a prerequisite for medical school, so there's likely to be even less math-major physicians outside of the US.

<comment><USER8> My friend math teacher used to say: "only 5% are good at math, but those 5% are good at everything".

<comment><USER9> Nobody is good at everything. But there is certainly a vocal contingent of maths/physics types who think they are.

</comment></comment></comment><comment><USER10> Meh, I think he just didn't explain what a "scheme" is very well. Compare it the NY Times piece. From that, I immediately understand that it is an elegant generalization of solutions to polynomial equations.

[http://www.nytimes.com/2014/11/25/science/the-lives-of- alexa...](http://www.nytimes.com/2014/11/25/science/the-lives-of-alexander- grothendieck-a-mathematical-visionary.html?_r=1)

Compare it to:

''The proper foundations of the enlarged view of algebraic geometry were, however, unclear and this is how Grothendieck made his first, hugely significant, innovation: he invented a class of geometric structures generalizing varieties that he called schemes. In simplest terms, he proposed attaching to any commutative ring (any set of things for which addition, subtraction and a commutative multiplication are defined, like the set of integers, or the set of polynomials in variables x,y,z with complex number coefficients) a geometric object, called the Spec of the ring (short for spectrum) or an affine scheme, and patching or gluing together these objects to form the scheme. The ring is to be thought of as the set of functions on its affine scheme.''

Sorry, this writing is just awkward. I can see why the editors of Nature rejected it.

I think the audience of Hacker News is closer to mathematics than the audience of nature (programming being more closely related to math than biology). I doubt that anyone in this thread unfamiliar with schemes was able to get much useful from Mumford's obituary. I don't even see many comments on the exposition.

<comment><USER11> To me the difference is that the rejected obit attempts to summarize how Grothendieck's innovations worked mathematically, but what most readers want to know is why they are important.

This is similar to the insight in the tech world that customers don't buy technology because it is built well, they buy it because it solves a problem for them.

<comment><USER12> "most readers want to know is why they are important". This happened to me in my second year studying physics and applied math. The math teacher did not know how to explain the importance of the math around the eigenvalues etc. Only a year later when taking quantum mechanics we got to the applications of that math. However in hindsight I hope he was trolling me :-) otherwise we need a separate curriculum for math teachers to get in touch with the reality :-)

</comment></comment></comment><comment><USER13> I think they were right to reject it. I have done plenty of math but I still couldn't 'grasp' the significance of the scheme system, and while I'm sure it is very important to the few people who understand it, I doubt the readers of Nature are among them.

<comment><USER14> Are all readers expected to grasp the significance of every article in Nature? More pertinent to the reason the article was rejected: shouldn't every scientist have heard of complex numbers and polynomials? It is, after all, part of every secondary school curriculum.

</comment></comment><comment><USER15> >Mathematics full professors that are female is a number in the single digits.

I'm not going to let this slide. This would be scandalous if it were true; however:

[http://www.mi.uni-koeln.de/Bringmann/](http://www.mi.uni-koeln.de/Bringmann/) [https://www.math.psu.edu/wli/](https://www.math.psu.edu/wli/) [https://web.math.princeton.edu/~smorel/](https://web.math.princeton.edu/~smorel/) [http://www.math.tamu.edu/~ptretkoff/](http://www.math.tamu.edu/~ptretkoff/) [http://en.wikipedia.org/wiki/Maryam_Mirzakhani](http://en.wikipedia.org/wiki/Maryam_Mirzakhani) [http://math.uchicago.edu/~wilkinso/](http://math.uchicago.edu/~wilkinso/) [http://www.math.wisc.edu/~lsmith/](http://www.math.wisc.edu/~lsmith/) [http://www.maths.ox.ac.uk/people/frances.kirwan](http://www.maths.ox.ac.uk/people/frances.kirwan) [http://math.stanford.edu/~ionel/](http://math.stanford.edu/~ionel/) [http://gauss.math.yale.edu/~ho2/](http://gauss.math.yale.edu/~ho2/)

I could easily keep going.

Edit: As ninguem2 points out, apparently the author was referring to the percentage of female math professors. Nevertheless, if you do not count only doctoral-level departments, even that appears to not be true:

[http://www.ams.org/profession/data/cbms- survey/chapter4.pdf](http://www.ams.org/profession/data/cbms- survey/chapter4.pdf)

(This study is counting all tenured professors, rather than full professors only, but the proprortion is well enough north of 10% that I feel it's safe to extrapolate.)

Of course, the proportion of female math professors is terribly and inexcusably low, but the situation is at least slightly less bleak than is painted here.

<comment><USER16> From the AMS study, Table 1, PhD math departments, 420 female out of 4669 total is, by most calculations, less than ten percent.

<comment><USER17> It's interesting to note in particular that these departments graduate many more women by percentage than they then hire.

Great article! I think a big problem in math is a certain insularity that suspiciously pushes away people who do interdisciplinary or education work unless they're also publishing "real math", narrowly defined.

</comment></comment></comment><comment><USER18> Lior Pachter is one of the great thinkers and communicators in computational biology. I never miss one of his talks, they're always energetic and enlightening.

</comment><comment><USER19> Mumford's Grothendieck obituary was posted to HN a couple weeks ago but unfortunately didn't get any discussion.

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

</comment><comment><USER20> My attempt at motivating schemes: [http://www.win- vector.com/blog/2014/12/lets-try-to-motivate-...](http://www.win- vector.com/blog/2014/12/lets-try-to-motivate-schemes/)

</comment><comment><USER21> In fact is not related with mathematics or biology. Is just a literary problem. They are not paying enough attention to the inner flow of their work.

An example:

"This is the field where one STUDIES the locus of

solutions of

sets of

polynomial equations

by combining the algebraic properties of

the rings of

polynomials with

the geometric properties of

this locus,

known as a variety.

Traditionally, this HAD MEANT complex solutions of

polynomials with

complex coefficients but

just prior to Grothendieck's work,

Andre Weil and Oscar Zariski HAD REALIZED that

much more scope and insight WAS GAINED by

considering solutions and

polynomials over

arbitrary fields,

e.g. finite fields or

algebraic number fields."

........ This is "almost lisp code" in its structure.

The inner flow here is really dislocated here with all those interruptions and changes of direction and meaning. There is also a problem with the timeline. They talk in the same paragraph about at least four, maybe five different moments in time, shown in this order: 5,1,4,3 and maybe 2 (being 1 the oldest and 5 the current time). This is driving to distraction to the reader probably (I find it pretty annoying at least)

<comment><USER22> That's a good point. It seems to be very difficult for mathematicians to formulate their thoughts in a non-formal manner. When they try to, it's almost like they speak in a learned second language. That said, mathematics is not really bound by any type of "reality" either, whereas other fields, even physics, certainly are. A little more reality in math and a little more abstraction in the rest would probably help.

</comment></comment><comment><USER23> I started a PhD on the boundaries between mathematics and biology.

I quit soon after finding out that my (mathematics) supervisor had been actively blocking me from communicating with biologists, including blocking meetings with my (biology) co-supervisor.

I gather they thought real, practical concerns would be a distraction from the purity of theoretical problems.

<comment><USER24> If it makes you feel any better these sort of games go on whenever cross discipline research occurs. It is all about controlling the research undertaken by the student.

</comment></comment><comment><USER25> Bashing Nature is almost cliche at this point, anyone in the research world knows about the issues there by now. However this is comical: "...in which he describes the rejection by the journal Nature of an obituary he was asked to write" I mean, who in their right mind rejects an obit that they asked someone to write? The power that the Nature editors wield is awesome in the ivory tower, and it has gone to their heads.

That said, I was a mathy undergrad and now am in a neuro PhD program. The gulf is large indeed. I think the largest difference for me is the relation to science in general. As a mathy person, we are all about the predictive powers of science. I do A, then B happens at time T. In bio, it is not that at all. Bio is an observational science. I see A, then I see B at time T. Sure, you can make predictions, but what these events all have to do with each other is almost impossible to predict in a living organism/environment. As such, when bio people hear Partial Differential Equation, they go running for the hills.

Case in point, PDEs are no big deal for me, I took an entire class on them. But in one class we had to _read_ a paper on using PDEs to model genetic interactions with a sugar input and then write up 1 single page on it (with some guidelines). Oh man, the riot! 59 of the other people in the class were up in arms about this. They tried to get the points on the paper halved, then eliminated, then the teacher to rescind the assignment, which they were all successful in doing. Then the non-stop complaining ensued for weeks in the halls. All because we had to read a paper with PDEs written out in it. My lord.

On the plus side, it leaves a huge hole that none of the bio people want to crawl down. This is a positive for mathy people, as the bio is ore memorization than anything. The bio field is rocking and rolling already from the intrusion that mathy people are mediating. Now, if your lab does not have a CS major in it, you are going to fall behind. The idea that quants and big data people are necessary is just starting to grab hold of the bio world. Now is a good time to get into grad school in the bio field if you have a math background as they are just now starting to realize they need you. It's just hard to get through classes though.

<comment><USER5> "Bio is more memorization than anything" \- no offense, but this was not so much my experience of biology and related fields. At the same time, I've noticed that many math folks make no effort to reach out to the other side - recognizing that PDEs _are_ a big deal to some people, intimidating, and not exactly terribly approachable. Or assuming because they know the math, surely the biology will just fall into place.

I have seen some _very_ interesting math papers with appalling biology in them.

I think the issue I have with this post, and the article in general, is the very one sided "You need us, take more math" tone. With funding being harder and harder to get in pure math, math also needs applications - biology among them as it potentially unlocks NIH funding. It's not a one-sided failure.

<comment><USER26> > At the same time, I've noticed that many math folks make no effort to reach > out to the other side - recognizing that PDEs are a big deal to some people, > intimidating, and not exactly terribly approachable.

Being a mathematician, I don't know any other way than to say: "Read this and this text and understand it. Then you'll grasp what I'm talking about.". I can tell you that even for many math students, say, PDEs are intimedating and not exactly terribly approachable at the beginning. But the difference is that by reading texts, hearing lectures etc. they simply get over it and get quite used to them. So, I believe, the mathematicians you talk about are quite honest in the sense that they are really doing their best, but simply don't know a better way to talk about their topic.

<comment><USER5> I would suggest starting with "What happened, and why I did it". Having explained my fair share of stochastic simulations of systems of ODEs to clinicians, I think the core of the problem is heading into the mathematical tall grass way to quickly.

<comment><USER26> > I think the core of the problem is heading into the mathematical tall grass > way to quickly.

In my experience non-mathematicians don't like listening to loooong mathematical talks (although those would be necessary for introducing the topic in a more smooth way).

</comment></comment></comment></comment></comment><comment><USER27> This reminds me of how Stephen Altschul had to take help from Sam Karlin(mathematician) in order to so solve sequence similarity problem. Stephen had made his problem look like a mathematical one so Sam could take interest in it. This led him to create BLAST one of the most successful tool in Computational Biology. Link: [http://www.nature.com/nbt/journal/v31/n10/full/nbt.2721.html](http://www.nature.com/nbt/journal/v31/n10/full/nbt.2721.html)</comment>


CSS Variables in Firefox - <AUTHOR> http://mcc.id.au/blog/2013/12/variables <comment><USER2> It just hit me: people learning web development now are learning a completely different CSS than I learned.</comment>


Ubuntu launches appstore - <AUTHOR> http://developer.ubuntu.com/2011/09/announcing-the-ubuntu-app-developer-site/

<comment><USER2> I've been a linux desktop user on and off since Redhat 5.0 and usually take a year break between attempts to give it time to catch up.

Recently I installed Fedora 15 because I love the new Gnome3 desktop and was disappointed to have all little sorts of niggling stupid things on my 4-year old ThinkPad T60... like recovering from sleep and now sound doesn't work or the iwl3945 being buggy.

I tried out ArchLinux and love the distribution, but found that building my own Gnome3 desktop with all the little applets and gadgets Fedora build in (like advanced touchpad controls, etc.) to be a pain in the ass of hunting down _exactly_ the right modules I needed.

I almost gave up, but decided to try out Ubuntu 11.04 after swearing it off when I spent a year with 8->9 and decided Unity looked horrible.

Boy... I was surprised.

It is more polished than anything else out there I tried. Runs well, everything worked out of the box and the first thing I noticed right out of the gate is the Add/Remove software has gone from being a simple UI over Synaptic to being what looks like an app store already.

As soon as I saw that it dawned on me how brilliant canonical was being with taking Linux desktop a step forward by giving a direct sales channel to people wanting to work and sell on Linux.

11.10 and 12.04 behind it are going to be excellent user experiences and with the addition of the app store I think Canonical is making all the right decisions to take Linux on the desktop to the next level.

You factor in tablets and tablet-friendly apps in the next few years and this is a really smart/aggressive move on their part.

Big congrats to that company and team for always pushing beyond the scope of what "Linux is known for" and shoving their way in to realms dominated by other consumer OSs.

It is nice to see the ambitious and gusto.

<comment><USER3> yes i am using using ubuntu for 5 years now, and have around 30 users following me to use it; and I find it a good step forward for canonical to focus on desktop. Last week I tried, kde4.6, gnome3, xfce and gubuntu and i was impressed by all of them. I am currently using gnome3 and sometimes unity 3D version.

</comment></comment><comment><USER4> Title should be changed to "Announcing the Ubuntu App Developer site".

Besides editorializing titles usually being frowned upon, this title is incorrect.

<comment><AUTHOR> Yes, it should be changed, I realized that after the fact.

<comment><USER5> After the fact that you read the article? or after the fact that you submitted it to YC?

<comment><AUTHOR> After I submitted I realized I should have kept the title the same. We were discussing it in the office in terms of an appstore, so the title made sense at that moment.

</comment></comment></comment></comment><comment><AUTHOR> In the past I thought Ubuntu's intention was to level the playing field, allowing beginners from any economic background access to the best free software. I can imagine in three years time that paid Ubuntu applications in certain fields, 3D, graphic design, etc. becoming priced above what users in developing countries can afford, even still these applications could become industry standards. This seems an unfair advantage to the first world countries who can afford to spend +10$ for an app.

<comment><USER6> The minimum price you can charge for your app, if you want to charge for it, is $2.99 ( <http://developer.ubuntu.com/publish/> ). I wonder why.

<comment><USER7> My guess would be related to their merchant account agreement. They probably wouldn't make any money on lower transactions due to fees.

</comment></comment></comment><comment><USER8> Yeah, and unlike the title suggests, they don't call it App Store. App Store may or may not end up being generic, but by avoiding any debate over it you save yourself unnecessary burden on yourself esp. when you are in the business of free software. (Although it then begs the question, do we change our behavior in fear of richer players?)

</comment><comment><USER9> Awesome. I hope I, as a developer, can make some money with this new service. Lets see ..

</comment><comment><USER10> Is it just me, or does the Ubuntu app store need:

      nav li { list-style-type: none; }

... using Chrome 14 on OS X

</comment><comment><USER11> I wonder if this means more DRM is on its way to Ubuntu.

<comment><USER12> I highly doubt that. You can't have an open source software with DRM.

<comment><USER13> Why not? It's the encryption keys that are important, not the encryption method itself.

<comment><USER12> Because in DRM is security through obscurity. The data/programme/file is encrypted to hide from the user, but must also decrypt it from the user, and the user has full technically and legal rights to that code.

If you have a DRMed music file, and (say) an open source music player can play it, then the file is encrypted and the encyrption key is kept with/in the file. You can just look at the source code of the music player and see it extracts the key from the file (or from your master key file), and see how it decrypts the file. You can then decrypt the file yourself. ergo drm breaking.

DRM can also force restrictions like "Only allow person with account id X from opening this programme", that could be implemented in the code as a function that says "doesUserHavePermission()". If the code is open source, then you just change that function to always return true, and to always allow everyone to use it. (Since it's an open source programme, you can then distribute your code with your 'fix' applied)

<comment><USER6> _You can just look at the source code of the music player and see it extracts the key from the file_

To be fair, we can also do that without source code. It only (yet again) proves DRM is pointless against technical people that are determined to break it.

Non-technical people or people that do want to play "by the rules" won't do that. Also, the vendor could do things such as embed the name of the buyer inside the downloaded executable/data, to discourage sharing...

<comment><USER12> _To be fair, we can also do that without source code_

You can, but it's not the same.

With an open source programme:

* it's much easier to find & disable the DRM checks

* I can (legally) distribute a version with DRM disabled

* I can legally distribute a (probably small) patch that disabled the DRM, it's much easier for someone else to verify that my patch disabled the DRM, and doesn't have a trojan than if I give a binary diff.

* With open source programmes, I could submit my patched version (that disables the DRM) to a very freedom loving distro (like debian), and campaign for it's acceptance into the package index (making all Debian users not have DRM, etc.)

These things are _technically_ possible with propriaty software, but you don't have the advantages above.

</comment></comment></comment></comment></comment></comment><comment><USER14> Isn't it just a portal to allow devs easier ways to upload their software than having to run an apt repository or maintain a PPA? I mean, sure they're enabling paid applications, but those have already been around for 6 months now.</comment>


Python Webkit DOM Bindings - <AUTHOR> http://www.gnu.org/software/pythonwebkit/ <comment><USER2> > that are then restricted to being exclusively used from one of the world's > most awkward and obtuse programming languages: javascript.

This is just flamebait. Javascript is just as capable as python, and these days, it's a lot faster too. Sure it has some boring idiosyncrasies, but so has python (one line lambdas are gonna be fun with heavily evented code such as DOM code).

There is room for everything in this world of technology, and i like the idea of this project, but please remove those corrosive and pointless statements from the main project page ..

EDIT : Well, downvoters ? Do you disagree with anything i said ? Because you are particularly silent at the moment, i can't see any of your replies. I stand by anything i said, calling javascript an awkward and obtuse language is flamebait, and implies a very shortsighted view of the technology the very individuals working on the project should know well. If you disagree with me, at least have the courtesy to explain why

<comment><USER3> A counterpoint:

I've programmed JavaScript long enough and on large enough codebases to know that JavaScript leaves _much_ be desired.

Problems:

      1) It's a language that has stood still since November 2000 as far as
         standards go.
      2) No sane package system (see #1) *everybody invents their own*
      3) Expression problem, altering prototypes is ridiculously powerful,
         but it's monkey-patching (see #1)
      4) Browser environment is a ball-and-chain for the language's evolution (see #1)
      5) Lack of rich datatypes (no sets) (see #1)
      6) Object identity based equality (see #1)
      7) Little facility to define new rich datatypes (see #1)

And on and on. The reasons JavaScript isn't totally crippled given these and more issues is that the language is wonderfully small, has first class functions, functions have variable arity, supports apply/call, its functions are modifiable objects, the context of a function call can be rebound, and it has prototypal inheritance. From these powerful bits people have created a many, many libraries that make JavaScript programming downright fun.

But to say that JavaScript is an especially capable PL is, to me at least, a bit of joke- it was clearly designed to run in a very limited scope, _in the browser_. And remember, this is critique from someone that has used JavaScript in large UI projects day in and day out since 2005 (before jQuery!).

<comment><USER2> I mostly agree with your critique of javascript. I do not actually agree with 7. You do have the possibility of defining any datatypes you'd ever need. You just don't have the possibility of defining literal support for them.

All your other points are right on, but i feel that most are more the result of the history and constraints of javascript than anything else.

#3 is a language problem but is also the most arguable of your points. Ruby allows monkey patches and is one of the most appreciated languages in existence today. Also viable approachs to give the power of monkey patching without the drawbacks are just being thought today. Protocols in clojure looks good but still need the appreciation of time i'd say.

#6 is stupid i agree

Every other point are more the result of the history, and most importantly of the use case of javascript: \- No sane package system sucks but a package system is hard to get right in a file based browser environnement. \- Browser environnement, well yes, but that's precisely what we are talking about, you can't really say it's a problem, it's the very reason we're using javascript in the first place \- Lack of rich datatypes is really bad. The lack of sets, but also of propers hash maps sucks. But more generally javascript lacks a __proper standard library __. Something that python definitely has. But it's also definitely harder to get right in a browser environnement, when you have got to ensure support from every browser on every platform.

But anyway, thanks for a proper critique of javascript.

<comment><USER4> The lack of sets as a data type at the language level is a serious problem with JS. Most languages which implement sets as a library make some assumption about the elements: they're ordered, for example, or they all have a unique string serialization. If you want to make a set data type in JavaScript, the language doesn't give you any of those assumptions. You might end up just using linear search of unordered arrays. (This is actually very fast for small sets, but still.)

I wrote some more about this here:

[http://finger-tree.blogspot.com/2010/09/sets-in- javascript.h...](http://finger-tree.blogspot.com/2010/09/sets-in- javascript.html)

And here is a library that offers sets in JS:

<http://github.com/PeterScott/simplesets-nodejs>

If you're using Node.js, you can get it with npm. It could be adapted to the browser pretty easily. This is what I use, and it makes my life so much easier.

</comment></comment></comment></comment><comment><USER5> I'm willing to bet that a solid 90% of all people desperately yearning for JVM (or similar) "in the browser" as well as stuff like these DOM bindings don't realize that JS is a powerful, decent, fast language. These days, at least. Instead of adding semi-functional alternatives, the web development community should focus on providing reasonable JS teaching and learning opportunities.

Mozilla's JS Guide is surprisingly well hidden, a majority of JavaScript tutorials are shockingly inadequate: there's a lot of potential there.

JS is neither awkward nor obtuse. Its shortcomings are exaggerated while its beauty is still a secret to many; that sucks.

<comment><USER6> JS might be great language, but still it's only one language, and it doesn't fit everybody. Allowing more languages in client-side web code enables more people to create great web apps.

<comment><USER7> These days Javascript is plenty fast enough to achieve this goal by simply writing other languages over the top of it...

There are some examples of this happening already, HotRuby for instance.

</comment></comment></comment><comment><USER8> It's interesting that the author is motivated by WebKit being "restricted to being exclusively used from one of the world's most awkward and obtuse programming languages: javascript."

I would hope that the leadership of such a project would at least demonstrate some kind of understanding of the language binding they wish to replace, objectively recognizing its contributions and shortcomings, with the professionalism to resist resorting to phrases like "world's most awkward or obtuse language".

</comment><comment><USER9> I'm a big fan of alternative client side languages (would love to see a ruby version of this project). The problem is wide spread adoption will take forever. You wouldn't be able to use another language in the browser until all vendors ship it and those browser versions become baseline.

What would be cool is if browser vendors implemented client side VMs with a standard bytecode. Then new languages could be developed and delivered over time.

<comment><USER10> This is the most critical point in the thread, it seems to me!

</comment></comment><comment><USER11> This would be more of a "Big Deal" if it hadn't been available for many years in Mozilla via PyXPCOM: <https://developer.mozilla.org/en/PyDOM>

That being said, there's definitely room for competition. PyXPCOM is far from a joy to work with.

</comment><comment><USER12> To me, a page of Python is supremely readable. It's concise and perfectly understandable.

A page of javascript looks like someone dropped a box of scrabble tiles.

This is just me, a bad programmer who hasn't gone to college yet, who only knows one language well enough to make anything useful, and who has resisted learning javascript all this time. I knew someone would do something like this eventually, and now they have. And now I shall make something truly beautiful.

</comment><comment><USER13> Javascript is a great, powerful and awesome language.

Python is a great, powerful and awesome language.

Birds of a feather flock together. I hope EVERY rendering engine gets Python support.

</comment><comment><USER14> I have often thought that lua would make the perfect addition for client side scripting. There are some annoying bits of lua, but it seems like a compelling alternative to me.

</comment><comment><USER15> This article lost me when it called JavaScript awkward and obtuse. Sounds to me like they have little experience with JavaScript.

<comment><AUTHOR> The author is the project lead of the pyjamas web framework (<http://pyjs.org>). He knows some Javascript :). But he hates programming with html, css and Javascript.</comment></comment>


Building a RESTful Web API with PHP and Apify - <AUTHOR> http://blog.fedecarg.com/2011/09/11/building-a-restful-web-api-with-php-and-apify/

<comment><AUTHOR> This looks a -lot- like the REST service I'm building at work. Many of the concepts are identical. I started with Zend Framework, though.

Since I was treading new water (I didn't find any other REST services built with Zend that I could learn from), this makes me feel really good about my approach to this problem.

And I have to say, it's been awesome to work with compared to some other in- house frameworks I've dealt with in the past. (Including my own. Heh.)</comment>


Ask HN: Why isn't native mobile libraries written in C? - <AUTHOR> I've always wondered why Apple and Google decided to use Objective-C/Swift/Java for their native iOS/Android libraries instead of plain C. Considering you can write bindings to C in virtually every programming language out there whether the programming model differs a lot or not (e.g OO or functional), you would be able to create mobile apps in any language you want if it can target the architecture.<p>Is there any particular reason why Google and Apple didn't take this approach? Does it introduce problems with the permission systems for apps? Security issues? <comment><USER3> It takes way too much of time to code, its complex, then there is porting and mainly there is no need to use C with kind of mobile specifications we've these days. These phones are faster than computers 15 years ago.

I have been part of teams where entire stack (even UI layer) was in C. malloc() was a prohibited function by design! It was way too much of code for what could be accomplished by having c++-STL these days. But then the system specifications were very low (~130 Mhz) too.

In one of embedded projects couple of years earlier - the trade off discussion we had was whether to include boost or to have a JVM ported to it! So we 've come far away.

With good chances of myself corrected here - I 've a feeling that C will be restricted to drivers/kernel, in most systems going ahead, as everything that can be written in C in rest of layers can be written in OO languages.

eg: OS based on nodejs on top of linux-kernel: [https://node- os.com/](https://node-os.com/)

<comment><USER4> Can you elaborate on why malloc() was prohibited?

<comment><USER3> Designing of component also involved a meticulous way of finding how much memory would be used. Most of the memory used was in stack and bss - <USER2> maintain model-and-state-machines. Predominantly these were 'static' variables. Then any allocation on heap was done using local-heap manager functions. Local-heap-manager allocated buffer of 3 or 4 sizes usually in terms of large kilo bytes - this was usually to process audio/video/image(AVI) frames. These allocation were mainly called by components involved in AVI libs. And any call to local-heap-manager had to get some sort of approval at architecture level - most of the time if it was not for AVI - it would be turned down with plenty of debate. This local-heap-manager abstracted to sort of a pipeline at system level. Only one pipeline can be active at any given state. Switch of pipeline meant - release-allocation of these large chunks of memory. Each pipeline involving say x components would use highest possible memory of say y. The error that was usually frowned upon was 'low memory' of system - this usually occured when a hardware unit was slow to process say a block of AVI. Also the total cpu load of each pipeline was also monitored.

</comment></comment></comment><comment><USER5> Firstly, C kinda sucks. Undefined behaviour is unavoidable, and compilers see it as license to do whatever they please, so you can actually get a segfault because the compiler decided to "optimize" away your null pointer checks. C is also dangerous, and Apple and Google don't want users getting segfaults. And even if the plan was to bind the C apis to high level languages, people would just write their apps in C.

Secondly, for stateful graphics programming, the most common kind of application on mobile, OO works really well. So Apple and Google both picked languages that support OO.

Finally, despite all this, both Apple and Google have native C apis. You can write C freely in Objective-C, which is a superset, and Android has its NDK.

<comment><USER6> Compiler dev here : "and compilers see it as license to do whatever they please", isn't that the definition of undefined behavior?

<comment><USER5> Well, yes. That's why compilers can comply to the spec and do that. But nobody EVER writes any C with no UB, so there are no guarantees about how the compiler will compile it. Most C programmers, I would guess, do not know the entire list of UB. The end result is that you can write code that looks completely safe to most, but compiles without any checks.

</comment></comment></comment><comment><USER6> While interopability is important in the desktop and server space, and for legacy systems, I am not 100% convinced that for a new and highly curated/guarded platform like android/iOS it matters that much. Google/Apple expect most people to develop using the platform canonical language.

Also while C has great interop. it still comes at a cost, you loose a lot of modern programming constructs like exception, static initialization, reflection and garbage collections.

</comment><comment><USER7> My #1 complaint about C is the .so file doesn't contain enough metadata to introspect functions and fields enough to use them metaprogramatically without also looking at the .h file; you can get the address with a symbol but that is not complete.

Compare that to Java where you can look at the class file and get enough metadata to do anything.</comment>


Is Toxic Masculinity a Valid Concept? - <AUTHOR> https://www.psychologytoday.com/us/blog/homo-consumericus/201803/is-toxic-masculinity-valid-concept <comment><USER2> This article is very high level, but I have been giving this some thought. Some aspects of masculinity can be toxic to the people around the man, but those aspects also tend to be something that was once (and no longer is) evolutionarily preferable. An example might be a man who has casual sex with lots of women. If there is one thing those men tend not to do, it's reproduce successfully. This is pretty ironic, because through most of history this may have been a singular factor affecting the extend of one's reproductive success. Toxic masculinity then might be something that used to have reproductive utility, doesn't anymore, but is perpetuated mainly by men and for men. It's mostly men that are impressed by hookups that other men have. No one is nearly as "impressed" when you actually have a child and raise them to be successful, which is strange, because that is the essence of reproductive. Whatever men do that is good for reproduction in our actual environment (make big bucks in tech being an example of something that has no precedent in evolution) could be considered masculine. Whatever men do, to impress other men, that is harmful to the people around them and yet not useful for reproduction (lots of casual sex while using birth control) could be considered toxic (?). Otherwise, no, whatever works isn't toxic.</comment>


Ask HN: What is the best way to start a social networking site? - <AUTHOR>

I have a great idea for a social networking site and would like to know what is the best way to go about doing it.  This would be a side project for me since I have a full time job.  Any help would be greatly appreciated. <comment><USER2> Is your concept so different you need a new system? Or could you piggy back off Facebook/Twitter and use their social graph API's?

<comment><AUTHOR> My idea is a social network for competitive gamers. The way I imagine it is sort of like a linkedin for pro-gamers. If the social graph API's allow me to build something like that I would be more than happy to use them. Do you think those API's would help in building something like what I described?

</comment></comment><comment><AUTHOR> Let me clarify, should I start from scratch or is there some sort of framework that I could use?</comment>


LuaJIT 2.0.5 and 2.1.0-beta3 released - <AUTHOR> http://luajit.org/ <comment><USER3> LuaJIT powers OpenResty[1] which powers my web framework Lapis[2] which powers my company itch.io[3]! (wow that's a mouthful)

Anyway, it's a stack I'm really happy to be using. Asynchronous IO without any code nesting. I wrote more about the benefits here: [http://leafo.net/posts/itchio-and- coroutines.html](http://leafo.net/posts/itchio-and-coroutines.html)

[1] [https://openresty.org/en/](https://openresty.org/en/)

[2] [http://leafo.net/lapis/](http://leafo.net/lapis/)

[3] [https://itch.io/](https://itch.io/)

I also made web server infrastructure for the Lua package manager LuaRocks in the same stack: [https://luarocks.org](https://luarocks.org) Source is on github: [https://github.com/luarocks/luarocks- site](https://github.com/luarocks/luarocks-site)

Lua (especially with LuaJIT) is a great choice for web development.

<comment><USER4> Love Lapis.

Question, since Lapis just transcode Moonscript into Lua to be used with OpenResty - why is Lapis so much slower than raw OpenResty/Lua?

[https://www.techempower.com/benchmarks/](https://www.techempower.com/benchmarks/)

<comment><USER5> Because the lua code moonsript emits is inherently slower.

<comment><USER3> Not really, the code mapping is very straightforward and generally has no performance degradation. There are some language constructs that are implemented in a way that can create anonymous functions in order to convert statements into expressions. Future versions of MoonScript can do a better job to eliminate those. If you're aware when they're generated you can avoid them by writing as you might do in Lua. Realistically though, the performance difference is negligible in comparison to all the other things that might happen in your average web request.

</comment></comment></comment></comment><comment><USER6> LuaJIT is such an amazing piece of software - apparently to such an extent that only Mike Pall fully understands some of its internals. Besides being much faster than the official Lua VM, it offers extended features like the FFI library [1].

Kong[2] uses it extensively, by leveraging the underlying OpenResty[3] framework.

[1] [http://luajit.org/ext_ffi.html](http://luajit.org/ext_ffi.html)

[2] [https://github.com/Mashape/kong](https://github.com/Mashape/kong)

[3] [https://github.com/openresty/lua-nginx- module](https://github.com/openresty/lua-nginx-module)

<comment><USER7> > LuaJIT is such an amazing piece of software - apparently to such an extent > that only Mike Pall fully understands some of its internals

Fully agree about the awesomeness of LuaJIT and incredible capabilities of Mike Pall, but also the reason I've stopped considering using LuaJIT for projects that should be "future proof". I think that depending on technology which can only be maintained by one genius is too much of a risk.

</comment></comment><comment><USER8> Looking at the LuaJIT changelog [1], it's interesting how many bugs need fixing in each version: 20 in 2.0.5 and 32 in 2.0.4.

Compare this with PUC Lua [2], which seems to have very few bugs: only 4 in 5.3.3 and 3 in 5.3.2.

LuaJIT and PUC Lua appear to be very similar superficially ("LuaJIT is Lua, but fast"). The relative bug counts reinforce the fact that in the details, the two implementations are very different - for example, LuaJIT uses a lot of assembly language while PUC Lua is pure C89.

The advantages of LuaJIT over PUC Lua seem to be performance and its FFI. I thought PUC Lua's only advantage was portability, but perhaps PUC Lua is also a generally more "correct" implementation?

[1] [http://luajit.org/changes.html](http://luajit.org/changes.html)

[2] [https://www.lua.org/bugs.html](https://www.lua.org/bugs.html)

<comment><USER9> Not only does LuaJIT have platform-specific assembly in its source, but a big part of its advantage over PUC Lua is of course that it's compiling down to machine language on the fly. And that process is also platform specific. I have definitely seen bug fixes along the lines of "fix X for Y platform's JIT output."

I have also seen non-jit-related bugs impact us in production.

BUT, LuaJIT _really_ is FASTER. Even when JIT cannot be used (e.g. on iOS), it can still be several times faster than PUC Lua.

And that speed is a real killer feature for us. Otherwise, we'd just use JavaScript.

<comment><USER10> Do you find LuaJIT much faster than a JavaScript engine like V8? That used to be true, but I was under the impression that V8 had basically caught up (unless you need to make a lot of FFI calls, since LuaJIT is heavily optimized for that).

<comment><USER9> I may be behind the times, but last I checked there was no way to use JITed JavaScript in iOS apps. Or maybe you could put JS in a hidden webview, but bridging to native was extra slow with this approach?

While LuaJIT can't be JITed either on iOS, I think the general consensus is that non-jit Lua is faster than non-jit JS.

I do a lot of bridging Lua to native, and that's another area where Lua is often considered more efficient.

Again, these thoughts may be out of date.

</comment></comment></comment></comment><comment><USER11> If you want to get an idea just how good LuaJIT is take a look at these benchmarks against the stock VM(which is already good) [1][2]

We used to run Lua on a 300MHz MIPS processor and it was impressive in how well it worked on that constrained platform(only 8mb is system ram, of that Lua ran in a fixed 400kb block).

[1] - [http://luajit.org/performance_x86.html](http://luajit.org/performance_x86.html)

[2] - [http://luajit.org/performance.html](http://luajit.org/performance.html)

<comment><USER12> The most impressive part of LuaJIT is that its non-JIT'd interpreter is _several times_ faster than Lua in benchmarks. Great for platforms like iOS which don't allow code modification at runtime.

</comment></comment><comment><USER13> Didn't Mike Pall step down sometime last year? It looks like he's made a ton of commits [0] and also made the announcements on the mailing list [1]. Anyways, congrats on the new release!

[0] [https://github.com/LuaJIT/LuaJIT/commits/master](https://github.com/LuaJIT/LuaJIT/commits/master)

[1] [https://www.freelists.org/archive/luajit/05-2017](https://www.freelists.org/archive/luajit/05-2017)

<comment><USER14> The commit author doesn't tell the whole story: the long description on most of the recent commits mention somebody else.

</comment></comment><comment><USER15> For an editor built from the ground up using LuaJIT see [https://howl.io](https://howl.io)

[/plug]

<comment><USER16> The documentation could use a section explaining what Howl has to offer over other text editors than are extensible using Lua, such as Textadept ([https://foicica.com/textadept/](https://foicica.com/textadept/)).

<comment><USER15> Good point. It's hard to highlight certain differences because it's a very different editor. In general I think Howl offers a better API and a more keyboard centric UI compared to Textadept. Most commands are operated via the command line which offers auto-complete (vs operating via the menu bar, with custom dialog boxes for each command). Howl also doesn't use Scintilla (Textadept does) and is not subject to Scintilla's limits.

</comment></comment></comment><comment><USER17> Really can't understant why Lua isn't more used. It play the same role as Ruby, Python and JS and is very fast, at least, much more then Ruby and Python.

<comment><USER18> Batteries are not included in Lua. To do most anything interesting requires third party libraries (like directory manipulations, network, etc).

<comment><USER19> Not just that, but Lua is very conservative about adding new language features so a lot of quality of life things are missing - no ternary operator, verbose lambda syntax, the incoherent mixing of arrays and dictionaries, bad default scoping, stuff like that.

<comment><USER18> If you are willing to fork Lua (and it's been done---one example is Ravi, which brings static typing) you can fix the verbose lambda syntax ([http://lua-users.org/lists/lua-l/2017-04/msg00387.html](http://lua- users.org/lists/lua-l/2017-04/msg00387.html)) and add ternary operators (which I haven't missed). I haven't found the mixing of arrays and dictionaries that bad in practice (and I do a lot of Lua programming at work) and the default scoping ... yeah, I can see that (I've learned to deal).

<comment><USER20> I had a fork a long time ago solely to allow the use of "?" in function-names. Writing:

        function alive?
           ... blah
        end

Is so much more natural, after being exposed to ruby. But maintaining forks is hard, so I've slowly gotten use to the standard.

It's a shame that the development is so conservative, and closed, but despite that it is a great language to play with.

<comment><USER21>
        A function that tests for something involving its arguments
        is called a predicate and usually ends in p or -p.

[http://www.cliki.net/Naming+conventions](http://www.cliki.net/Naming+conventions)

</comment></comment></comment></comment></comment></comment><comment><USER22> Build system in pure Lua: [https://github.com/rweichler/aite](https://github.com/rweichler/aite)

3DS port: [https://github.com/rweichler/luajit-3DS](https://github.com/rweichler/luajit-3DS)

iOS runtime inspector: [https://github.com/rweichler/lucy](https://github.com/rweichler/lucy)

Cydia alternative: [https://github.com/rweichler/jjjj](https://github.com/rweichler/jjjj)

And this is just stuff by me, some schlep. LuaJIT is so underrated it's kind of sad.

</comment><comment><USER23> Don't forget the Not Yet Implemented features: [http://wiki.luajit.org/NYI](http://wiki.luajit.org/NYI)

Edit: By the way, can someone explain why ipairs() is implemented, but not pairs()?

<comment><USER24> Those are just features that aren't _JIT compiled_. They are still implemented, in the sense that LuaJIT fully supports them in the interpreter, so you can use them in LuaJIT programs.

I'm guessing that pairs() is not JIT-compiled because iterating over a hash table involves logic that is significantly more complicated than iterating over an array (like ipairs()).

</comment></comment><comment><USER25> I'm still unable to use LuaJIT because the build system makes an incorrect and silly assumption that code compiled during the build by the build compiler had the same executable properties as the code compiled during the build by the host compiler, leading to the situation where: repeatable builds don't work, and you can't compile for Linux/x86_64 from Linux/x86 or Linux/arm.

It is one of very few packages broken this way, along with basically only XFree86 4.8.0

:-(

</comment><comment><USER26> I hooked up LuaJIT to emacs for fun. Emacs recently released a new module system where you can build DLLs that are loaded dynamically: [http://diobla.info/blog-archive/modules-tut.html](http://diobla.info/blog- archive/modules-tut.html)

Getting LuaJIT to work on 64-bit OS X required building a custom emacs with linker flags -pagezero_size 10000 -image_base 100000000. This is unfortunate since obviously users will not take the time to build an emacs with custom linker flags. But more generally, this is an issue any time you want to embed LuaJIT in an application plugin rather than the application itself.

There's a bunch of scattered info about the issue:

[https://gist.github.com/nddrylliog/8722197](https://gist.github.com/nddrylliog/8722197)

[http://hacksoflife.blogspot.fr/2012/12/integrating-luajit- wi...](http://hacksoflife.blogspot.fr/2012/12/integrating-luajit-with-x- plane-64-bit.html)

[https://en.blog.nic.cz/2015/08/12/embedding-luajit- in-30-min...](https://en.blog.nic.cz/2015/08/12/embedding-luajit- in-30-minutes-or-so/)

[http://luajit.org/install.html](http://luajit.org/install.html)

I was hoping there might be a way of sidestepping the issue somehow. If anyone has any ideas, it would be appreciated. LuaJIT has some nice speed improvements compared to standard Lua, but more importantly it has a pretty amazing FFI library. The C declaration parser in particular is valuable.

(Yes, I know it's pointless to hook LuaJIT to emacs. It's mostly a "just because" project.)

<comment><USER27> > I was hoping there might be a way of sidestepping the issue somehow. If > anyone has any ideas, it would be appreciated. LuaJIT has some nice speed > improvements compared to standard Lua, but more importantly it has a pretty > amazing FFI library. The C declaration parser in particular is valuable.

Why use LuaJIT over plain Lua here? I can't imagine that you need the extra speed in a text editor. The ffi is available for normal lua too: [https://github.com/facebook/luaffifb/](https://github.com/facebook/luaffifb/)

<comment><USER28> Because it's so easy. From the manual:

So here's something to pop up a message box on Windows:

        local ffi = require("ffi")

        ffi.cdef[[

            int MessageBoxA(void *w, const char *txt, const char *cap, int type);

        ]]

        ffi.C.MessageBoxA(nil, "Hello world!", "Test", 0)

Bing! Again, that was far too easy, no?

Compare this with the effort required to bind that function using the classic Lua/C API: create an extra C file, add a C function that retrieves and checks the argument types passed from Lua and calls the actual C function, add a list of module functions and their names, add a luaopen_* function and register all module functions, compile and link it into a shared library (DLL), move it to the proper path, add Lua code that loads the module aaaand ... finally call the binding function. Phew!

<comment><USER26> In fairness, luaffifb seems to give the same feature.

I think the main argument against Lua + luaffifb is that it might require an external dependency: luarocks. Whereas if someone were to theoretically provide Lua integration with emacs, it might be a good idea to offer the ffi library as a baseline feature.

This is a weak argument, because it should be possible to embed luaffifb plus Lua inside of a linked library, with no need to depend on luarocks.

It's probably best to explore both options.

<comment><USER15> Well, LuaJIT will also JIT compile Lua code operating on C structures - <USER2> speed could be another big argument.</comment></comment></comment></comment></comment>


The Lost Art of Threaded Discussions (2009) - <AUTHOR> http://cafbit.com/entry/the_lost_art_of_threaded

<comment><USER2> Unless you've actually used a decent newsreader like trn, It's difficult to appreciate just how much we've given up by moving most online discussions to the web. Loss of threaded discussions isn't the worst of it -- many of the web-based discussion boards I frequent don't even properly track _which messages you've actually read_ , using a vague "last time you visited" heuristic instead.

I miss being able to catch up on all my discussion topics using almost nothing except the space bar.

<comment><USER3> Usenet was a truly amazing thing. The problem was that it just wasn't scalable, there was a sweet spot relative to community size that if you happened to be around to experience was amazing, but as the internet has grown, and grown, and grown usenet became less and less sustainable. And now we're trying to claw our way back up to that level by inventing new systems that handle the scaling problems of communities better, but it's been and will continue to be a long slog.

<comment><USER2> Agreed re: community size and Usenet's inability to scale to it (see: <http://www.studio-nibble.com/lazlo/images/wiredquote.jpg>). My lament is strictly about the tools used to interact with that community.

Most web discussion boards are just GUI on top of a message store, and the reading/posting pieces of NNTP are a stable, standardized API for interacting with just such a message store. If every VBulletin instance _also_ exposed an NNTP interface to its message content, I think it would be a huge step _forward_ for discussion-board usability. (Well, once the NNTP-client world woke back up again. Are there even any actively-developed NNTP clients left that aren't focused on guzzling pirated media from the _.binaries._ groups?)</comment></comment></comment>


Any book you want in exchange for DarkNote XDN - <AUTHOR> http://darknotebooks.weebly.com/

<comment><AUTHOR> DarkNote Books is the first book store that accepts DarkNote XDN cryptocurrency ([http://darknote.cc/](http://darknote.cc/))!

20% discount for the first customers.</comment>


Facebook Launches Mobile Ad Network - <AUTHOR> http://techcrunch.com/2012/09/18/facebook-mobile-ad-network/ <comment><USER2> Came here to hate, left pleasantly surprised.

This is a fantastic idea. Ads, without having to put them in the actual application. Can't argue with that.</comment>


Special report: Profiting from prison - <AUTHOR> https://www.axios.com/profiting-prison-c2bd43b2-4b2f-44ee-8f23-c6c9a14c1aaa.html <comment><USER2> The entire concept of a private prison kind of disgusts me. We sh. In most states we purposefully strip away their right to vote after this, so the people who have to experience these terrors first-hand don't even have any kind of say in regards to changing this.

You can read horror stories of prison companies only having one underpaid doctor for multiple prisons forcing inmates to wait weeks to get treatment for basic injuries, leading to broken bones healing incorrectly, or dying from appendicitis.

I realize that it's easy to have the mentality of "if you can't do the time don't do the crime", and I guess at some visceral level I can agree, but it feels like, no matter who you are, there should be some minimal level of humanity.

<comment><USER3> There are 12 states that are hard to get your voting rights back after serving time for a felony.

[http://www.ncsl.org/research/elections-and- campaigns/felon-v...](http://www.ncsl.org/research/elections-and- campaigns/felon-voting-rights.aspx)

I do agree we need a major overhaul of what we do with those who do not adhere to society and the the rules within.

We need to separate violent/nonviolent crimes better than we do now. When someone who gets busted for growing a plant repeatedly gets thrown into a prison with child molesters/rapists there is an issue.

I believe they already do try to separate this out but the way in which we try to rehabilitate those who have been convicted should change as well.

For non-violent offenders we should rehabilitate them more like Norway [https://www.businessinsider.com/why-norways-prison-system- is...](https://www.businessinsider.com/why-norways-prison-system-is-so- successful-2014-12)

And for those who are nothing but a total net loss on society, someone who has no inner morals and has raped, killed, hurt children type - having them go to 'prison' where they are exploited for profit (modern day labor camps?) I see no harm with it, as long as that profit doesn't line pockets of individuals (which it does currently guaranteed)- but rather pays back the operating costs/society itself for the negative strain the individual creates.

The idea that all people can be 'saved' or shown the light is garbage, there are monsters in the world who will always be monsters and should be treated as such.

<comment><USER2> I agreed with you until the last line.

Can all people be "saved"? Probably not, but I don't know that that's a valid excuse to get into this scary nightmare of "we can do whatever we want with these people".

First off, people _are_ wrongly convicted of crimes, even heinous ones like rape and murder. Fortunately, it's not as common nowadays since DNA is pretty cool, but it still happens, and I don't know that I feel comfortable doing something like waterboarding to someone that might be innocent.

But honestly, even if we could somehow guarantee that we never have an innocent person in jail, I still think it's wrong to mistreat a human more than a certain level of punishment. Whether or not we can "save" them is sort of irrelevant in my mind.

Admittedly this is a more "feels-based" argument, but I think that the more dignity that we treat our prisoners with, the less apologetics we'll have to deal with to future generations. I genuinely can't see history looking kindly on the conditions of current private prisons.

<comment><USER4> I like to think more in terms of wasted money. Imprisonment is a waste. For the murderers take a hand or arm. If they repeat take the other, eventually they won't have the physical apertures to commit the crime in the first place. Maybe also exile them to Mexico or something. Make them not our problem. For everyone else who's non-violent I think community service and house arrest plus the public shame of being a convict should be enough.

Maybe forced education along-side community service, so they are forced to become better via becoming smarter...

I say this tongue in cheek (a little) as a staunch progressive and bleeding heart liberal. I know it's not humane to 'take an appendage', and I'm against the death penalty, but also as a pragmatist that would much rather see tax- payer dollars spent on single-payer healthcare than incarceration - we need to ensure public safety from those who may not be able to be fixed. I'd like to honestly find something that is streamlined, cost effective, and has zero incarceration time involved, is humane as possible and benefits the most people in society. Murderers and violent thieves (with a deadly weapon) lose varying 'lengths' of their appendages. There should be a line drawn at things like bar fights, and maybe leniency for first-timers. Could be as small as 'take a pinky'.

If we could completely end private prisons, and insurance in the country we'd save a ton of money per capita to use for other much more worthy endeavors.

</comment></comment></comment></comment><comment><USER5> Jail overpopulation is the real problem.

Legalization of all drugs seems the way to go. There is no reason why the government should be enforcing what you can and can't put in your own body. Even if it's bad for you.

<comment><USER6> I'll give you a good reason, healthcare costs. You think all that life saving medical care after an overdose is free or cheap? It's the same reason why motorcycle helmets are required by the government in many states. The public doesn't want to pay for the un/under-insured comatose rider's prolonged stay in the hospital after an accident.

<comment><USER7> Does it cost more to treat an overdose than it does to hold someone full-time in prison?

<comment><USER6> Undeniably, yes, it costs more to treat a patient on a per/day basis.

US Federal inmates cost ~$38,000 per year or ~$107/day. (approx based on previous years' info) [0] Just the ambulance ride alone is going cost much more than that. Add in hospital admission and treatment for all those nasty needle shared diseases and maybe an organ failure or two (livers can only put up with so much abuse) and the cost skyrockets.

[0][https://www.federalregister.gov/documents/2018/04/30/2018-09...](https://www.federalregister.gov/documents/2018/04/30/2018-09062/annual- determination-of-average-cost-of-incarceration)

<comment><USER4> You forget all the people dying from overdoses, those people don't cost a cent, and save money because that's less drain in your hypothetical scenario because they're no longer around to drain the system. I don't know many drug users who wast 30k per year on medical, most probably don't even go to the E.R. unless someone else takes them. Many are dying just because they are not too big on self-care in the first place.

Also 38,000 seems a little low, but I guess averages. It's more than that though, you're taking away any tax dollars that person could be spending assuming they would make enough and if they're missing out on crucial years to get an education and could be higher contributors to society but aren't then you miss out on that as well.

Prison also often creates career criminals from those who maybe otherwise wouldn't have been. Legalizing all drugs (possession - not sales), the sex trade, and other crimes of 'morality' that harms nobody but the perpetrator would go along way to cut costs. After we do that we can look at ways to replace those societal habits and issues with something better.

Not saying they need be set completely free, but drug use isn't a criminal act. Often it is one of mental issues. It's more a mental medical issue than a criminal one and should be seen as such. Nobody with a mental illness should be in prison because of their illness and because they can't get treatment elsewhere.

If they have no mental issues, they should be required to do community service, as well as get an education. Let's not only make community college free, let's make it a replacement for prison for non-violent offenders so that would be career criminals can become professionals in another much more redeeming career.

</comment></comment></comment></comment></comment><comment><USER8> The principle at stake is that _no one must benefit_ from someone's imprisonment. There can be no financial incentive to hold someone in confinement. There should be no attempt to offset the costs of incarceration or exploit the labor of inmates.

</comment><comment><USER9> I would just like to state for the record that not all companies in the rehabilitation-space are scummy and greedy. While there are other companies in our field (I won't mention any names as we work with some of them) that fall under that umbrella there are other companies, like mine, dedicated to improving the lives of people once they get out of jail or in some cases keeping them out of jail in the first place.

As far as I know we were the first ones to release a very low-profile ankle bracelet [0] and give participant's a phone they can use to keep in contact with their supervisors. If you don't know much about the rehabilitation-space then you might not understand how big of a deal that is but understand that before us the only monitoring systems in existence were bulky ankle bracelets that could barely last a full day on a charge and provided no more than beep/buzz as a form of communication.

The ability to reach out and talk to a participant is huge deal as we can steer someone back from doing something like violating parole/areas they aren't allowed to be in. Before this the "solution" was to just dispatch an officer to the location the ankle bracelet reported. Now we can proactively call them when they are going somewhere they shouldn't be and give them a chance to reconsider. You have to remember that a number of people on our program either can't afford a phone and/or the service for it so it's not as easy as just "call the participant". Using our program we insure there is a stable line of communication at all times.

We also work to provide a spectrum of options for our agencies to use from Ankle Bracelet+Phone, to just Phone, to just an app on their own phone. Agencies can use this move participants between our offerings as they move between perceived risk levels. You might put someone right out of jail on a Bracelet+Phone and then graduate them to just the Phone after a few weeks. You might just use our Check-In app to periodically check in with the participant. You might use our video chat app built into our phone (we do NOT charge by the minute or anything scummy like that) to avoid having to have them come into the office (in a lot of jurisdictions a video chat can be legally equivalent to a face-to-face visit, either at the station or at a participant's house).

I could talk about this for hours but I'll leave you with this, our mission statement:

> Corrisoft's mission is to deliver advanced technology services that enable > community supervision agencies to engage with their clients more > effectively, drive better outcomes, and reduce recidivism.

I'm sure other companies might use similar language but from the inside I can tell you we really mean it.

[0] [https://corrisoft.com/air-smartphone-supervision- solutions/](https://corrisoft.com/air-smartphone-supervision-solutions/)</comment>


9th Circuit: Collecting Unencrypted Wireless Net Messages Covered by Wiretap Act - <AUTHOR> http://www.volokh.com/2013/09/11/ninth-circuit-holds-intercepting-unencrypted-internet-communications-covered-wiretap-act/

<comment><USER2> Interesting result. That will make WEP cracking more fun to prosecute.</comment>


Show HN: SimAirport – Our 'pivot' from web dev - <AUTHOR> http://store.steampowered.com/app/598330/SimAirport/ <comment><USER2> My impression was always that Maxis/EA were very aggressive legally against anyone else publishing games with "SimX"\- style titles.

Is this not the case? Or maybe they're not as aggressive on this front as they used to be?

<comment><AUTHOR> It's the one thing I can't talk about publicly, as much as I'd really, really love to. All I can really say is that we're in the process of securing the trademark right now; and we definitely obtained counsel's advice, far before deciding on & moving forward with the name. =)

<comment><USER3> Ouch. Get better council...

</comment></comment></comment><comment><USER4> That looks _obsessively_ detailed. How well does the simulation scale? Can I simulate a Changi or a Dubai?

<comment><AUTHOR> Unfortunately we're hitting some scaling issues, we're exploring some ways around them, but even in "clean slate" tests we're struggling to exceed ~10k agents in motion without framerates starting to dwindle. We've also very quickly learned that multi-threaded development is, or can be, quite difficult & tedious. Things can go wrong in even more ways than we'd have imagined, though it has been a fun challenge too.

Right now, players with higher-end computers are reporting that they're able to push ~3k or so "pax" (passenger agents) before framerates start to get choppy.

When we receive save game files with bugs to look into, and we load them up and see 4-5k+ pax, we cringe a bit (and it's even worse w/ all our logging on, etc). ;-)

As far as details go, the algorithm for passenger needs/desires/selection is pretty neat -- it uses "delta need scoring", it's quite a robust approach & also a decently-scalable system.

<comment><USER5> If you don't mind my asking, which parts of the agent logic tend to be the profiling hot spots when you have several thousand of them? Do you end up running into a combinatorial explosion somewhere?

</comment></comment></comment><comment><USER6> Did you guys use any particular toolset to build the game? Looks fun.

<comment><AUTHOR> Yep, we used Unity. It gets a hard time sometimes, but if you treat it just like you would any other toolset/language/tool, it really is pretty great. It's also pretty easy to jump into, and have something running quick (Hello World style), though definitely takes some time to get used to the different paradigms and the "Unity Way".

<comment><USER7> Just don't start wanting users to chat with emojis and you're fine.

<comment><AUTHOR> I may be (probably am) missing the reference -- but my first instinct would be to check out TextMeshPro for something like that, especially if you want to keep draw calls low/when performance is a supreme concern.

Apologies if it's just a reference I totally missed though! =)

</comment></comment></comment></comment><comment><USER8> This looks very, _very_ similar to Prison Architect, down to the builders, build menus, etc. Are you worried about a backlash from PA fans?

<comment><USER9> I think these are free assets, Rimworld looks a lot like Prison Architect, and I have seen other indie games with the same assets.

Why would PA fans be upset? There's a whole other game to experience now, with a similar look and feel to their favourite...

<comment><USER8> No, that's wrong. PA developed their own assets.

Tynan Sylvester (the Rimworld developer) made his own art, intended as placeholder art, minorly inspired by Prison Architect. The games however are extremely different when it comes to mechanics.

This game however seems to directly copy a large chunk of PA's gameplay.

</comment></comment></comment><comment><USER10> Can you talk about the "pivot" from web dev? Would be interested in learning why you pivoted, how you decided to pivot into creating a game, etc.

Game looks cool though.

<comment><USER11> I'm curious about this as well. I feel like there is a lack of context. Who is this? What does this have to do with web dev?. The company is LVGameDev LLC, but I can't find anything about them beside that they made this game. Is there a previous HN posting I should be reading as well?

<comment><AUTHOR> Me and my partner are just long-time, avid HN readers...

Will respond to the parent post shortly as well, just want to make sure I take enough time to answer well/thoroughly. =)

</comment></comment></comment><comment><USER12> This is an amazing technical achievement. I hope it's also a successful business. Congratulations on the algorithms.

</comment><comment><USER13> Awesome! Played Airport Tycoon a bunch as a kid, just need to see if it has the distorted PA sound effects too, haha</comment>


Show HN: A first project in Rust – in-memory order book - <AUTHOR> https://github.com/connorwstein/exchange <comment><USER2> Heh, I also released my first project in Rust yesterday. An ncurses gopher client. I probably missed many patterns and idioms as well. Starting with Rust is quite hard, even as an experienced developer. I spent hours "fighting" the compiler. Code available at [https://github.com/jansc/ncgopher/](https://github.com/jansc/ncgopher/)

<comment><USER3> Could you talk a bit about the kinds of things you had to fight the compiler on?

Can you identify any idioms or approaches that seem normal or natural in other languages, but which are problematic in Rust?

<comment><USER2> Two examples: The application has two main components, a controller and a struct containing the ui implementation. Callbacks in the cursive library are called with a reference to Cursive, but I had a hard time figuring out how to pass the controller to the callback. In the end I decided to use a message channel (mpsc::Receiver and mpsc::Sender) to let the two components communicate. After some struggling I saw that cursive has a function to set user data which is accessible inside the callbacks. So I pass the channels through userdats. Not sure if this is the best architecture. I never managed to pass a reference to the controller to the ui callbacks. The Compiler complained about undefined lifetime of the reference, though I knew that both outlive the application runtime.

A similar situation occurred in the asynchronous communication with gopher servers. I use a thread to fetch a resource from another server while keeping the ui responsive. Passing the result from the thread back did not work out in the beginning.

I don't think the idioms are so different in Rust, but when passing data between components, threads and the like, you have to be very specific in your code, using Arcs, RwLocks, Mutexes, etc.

On the bright sight, when the code compiles, it usually worked as intended. Using C or C++, there would be more race conditions, null pointer exceptions and more.

</comment></comment></comment><comment><AUTHOR> Feedback welcome! I'm sure I'm missing loads of Rust patterns and idioms...

<comment><USER4> Some comments:

Async/await syntax is poorly documented across the ecosystem but has landed now and is useful, without it codebases will look outdated soon enough, hyper itself has some of the best docs

Lazystatic is popular way to use globals like that yet don't really bother with it anymore. The paradigms are a bit different for a language, you are discouraged from such things for a reason, there's certainly ways around using globals.

You don't need _extern crate_ with 2018 edition and macros are automatically imported

<comment><USER5> Instead of lazy static, use once_cell's Lazy type[0]! It is a replacement that does away with the macro-based approach, possible thanks to improvements in const fn. This leads to improved IDE experience.

[0] [https://docs.rs/once_cell/1.3.1/once_cell/](https://docs.rs/once_cell/1.3.1/once_cell/)

</comment></comment></comment><comment><USER6> If this is intended as anything more than a toy, you don't want to store the full OpenLimitOrder in the book data structure.

The symbol should be allocated once on the book. The side is allocated twice in each set of vecs. The price is defined in the vec itself. The queue should be a vec of IDs and open size. The real struct should only be constructed lazily as absolutely needed.

<comment><AUTHOR> I suspect it will remain a toy, but agreed on those optimizations

</comment></comment><comment><USER7> I don't do Rust but that was nicely readable. One comment: using Enums for stock symbols presumably forces a recompile on each new symbol. What would be the idiomatic representation in Rust for things like that? Some kind of interned string?

<comment><USER5> A string works. If a numerical/in-place representation is wanted for efficiency, you could rely on the fact that stock symbols are always less than 8 characters, so we can parse it into an array of 8 bytes.

<comment><USER8> Is wrapping a String in a semi-opaque newtype (or a type alias at least) good to encode the semantic meaning of the string type?

</comment></comment></comment><comment><USER9> Great stuff! Since we're working on things like that on the daily, you have inspired me to do something like that in elixir :)

</comment><comment><USER10> Why use a Vec instead of a B-Tree?

<comment><AUTHOR> I was imagining inserts at an unoccupied price level would be relatively rare in normal order book operation, so a Vec just seemed simpler

<comment><USER11> They aren't that unusual on an absolute basis but relative to the number of orders in a stock they are quite rare (iirc - it's been a while since I was directly involved in this).

This is a cool project btw - I'm looking for my first chance to really sink my teeth into rust so found it interesting. A few non-rust observations (you probably know all this but kept your orderbook simple which is totally cool but just in case):

An actual order book has a "tick ladder" which specifies which price points are valid for a given ticker on a given venue. This means you actually know all the possible prices ahead of time. If you ever wanted to productionize this you could probably take advantage of that and make a custom data structure that used the fact that you had all the keys preset and did the insert and lookup in O(1).

Secondly in real life the matching logic is quite a bit more complex because of order flags and venue logic. If you're just covering US venues you don't need to worry about venues because of Reg NMS but anywhere else you'll want the order books to actually by venue and symbol not just symbol.

Order flags interfere with matching in a number of ways. Firstly a normal limit order will partially match up to the limit and any remaining quantity will sit on the book waiting to be matched. You can flag the order as "fill or kill" to say fill the whole order or nothing and you can flag it as "immediate or cancel" to say don't put any remaining quantity passively on the book. There are many other order flags but those are probably the most important ones for matching.

Secondly on many venues orders can have an iceberg order type which means that only the "tip" quantity gets shown on the book but they will actually match up to a larger quantity at that price.

Finally you can add a "minimum executed quantity" on any passive orders to prevent pinging (information leakage). This will only match with incoming orders bigger than the MXQ, so messes with the normal price, time ordering. Orders behind that order could match first potentially. MXQ is more important for dark venues or order types so maybe you don't need to consider it.

<comment><AUTHOR> Thanks for the info! I definitely did not know all of that :). I do work at a crypto exchange, but on the custody/stablecoin side, not the exchange team.

Can you elaborate a little on the "pinging" process to extract information? Sounds interesting

<comment><USER11> You are most welcome. I'd be somewhat surprised if crypto exchanges supported all the same stuff I mentioned - it's based on my history on equity exchanges and I'd expect crypto to be different.

Anyway the way MXQ and pinging works is imagine you have an orderbook where passive orders are not visible to other participants (ie the venue is dark or you have a grey venue where some orders can be flagged as dark). It's possible fro participants to pay to learn what orders are in the book by making some very small aggressive orders and seeing where they match. In the world of equities this would be buy 1 share agressively, sell 1 share agressively with a limit in each case. This is called "pinging" because it's like ICMP ping discovering whether hosts are alive. The concept in crypto (if it applies) would be the smallest quantity the exchange allows you to buy or sell.

Assuming the venue supports it, you can prevent your dark orders matching these pings by setting an MXQ. If your MXQ is 100 say, they would need to buy 100 shares for your order to match. You would set the size to a point where you don't mind giving up the information about where your order level is because the match is meaningful enough.</comment></comment></comment></comment></comment>


Spilling your guts online? You may have an Internet problem - <AUTHOR> http://www.itworld.com/software/301944/signs-youre-compulsive-internet-user

<comment><USER2> Wait, being open and forward to strangers on the internet means I'm addicted? Well, that explains a lot...</comment>


TechStars Beats Y Combinator, Ranked Best Accelerator Program in U.S. - <AUTHOR> http://www.readwriteweb.com/start/2011/05/techstars-beats-y-combinator-r.php

<comment><USER2> Lest anyone think this is being suppressed or something, it's a dupe. The original is here: <http://news.ycombinator.com/item?id=2506580>

<comment><USER3> I certainly don't think this is a dig at YC at all (despite the unfortunate inflaming title chosen by RWW). It will be interesting to see what the data say when they are released. Rankings coming out have certainly given schools much greater visibility and clout. I think that they can do the same for incubator programs. More incubators > more competition > better startups > world changes.

</comment></comment><comment><USER3> I think the ranking is less important than what all of these incubators are doing for startups. There is more of an opportunity than ever for entrepreneurs. The barriers to entry are getting torn down through these programs.

</comment><comment><USER4> This thing has no credibility and RWW is lame for "reporting" on it.</comment>


Sight on Chrome Web Store - <AUTHOR> https://chrome.google.com/webstore/detail/epmaefhielclhlnmjofcdapbeepkmggh

<comment><USER2> Just downloaded and tried it out. I like it, it works well with our subversion repository here at work. One suggestion would be a menu option to allow the user to highlight a page on request (with a chosen syntax), if, for example, you had large chunks of code embedded in normal html.

<comment><AUTHOR> Done. Sight v1.0.0 was just released! Please update.</comment></comment>


Ask HN: Help me design a personal project - <AUTHOR> I am thinking to start working on a project which in future would become a product (hopefully). I want to take it as opportunity to learn what modern programming era has been shifted to. As of now, All i know is Java based web apps, with old school Business Layer (EJB)/JSP front end. Not to mention, the front end isn't optimized for different platforms and if I have to create web apps out of this then its an other story for me.
So how should i design the app which
1. Will have a Web Client for Administrators and for users 2. Should provide user access on iOS/Android
I was looking at different technologies and I am so confused. There is Angular JS, ROR, DJango, IonicFramework and so many more ... So if i ask you to design a modern web-app for browser and cell phones,
1. How many tiers you would have 2. What framework/would you use at what tier 3. What architecture you would use. I mean there was SOA back in the time and now there is a new buzz word (micro-services). How would you decouple server with front end so that same functionality could be used on client brwoser and native mobile apps.
Any help is appreciated. <comment><USER2> As far as I can tell web services returning json is the standard way to separate business functionality and UI. also, bootstrap is a pretty common library that allows your webpages to respond to different size browsers pretty easily. After that you get into choices that are language dependent. Angular JS, knockoutjs, react others are frameworks(using loosely) in the browser. There are a lot of MVC frameworks for the Server including java based ones(groovy/grails). Then, for native you need to decide whether you might want a mobile platform that can be used for both iOS and Android. Cordova, Corona, Titanium, Xamarin.

<comment><AUTHOR> Given that i am trying to understand what technologies fit where, I was looking for something more discrete answer. Something along the lines

* I could use Django to create the server side. The whole server would be created in RESTFul architecture

* Front end ??? Would i create two different projects for Web and Mobile clients ? What framework to use here ? Shall the front end directly communicate with Django RESTFul api or some other layer should be there ?</comment></comment>


What Would Have Happened Had You Invested in an Index Fund? - <AUTHOR> http://blog.greaterthanzero.com/post/84006166062/real-benchmarking-what-would-have-happened-had-you <comment><USER2> I'm not sure the post ever answers the question given in the title. It gets very detailed, but it's a pretty muddled, unclear answer at best about something related to benchmarks.

<comment><USER3> Here's a comparison between Berkshire Hathaway and Vanguard for the past 10 years: [https://i.imgur.com/yHVY0qP.png](https://i.imgur.com/yHVY0qP.png) (data from morningstar.com).

Overall, very similar, but if you went in and out of the funds at different times you might have had a different net result.

</comment></comment><comment><USER4> Article did not have a very clear answer. Its more powerful to look at the alternative to index investing. First of all lets be clear that true index investing balances your equity/fixed portfolio based on age or some risk profile. As for alternatives, close to all money managers do not beat the market in the long term. There are exceptions but the vast majority are not going to beat it. So outside of index based investing my options are very limited. If most hedge funds lose to the market, how am I going to beat it? Might as well just settle for index investing and balance my fixed/equity ratio. No time wasted and in the long run most likely will come out ahead.

</comment><comment><USER5> My father once told me that the secret to successful stock market investing was to start investing a long time ago.

It's not as trite as it sounds - what he meant was start investing as a young man, and keep adding to it.

<comment><USER6> Like the old proverb: "The best time to plant a tree is 20 years ago. The second-best time is now."

</comment></comment><comment><USER7> Worth calling out: if your money isn't tax sheltered (IRA or 401k) then an index fund will be worse than buying those individual stocks.

That's because with individual stocks you can sell the losers from time to time, buy a similar replacement (ex: Coke for Pepsi) to avoid the wash rule, and harvest a bunch of capital losses to offset future gains.

Proper tax management is a HUGE part of this and is almost always overlooked in these kinds of articles.

<comment><USER8> _if your money isn 't tax sheltered (IRA or 401k) then an index fund will be worse than buying those individual stocks._

... as long as you're handling sufficiently large amounts of money that you don't lose the difference on trade commissions. Rebalancing my ETF portfolio costs me $60 (6 ETFs, $10/trade), but rebalancing a portfolio consisting of the 2000 individual stocks and bonds in those ETFs would be insane.

<comment><USER7> Absolutely right. It helps that you don't really need all x000 stocks since a diversified subset (say 100) will be very close to index performance and still yield the harvesting benefit.

</comment></comment></comment><comment><USER9> If you're going to invest in index funds (and you should), don't pick the S&P 500. Why invest in 500 stocks when you could use the vanguard total market index instead, and invest in essentially the entire US market, with a management fee of 0.05% per year? Also, there's no need to take on unnecessary risk by concentrating investments in the US. Better to put a good portion in a broad ex-US fund as well. Vanguard has a good option there too, of course, but there are certainly others as well.

Also, if like me you're outside of the US, these all come in ETFs that can be bought anywhere and have similarly low fees.

<comment><AUTHOR> Indeed, investing in just the S&P 500 would be an example of poor diversification: you'd limit yourself to US large cap stocks. By recommending the S&P 500, Warren Buffet is saying, implicitly, that he believes in US large caps to the extent that he does not even want to diversify.

<comment><USER9> I would give him the benefit of the doubt and assume he was simply picking an index everyone has heard of. But regardless, yes, it would be poorly diversified.

</comment></comment></comment><comment><USER10> This read much more like an advertisement for GreaterThanZero's services than an article whose conclusion actually addresses the title's question, but the author seemed to do a good job accounting for the differences between Warren Buffet's estate and a regular, living person's money (namely that the person sometimes needs to spend it).

Actually, come to think of it, I don't think the author explained why Buffet's estate should be treated as if withdrawals will never be made from it, but I assume it's because the 10% of his money that will go into short term savings bonds is still a ridiculous amount of money and should be sufficient to cover any expenses in the foreseeable future.

</comment><comment><USER11> Companies come and go, especially tech stocks and whatnot. Buy a single share of the DJIA at 13k in 2007, see it drop to 8.5k, wait a couple of years and - wait - it's at 16,500. It's a 27% return in 6 years, which isn't great, but considering the crash, you're still up.

That said, I don't know much about investing. But index funds seem to me (completely useless when it comes to investing) one of the safer bets if I'm going to be in the market at all.

<comment><USER12> The reason why index funds are better is because they're generally managed by a very simple computer algorithm which means very very low fees compared to actively managed funds. If you look over the lifetime of someone's 401k it's really shocking how much is eaten up in fees. Also, over long periods of time you're generally not going to beat the market.

What you pointed out about the DJIA having lots of fluctuation, particularly during crashes, is why it's important to keep investing a little every paycheck. That way when stocks are low you're buying more shares. It's a sale!

</comment></comment><comment><USER13> MarketRiders has been providing similar advice to invest in low load index funds and EFTs for some time [1]. The real issue is that if you are paying 2% fees or if the account is being churned (or both), you're getting screwed.

Suggestion: show all calculations.

1\. [http://marketriders.com](http://marketriders.com)

</comment><comment><USER14> Was a bit difficult to parse at first glance. Was the answer in favor Buffet's advice?

<comment><USER15> Yes, Buffett's advice gained $9,309 more over a 5-year period.

<comment><USER16> Heh. The first thing you learn when you back-test stock-trading algorithms is "Give me any investing strategy, and I will find you a five-year period where it does well."

Which isn't to say that I think you can outperform index funds... I don't; but the answer, it looked to me, was 'sign up for the GreaterThanZero web app and run the model yourself.'

<comment><USER15> Agreed, but in this case it looks like he was responding to Buffett's quote:

>My advice to the trustee couldn't be more simple: Put 10% of the cash in short-term government bonds and 90% in a very low-cost S&P 500 index fund. (I suggest Vanguard's.) I believe the trust's long-term results from this policy will be superior to those attained by most investors—whether pension funds, institutions or individuals—who employ high-fee managers.

Then he compared his 401k results with the Vanguard Target 2040 fund. Seems pretty straightforward.

</comment></comment></comment></comment><comment><USER17> why does buffet suggest 10% in short-term gov bonds?

is it a security/diversity thing?

<comment><USER18> I'm not sure about Buffet's advice, but John Bogle (founder of Vanguard) recommends bonds so that you can rebalance your portfolio to your desired asset allocation when stocks are down by simply selling some bonds to free up capital.

So if you have 90% stocks and 10% bonds but the market takes a dive and now you're at 80%/20%, you can sell enough bonds to bring you back to a 10% bond allocation and use those funds to buy more stocks.

</comment></comment><comment><USER19> This article does not address Warren Buffett's advice at all. Instead, it compares two target date funds, one active and another indexed. Not really apples to apples.</comment>