Camen Design

c share + remix

Camen Design: Now With Added Forums

  1. History
  2. Goals
  3. Code

Where I have said before that I do not want comment threads on my website because they promote thoughtlessness, I am not opposed to good old fashioned discussion. For me, e-mail and letting you write on your own preferred websites serves as the right medium for discussion of my articles, it’s a formal relationship whereby I serve you the content and you pass it about.

Now for something completely different:

Camen Design forums, in a Commodore 64 theme
The new Camen Design forums, click image to enter

History

When I started out on the Internet in 1996 it was undergoing a generation shift; usenet, the mainstay of message board systems was eventually brushed aside by the browser wars and the momentum of what became the dot-com bubble. With so many people getting online, and their first experience of the Internet being through content portals such as Compuserve and AOL, a new generation of (much hated) users were exposed to an Internet composed of just the web, rather than the more complicated usenet and IRC (with BBSes before that).

This gave rise to the ‘Forum’, a completely over-engineered hack-job of spaghetti code re-implementing a fraction of the capability of usenet in browsers that were never designed for the task. It worked, though, and it lowered the bar for entry so that everybody could participate. One of the early successors was ezBoard, effectively the GeoCities of forums. By 2005, phpBB and other board software had taken over.

Before Facebook, Twitter and all this ‘social’ junk, the forum was king. It was the way things got done on the Internet and I’ve spent more time in forums than just about anywhere else on the web. Having grown up on a diet of ill-fated forum-based projects, I of course wanted my own. In 2003 I embarked in a massively over-engineered project to build my own website, encompassing all my favourite things. A central database and shared functions was to provide forums for each of the differently themed sections of the website, one of which dedicated to the Commodore 64:

Commodore 64 themed web site
Scrolling marquee and background music? Yeah, that would be 2004

The forums for this were particularly nice because nothing like this had been done before due to the complexity of existing forum software.

Commodore 64 themed Internet forum

The irony of this being that this was possible because Internet Explorer had supported font-embedding since version 4. Firefox was released in November 2004 and rapidly gained traction. I rewrote portions of my site to work with Firefox standards, and the Commodore 64 site was dropped because there was no font-embedding support in Firefox—a limitation that would take another five years for them to fix. Regardless, I never completed my website, having written too much code with no clear sense of direction and purpose.

It was the modern, clean HTML5 iteration of Camen Design that completely turned me around. With the experience of failure before, I set myself the goal to write the most minimal website I could finally complete. Since then I’ve always been striving for the most elegant and straight forward solutions to all problems without all the cruft that is common everywhere I look. I now make my own decisions on what is actually necessary rather than following trends. I couldn’t be a more different programmer than I was before!

Goals

Modern forum software has become so bloated these days that it seems to have lost the goal of facilitating actual discussion. So many features are dedicated to massaging everybody’s bloody ego, it’s a joke. Signatures chock full of images, user ranks and badges, user profile pages, “social networking”. I wouldn’t be having any of this crap.

In creating the forums, I set some primary goals in mind that would help keep the design focused and let me put together something that worked in the least amount of time.

No database
Too much extra code to manage. Each discussion thread is a single file on disk. Want to delete a thread? Delete the file. Want to move a thread? Move the file. No code required.
One format, one file per thread

Each discussion thread is itself an actual RSS feed; i.e. the data is stored as RSS. Since there’s no database there’s no e-mail subscription feature, if you want to follow a thread add it to your RSS reader. That means that there’s no duplication on disk, whereby I have to keep a data store (like JSON) and then cache that out to RSS files when it changes. When you add a post to a thread, your post goes directly into the RSS file meaning that the change is seen instantly, no caching is needed (as the RSS file is static) and no code is needed to manage both data and RSS—they are the same thing.

It’s not as simple code-wise as using JSON, for example, but it’s worth it to not have the same content spread across more than one file.

No session, no login, no registration

Has no purpose other than to facilitate all the ego-features. RSS would serve for getting updates, so e-mail isn’t required. Anyone can sign up for a free / fake e-mail, so it doesn’t prevent abuse or spam.

I do respect that people prefer to stick to a particular name / alias / handle, and it wouldn’t be right to allow anybody to post under any name as they could reuse someone else’s name to cause trouble. For that reason, I have implemented a very simple system of name reservation that allows someone to keep their desired name and prevent others from using it.

When you post or reply on the forums, it asks you for a name and password along with your message. Your chosen name and password form a unique key that prevents others from using that name. You do not have to pre-register in order to post like most forums. The very act of posting forms the ‘registration’. Just simply use the same name and password each time you post in order to re-use that name. You never have to log in through a dedicated login page beforehand every time, and there’s no session and no cookies so the forum never has to bother you about logging in to post. Get your web browser to remember your username and password and you won’t have to enter it again at all!

Users are stored as a text file in a folder. The name of the file is the hash of the user’s name, and in the text file is the hash of the password; neither are stored in clear text.

The user folders, containing two text files

This makes user authentication blindingly simple:

$user = "users/".md5 ("C64:$NAME").".txt";
//create the user, if new
if (!file_exists ($user)) file_put_contents ($user, md5 ("C64:$PASS"));
//does password match?
if (file_get_contents ($user) == md5 ("C64:$PASS")) {
	⋮
}

Thus you can post under your desired name, also reserving it from others, without having to register, login or use JavaScript, a session, or cookies.

This is obviously not a system for preventing spam (confusing the problems of name reservation and spam is bad systems design). I have put in a very basic anti-spam feature via a hidden field but if the spam bots come along then I will probably integrate Akismet, but any suggestions are welcome; they just have to work without a database, JavaScript, sessions, or cookies :P

Focus on discussion

As has been alluded to so far, I’ve cut a lot of crap that is standard in forums these days. There won’t ever be signatures or user pages, crowd-spam and the like. People’s “rank” should be known simply from their participation and generosity—their actual deeds, rather than a label. In essence the forums should let humans be humans.

I’m not against personal expression, I just don’t believe that bling is personality. As the code improves, I’m happy to add bbcode and other means to better express text, you can even draw PETSCII art using unicode and a proper interface for this would be good.

The forum is unique (I believe) by keeping the initial post of a thread at the top and paging the replies so that the discussion can hopefully remain on-topic by always displaying the initial post. I will have to see how this works out, but I think it a good addition.

Code

The prototype for all of this was a programming exercise I set myself called “Few Lines As Possible” (FLAP). I decided to set myself the task to complete something in the most basic fashion to see what could be done. Programming, for programming’s sake. You can view the result of that exercise here (it’s 125 lines long).

Of course, it had absolutely zero security (that I believe to be the fault of language design—why shouldn’t this code be secure by default?) but it showed that it was possible to simplify things a great deal by using files on disk as the data store.

I have put the new forums together faster than just about anything I’ve ever made before. I have purposely forced myself to be untidy and unfussy in implementing it in order to get a basic but functional system out to you quickly and then improving from there rather than my usual habit of keeping things tucked away for years before releasing them.

You can download the code here and view the source on github where continual improvements will be baked into the code.

Many thanks has to go to Style64 for the high quality C64 font that made this possible. (The font I used on the 2004 design didn’t include the PETSCII graphics).

I hope to see you in the forums soon!