Tutorials

This is a learning weekend and I have tutorials on CSS, CSS3, jQuery and AJAX lined up.

I like these W3CSchools tutorials as they fit my learning method perfectly – short and simple with plenty of try-it-out code samples. That allows me to quickly get a gist of the language and get started working with it. Then I can learn all the powerful and advanced features as and when I need them. This reminds me, how different my current learning methodology is from when I was a full-time tech student. Back then, I use to run through a full book, or many books, on a programming language before attempting to write any serious code with it. Guess I had the liberty of almost unlimited time and no pressure to deliver back then. Then everything was a deep dive. Now, they are all dip sticks.

Anyway, just finished the CSS tutorial. 1 gone, 3 to go.

POST using xmlhttprequest

Struggled with this all of yesterday and earlier today. Finally, discovered what seems to be a bug in the implementation (or something that specs missed):

When passing arguments / parameters with a POST request, the javascript: xmlHttpRequest function seems to truncate/modify the first and last arguments.

So, now I’m sandwiching the actual arguments between empty buffer parameters and its working.

Can’t believe how many hours I’ve wasted on this one issue, and that no one addresses it anywhere on the web.

Anyway, the whole app is now working via ajax, and, as a result, is lightening fast. Now, need to include offline storage of files (manifest) and data (localStorage). Before that, wondering if I should do a split version and test passing the whole formatted html div instead of just JSON objects in response to xhr requests.

Another code restructuring /

Yesterday I restructured (I think they call it refactoring) all the code to integrate it into a single html template and a single python class. Also moved all calls to POST so nothing is visible, and editable, from the URL.

Today, I realise I may have to restructure (refactor) the application again. Yesterday’s restructuring was to bring in simplicity and order. This time it is required for the ‘offline webapp’ bit. This is what happens when you use the learn as you go (cross the bridge when we get to it) approach.

Looks like I’ve got another few long hours of boring, error-prone, code restructuring ahead of me :/