Ask HN: Thoughts on grad school? (CS PhD) - <AUTHOR> To give a little bit of background about myself: Although I took some CS courses in college, I didn't seriously consider myself a programmer until just over a year ago, when I started writing code as a quant at a hedge fund and realized that, when using the right languages and working on cool problems, programming can be a lot of fun. I've also realized that there are many people a lot better at it than I am, so I have a lot to learn about technology and computers. Among my interests are artificial intelligence and programming languages, so I figure that graduate school might be the way to go.
I'm interested in AI/machine learning research, which practically require a PhD, even in industry. I've also considered the entrepreneurial route, but I lack a certain technical maturity as well as co-founders, both of which I could find in grad school. Eventually, when I'm in my 40s, I'd like to be involved in VC... but I'd like to spend the next couple decades doing more detailed technology work so that, when I get there, I understand what I'm analyzing.
So, given my interests and career aspirations, I'm considering pursuing a PhD in computer science. I'm wondering if anyone here could give me some perspective on what to expect.
Here are my credentials. I'd like to know what I can expect in terms of admissions success. Are, for example, top-10 departments a possibility?
3.9 / 4.0 in-major (math) from top liberal arts college.
CS courses: AI, PL, Software Eng., Data Structures, Intro. Grades of A/A- in all but SE.
GRE (2004): 800Q/670V, 98% on math subj. test, have not taken CS subj. test.
Top 100 finish on Putnam.
Research: Two internships in applied math, but in a govt. context. Consequently, I have no publications, so this may be a weakness.
Career: Entered pure-math grad program in fall 2005. Passed quals but did poorly in courses. Left after 1 year (no degree) to work on Wall Street, starting 5/2006. Worked on WS up to 2008, with a reasonably successful career and 1+ year of programming experience, but no research or publications (obviously).
Specific questions are:
1. How much is it going to hurt me that I entered a PhD program and left? Is this a deal-breaker, or can I explain it away? (My reason for leaving pure math is that I realized the academic job market sucked, and that I was already qualified for a decent industry job. However, a CS PhD carries a lot of benefits outside of academia.) Could I possibly turn my grad school experience into an asset, noting (in spite of my lack of success, and departure) that I've been through the experience before and know what I'm getting into?
2. Ideally, I'd like to get an NSF or equivalent fellowship, but I have no hope of getting that without research experience. Is it likely, outside of the ivory tower, that I can hook up with a mentor and get to work on a problem so that, when it becomes time (12/08-2/09) to apply to schools and for fellowships, I'm on the ball?
3. How much does the distinction between top (5, 10, 20) schools and the rest matter in CS, assuming that I will not be seeking academia? Do AI research groups care about the distinction between #1 and #8 and #22? If I pursue the entrepreneurial route, are higher-ranked schools going to have better co-founders?
4. The most important, but most distant question: What can I expect once I am in graduate school in computer science? What are the courses, students, research opportunities, and career possibilities like? <comment><USER2> I can show that you don't need to finish a PhD in AI to do research and create AI to solve problems people have never before successfully approached. I've done it myself (though unfortunately most of it is locked behind a walled garden of IP).

If this is a course you're interested in, here's what I suggest.

1) Read up on AI breadth first and shallowly. Focus more on machine learning, search, filtering, and so forth, than heavier (and less successful) topics such as knowledge systems and computer vision.

2) Go through a list of startups that you like, use, or admire. Imagine the simplest cool/good/useful thing the startup could do with a cute little algorithm.

3) Develop the basic idea for it, contact the company, say you'd like to hack on it for cheap.

4) Kill the problem.

5) Use that startup as a reference. Find another one, but this time, ask that you can publish the method.

6) Repeat. Blog about your conquests. Explain how to replicate and extend your results. Eventually, focus on a bigger project to tackle. If your interests align with a research program at a university, consider entering the PhD program then. With this behind you, you'll probably get in anywhere.

If you're interested, I can give you some pointers on the development of quick and useful recommendation engines, which practically every startup can use. If you'd like, send me an email at firstname.lastname@example.com

<comment><USER3> +1.

See this line from your autobiography?

 _Entered pure-math grad program in fall 2005. Passed quals but did poorly in courses. Left after 1 year (no degree) to work on Wall Street..._

You're right to think that grad schools might look at this and say "hmmm". Sometimes past behavior _does_ predict future results: You will have one eye on the door throughout your graduate career.

(Although some grad school, somewhere, will admit you anyway -- there's not a lot to lose; they get a very smart and cheap TA for 1 to N years. So you should be as sure as you can before you start school that you have found an _adviser worth having_ who will take you on, so that you don't end up wandering around campus post-quals with a "will write thesis for food" sign.)

Whatever you do, don't tell them up-front that you're uninterested in academia. To an academic, that's like saying "I have no self-confidence and I'm going to quit under pressure" -- because precious few of them accept, deep in their hearts, that quitting academia is a meaningful career choice. You don't need to go into detail about your imaginary academic plans, but do make some vague noises about the possibility. Talk about how your brief excursion into the working world served to remind you of how much you prefer really _meaningful_ , _advanced_ research problems that could _change the whole game_. They'll eat that up.

But to heck with what _other people_ think about your resume. Let's consider what _you_ should be thinking: You've _been_ to grad school, you obviously didn't like it much the first time, but now it looks really good compared to life on Wall Street. My take on this is that perhaps you need to try door number three: You ought to _get out of Wall Street_ , a land of credentialists in suits, and try another job or two before you try grad school. Because

 _I'm interested in AI/machine learning research, which practically require a PhD, even in industry._

sounds frighteningly like the kind of thing _I_ would have said before _I_ started grad school. You know, back when I was really used to jumping through hoops. I had a really awesome track record at hoop-jumping -- big GPA, big GREs, NSF Fellowship, etc, etc. -- and, whenever I got confused about my future, I would just look around the arena until I found another hoop!

Try something else for a while. At this point, the Ph.D. program will wait for you. Take your future out for some casual dates before you marry it. If nothing else, why not start with an M.S. degree? Two years will give you plenty of time to network with folks in your new field.

</comment></comment><comment><USER4> Just FYI, I have an MS in EE and I work at a pattern-rec startup. So, no PhD not really required to get a job in that field. That being said, having a PhD helps alot if you want to take on the 'scientist' role right off the bat (for example, my job duties have included things like optimizing the algorithm both computationally and algorithmically).

Your stats look fine for applying to CS PhD. Top 5 is probably a long shot (but it always is). But, they love math backgrounds. The only problem is no publications. Top tier CS schools virtually require a strong research background.

1\. It's probably going to hurt more than help, to be honest. Even though EE and CS and the like -do- have industrial applications, the people who are reading your application chose to stay in academia. That means they don't necessarily look kindly on people diminishing that. My suggestion say "financial obligations" and leave it at that. The key is to seem really really really really excited about CS and that's why you are applying.

2\. This is a serious longshot.

3\. AI research groups will care alot more about your research than the school. And yes, top tier schools will tend to have smarter people and therefore better co-founders. Any "decent" school though will have plenty of smart people.

4\. The money is there at any CS school so you'll more then likely go to school for free and work on funded research projects. The career possibilities are as good as they get with any PhD.

<comment><AUTHOR> Which is the longshot, finding the mentor or the NSF?

My experience is that top departments, and fellowships like NSF, basically want people who are already grad students. Actually, NSF seems to have more to do with the merits of the research problem than the student, per se. I don't think I have a shot without enough research experience to have a rough idea of what "my problem" will be.

<comment><USER5> An NSF graduate fellowship is _always_ a long-shot. Every good first- or second-year graduate student in the country is applying for one, and the competition is intense.

More to the point: the competition is at such a high level that the outcome rests on things that are far more subjective than you might like. For example, volunteer experience and educational outreach can be decisive factors when all the candidates are equally good on paper.

<comment><USER6> Make a good story about how you want your work to help other people, and also play up the diversity angle if you have something like an immigrant parent. That's what my NSF friends did (except those who were so excellent that they didn't have to jump through hoops).

<comment><USER2> The cost you pay for this is that your place in grad school and your fellowship are now predicated on your ability to bullshit. This emotional weight may be worse than just plain not getting the shiniest fellowships, or into the most prestigious school.

<comment><USER5> Most of academic life is predicated on your ability to bullshit. ;-)

</comment></comment></comment></comment></comment></comment><comment><USER7> Have you read this?

"Applying to Ph.D. Programs in Computer Science", by Mor Harchol-Balter ( <http://www.cs.cmu.edu/~harchol/gradschooltalk.pdf> )

It's quite good. Since you have been in grad school already, many of the things won't be news to you.

I would say that the fact that you left grad school for a Wall Street job will hurt your application. The admissions committee might think that you're not determined and self-motivated enough for grad school. They might think "If this dude likes CS so much, why didn't he jump to the CS department back then?". Might be a good idea to explain in your statement of purpose that you discovered your passion for CS while in Wall Street.

<comment><AUTHOR> Read it years ago, but will read it again.

</comment></comment><comment><USER8> Given my experience (CS PhD. CMU) I would say that you are likely a very good candidate. The PhD you left was pure-math (not CS) so I don't think it counts much against you. You have lots of plusses (analytic and work experience) and the best thing would be to be very articulate about what you want to do (at this point they will be expecting you have some goals). The CS GRE really can not be taken without some studying (it had some obscure stuff on it when I took it).

Now for picking a grad school a lot of things are really important. 1) Will they fund you? 2) Are they teaching what you want to learn? 3) Is it a happy place?

Don't want to start a fight here- but schools vary by A LOT on these criteria.

<comment><USER9> I strongly agree. The PhD is an apprenticeship, so the people you'd be working for (and with) are the most significant factor. Make sure you fit with the research and social philosophies of a program before applying if you can, and certainly before accepting an offer.

As you leave school and prepare to enter industry or academia, my experience has generally been that the strength of the recommendations backing you matters far more than whatever rank your institution may have.

As you mentioned AI/machine learning, I believe these factors are even more important. There are some very distinct schools of thought when it comes to those things, so make sure you look for philosophical compatibility when picking programs. AI has a few deep schisms and widely separated sub-fields, so tread carefully.

It may be worth it to consider some of these: What's your philosophy of mind? Symbolic/statistical/neural? How important is biology/neuroscience when looking at artificial intelligence? What general approach to AI/machine learning most interests you?

</comment></comment><comment><USER10> Or find an AI problem that interests you and that can interest a customer base, solve it, and bootstrap a business.

Make your own path.

</comment><comment><USER11> 2\. Especially since you have a pure math background, you could work on SAGE (<http://sagemath.org>). The people there (mostly academics) are very friendly and open, and you should be able to find something with an AI flavour (e.g., automated empirical optimization of software, as is done in ATLAS <http://math-atlas.sourceforge.net/>) that has a fair chance of generating a publication, or at least generating an outcome you can point to.

</comment><comment><USER12> I can help answer #2 and #3.

#2. I received an NSF fellowship in grad school with 6 months of research experience. The experience probably helped, but getting an NSF is a long shot no matter what. I know of other students with similar qualifications who didn't get it.

#3. The prestige of your grad school matters in some circles but not in others. If there are particular companies that you want to work for, try to find out what their hiring practice is. Some companies place a high value on the school you graduated from, and some don't care at all.

</comment><comment><USER13> My friend, I think you're more than set to get into CS grad school. Though please understand, the PhD enterpreneurs are few and far between. Most PhD students in CS and engineering don't understand how to develop their own great ideas, and they don't want to. PhD's are mostly for academics. Exceptions include places, like Harvard, MIT, and Stanford.

The upside is that you'll have lots of free time during a PhD curriculum to chase down your own ideas, and find the handful of like-minded people around campus. A PhD is a free time to pursue your own intellectual pursuit, and if you're already so energized, you'll do well.</comment>


The Eastland Disaster Killed More Passengers Than the Titanic and the Lusitania - <AUTHOR> https://www.smithsonianmag.com/history/eastland-disaster-killed-more-passengers-titanic-and-lusitania-why-has-it-been-forgotten-180953146/ <comment><USER2> Regulation often has unintended consequences.

> The 1912 sinking of the Titanic gave rise to a "lifeboats-for-all" movement > among international marine safety officials. In the United States, Congress > passed a bill requiring lifeboats to accommodate 75 percent of a vessel's > passengers, and in March, 1915, President Woodrow Wilson signed what became > known as the LaFollette Seaman's Act.

> During the debate over the bill, the general manager of the Detroit & > Cleveland Navigation Company had warned that some Great Lakes vessels, with > their shallow drafts, "would turn 'turtle' if you attempted to navigate them > with this additional weight on the upper decks." Too few legislators > listened.</comment>


MobilBye: Attacking Advanced Driver Assistance Systems with Camera Spoofing - <AUTHOR> https://arxiv.org/abs/1906.09765 <comment><AUTHOR> The paper shows a proof of concept that an advanced driver assistance system can be fooled by using a drone projecting a speed limit sign onto a building wall.

This might raise some serious questions regarding the safety of future autonomous driving.</comment>


Ask HN: How do you responsibly dispose of an old laptop? - <AUTHOR> I've found some other threads on HN suggesting that you find a way to donate your old laptops. Mine is a 2008 MacBook, and I suspect that few organizations or even individuals would want an eleven-year-old machine.<p>Are there any organizations, forums, subreddits, etc. where I might find people interested in making use of it? If not, are there ecologically responsible recycling programs I could send it to? <comment><USER2> Best Buy will accept computers and just about all electronics for recycling at no charge. You can check out the companies which recycle particular types of products for them at [https://www.bestbuy.com/site/recycling/recycle- guidelines/pc...](https://www.bestbuy.com/site/recycling/recycle- guidelines/pcmcat174700050010.c) and researcj if they meet your definition.of ecological responsibility.

</comment><comment><USER3> Put the laptop on eBay or its local counterpart as an auction with the starting price of $1. A working laptop from 2008 is pretty much guaranteed to sell like that. Whoever cares enough to compete with the other buyers and to pay money for it is likely to have a purpose in mind for the laptop. They may want to use it themselves, give it away as a gift, take it apart to fix other laptops, or (refurbish and) resell it.

</comment><comment><USER4> I don't know about any organizations you can donate it to but if you don't find anyone and you gotta get rid of your machine, it looks like you can find someone to recycle it here:

[http://e-stewards.org/find-a-recycler/](http://e-stewards.org/find-a- recycler/)

<comment><USER5> Since it's an Apple product, Apple also recycles - [https://www.apple.com/shop/trade-in](https://www.apple.com/shop/trade-in) :

> Apple Trade In lets you recycle any Apple device (including devices from > Apple-owned brands) at any Apple Store and on apple.com for free. That > includes your batteries and old electronic products as well as free, on- > demand packaging recycling for our commercial, education, and institutional > customers. When we receive your device it will be thoroughly inspected to > determine if components can be recycled or reused. Whether recycled or > reused all activities relating to the processing of your device will be > managed in an environmentally responsible way.

<comment><AUTHOR> This option appeals to me the most. I'm relying on some cognitive shortcuts here, but I assume that due to its scale alone, no one is in a better position to recycle (or find recyclers for) Apple products than Apple itself.

Thanks for this!

</comment></comment></comment><comment><USER6> Send me it.</comment>


Biolab Disaster - an HTML5 Game (plus Making-Of Video) - <AUTHOR> http://www.phoboslab.org/biolab/

<comment><USER3> I have the utmost respect for you. Myself and a college friend are currently working on a html5 game engine, but we're doing it in GWT, so we code Java rather than Javascript. We decided to do that because, well, it's goddamn difficult to make a really good game engine in js.

So, in summary, holy shit, that's _absolutely amazing_. Hats off.

I have two questions, though: How do you do your particle effects? Also, I noticed when you went through some code, you seemed to only point to Ogg Vorbis audio files. How does your sound system work?

(also, heh. Lesbian porn easter egg in the making-of video)

Edit: I should mention that our engine is (will be) open source. Not stealing your ideas, just really interested. ;)

<comment><AUTHOR> Thanks!

Yeah, managing a "large scale" JavaScript application isn't easy. I ended up inventing a module system that loads all the dependencies before it executes a .js file's body. This is all hidden on the page, because all the files were compiled together into just one.

All the objects in the game world are derived from a base "Entity" class and inherit physics and stuff like that. So each particle, like any other object, is an Entity and not handled differently at all. When the Blob enemy dies, it just spawns some new Entities - the particles.

For the sound, the files names are all with an .ogg extension. The engine then decides if the browser can play Ogg Vorbis and substitutes the extension to .mp3 if necessary. So I _do_ have to have all sound files as .ogg _and_ .mp3. I hope that'll change in the future...

Edit: just uploaded the Editor as well. Saving is disabled, but everything else should work. Press Space to open the Entity or Tile menu (depending on which layer is currently active); hold Right Mouse Button to pan around; Z and Y are undo and redo.

<http://www.phoboslab.org/biolab/weltmeister.html>

<comment><USER3> Haha, that's virtually identical to what we're doing, except with GWT, so we can hand off some of the tough stuff to the underpinnings and don't have to deal with js's strange object-oriented system (at least to us, C++ programmers ;)).

So you didn't use the audio tag's <source> option? Did you find that too slow?

(also, I don't know if it'll help you at all, but I got audio working nicely on iPhone/iPod/iPad and wrote this tutorial about it [http://flax.ie/how-to- get-hidden-autoplaying-audio-in-html5-...](http://flax.ie/how-to-get-hidden- autoplaying-audio-in-html5-on-ios/))

Edit: By the way, does your map editor output as JSON? We went through a bunch of crap getting serialisation/de-serialisation working across client/server, but you probably wouldn't hit any of those problems because your code isn't "compiled"

<comment><AUTHOR> John Resig's Class-Object has some simple inheritance without the (very verbose) prototype stuff. It's the basis of my engine:

<http://ejohn.org/blog/simple-javascript-inheritance/>

I used the Audio API's canPlayType() to decide whether to use mp3 or ogg. I just found it simpler than constructing the DOM for Audio and Source elements. I'll definitely look into the sound issuse on iPhone. Thanks for your tutorial!

Yes, the levels are saved in JSON format, with a bit of boiler plate code so it can get loaded and "baked" nicely. Here's the source for the first level:

<http://www.phoboslab.org/biolab/lib/biolab/levels/biolab1.js>

</comment></comment></comment></comment><comment><USER4> It's easy to get a platformer wrong; this is exactly right. The controls are snappy, the gun actually shoots properly, the jumping physics feel satisfying, and the baddies don't just stupidly trawl a preplanned path.

Also, the performance is impressive. Playable without a hitch with Chrome 6 on my Eee 900.

 _Excellent_ work!

<comment><USER5> Worked fine in Firefox 3.6 despite the page saying it would be slow...

</comment></comment><comment><USER6> Also interesting:

Blogpost – <http://www.phoboslab.org/log/2010/09/biolab-disaster>

Making Of (Video) – <http://vimeo.com/14920760>

That's all linked from the game page but easy to overlook because the game is so much fun.

</comment><comment><USER7> Anyone know of a Kongregate-like website that accepts HTML5 games?

Kongregate looks like a fun way to try making a buck, but they only seem to support Flash and Shockwave, and I'm allergic to Adobe. :-P

<comment><USER8> There's this: <http://html5games.com/> Our game is up there: <http://html5games.com/2010/07/onslaught/>

</comment></comment><comment><USER9> Ha, From the page source for:

             Hey there, it looks like you're using Microsoft's Internet Explorer. Microsoft hates the Web and doesn't support HTML5 :(

Edit: formatting.

</comment><comment><USER10> So we've reached Sega Genesis level gaming in the browser. As soon as someone gets a Sonic port finished, I'm done working forever.

</comment><comment><USER11> Just wondering, what is the best way to set up the game loop - <USER2> setTimeout?

I have considered if it would be worthwhile to try putting the logic into a web worker and trigger update events to the display. Then again, sending an event from the worker to the UI thread will probably be scheduled the same way as a setTimeout event.

It's just that setTimeout seems rather slow. I have created a game with AI in Javascript, which runs fine with web workers. I tried to make it work without workers by frequently interrupting the AI thread with setTimeout events, and it was a lot slower.

</comment><comment><USER12> Very well made game. Reminds me of games made with flixel for Flash. <http://flixel.org/>

</comment><comment><USER13> Very nicely done. I played to the end, which is a big compliment coming from me, as I don't usually play JavaScript or Flash games more than a few minutes.

It gave me a pleasant nostalgic feeling, reminding me of the Commodore 64 games I used to play as a teenager in the 1980s.

Here's hoping more of the same is coming!

</comment><comment><USER14> The making of video has 'lesbian porn' in the google search box on the top right.

Hilarious if it was intentional, and even more hilarious if it was unintentional.

Justin Bieber as the sole mp3 on the desktop is also funny for some reason, and LOLCATS/WAREZZZZ as the other folders.

<comment><USER11> Sounds as if the desktop was carefully prepared for the video.

</comment></comment><comment><USER15> Feels a lot like Rick Dangerous. Responsive, convincing weapon effects.

</comment><comment><USER16> Great game! I wish there was more of it. Shame JS is still too slow for games, my OS dragged while it played (with a somewhat decent frame rate though) in Chrome.

</comment><comment><USER17> When I closed the tab, the music kept playing for a while.

Great job other than that. Judging by the code it looks like you have a game programming background.

</comment><comment><USER18> Very cool! Jumping is a bit slow, so one needs to plan unexpectedly far into the future to avoid some enemy fire. Apart from that: great achievement, congrats!

</comment><comment><USER19> This is really cool but can you map the up key as jump? I instinctively push up on platform games like this then i die because the dude didnt jump. :P

<comment><AUTHOR> The Up Arrow usually scrolls the page up. I could suppress it with preventDefault(), but this wouldn't work in Opera. I'm therefore hesitant to enable it.

You can enter the following in the address bar, while the game is running, though:

javascript:ig.input.bind(ig.input.UP_ARROW, 'jump');

<comment><USER20> _The Up Arrow usually scrolls the page up. I could suppress it with preventDefault(), but this wouldn't work in Opera. I'm therefore hesitant to enable it._

Maybe it's better to enable it, so that Opera users would complain and it would finally get fixed (by Opera team).

You could use "keypress" event instead of "keydown" (for which for some reason preventDefault in Opera works), but this just brings other problems.

(BTW it was me who left comment about events in your blog post. For my HTML5 games, I chose to use arrows and preventDefault, as in majority of browsers it improves user experience (even in Opera problems come only when page is larger than window). Just don't forget to cancel events only for keycodes that you actually consume).

</comment></comment></comment><comment><USER21> great great great.

That's all I can say. You could probably make a fortune for a year or so off of the engine that drives this.

Any plans to make it work better on mobile devices?

</comment><comment><USER22> Crisp graphic design too.

</comment><comment><USER23> Jump should be up-arrow!

<comment><USER24> That might be a bad idea. It might conflict with the browser.</comment></comment>


Open Connectivity Foundation IoT (Internet of Things) Standards Group Announced - <AUTHOR> http://openconnectivity.org/news/open-connectivity-foundation-brings-massive-scale-to-iot-ecosystem <comment><AUTHOR> Open Connectivity Foundation to establish specifications & protocols by which manufacturers & service providers can ensure interoperability. Members include Intel, Microsoft, Samsung, Cisco & others. [https://twitter.com/openconnorg](https://twitter.com/openconnorg)</comment>


It's been a year since Sherpaa went from VC-funded to Independent - <AUTHOR> https://medium.com/@jayparkinson/its-been-a-year-since-sherpaa-went-from-vc-funded-to-independent-aka-how-to-be-a-sustainable-1cd407e6c005 <comment><USER2> There seems to be a trend of the dark side of VC getting called out more and more, with names being named, and I am all for it.</comment>


Lovefield, a relational database for web apps, works cross-browser - <AUTHOR> https://github.com/google/lovefield <comment><USER2> I used this for a while and while it's a neat idea it was slow and had HORRENDOUS error reporting. It was impossible to tell what had gone wrong and basically there are like 10 numeric error codes that pop up associated with a link to a page that gives you scant information about the error that cannot easily be used for debugging.

<comment><USER3> Might want to try (disclaimer: mine) [https://github.com/amark/gun](https://github.com/amark/gun) then, it is a cross-browser graph database (that supports relational/table based data) and has live streaming updates like Firebase. Plus, a SQL query engine is in the works for it too. And it currently does 15M+ ops/sec so it won't be slow.

I've made quite a bit of effort to make error reporting as intuitive as possible, but admittedly this always needs to be improved. But the community is pretty active and always around to help if there are problems. :)

</comment></comment><comment><USER4> Isnt this just something google threw out there some years ago that no one picked up on?

<comment><USER5> I'm using it in production and are very happy with it.

<comment><USER4> Cool, not saying it is bad, just that it didn't catch on.

</comment></comment></comment><comment><USER6> Dexie.js (a wrapper for IndexDB) just stopped working on all browsers running on iOS 10.3.1 (apparently a webkit bug).

Lesson: always test _cross-browser_ before commiting to a js library

<comment><USER7> Seems like the lesson should be extended to something like:

Always test cross-browser before commiting to a js library, after you have committed to it, and on every browser or js library update.

<comment><USER8> Yes. But it also seems like the browser based model continues to be flaw. One application (i.e., browser) makes a single update and EVERYONE downstream now needs to retest? And Perhaps significantly refactor?

This is a MAJOR UX violation. If you were going to by a car and you were told that's how it works you'd never buy that make/model. We keep getting by on the ignorance of end-user. That's not a positive.

I'm not sure what the details of the answer is. But I do know that accepting the status quo is no longer acceptable. The first step to solving a problem is to admit you have one. Step 2 is to make sure you identify the right problem.

We have a problem, yes?

</comment></comment></comment><comment><USER9> One thing I like about Lovefield is the ease of choosing a storage layer: lf.schema.DataStoreType.FIREBASE

You can use it with in-memory (no persistence, .MEMORY), IndexDB (local persistence, .INDEX_DB), or Firebase Realtime Database (cloud persistence, .FIREBASE).

</comment><comment><USER10> I like databases that don't require you run a specific browser for it to work, but what do I know?

I thought we got over "you must run this browser to have the app work" stuff when we all got off IE6.

I understand the use case is to store the data locally, and I'm sure it has its use cases, but they are probably limited.

<comment><USER11> > I thought we got over "you must run this browser to have the app work" stuff > when we all got off IE6.

Assumption is flawed -- we haven't all gotten off IE6, it's use has simply dropped significantly. It's a simple case of diminishing returns, and it will never cease to exist, even with the rise of evergreen browsers. There's also a big difference between supported browsers and explicitly mandating certain browsers.

That said, IE10+ is somewhat limiting, but some people may be completely fine with that limitation. For about 90% of the apps I personally work on, IE10+ is perfectly acceptable.

</comment></comment><comment><USER12> Previous discussion from Sept 2015: [https://news.ycombinator.com/item?id=10197672](https://news.ycombinator.com/item?id=10197672)

I'm sure there's been updates since then, just linking for reference.

</comment><comment><USER13> Curious about the name. Love Field is the smaller airport in Dallas, Texas, but guessing not related? Just love database fields maybe?

<comment><USER14> It must be named for the airport, which I always associate with the Kennedy assassination but it has a long history aside from that.

<comment><USER15> Are Southwest Airlines involved in this db devel?</comment></comment></comment>


Pingdom reducing features on their free plans to convince customers to pay - <AUTHOR> https://www.pingdom.com/planfree <comment><USER2> And by "reducing features" they really mean "completely gutting the free plan" \-- no non-HTTP monitoring, no IPv6, 5 minute polling instead of 1 minute, no SMS alerting at all, etc.

<comment><USER3> Pingdom's IPv6 monitoring was never practical on the free plan, because you had to forego IPv4 monitoring in order to use it.

Granted, the right solution is to make all checks dual-stack by default, instead of moving IPv6 to the paid tier.</comment></comment>


Fast accessible, shareable & mobile friendly dashboard in just 10 seconds. - <AUTHOR> http://blik.io

<comment><AUTHOR> I have just launched a simple dashboard for GA - blik.io. I have used it for my own purpose several months ago and I decided to provide it publicly now. It is and will be free, so you can use it if it is valuable for you. I would appreciate any feedback. Thanks!</comment>


Rust for Web - <AUTHOR> https://medium.com/@eugeniyoz/restful-api-in-rust-impressions-63250d611d15 <comment><USER2> I'm continually delighted to see so many programmers with backgrounds in dynamic languages feeling at home in Rust, given that that's my trajectory as well. :) I'm giving a three-hour Rust tutorial at OSCON this year and I'm honestly torn over whether I should tailor it towards people coming from dynamic langs or people coming from C/C++. I feel like I might end up just having to write two tutorials and take a survey as people come in to determine which to focus on.

<comment><USER3> The creators of Go assumed that their primary audience would be disgruntled C++ devs, and were surprised to find instead that it's mostly Ruby and Node.js people.

Despite all of the "systems language" talk, it would not shock me in the least to see the same thing happen with Rust (or whatever new language comes along next year).

I don't intend for this to be a slight, but the plain fact of the matter is that "dynamic" languages come in and out of fashion every 5 years or so. Those people are accustomed to that cycle. They get bored easily and PREFER that cycle. The senior ones are usually on their second or third language cycle (or beyond).

In contrast, C++ and Java are ENTRENCHED in their areas (systems programming and business applications, respectively). Whatever ultimately displaces them someday... it will have to be an order of magnitude better, and it would still take years.

By all means, market your favorite new language(s) to all possible demographics. Just understand that the "PHP/Python/Ruby/Node/Go/Elixir/Swift" crowd are going to be your primary adopters (and conversely, the first to grow bored and leave when the next thing comes along).

<comment><USER4> > Whatever ultimately displaces them someday... it will have to be an order of > magnitude better, and it would still take years.

I actually think there's no room for any language to displace C++ in that way, _ever_.

The biggest reason that people give for bouncing off Rust is that the novel aspects of the language--lifetimes and borrowing--are too unfamiliar and/or hard to learn. Any language that is to be an "order of magnitude better" than C++ will necessarily have aspects that are unfamiliar and hard to learn. Long- time C++ users will bounce off that language for the same reasons they're bouncing off Rust.

No non-C++ language will ever appeal to C++ users who don't want to learn new concepts. C++ is very good at being C++, and for that reason it's immortal. Rather, new languages will continue to chip away at the uses of C++, making its use more and more marginal. This is a process that has been going on since the '90s--remember that in the '90s practically all software was written in C++, whereas in 2016 most new programmers aren't even learning it anymore. C++ has been declining not because it's being replaced but because its domains have become smaller and smaller. Rust is just a continuation of that trend: now there's a better option for security-critical software that can't be written in a GC language for performance and/or flexibility reasons (to name Rust's strongest domain), which has reduced the domain of C++ just as Java did 15 years ago for the server space and the rise of the iPhone App Store did in 2008 for the consumer app space. The continuation of this trend is what will gradually make C++ more and more niche going into the future.

<comment><USER5> My only gripe with Rust is that they should have taken a page out of Python's book in making a langugage syntax both stringent and beautiful. Not only is PEP-8 the greatest thing when dealing with a community project ever, but the syntax is designed around human readability in such a great way.

I think syntax like fn foo(bar: int) -> string {}; is a step backwards. More glyphs, more arcane nomenclature, and I just get a ting of change for the sake of change or "I want to be a functional hipster".

What is wrong with rettype name<templates>(argtype argname): ?

Why am I still writing all these damn semicolons and curly braces? I'm already intending the code and newlining every statement.

Why are there so many damn macros when C++ is realizing having language features rather than preprocessor macros is a huge usability gain?

I still think Rust is the best language out there today, but the failures in my view drive me insane that its not perfect. Its so close!

I guess I kind of just want a native compiled statically typed Python, though.

<comment><USER4> > My only gripe with Rust is that they should have taken a page out of > Python's book in making a langugage syntax both stringent and beautiful.

I prefer Rust's syntax to whitespace-sensitive languages.

> I think syntax like fn foo(bar: int) -> string {}; is a step backwards. More > glyphs, more arcane nomenclature, and I just get a ting of change for the > sake of change or "I want to be a functional hipster".

No, Rust's type syntax is the way it is to avoid the lexer hack, which causes real problems in C++ (typename qualification, in particular).

> What is wrong with rettype name<templates>(argtype argname): ?

The lexer hack.

> Why are there so many damn macros when C++ is realizing having language > features rather than preprocessor macros is a huge usability gain?

Rust macros are not preprocessor macros, not even close. Macros _are_ language features.

<comment><USER5> What is the lexical hack in relation to the syntax I proposed?

I'm not arguing it, I'm just curious why Rust is using the prefix _var pointer syntax when you are almost never supposed to use those in language.

I guess my point is more you could start from a clean unambiguous syntax (when is "rettype name<templates>(argtype argname):" ambiguous?) and rather than just verbatim copy C's glyphic syntax append vocabulary to the language to describe ill-used features.

One thing I have always considered a reasonable design choice going forward would be to _start* with somethking akin to ptr(foo) rather than _foo to denote dereferencing. In general I would like to see languages in this field_ start* with vocabulary and transition to glyphic grammar only on the most frequently used language features.

That would mean you could start with a language that does things like this:

       int foo(5)
       short bar(3)
       long res(foo.plus(bar))
       bar.equals(foo)

And then you could have just int, short, long etc classes that have operator overloads for =, +, etc and systemically avoid glyphic overload ambiguity because you are forced to handle that ambiguity in the operator descriptions.

With modern compilers (particularly LLVM) this could probably work very well, because the optimizers are so good even if you start defining your primitives in object notation and handing off really ugly bytecode that is treating everything as a non-dynamic object the backend llvm equivalent asembly generator will almost certainly be able to strip all the overhead out and return you back to optimized platform specific math operators onregister-sized words.

I'm not a language designer (obviously). I'm just a developer frustrated with how every language but Python is so much harder for my uncle to read (who is not a programmer) and thus makes _me_ spend more brain energy deciphering it than if it were less verbose and more plaintext. And after writing a few of the Rust tutorials on the weekend a few months ago and giving a crack at writing a webrtc library for it I was really frustrated with how much extraneous glyphic grammar I had to learn and deal with in the language, since it seems so much worse than C++ from my perspective.

<comment><USER2> (Note that your comment is a bit difficult to read because Hacker News turns asterisks into italics.)

Putting the type name before the variable name can grossly complicate your tooling (the aforementioned lexer hack, [https://en.m.wikipedia.org/wiki/The_lexer_hack](https://en.m.wikipedia.org/wiki/The_lexer_hack) ), which is part of the reason why tooling for C and C++ is so relatively rudimentary despite thirty years of time to address it.

There are also semantic difficulties that can arise from putting the type name before the variable name. For example, C++ recently added a return-type syntax that resembles what you see in Rust:

      auto multiply (int x, int y) -> int;  // this is valid C++

The reason why this syntax exists is because, well... it's a bit complicated to explain here, read [http://www.cprogramming.com/c++11/c++11-auto-decltype- return...](http://www.cprogramming.com/c++11/c++11-auto-decltype-return-value- after-function.html) instead. :)

Furthermore, the `name: type` syntax is simplest solution when your language supports both patterns and type inference, as Rust does. IMO it also reads more nicely because when scanning code I care more about what a value's name is than its type (which may only be because Rust's type system is relatively strong, and I count on it to catch me if any types are out of place).

There's also the emerging historical trend: AFAICT, every language designed in the past ten years has put the type after the variable name. Rust, Go, Swift, TypeScript, Nim, Crystal, Pony... even Python 3 ([https://www.python.org/dev/peps/pep-0484/](https://www.python.org/dev/peps/pep-0484/)). All the proposals that I've seen for optional types in Ruby and Javascript put the type after the name as well. And this syntax has roots in a much older language, ML, and is generally shared by ML's descendants (such as OCaml, and also possibly Rust).

<comment><USER5> For someone who uses Reddit and HN too much I sure can forget about markdown.

The function syntax C++ has seems more like a bandaid around the broken scoping rules inherited by C more than anything. If you were writing a replacement it seems like it would be one of your first considerations to make each statement scope limited to the scope of the declaration. I mean, that is what auto is effectively doing in C++ nowadays - you have to evaluate the whole statement to resolve what auto is supposed to be at compile time.

I would take consistency of using postfix typing as a sign there is legitimacy and simplicity in compiler design to do so, but I don't think the Python example is particularly fair, since it (and the C++ ->) are both extending a language that already had declaration syntax and thus the kind of glyphic overhead imposed by colons and arrows is less condemnable because they had to maintain backwards compatibility.

My gripe boils down to the difference between "August 5th" and "5th of August". The latter can convey the information in a more meaingful sense (you usually care about the day more than the month if you are using both) but it comes with a grammatical overhead "of" that, if were writing and reading a _lot_ of dates of this form, would have a tangible impact on overall reading and writing efficiency. It would of course be minor - that is why its a gripe, and I still love Rust from what I've done with it - but it nags on you like it could have been done better.

And I also can understand the concept of name over type, but as someone who strongly favors static typing over dynamic after about five years of Python and three of C++, I think just conceptually "Canister Bob" is easier to parse than "Bob the canister". It is almost certainly just habit, but I justify my appreciation of the habit because it doesn't need to involve those damn conditional constructs (be they the, if, or a colon) that clutter up my reading and writing.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> "<...> but I don't understand why I need to write code for both cases, error and success, when I only need value from successful case and I can completely ignore Err or None results."

Have you considered `if let`? Seems like the exact thing you need here. [https://doc.rust-lang.org/book/if-let.html](https://doc.rust- lang.org/book/if-let.html)

<comment><USER7> That page illustrates an important distinction between expression based languages and procedural ones. You couldn't do that in an expression, as it wouldn't type check without a value for the None case.

When I first saw Option it seems like a great way to force handling of the None case, either explicitly in place, or by passing on a mapped option as a return value (monadic composition make this a nice thing).

This resembles how exceptions are handled in most procedural languages, either you catch it and handle it, or you don't, and someone else gets to do it further up the call stack.

The example on that page looks like the equivalent of an empty catch block. It's almost certainly a bad idea that will bite you in the ass some day.

<comment><USER8> Maybe I'm misunderstanding you, but why wouldn't it work in an expression based language?

Isn't

      if let pat = expr1 { expr2 }

just syntactic sugar for

      match expr1 {
        pat => { expr2 }
        _ => { }

meaning the type of expr2 must be unit, and thusly if let is always of unit type?

<comment><USER7> Granted. But a unit expression is only useful for its side effect so I guess I put that in the gray area between paradigms, not really in the spirit of only evaluating expressions. Which brings us back the point of my comment: It's almost certainly a bad idea.

</comment></comment></comment></comment><comment><USER9> I wish there were more articles like this as I'm genuinely curious of people's experiences using Rust as a backend to their API's or websites. The only example I had known of before this was Rust's own crates.io [1].

[1] [https://crates.io](https://crates.io)

</comment><comment><USER10> I've been considering Rust (or Swift) for webapp backend, but these cons are spot on: Named parameters are missing, and one can't build natural looking JSON validation if one can't nest them nicely.

Swift looks promising though, if a bit in flux.

I've been ramming my head against Scala lately, and while it's nice at times I would like to have compiled language.

<comment><USER11> Could you show an example of what you mean by "natural looking JSON validation"? I am not sure I have seen what you are referring to.

<comment><USER10> I think succint is the word I want. Nested validation logic that looks like the object you are validating.

Unfortunately Play docs are not succint, but you may get the idea from here: [https://www.playframework.com/documentation/2.3.x/ScalaJsonC...](https://www.playframework.com/documentation/2.3.x/ScalaJsonCombinators)

I tried to implement similar (typesafe) myself using TypeScript: [https://github.com/Ciantic/model- validation](https://github.com/Ciantic/model-validation) there are certain problems I hit with TypeScript, and also I don't want my backend to be JavaScript so I've stopped working on it.

</comment></comment></comment><comment><USER12> Good write-up and experience summary. Nice to see that people from dynamic language backgrounds are able to pick it up.

</comment><comment><USER13> I tried Rust with Iron as the article mentions but JSON parsing and writing wacky match expressions turned me off to Rust early on.

<comment><USER14> Out of curiosity, how long ago was that? I've found that over the last 2-3 months (I started tinkering around 1.4), the ecosystem has already become quite a bit better.

<comment><USER13> About 6 months ago I think. It was pre-1.0 and yes some things weren't fully mature. Maybe I'll give it a whirl again soon.

I was initially excited about Rust because it appeared to achieve system programming language performance and stability with application programming language expressiveness.

The nature of static typed languages doesn't allow for things like first class lazy JSON serde. Java, C, C++, C# all have the same issue.

In the grand scheme of things it's not a huge deal if performance is #1 but I value my enjoyment level while coding.

</comment></comment></comment><comment><USER15> Is it just me, or is using Rust for web apps kinda odd?

<comment><USER16> The main downside to using Rust for web apps - at least in my opinion: is having to learn and use a type system which includes affine types: lifetimes, borrowing etc. But if you've already put in the effort to get to grips with this part of the language, that's not as big a drawback. Then you get all the other positives of the language, like its strong type system, fast speed, sensible package manager, lack of GC pauses etc.

<comment><USER4> I'm in full agreement with this. The learning curve (and the compilation speed I guess--but that's improving quickly) is the main drawback to writing Web apps in Rust. If you've already learned it, though, then it's basically just down to the typical static vs. dynamic typing tradeoff, with Rust just being like any other statically typed language.

<comment><AUTHOR> Rust's errors handling and memory safety are important differences too.

</comment></comment></comment></comment><comment><USER17> I was wondering how you would test web apps written in rust. In particular the api you're building. Right now as my first rust project I'm trying to implement an HTTP protocol with hyper but I'm not really sure how to test it properly next to just creating a client connection and throwing requests at it. Btw my final idea is to have it as a library that gives you a handler to use with what ever rust framework you choose to use. Not really sure how to do that though, I'm using a lot of hyper stuff.

</comment><comment><USER18> [http://arewewebyet.com/](http://arewewebyet.com/) \- (You can use Rust for web stuff, but the ecosystem isn't mature yet.)

<comment><USER19> This website is quite out of date. It hasn't been updated in 9 months.

Related: [https://github.com/teepee/arewewebyet/issues/24](https://github.com/teepee/arewewebyet/issues/24)</comment></comment>


Show HN: ExactImage's Barcode Scanner ported to JS - <AUTHOR> http://manuels.github.com/unix-toolbox.js-exact-image/demo/

<comment><AUTHOR> Tobias Schneider's barcode scanner [1] is a great example for a simple bar code scanner (<100 lines) However, it turned out to be not very accurate in a lot of cases. That's why I ported ExactImage's [2] bardecode [3] to javascript using emscripten [4].

I hope you like it.

[1] <https://gist.github.com/tobeytailor/421369> [2] [http://www.exactcode.com/site/open_source/exactimage/bardeco...](http://www.exactcode.com/site/open_source/exactimage/bardecode/) [3] [http://manpages.ubuntu.com/manpages/lucid/man1/bardecode.1.h...](http://manpages.ubuntu.com/manpages/lucid/man1/bardecode.1.html) [4] <http://emscripten.org/>

<comment><USER2> Love the idea, but can't get it to work using images taken from my phone, even when I make sure they are in perfect focus.</comment></comment>


Why Facebook Should Acquire Foursquare - Caleb Elston 	 - <AUTHOR> http://calebelston.com/facebook-should-acquire-foursquare <comment><USER2> I've assumed that Facebook would be adding location to their mobile clients in the near future. In doing so, they won't hav to resort to the games Foursquare uses to try to get to critical mass. I also doubt that foursquare has any key infrastructure pieces that would be useful at facebook scale. In short, an acquisition doesn't make much sense, other than as an acquire to hire signing bonus.

I think the best positioned player in the mobile location based service space is Apple. They are well positioned to get paid well, no matter what service ends up winning over the most users.

<comment><USER3> A few restaurants and bars around Austin are giving Mayors discounts on food/drinks for as long as they hold the title. The game element is very enticing in this regard for both players and local businesses.

I agree with you about critical mass.

</comment></comment><comment><USER4> I fail to see how this makes sense as a Facebook acquisition. There are plenty of location-based social networks out there with many times the users and, I'm absolutely sure, available on more devices than this is.

It looks like more of a Facebook application than an integral part of Facebook.

</comment><comment><USER5> Dennis watched Dodgeball get acquired by Google, neglected, and then killed. Foursquare is what Dodgeball would have been a few years later had Google given it any TLC (and it also might have been Twitter).

I think he might think twice before selling to anyone based on that experience.</comment>


Cradle of Mankind to Patagonia in 7 Years: A Journalist's Narrative Walk - <AUTHOR> http://www.niemanlab.org/2012/12/how-do-you-pack-your-bag-for-a-seven-year-22000-mile-international-reporting-assignment/

<comment><USER2> I wonder how he'll backup his footage</comment>