Dave Young - Incremental Developments: Difference between revisions

From XPUB & Lens-Based wiki
Line 29: Line 29:


==6-10==
==6-10==
[[File:chat-screenshot.png | frame]]
[[File:chat-screenshot.png | frame | Screenshot of chat application]]
I rewrote the code from the start, completely omitting any functions/variables etc that I did not need for my own application, and made a working example that I could run on a local node server. At the moment, users are unnamed authors, with no distinguishing styling features. Text is not added to the chat window in a top-to-bottom manner typical to chat clients, instead it follows left-to-right, as it would in an ordinary text editor.
I rewrote the code from the start, completely omitting any functions/variables etc that I did not need for my own application, and made a working example that I could run on a local node server. At the moment, users are unnamed authors, with no distinguishing styling features. Text is not added to the chat window in a top-to-bottom manner typical to chat clients, instead it follows left-to-right, as it would in an ordinary text editor.


An example of the current state of the experiment can be seen on the right =============>
An example of the current state of the experiment can be seen on the right =============>

Revision as of 13:05, 7 October 2012

About

I have begun development on a simple webchat application built with nodejs, and inspired by the structure of the feedback sessions used in the communes in the early 1970s. I am interested in how they aspired to create a hyper-democratic social system built on the foundations of countercultural politics and cybernetic theory, yet failed spectacularly in this ambition.

3-10

Began looking at php/javascript chat client examples and reading tutorials in order to get a good understanding of the ideas involved with creating a basic chat application. This tutorial was useful.

4-10

Swapped to nodejs. I followed this tutorial, and I read up on the nodejs documentation.

5-10

Began to deconstruct the example from the tutorial I completed on the previous day. I removed certain parts (usernames, colours, text formatting in the chat window) that were not necessary for my intentions. In the original example, all this data is communicated between the server and client using JSON, as follows:

var obj = {
    time: (new Date()).getTime(),
    text: htmlEntities(message.utf8Data),
    author: userName,
    color: userColor
};

history.push(obj);
history = history.slice(-100);

var json = JSON.stringify({ type:'message', data: obj });
for (var i=0; i < clients.length; i++) {
    clients[i].sendUTF(json);
}

I tried to modify the JSON structure, but obviously made an error, as the code broke :(

6-10

Screenshot of chat application

I rewrote the code from the start, completely omitting any functions/variables etc that I did not need for my own application, and made a working example that I could run on a local node server. At the moment, users are unnamed authors, with no distinguishing styling features. Text is not added to the chat window in a top-to-bottom manner typical to chat clients, instead it follows left-to-right, as it would in an ordinary text editor.

An example of the current state of the experiment can be seen on the right =============>