First Flounderings in the Real World

First Flounderings in the Real World

After driving through HTML, CSS, JavaScript, PHP, Responsive Design, and Information Design courses on Coursera, Udacity, and Code Academy, I knew I was ready to get super confused and flounder like a drowning rat in the real world. So yesterday, I came up with the brilliant idea of making a quote randomiser.

I calculated: index.html, CSS, and JS files. Just three files. The HTML file contains just the usual links to the CSS and JS files, and an element for the randomiser. That’s it. The JS file contains what I imagined to be a simple function to pick from an array of quotes. So simple. What could go wrong? Well, remember that time you wanted to have the computer open a program automatically at a specified time and you thought it would take 5 minutes but it took like 4 hours?

Three frustrating hours later, after tweaking a handful of functions I’d taken from elsewhere any which way I could, and on the verge of murdery activities, I discovered why they weren’t working. They were working! The problem was, I’d put the link to the JavaScript code in the head of index.html, just like many examples showed. Of course it’s not supposed to be there. Why would it be? Just as life, destiny, and the universe will it, it should be at the bottom, below </body>, and all the examples before were created by the Elders of the Internet solely to fuck with you.

Finally, I could turn my mind to other problems. Two aggravating hours later, I figured out that some of the code was JQuery, and I couldn’t use them without installing something? I’m not sure at this point, but I googled up strictly JavaScript alternatives and they finally worked.

Then I could work on the CSS, which wasn’t bad, just tedious. Changed sizes and colours and floated things left and right and, vitally, realised that I did not know what the standards for these things were. I was just making things up on the fly. I’m sure there are standards. Right? I have to return to Colleen Van Lent’s lectures and read up on conventions and other things.

In particular, I spent a lot of time trying to figure out how to make the background cycle through all the colours of the colour wheel. Apparently, that’s a tough one. Most tutorials tell you about how to cycle through just a few colours. At least I learn that. It was at this point that I found -webkit- codes. My first brush with it and it’s confusing. I kind of get what it is, but not really.

And then, because someone’s onclick function worked for him but didn’t work for me even though I’m very sure it should, I had to look into addEventListener, at which point I discovered that the fight between Netscape and Microsoft over event handling left us with and inconvenient piece of heritage: confusing events order. Naturally, I had to wonder why they couldn’t get their shit together. Anyway, I read the linked article, and I will likely forget it until it comes back to bite me on the behind.

I also learnt that document.getElementById() is different from document.getElementById().innerHTML. But I don’t know how and I don’t know when to use either, and tutorials and lectures don’t seem to explain the difference between them. I got by on trial and error on this one, and several other things. Not ideal.

Finally, the randomiser worked. And now, I wanted to go on to the next phase. I want users to input quotes. But, I need some sort of CMS. Something like Flask? So each user has his/her own account. The gap betwixt seems the length and breadth of Thanatos’ scythe. But, what with the Law of Diminishing Marginal Returns (that is, I got tired) setting in, I became more and more unwilling to research things properly and experiment. Next weekend then!

If this post is a bit confusing with too many irregular bits thrown in, that’s because it reflects what beginning programming feels like. You think the learning curve is linear, but more often than not, it turns into a bewildering mess in the blink of an eye.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s