Hi, author of the post here -- I actually skipped a few steps in this code, because it was getting quite long. As it turns out, ActiveRecord is amazingly complicated, even for the simplest of queries.
It's trying to build an AST for every query, and that AST uses Arel, which is its own, complex layer of abstraction. There are a lot of layers of turtles before you get to anything that looks like SQL.
Awhile ago I found a patch to Arel fixing up its support of unions, which I wanted to use, but it hadn't been merged and had fallen behind the version I was on. Fixing it up for the newer version required enough tweaking that I had to actually figure out how the code worked. I found it to be an impressively simple and well-written solution to an inherently complex problem.
All of this is to say that it would be neat to see this journey go even deeper!
My keyboard seems to disregard about 25% of all my p, k, and l key presses. The above should have been part. I'd throw the keyboard out but I love the layout of it. If anyone knows of a Microsoft natural Internet keyboard layout with mechanical switches I'd buy a few immediately. There's got to be a bespoke keyboard business out there somewhere with all the 3d printers nowadays.
I really appreciate what the omniref guys are doing, but I find these "posts" (maybe not the right word?) incredibly difficult to follow. I can't tell if I'm supposed to read the left pane, the right pane, the bubble? Do I click the quote bubbles? Does the left pane "track" the right pane?
A little hard to follow? Only because I've never seen it before. This is a great idea.
The publishing of code-as-narrative or code alongside narrative is something that will slip into the mainstream, maybe in our lifetimes.
Already, ruby code (and other similar languages) are nearly understandable by non-technical folks. And consider the popularity of tools like cucumber that involve tests that are readable by anyone.
Imagine a day when code is published on the New York Times homepage, alongside some Silicon Valley luminary's commentary.
In this case, the "bubble" is the thing...but yeah, it's a little noisy. Perhaps if we fuzzed out the background a bit when the annotation viewer (the bubble) is open it would help?
Please don't do this. It was immediately obvious to me which part was the part I was supposed to read. (And I've never visited this site before today!)
Look, man. Until one gets a sample size that's a fair bit larger than two, one cannot know whether the person professing confusion or the person professing clarity represents the more common case.
I personally managed to follow the series without difficulty, though I can sympathize with the parent's sentiment because I felt a brief moment of confusion when the page first loaded. Excellent write up though! Looking forward to going through the rest of the content after work today.
I'm no UX expert, but I think if you want story reading to be a core feature of your product it will have to have a core place in your layout, so not a pop up box. It would replace whatever currently is your main feature (I.e it would become the left bar).
I think the thing to do might be to detect if the page was loaded with the annotation open, then fuzz background. Otherwise, you know what you're looking at and explicitly clicked the open annotation button.
It's great that the site supports such deep linking.
My original comment was worded poorly. Left side blur should be on initial load if the referring url is not from the same site, not every time you open an annotation.
I see that it popped up under recent questions on the home page. Once a question gets bumped off that list, is there an easy way to find it (e.g. through search) or can one only find it if they happen to be viewing the Q&A tab under the same file?
Since this is my first question there, I'm not sure if I have to check back repeatedly for answers or if I'll get notified somehow.
I love these, great work. One minor nitpick; the next/previous links seem like they're backwards: I ended up hitting previous by mistake twice, thinking I was moving forwards.
It's trying to build an AST for every query, and that AST uses Arel, which is its own, complex layer of abstraction. There are a lot of layers of turtles before you get to anything that looks like SQL.