226 points · by deafcalculus · 9y ago · 172 comments
And then, of course, there's Web 0.1: https://thedailywtf.com/articles/Web_0_0x2e_1
It was AJAX and processing data via JavaScript that was a web 2.0 thing (for the most part), not just submitting forms in general.
Also see:
http://www.paulgraham.com/web20.html
I think everyone would agree that democracy and Ajax are elements of "Web 2.0."
Funny given that the whole purpose of AJAX/SPA was to reduce response time. That's it's reason for existing.
Turns out it just complicates things ...
No, a good car is not evidence that the plane just complicates things, it's evidence that you've got a good car.
How I remember it, it was created for user experience reason. Not having to submit a form and refresh the entire page and cause the page to bounce back to the top of the page, etc.
AJAX (at least when I learned and implemented it) was for updating the user about an action they performed without refreshing the entire universe in front of their eyes, only updating the contents of a div or something else.
The whole web app as a javascript app.js blob idea took the AJAX idea to an extreme. In this extreme it often does slow down page load speeds and negatively effect the user experience when Javascript doesn't work, for whatever reason.
The idea of AJAX/SPA was to provide interactivity and a less technical UI that caters to the average Joe. AJAX/SPA moves some of the computation from the backend to the frontend so the service scales better for millions of users.
This forum is not going to be fast for millions of users (it might not even be for hundreds of simultaneous users) because the server has to render everything again for everyone.
Server side rendering is good for response times, that's why the SPA world went back to it (Google: react ssr). SPA is good for scalability and average Joe UI.
...and AJAX is there so we don't need to do a full page reload all the time. Again, not because of response times.
I hadn't heard that reason before. Can you please talk more about this?
> This forum is not going to be fast for millions of users (it might not even be for hundreds of simultaneous users) because the server has to render everything again for everyone.
This theory doesn't match reality. In reality, multipage applications are faster than single-page ones. In fact, most things on the internet still are multipage, including web forums. Most web forums are powered by PHPBB, a multipage web app, and they were powered by PHPBB 15 years ago, when hardware and PHP were much slower. This very site is a multipage web app, and it holds up just fine, even though it has enough users to bring down other websites.
Single-page applications seemed like they would be faster, but usually they aren't.
First, let's look closer at a multipage application. All of the scripts, styles, and images should be cached after loading the first page, if you set the headers right (the Expires header, mainly). Therefore, what is left? The content. And I have found that the size of the HTML content is often close to the size of the same thing in JSON --- at least the way I write HTML (I try to keep it lean. Few classes, extraneous divs, etc.). This is because JSON has all those keys:
{
"color": "red"
}
while HTML has just the values: <div>red</div>
That was a simple example, but I measured a bigger one, and the size turned out to be about the same, especially after compression. All of those HTML tags compress well, because of repetition.Now if they are the same size, then they should load in the same time. Except they don't. The server-rendered page loads faster. Why? Because of progressive rendering. When just some of the HTML has come down the pipe, the page appears. But with AJAX, all of the JSON must first load, then be parsed, then wrapped in a template, then inserted into the DOM. Then it appears all at once.
Average Joes want spinners, buttons, draggable stuff, toggles etc. that don't lead to a page load everytime you press them. Sure, you can say that "well just make a multipage app with some jquery". But at some point you're just approaching a SPA with SSR support.
Imagine facebook's chat but everytime you hit enter you had a full page reload :D
> In reality, multipage applications are faster than single-page ones.
I agree. They are faster for a single user when the usecase is a semi static page like a forum. However, the SPA + API model makes stuff easier for the backend side and allows that average Joe UI stuff. It scales well to millions of users.
The thing is, it's not about you. It's about everyone. We want to build services that please the majority and backends that stay up when the majority is logged in.
Also, it really isn't possible to build realtime/dynamic stuff with a "let's render some HTML on the server" mindset. How do you do realtime chat? Realtime games? How do you do a collaborative text editor? and so on.
JSON/SPA/AJAX are not there to so your static forum page loads fast. They are there because of the next generation of the web.
At that point, you'd have to cache the JSON responses just the same, so the complexity of cache invalidation would be there in the exact same way.
But you would still not have the additional load and bloat on the user browser.
Load and bloat? Well that depends. If you're doing a realtime collaborative texteditor with a realtime chat, I just don't see how you'd get anything even remotely nice without what you call "load and bloat".
However, to return to the original topic. Which is simpler: a) creating a performant data API b) creating a performant server that handles data stuff just like a) AND all the rendering & UI stuff
Surely the latter is more complex since it has more responsibilities?
Oh, don't worry, they're reinventing it in JS. I've had a recent project proposal and one of the engineers said that to make the webpage faster we could prerender the pages on the server side with JS.
Like, at that point, you're just using PHP with a different name and worse performance (a small 4$ shared hoster can easily handle 1M users per month, I've yet to see a NodeJS app handle 1M users per month on a 5$ VPS without problems)
We should make the best use of pure HTML/CSS web pages, that is what the web was made for.
For anything else, better go native with Web APIs.
The way you create cookies is also insecure, you should be using crypto/rand instead of math/rand AND rather hex.EncodeToString() the result instead of just generating random numbers in the alphanumeric range.
The hex.EncodeToString() point is a nit. Generate 128 bits of randomness, and then encode it however you'd like. The track record of people trying to get "generate random numbers in the alphanumeric range" isn't great; it's an opportunity to reintroduce bias. Start with a random token of sufficient size, then encode.
The Argon2 vs. bcrypt thing is unhelpful. It does not matter what password hash you use, so long as you use a hash designed for password storage (ie: not "salted SHA-2"). Bcrypt is fine. I prefer scrypt, for the obvious hardware tradeoff. I don't recommend Argon2 to people (or tell people to stop using it) because of the library support issues.
But I think it's specifically a bad idea to tell people to switch password hashes from bcrypt (or PBKDF2) to the trendy new hash. The security benefit of "upgrading" from one password hash to another is marginal.
(Obviously, the benefit of switching from "salted" hashes to real password hashes is not).
And I think one can also make mistakes with scrypt when choosing parameters which Colin himself acknowledged. So isn't it time to go ahead with Argon2?
People have weird ideas about the importance of picking password hashes. It's important not to use non-password-hashes. Other than that, which password hash you use? Not so important.
There are a few 3rd party implementations... But is it more secure to use a lesser known 3rd party package to have Argon2 support or is it more secure to use the more widely adopted bcrypt package supported by the Go dev community?
Does it not have the issue that it will silently truncate passphrases beyond 72 bytes? As far as I can tell OP does not check for that and the Go API they use makes no mention of it and was affected at some point[0].
72 bytes is not a very high limit when SEA abugida use roughly as many symbols as western alphabets per word/phrase but each symbol takes 3 bytes (assuming UTF-8) rather than one.
For instance "Gujarati script" is 15 codepoints and 15 bytes but and "ગુજરાતી લિપિ" ("Gujarati script" in Gujarati) is 12 codepoints and 34 bytes.
Even fairly trivial codephases are at risk, XKCD's "correct horse battery staple" is 28 bytes but translated to Gujarati (via gtrans) it's 60.
[0] https://groups.google.com/forum/#!topic/golang-nuts/xLZnuiVo...
On the other hand, 72 bytes is a lot, especially when you have decent bcrypt settings.
The newer ones led by Discourse, Nodebb and Flarum have completely gone in another direction in reinventing how discussion forums should be and perhaps gone too far. They feel strangely 'rootless' and completely lack the 'community feel' of user forums.
This looks promising for something fast, lightweight and easy to deploy.
I've looked at all three:
* Flarum had nausea-inducing animation, and now it overrides natural scroll behavior. (Please never do that to users.)
* NodeBB had some problems when I was using it. If JS is disabled, even the homepage links don't work. Forums should be server-rendered.
* Discourse could be improved by removing most of the animation and Material Design creep (bad for motion accessibility), but other than that, it's the best at the moment. It would also be nice to have easier, full theme customization. Maybe it's in there somewhere, but I haven't found it yet.
I would like to see forum software that has the feel of classic forum software (like Flux), not in PHP, that is server-rendered, with a very minimal default theme (no animation) and minimal JavaScript, and that has many of the modern features of Discourse.
I started the project years ago and in the last few have gotten really great support from glebm and some others to get it to the point where it's a really lovely, stable, and fast piece of work.
We consider it the best Ruby/Rails-based alternative to Discourse out there (as an aside - wewere honored that Ryan Bigg would point people our way when he stopped maintaining Forem[1])
You said:
√ I would like to see forum software that has the feel of classic forum software (like Flux)
√ not in PHP
√ that is server-rendered
√ with a very minimal default theme (no animation)
√ and minimal JavaScript
√ and that has many of the modern features of Discourse.
I think those check out. In any case I suggest you check out the website[2], the repo[3], and the demo[4].[1]: https://github.com/rubysherpas/forem#no-longer-maintained
[2]: https://thredded.org
(Your about page says a lot about the forum software & its features, but nothing about who you are or why you're donig this, e.g. vision & goals.)
What about providing hosting? (for people who don't want to / cannot install themselves.) And what about Gmail & FB login, what are your thoughts about supporting that?
https://www.effectivediscussions.org (I'm developing it)
I have copied ideas from Discourse — so yes it has some of Discourse's features. Plus features from Slack (i.e. chat), HackerNews (best comments rise to the top) and StackOverflow (question-answers) & Disqus (embedded comments).
More things you mentioned: It's not PHP (it's Scala instead, in Docker containers), it is server side rendered (React.js), fairly minimal Javascript: 150 kb JS on page load.
I made a personal commitment not to use Facebook's software (React) whenever there are suitable alternatives available, because I don't want to support that awful company in any way, but hope that your project goes well.
I do wish that it were server-rendered by default. SPAs are not ideal for content websites for several reasons. And one shouldn't need a recent browser version to read and participate in the WWW.
Web 2.0 has nothing to do with a technical revision or change in the Web. It was used by Tim O'Reilly back in 2004 (and became popular) and refers to the rapid change in the way the web is used, more specifically the switch from static web to user generated content.
I'm sorry but your forum is all about UGC, and AJAX has nothing to do with Web 2.0.
If it doesn't work well with w3m something is wrong with the site philosophy or execution.
Point of clarification: "wrong" according to your moral philosophy about web sites, even if it's one I happen to share.
Philosophically wrong is using technology that limits the web from being what the interpreter expected, as in this example (there's still a rational reason in this case to do it the "wrong" way and it's based on personal morality).
Objectively wrong being trying to make a website out of custard.
This. If you want old school, go with 10px Verdana, and pad sparingly. I want information, not negative space dammit! With pine, my email editor in 1995, I could read 40 subject lines on a 640x480 screen. With Gmail (in compact mode) on an MBP retina, I get 36. Progress, indeed. Designers 1, Users 0.
One trick I often use is to have the window take half (or less) of the screen and spoof my browser to be Chrome on Android Kit Kat. I just wish there was a change to have a different browser spoofed per tab, or maybe a "whitelist" of websites that are designed well enough that I won't pretend I'm on a phone.
It relied on BrowserID though so it's no longer working and I was thinking about re-doing it using Go so I'll look at this.
The process of setting up a public sandbox for users to play with seems like it should be easy, but abusive/obscene posts by users make a testing sandbox unusable/NSFW very easily.
Nice and fast though. Good work.
edit: I turned on my brain and found the link was on the homepage the whole time.
https://github.com/arclanguage/anarki/blob/master/lib/news.a...
I do feel however that there can be a compromise, I think we can build our web applications in the 1.0 style and power them up in the 2.0 style, allowing the capability of the client drive the presentation of the application.
For hints on how I'm doing this for Remarkbox (https://www.remarkbox.com) - please read http://russell.ballestrini.net/capability-driven-presentatio...
https://www.kajmagnus.blog/new-embedded-comments (scroll down to the bottom)
it has more "modern" features than Isso, e.g. FB and Gmail login, & some new ideas. Here's an about page with more info: https://www.effectivediscussions.org/blog-comments
(I'm developing it.)
Embedded comments requires JS, but ... the discussion forum part of ED (not embedded) works like Web 2.0, that can fallback to Web 1.0 (I mean, static HTML with no JS). Although this is only partly implemented.
If you decide that you would rather tinker on something else, and just want a hosted comment service to be a solved thing for your personal blog, please reach back out and I'll try to work with you.
However, for any larger web application, this increases the testing effort dramatically, as you need to test all possible sets of capabilities (i.e. all kinds and versions of browsers and other clients). This becomes quickly unbearable burden, unless all functionality is 100% provided and battle-tested by the framework.
[1] https://hashnode.com/post/hashnode-looks-pretty-amazing-its-...
For example are you planning to provide hosting?
Continue developing the open source version and add features like spam protection? Google and FB login?
I'll provide hosting if anyone wants it. That said, ease of deployment was a major consideration right from the start. That's why I chose golang over Django/Rails and decided to offer SQLite as an option to support quick deployment for internal / low traffic sites.
(I've seen Dan's post me too in the past, it inspired me to try to remove lots of JS from some similar stuff I'm building.)
It needs to limit entries to a certain number of characters where you can click a "see all" button to see the rest of the long entry.
The initial CRUD weekend-ware is straight forward. LIMIT/OFFSET for pagination. Throw in some Markdown support. Seems easy enough.
But the devil is in all the individual features that make a forum usable. Like getting notified when someone @mentions or replies to you, marking threads that you've posted in, tracking the high watermark per user per thread so you can create a "go to first unread post", implementing a decent search, making deep pagination fast, a PM system, trying to generalize it.
A serious amount of breadth between weekend #1 and production if your users want the feature set of Xenforo. The main positive I can say is that my forum is cheap to host.
I think the Discourse (forum software) team were a few people, like, 3? and they spent some year(s) developing the initial version of Discourse. So ... yes some weeks/weekend? for the initial version, and ... >= 3 years ? for a "real" version :- P
Is your software anywhere online, e.g. GitHub?
I might have butchered that, but three years has been my experience as well. I chuckled when I read that post because the three year mark was finally when I looked back on my forum, felt somewhat content with it, and went "holy shit, that took a while".
My forum had active users from day one since I was porting vBulletin to my own stack. I actually used Clojure + Datomic for the first iteration and rewrote it to Node + Postgres a year later.
As developers it's easy for us to go "3 years? Psh! What are you doing all that time!" because we like to pretend everything is just a pure technical problem and consistently underestimate the work. I certainly wasn't working on my forum for 3 years full time.
It was a hobby balanced on community building and creating a compelling experience for my users. It took a week to build the initial release where people could actually register and post. From there I'd burst a week of full-time development work into it every 1-3 months.
I'm glad I experienced this journey, though bless my poor users that had to wait on me to implement basic conveniences over the years. I can say with certainty that I will never go "hah, that looks easy!" ever again.
Actually now in the end, I've found some frameworks that I like (love?) and ... without them, I'm afraid everything would instead have beeen a terrible mess. These frameworks help me structure the code and reduce my total amount of code: React.js, and Play Framework, and Nginx + some Lua (instead of doing everything in the app server).
My personal lesson is ... Do use frameworks but not the wrong ones :-) and it can take long to undo a use-the-wrong-stuff decision.
Really? _that_ is complicated?
Serious question, do you find it complicated because you're still a beginner, or is there something I'm missing?
What language(s) did you use?
Also, do you really want to send an email for a @mention immediately? What if the user who writes the post, keeps editing it, after having saved it? Should you wait for a minute or two, until s/he seems to be done editing it? And then generate the @mention email? Or directly, even if then an early out-of-date version of the post will be included in the email.
What if the @mentioned user is in do-not-disturb mode, then you need to schedule the notification for later.
And what if the @mentioned user is already online and sees the post with the @mention in, diriectly? Then maybe you needn't generate any notification at all. But how do you determine what s/he is reading currently?
There's a lot to think about (more than what I mentioned above) that one might not think about, ... before one starts implementing everything. — And this is just for @mentions. ... Kind of goes on like this, with every small seemingly simple feature you want to add.
I hate most modern forum software with a passion.
Can someone @mention (and thus notify) everyone on the forum in one post? Of course not, just take the first 6 unique mentions.
But what if they edit their post and @mention 6 different people? Easy, edits don't trigger notifications. Well, what if someone forgot to mention someone or typo'd someone's name and they just want to make that edit. Seems pretty lame that they can't fix their mentions.
So if you want to allow the latter but not the former, you need to start tracking historical mentions per post in the database. Which you needed anyway so that someone can't @mention, delete the @mention, and then @mention again to trigger dupe notifications.
And what does the notification actually look like if someone edits a one-week-old post to add a @mention? It's kinda confusing for a user to see "Foo mentioned you in post #123", click the link, and see that the post is a week old. They report it as a forum bug. So maybe you now have some logic that sends a notification with "Foo edited post #123 to mention you." Yet another if-statement.
We both could go on and on.
And this is how every feature goes. They are hard problems without a best solution, only trade-offs.
At least if you're building a generalized forum like phpbb, you're solving a problem that will compound across thousands of users deploying your forum software. Meanwhile my forum was completely bespoke for my community and I couldn't shake the feeling that I was wasting my time.
So then it was tempting to wonder if I should work on generalizing my forum so others could use it. Well, now you're even in the bigger hell of generalizing software in a pond with dozens of formidable competitors in a world where you're pretty certain that traditional forums are slowly dying. Good luck with that.
Adding more complexity to the example - what about offering a digest-format where a user opts in to only receiving one email a day.
I mean, how complicated could it be, if the user is in the channel and he doesn't have notifications turned off, then send it, it's just a simple nested if statement, right?
But, it turns out that when you map out all of the decision points, it's quite a bit more complicated.
If you count the situations that lead to "No" you'll realize that all the "No" cases can be easily checked for, and if you're not in a "No" case then you're in a "Yes" case.
Can probably be implemented in a regular function with about 30 lines of code?
Suddenly there are a lot of things (on top of user sessions, which most web languages/environments have plug and play solutions for) hitting your database and effecting your caching strategies.
And each feature always seems trivial on the surface. That you pick on this feature as an easy one makes me chuckle and shake my head slowly as I recall the hubris of my past self.
I once made the mistake of thinking that building a forum would be easy, so I can relate.
I hope this trend starts to pick up more steam and become the sane default that everyone just assumes. Instead of the current mess where everyone assumes that it's "normal" to live in this messy world of countless abstractions and frameworks and micro servers, etc.
Just about anything that's not facebook/twitter/google.
I think you underestimate how much load it can handle.