Show HN: A Reddit reader that looks like the frontpage of a print newspaper
unim.press
unim.press
If I were reading this on /r/dataisbeautiful, I’d immediately parse and grok the headline just fine. But with this, my mindset was on the reporting of actions or events and I read “to scale” as an infinitive (verb/action), almost like the intro to a sci-fi novel that starts with a stunning declaration that in x days, all planets will actively shrink by y% in some never before seen cosmic event.
If you’ll allow me to use a programming analog, it wasn’t until my tokenizer hit the first parenthesis that my lexer switched to the correct track.
I had to read it like a first grader and think about it to understand that it was just a label for a chart and NOT a headline of an action.
Web app authors can be very creative, but one thing I don't like about web apps is that often their error handling is nonexistent. It's not about individual authors; behemots like Microsoft also do this in an irritating way: "Something did not work. Reload the page please" -- Is this really the best a billion dollar company can do? Well, I suppose this is still better than no error at all, which is a default error handling method for big chunk of web apps.
I think (but can be wrong) that by using such a dynamic environment like JS is the culprit for lack of good error checking mechanism.
Also one thought of mine for the reason why even big companies are unwilling to provide good error messages is that it's impossible to get the real reason. There may be so many moving parts that even the developer isn't able to handle it all. Which sparks a doubt in my mind if this environment is really fit enough to provide high quality software. Since it's so popular it's obvious that it has some aspects that it does right, but it seems that the web app environment could benefit from some fundamental changes.
Didn't realize until posting here that apparently Firefox blocks the reddit api from the browser in certain common configurations. So maybe that would have been useful.
IMO if a website displays a loading message indefinitely then this isn’t error handling.
I’d say that showing accurate feedback is part of proper error handling; like the one you suggested:
> I suppose I could have added a "it seems we can't reach Reddit" kind of message,
Not that a hobby project needs error handling, it’s cool even without it.
In the function fetchRedditStories, it looks like that the callback param in the catch is named `e`, but it tries to log `error`.
Checking the network panel I'm getting a 200, but I'm pretty sure it's failing anyway because of the ReferenceError
The underlying problem here is using Javascript instead of TypeScript.
And of course under that problem there's the problem of Javascript bit being TypeScript in the first place.
(Not a bad word about Brendan Eich though, considering that the language was created by one man in three weeks it is amazing, but it is still sad that we ended up with an untyped language in such a critical place.)
Not at all. It's perfectly possible to implement solid error handling. There's even a global handler: https://developer.mozilla.org/en-US/docs/Web/API/GlobalEvent....
For legacy scenarios (IE11) you can add an event handler for the error event, so you end up with something like the following to deal with both situations:
window.onerror = yourErrorHandlerFunction;
window.addEventListener('error', yourErrorEventHandlerFunction);
The shape of the objects passed in differs slightly, hence the need for two different handlers. In my case one simply repackages the object and hands it off to the other.It has an error. Report the bug. Hope it gets fixed. The end.
Typography and layouting of a newspaper is quite complex. If you look at a printed newspaper, the stories are arranged and cut to size with images, captions and inserts to fit neatly into the grid.
Depending on the newspaper the information flow from headline, subheadings, article is strict, optimizing for allowing for fast skimreading or to grab your attention.
To do this "right" on challenging unedited reddit posts will be a lot of work, but an interesting challenge.
I have seen plenty of people struggling when reading relatively large newspaper. Most of them are.
And then I also need to wash my hands afterwords
The resource at “https://api.reddit.com/r/dataisbeautiful/hot?limit=25” was blocked because content blocking is enabled.
ReferenceError: error is not defined
MacOS, Firefox 77.0.1
And an option to "turn the page" for more content from the select subreddit would be even cooler!
In my experience, "hyphens: auto" in browsers doesn't work well at widths smaller than 80ch. The "center-spread" column is currently set to width: 600px, approximately 67ch. Changing it to width: 80ch looks much, much better, in my opinion.
I also suggest adding the Safari variant, "-webkit-hyphens: auto", and add the lang="en" attribute to your <html> tag, to enable hyphenation in Firefox.
Now, we’re lucky if we get an option to manually specify hyphenation points for line wrapping, we have horribly thin and broken “web fonts” that supersede even locally installed versions with correct hinting of the same typeface, have disabled subpixel rendering so we can play nicer with animations, transitions, and useless effects, and consider ourselves incredibly lucky if we get real italics rather than oblique versions of the Roman typeface *for fonts with italic versions around since the early ‘90s.
And even then it is getting better, the modern CSS can do things Word can't (notably all small caps and old style figures).
After championing it and spending 13 years adding it to the OS and getting it supported everywhere, Microsoft removed ClearType subpixel rendering from Windows 8’s UI framework for those same reasons, went on to ship Windows 10 without it, and only went back on that decision with the Creator’s Update and are still working to correct that mistake and its fallout.
https://bugs.chromium.org/p/chromium/issues/detail?id=676270
But you can see all the CORS issues this is throwing up. Rather than a 100% js app, why not call a function which fetches the content and caches it too? CORS issues begone, and caches too! You don't need an expensive server setup, have a look at AWS Lambda or Azure Functions.
As one example, the front page of the Wall Street Journal in 1987 was predominantly text. [1]
[1]: https://wsjshop.com/products/framed-reprint-crash-of-1987-st... "Black Monday Crash of 1987"
Browsers don’t hyphenate, so avoid justified text on the web.
In Google Chrome, you'll see that it hyphenates "profes-sional" in the second story of the center column. It's still not enough, though, because it still leaves huge gaps in the justified text; it works best when you use width: 80ch. The page is currently using width: 600px, which is approximately 67ch.
(If you don't see hyphenation in Safari, that's because the developer didn't enable -webkit-hyphens. If you don't see hyphenation in Firefox, that's because the page's <html> tag doesn't have a lang="en" attribute.)
var Hyphenopoly = {
require: {
"en-us": "Supercalifragilisticexpialidocious"
},
setup: {
selectors: {
".story": {}
},
CORScredentials: "omit"
}
}
script = document.createElement('script')
script.src = 'https://unpkg.com/hyphenopoly@4.5.0/min/Hyphenopoly_Loader.js'
document.body.append(script)I know real newspapers do hyphenate, but the site would probably look a lot less like a newspaper without justified text.
Probably because hyphenation is itself a rabbit-hole of complexity; some languages may require a complete dictionary to determine where words can be hyphenated, and sometimes it could depend on what style guide you follow, etc.
> Only supported on Android & Mac platforms (and only the "auto" value) for now.
Even where the property is supported, the supported language matrix [2] tells a depressing story.
[1] https://caniuse.com/#feat=css-hyphens
[2] https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens#Bro...
Now do hackers news. It’ll be like the WSJ, a nice counterpart to this, which is a little more like US Weekly.
https://github.com/thesephist/torus
Nice showcase of the tech! Now I want to tinker with the Torus framework as well.
Curl, BeautifulSoup, and Latex. Great fun.
How about doing the page generation on the server-side? That way a static page could be served.
... actually, in that case, maybe a _PDF_ could be served, and that's really more like print :-)
edit: clarity
I used it extensively on an iPad first generation but unfortunately it's no longer available on the App Store.
And did you already know the backend tech in order to speed up development?
The app renders using a UI rendering library I wrote (https://github.com/thesephist/torus), so I knew the tools I was using inside out, which helped with speed.
"COMMENT CONTENT," USERNAME said when prompted
USERNAME had this to comment: "COMMENT CONTENT"
We interviewed USERNAME, who said: "COMMENT CONTENT"
etc.
app.subreddit = "nameofsubreddit"; app.fetch();
Only one thing, an old news paper format won't have images on all stories which is bit awkward to look at.
But this is really great work! Great idea and really cool! Good work!
Regards, Peter @ Oeck.
P.S. I think special characters need to be unescaped (> → &)
EDIT: just checked the date is wrong.
This format looks good on paper, but on screens its a mess and poorly formatted one at that.
Can we stop re-inventing bad UX all over again?