HNHacker News
TopNewBestAskShowJobs

EvilTrout

2,265 karma · joined February 4, 2009

Game developer "The Roottrees are Dead" and "The Incident at Galley House". Formerly, co-founded Discourse.
submissionscomments
EvilTrout··on AngularJS versus Ember
Those private topic bugs are not the result of ActiveRecord. We added a group layer on top of existing code and missed some places where queries did not respect it.

Had we used raw SQL instead of an ORM we would have had the same issues. All projects are open to this style of bug. The correct thing to do is report, close them quickly and add tests to prevent them from happening again (which we do.)

EvilTrout··on AngularJS versus Ember
I went back and forth on the title. I don't usually write sensational titles but for some reason decided to give it a try.

I think it's a very good point and I doubt I'll do it again.

EvilTrout··on Moot 1.0 launches with embeddable forums and commenting without iframes
Nothing personal, just as makers of forum software, anyone else who makes some is a competitor by definition, even if we are both free products.

I'm happy to have many others in the forum space as it legitimizes our cause and pushes everything forward. Our main goal is to modernize forum software and so is yours, so we're fighting the same battle here.

Also there's no way we're backing down on infinite scrolling :)

EvilTrout··on Moot 1.0 launches with embeddable forums and commenting without iframes
Discourse founder here. I tried their demo forum but it currently isn't responding. Probably too much load from HN although their home page claims they can handle 1k posts per second (trollface).

From a cursory point of view, it seems to have more in common with Disqus than Discourse. It's embeddable, doesn't allow rich posts or markdown or our support for embedding videos, github, wikipedia, amazon, etc.

It's also closed source, although it is free and they claim they'll never insert ads.

I have no idea about their support for the other challenges we've faced such as infinite scrolling that is compatible with the back button.

I am skeptical of redis as their only data store. We use redis too in Discourse but this would demand that all forum content can fit in memory at once, and there is a chance if a server crashes you'd lose so. Not to mention querying it is much more difficult especially when filtering.

Either way, we're glad to have the competition!

EvilTrout··on Why we're moving away from Ember.js
Discourse doesn't use ember data and it has been an absolute pleasure to code in EmberJS. I think a lot of people don't realize just how simple it is to create an Ember object from an AJAX call and start using it. A finder is usually as simple as:

$.get("/user/eviltrout.json").then(function(json) { Discourse.User.create(json) });

I'll probably end up writing up an AJAX tutorial because I think a lot of people are underestimating just how simple it is.

EvilTrout··on Why Ruby?
He's talking purely server times here. And it shouldn't be pages so much as "JSON Blobs" :)
EvilTrout··on Making some Discourse code a little better
Honestly it came down to there being private keys and other shifty things in there at various points. Also there was a lot of old crap as we evolved the prototype closer to what we released... We just thought it was a good idea.
EvilTrout··on Making some Discourse code a little better
A couple of weeks ago, I was talking to a friend about the impeding launch of Discourse. She asked me if I was worried that people would judge me for the code I'd written (although to be honest, you can't tell who wrote what since we reset our commit history when we launched).

The truth is releasing your code is a very scary thing to do. I knew some parts were good, some parts less so.

Posts like this (and their pull requests) have floored me. Grant did a fantastic job refactoring a large chunk of technical debt we'd acquired, and then took the time to write up why he did it in detail.

I really hope this trend of improving something and writing how you did it catches on. I want to see it in other people's code bases too!

EvilTrout··on Why Discourse uses Ember.js
Actually we aren't using server side handlebars rendering for the Google aspect, although that's something we considered! We're using it for more boring stuff like our Oneboxes.

Our site is indexable by Google and it doesn't do much fancy. On certain URLs, we generate a small HTML view of the content in the <noscript> tag. You can see this by viewing source or disabling JS in your browser. It's just a simple ERB template in Rails, and uses the same object graph that we serialize via Active Model Serializers.

Google can see it and index it, we've confirmed by searching post launch.

As time goes on we'll probably work more on it to make the SEO even better. As you can imagine it was tough to do when we were in stealth mode ;)

EvilTrout··on Why Discourse uses Ember.js
Fixed, thanks!
EvilTrout··on Civilized Discourse Construction Kit
I think you might be surprised if you check out what we came up with. You're right that in the beginning Jeff was interested in gamification, but when we sat down and started to crack at it, we found the interface itself was in need of the most work.

You can like posts in this release, but it's mainly to prevent useless "me too" posts. Users don't have scores. Posts do, but that's just so we can calculate a summary view for mega threads.

Additionally, almost everything is configurable. We give what we consider sensible defaults out of the box, but you can disable/tune a lot right now.

We also integrated features suggested by goons like a global API.

I've been a SA goon for almost a decade. I really want to make this software good. Actually I'll probably post a follow up topic there soon!

EvilTrout··on Civilized Discourse Construction Kit
We are closer to your vision than you might think.

Discourse remembers what you've read and what you haven't. You can "like" posts or "flag" them as poor.

Our API coverage is almost 100% - our rich JS client consumes our own API for just about everything, so we actually know it's working because the client wouldn't work without it.

We also have an (admittedly undocumented) plugin system, where you can install rubygems that add or remove functionality from the core app.

EvilTrout··on Civilized Discourse Construction Kit
When you're logged in, we track exactly what posts you have seen. When you click on the topic again, it takes you directly to where you left off, to the post!
EvilTrout··on Civilized Discourse Construction Kit
No, we were worried that rendering different content for google violates their TOS. So what we do is render a super basic version of the page in the <noscript> section with no tools or extras. You can see it if you disable javascript in your browser.

It's not much to use, but enough for google to get at the words and links.

We're not sure how well it works since the project was secret until today! We're going to keep an eye on it and adjust for maximum google-fu going forward.

(Shout out to Sam Saffron who implemented this!)

EvilTrout··on Civilized Discourse Construction Kit
Not only does it run the latest stable release of Rails 3.2 (which was immune from the latest security vunerability), but I made sure we are running the latest versions of all Rubygems.

Having said that, this is very much an early beta right now. We expect to get a lot of feedback over the next little while, and we want to integrate that before we release a 1.0 stable that we'd be comfortable telling many people to install.

If you install it now, you'll have a more complicated upgrade path to our 1.0.

EvilTrout··on Civilized Discourse Construction Kit
Thanks. I'll probably write up a blog post of how it's done eventually but the short version is we use HTML5 replaceState to update the URL as you scroll down a topic stream, so you have a unique URL to go back to and share.

There is a little more intelligence as links within a topic just replace the state, but links to other topics push the state.

Also infinite scrolling downwards is easy to implement. Upwards is a huge headache.

EvilTrout··on Civilized Discourse Construction Kit
1. If you log in across various devices you'll end up with links to the last post you read in the topic. Unlike other forum software we don't consider all posts on a "page" viewed when the page downloads, only as they are scrolled into view.

2. We use HTML5 replaceState to update the URL as you scroll. Just grab the link from the URL bar and it'll take you to where you left off. Or additionally click the "Share button" for a copy and pastable pop up.

3. Yes we render a lightweight version of the pages in a <noscript> tag for google indexing.

EvilTrout··on Civilized Discourse Construction Kit
Once upon a time people said that creating stuff in PHP was ridiculous as Perl in cgi-bin was way more supported.

As was mentioned, we have a hosted offering planned so people can set up a forum in a few clicks.

But besides that we actively want to work to make Ruby apps easier to install. Right now they're too hard and we're going to try and fix that.

At the very least we'll offer VM images and install scripts for various cloud hosts.

EvilTrout··on How our users exploited concurrency and how we fixed it
I think you're being a bit dramatic about little part of one sentence.

There are many application developers out there using Rails, PHP or Django who can go years without invoking locks or semaphores due to the strengths of the APIs and frameworks they use.

As they learn and grow as developers, they will be introduced to new problems and solutions. A semaphore can be exotic, not because they've never heard of it before, but because they've not used them very much outside of that one assignment they did in CS 5 years ago.

How about instead of criticizing people's eductions, we encourage them to be mindful about what they don't know, and to learn whatever they can when they get a chance?

EvilTrout··on How our users exploited concurrency and how we fixed it
Everyone's got to start somewhere!

In the sentence before I explicitly said I was a newbie to this stuff at the time. Obviously it's not exotic to a more experienced developer :)

EvilTrout··on How our users exploited concurrency and how we fixed it
That introduces external dependencies though. Also, since the update has to occur anyway, I'd bet that my solution is faster than also making a call to another database for a lock.
EvilTrout··on How our users exploited concurrency and how we fixed it
In the example code I gave, by default in Rails with Postgres (which supports MVCC) you'll still get the error. So it's not as simple as using a transactional database: you either use a trick like this one, an row-based version column, or you need to change your isolation levels which has other performance issues.
EvilTrout··on How our users exploited concurrency and how we fixed it
Right, but that involves changing your database and adding hidden form fields to your app in order for it to work on a multi process environment (like every production server should be.)

My solution is basically the same amount of lines, requires no such changes.

EvilTrout··on How our users exploited concurrency and how we fixed it
There's a difference between a transaction that locks for writes and one that locks for reads. By default the reading is not locked in this (common) case.
EvilTrout··on How our users exploited concurrency and how we fixed it
facepalm

I forgot a very important part of the query:

row_count = Goal.update_all "completed = true", ["player_id = ? AND completed = false", player.id]

If you update where completed = false, the rowcount will only be 1 when the update works.

(I've updated the blog post.)

EvilTrout··on Turbolinks and the Prague Café Effect
> Using turbolinks won't make your site slower than not using turbolinks.

No, but it encourages a style of development that makes you rely much more on the server side speed than you should. That is the major flaw I was trying to bring attention to.

The general sentiment was supposed to be: interested in turbolinks? Well take a look at THIS first.

Client Side MVC frameworks are certainly not all about speed - they have other advantages such as great organization of your Javascript code, API first development, etc.

EvilTrout··on Turbolinks and the Prague Café Effect
Author here.

One side note: I don't actually hate Turbolinks. If it's working for some people with little effort, more power to them.

I'd just suggest to _anyone_ considering it, you should look into a JSMVC framework first to see all the other benefits you can get.

EvilTrout··on Introducing the Rails API Project
As someone creating a large Javascript application with a Rails API, this makes me very happy. Perfect timing!
EvilTrout··on Who's the Boss? There Isn't One
Do you have a source on that? I'm a huge fan of Valve's and I've never seen that quote.
EvilTrout··on Brendan Eich of Mozilla gave $1000 to support gay marriage ban
It says "Mozilla" right beside his name. I think most people would have less of an issue of he donated without stating his employer.
← PreviousPage 2 of 5Next →