Archive for the ‘General’ Category

… a pointless headline

Posted in 'General' by James on June 28th, 2009
… a pointless headline

I have no doubt, in some cultures, industries, societies and organisations the individual is assumed guilty until being proven innocent. Regardless of law, a.k.a pen on paper, people as a modern “species” seem to deny their peers the very respect which they themselves strive for. You don’t have to look far; the morning papers will provide suitable confirmation… we’re falling apart, and it’s been happening since the dawn of the Human.

I think very little about topics of this genre because I’m normally left depressed and far from reality; I rather put thinking time into modern distractions like media, the internet and other trivial pursuits. But sometimes, you’re forced into a mental corner and it makes you wonder about things far from life, like life itself and the point in you existing.

I won’t bore you with realisations you’ve probably made before; I’m sure my thoughts have been thought a thousand times before and that almost makes this tiny endeavor entirely pointless. I won’t stop though, because I think this website deserves a bit of character; I rather be more than just a code-monger; I rather be a human in your eyes.

I guess that’s the thing about the internet; it reduces a persons effort and character to nothing more than a few words on a page. It’s a reductive medium; like the TV, or radio, or a written publication. As a reader, viewer or listener you’re never going to be able to fully appreciate the emotions behind the medium. Because of this, everything is constantly belittled!

What you may not realise when using these mediums is how just one sign of gratitude can make an entire endeavor worth the effort… And I’m not talking about me or anything related to me; I’m talking about everything and everyone! Even the most altruistic people on earth would not deny gratitude; in a way, it makes their actions all the more significant. It’s not the words themselves that are important; it’s the fact someone has said them!

Other times, the words mean nothing, because we hear them so often. When you read a paper I bet you rarely really think about what you’re reading; oh, another bomb killing 50 people, another dead celebrity, another abused child dead… These headlines come easy off my tongue because I hear them so often; they’ve lost all meaning. Do you feel pain when you hear that 200 people have died, regardless of cause? Does it mean anything to you, or is it yet another headline describing the unfortunate fate of someone you’ve never met?

Microsoft, you make me sick!

Posted in 'General' by James on June 18th, 2009
Microsoft, you make me sick!

I’m not normally one to protest so distastefully but Microsoft’s last move has really pissed me off. Apparently, their new devil-child, IE8, beats Mozilla Firefox and Google Chrome in areas such as “Reliability”, “Compatibility” and “Developer Tools”; at least, according to this chart (IMG)!

Apparently IE8 considers itself more secure and easier to use than other browsers too!

I can’t even begin to express my absolute opposition to every speck of misinformation on that chart. How dare Microsoft mislead consumers to such a degree - I know they put financial superiority and their monopoly above all other human values but this doesn’t excuse their flagrant disregard of their customers’ intelligence.

Consumerism is only good for one thing in my opinion - creating arrogant, possibly corrupt and more annoyingly, ignorant individuals. The people running Microsoft and the various departments involved must either be unquestionable morons or just so manipulated by the culture of consumerism, personified solely by that retched corporation, that they are beyond help!

In the past I’ve been quite calm and civilian in my dealings with the atrocity known by some only as “IE”, but now I feel a new spark of anger has been born; Microsoft has forever lost my respect and confidence in the prospect of change.

I know, I know! Marketing and advertising, it’s all about lies, spin and manipulation… But, that doesn’t mean it’s right, and yes, there is room in our capitalist cultures for honesty.

I want to have a long and hard chat with the heads of the IE team; I’d love to hear their twisted take on reality - maybe one of them could shed some light on the unacceptable marketing drivel that’s been circling the net, which, by the way, not only includes the chart I mentioned, but check this out! Yes, not only are Microsoft capable of releasing lies in the form of propaganda but they’ve also developed a system that will insult the browser you’ve chosen to use unless, of course, you’re using Internet Explorer, but then why would you?

The marketing team responsible for the latest scam should publicly apologize and then be permanently banned from every touching (or speaking about) anything remotely related to technology again!

It’s fair enough when Microsoft slam their own previous products but attacking Google Chrome and more shockingly, Mozilla Firefox, is way below the belt!

Rant: “Crappy comments”

Posted in 'General' by James on June 4th, 2009
Rant: “Crappy comments”

Okay, this really annoys me sometimes; you read a blog post or article, it was interesting, you scroll to the comments section looking for an interesting discussion regarding the content of the post but all you find is countless grammatical or technical corrections contributed by “helpful” readers!

For me, the comments section of a blog post is where users can contribute thoughts concerning the material covered in the post; not spelling mistakes, or a complaint about the site’s content. Apparently not everyone feels this way, because whenever I go to read the comments there’s always a few egotistical children leaving comments about the damn grammar!

Now, I’ve probably done it a couple of times in the past myself but I’ve stopped - I eventually realised I was only doing it to gratify my own needs; I wasn’t really interested in the grammatical correctness of any post - my ego just required a frequent pampering, apparently in the form of grammatical superiority.

Sometimes it may be appropriate to point out these mistakes; if the mistake will cause obvious grief to other readers who take heed from the post then by all means contribute your correction, but if it’s a tiny, barely-noticeable mistake then please keep it to yourself… or, if you feel your alter-ego “Grammar Nazi” kicking in then, by all means, send the owner of the site an angry email.

I have a secret; I delete non-spam comments sometimes! Yes, it’s true! Do you know why? Because this is my website and as such I feel it my responsibility to police the content of it - if a comment is defamatory or just downright rude then I’ll delete it, or if I feel the comment adds absolutely nothing to the post then I’ll delete it. For example, if your comment contains just one word like “Wow!” or “First!” or “Interesting!” then it’ll probably be deleted; why are you wasting your time writing such drivel?

I rarely have a problem though; this is a tiny blog with a tiny readership; something I’ve come to appreciate greatly!

I do feel sorry for the guys at Smashing Magazine! With over 100,000 subscribers they really do get some crap appearing in their comments!

I’m on Github!

Posted in 'General, JavaScript, My Life' by James on May 16th, 2009
I’m on Github!

Yes, finally I’ve joined the masses on Github and I plan to sporadically share special things on there, starting with the following recent developments:

“literalHTML”

A tiny but powerful modification allowing you to specify HTML/DOM structures inline in your JavaScript code, an example:

var className = 'active';
var myMenu = |
    <ul>
        <li class="{className}">Item 1</li>
        <li>Item 2</li>
        <li>Item 3</li>
    </ul>
|;
 
// myMenu is now a DOM object:
myMenu.nodeName; // "ul"
myMenu.childNodes; // [ <li.active>, <li>, <li> ]
 
// Do something:
jQuery('body').append(myMenu);

View here »

“getDescendants”

Something I required for a project; a function to gather all descendant-elements down until a certain depth is reached:

<div>
    <ul>
        <li>Something <strong>interesting</strong></li>
    </ul>
    <p>Something <span>else</span></p>
</div>

Examples:

var div = document.getElementsByTagName('div')[0];
getDescendants(div, 1); // -> [ <ul>, <p> ]
                        // i.e. children
getDescendants(div, 2); // -> [ <ul>, <p>, <li>, <span> ]
                        // i.e. children + grandchildren
getDescendants(div, 3); // -> [ <ul>, <p>, <li>, <span>, <strong> ]
                        // i.e. children + grandchildren + great-grandchildren

View here »

I’ll hopefully be adding to the repositroy with new exciting discoveries in the near future; visit my profile and “follow me” to stay updated!

Learning jQuery 1.3, the book

Posted in 'General, JavaScript' by James on March 30th, 2009
Learning jQuery 1.3, the book

Not too long ago I acquired a copy of “Learning jQuery 1.3“, a recently released ‘PACKT’ publication written by Karl Swedberg and Jonathan Chaffer. The only books I’ve previously owned relating to web development were not framework/library specific so reading this one was a totally new experience.

The book is mostly aimed at beginners but does cover some more advanced topics so may be of interest to the more savvy web designer or developer. Actually, anyone wanting a solid jQuery reference would benefit from this book!

I’d guess that one of the troubles with writing a book just about a specific topic is that you’re limited to its confines. This book does not start by discussing the DOM API or JavaScript itself, but instead it begins by first explaining the intent of jQuery and then by detailing the jQuery wrapper function and how you can utilise the power of CSS within this magical dollar symbol. jQuery is wonderful but, in my opinion, without a solid foundation in JavaScript you can never be as good as you could be.

The authors did a wonderful job and I don’t think anyone could ask for a better book about jQuery but I cannot help but raise the question of whether or not jQuery is the practical place to start.

I have this image in my head of some hotshot interface designer longing for some hotshot Ajax’y coolness to suit his ego; he wanders into Waterstones and picks up a copy of this jQuery book he’d heard of, he takes it home, and willingly begins on the long journey of learning “jQuery”. If the world were what I wanted, then this guy would soon realise the error of his ways and how he should have learnt JavaScript before venturing into it’s squeeky clean abstractions; but, unfortunately, the world is not like that; the reality is more upsetting - not only will this designer never realise the error of his ways but he’ll live on, writing jQuery everyday, creating bouncy effects and “jQueryfied” web interfaces. Why is that a problem? - Because he will never be able to program in JavaScript he’ll lack the fundamental knowledge that would otherwise ensure him complete cross-browser and timeless sanity!

Dear Apple’s flock…

Posted in 'General' by James on February 17th, 2009
Dear Apple’s flock…

When do you know you’ve gone crazy? - When you’re more impressed by a tool than what you can create with it!

I reckon the great majority of people in this industry would unconditionally subscribe to the conception that an Apple Mac makes you more productive. This little white magical box somehow enhances your ability to produce amazing things, right? Oh and let’s not forget all the other Apple stuff. The iPhone, Ipod, iMac, MacBook, Mac mini - they’re all magical creations tht enhance our existence!

I guess it’s all down to the modern-day infatuation with shiny new technology coupled with manipulative marketeers operating you like a puppet! I mean, seriously, do any of you think that Apple, the corporation, cares a smidge about how productive you are or how innovative your creations are? They don’t! They really don’t give a damn!

Don’t get me wrong, I love new technology - I think it’s great. But I’m not going to consign to this crazed kind of addiction that so many people have. No, I don’t need that new MacBook, I’m perfectly happy with my three year old PC running XP! And speaking of Operating Systems, no! I don’t need Vista, OSX or Windows 7 - I can manage quite happily without all that!

Real web designers use Macs!

Oh I see; all this time I was under the delusion that one’s credibility in this industry was platform agnostic but obviously I’m totally wrong. What was I thinking!? Of course, I see it now, the extent to which a developer is good at his/her job can be solely measured by the software and hardware they use! How could I have ever thought otherwise!?

Grow up! This industry isn’t about my hammer being better than yours; it’s about what I create with my hammer, and what you create with yours! Like the old saying goes "A bad workman blames his tools" - actually, I’d take it further: "A bad workman feels so passionately about his tools that he values them more than his actual work!"

I actually find this quite comical:

There is absolutely no reason in the world you should use anything other than Keynote. Period. I don’t care if you’re on a PC — if you’re serious about speaking, buy a MacBook just for presenting. There is an astounding difference (not an exaggeration) between the tools, canvas placement, typographic control, and overall aesthetics in Keynote compared to PowerPoint. Once you become familiar with Keynote, which isn’t an arduous process, the productivity and just plain enjoyment you’ll experience using it over PowerPoint is completely worth any switching costs.

Obviously Cameron Moll feels that to succeed as a speaker you MUST BUY A MACBOOK!

I’m going to stop now, I feel I may explode!

If you suck at something on a PC you will also suck at it on a Mac!

PS, congratulations Apple, you’ve actually made me want to hold on to my PC out of protest!

JavaScript Abstractions

Posted in 'General, JavaScript' by James on February 8th, 2009
JavaScript Abstractions

jQuery, MooTools, Prototype, YUI and Dojo all have at least one thing in common; they’re all partial abstractions of JavaScript, the “official” client-side programming language. Each of these frameworks enables further abstraction whether it is through “plugins”, “extensions” or “classes”. So where does the abstraction end? Or rather, where should it end?

The point in abstraction is to make something simpler by factoring out details. If we take jQuery for example, it abstracts away cross-browser pains; it essentially covers up the difficulties. This can make for faster development but can sometimes result in an abstraction leak.

The law of Leaky Abstractions, a term coined by Joel Spolsky, states that “All non-trivial abstractions, to some degree, are leaky”. A “leak” occurs when an abstraction breaks and you have to resort to a lower level abstraction to solve the problem. So, if jQuery fails to provide cross-browser sanity in a particular situation then you’re left to battle it via “pure” JavaScript (a lower level abstraction).

This highlights a common controversy: is it necessary to know JavaScript at all? Are you comfortable operating on a wafer-thin high-level abstraction like jQuery, MooTools, Prototype or any other framework? What’s your course of action when your beloved abstraction leaks?

How low can you go?

So, given that all abstractions are, to some extent, leaky, how low should you go? I think this can be answered with another question, how low can you go given the constraints of the platform? With our jQuery example the platform is the browser; this piece of software does not offer anything lower than JavaScript, so surely that’s as far as you should go!

Similarly, with CSS frameworks like BlueprintCSS and 960gs you should go as low as you can, which, in this situation is CSS itself.

Using frameworks is absolutely fine as long as you know the technology on which the abstraction was formed. If you want to use jQuery, learn JavaScript; if you want to use a CSS framework then learn CSS!

This get’s more complicated in the area of software engineering because the platform allows you to go very low. Should all .NET developers know how to write C++, should all C++ programmers have a strong grasp on Assembly? I can go on forever…

It’s a compromise!

If we define “control” as a reasonable level of supervision over a piece of functionality (whether it’s a form validator or an image cropper) then it has a negative correlation with abstraction; in other words, the higher the level of abstraction, the less control you have.

Recently I discussed the benefits of creating a jQuery plugin but I failed to point out the obvious flaw: by creating a plugin or extension for any framework you’re raising the level of abstraction even further covering up the details), thereby decreasing the level of control someone has over it. Fortunately, because it’s JavaScript, we never really lose control; we can change the plugin source at any time. But the end user of your plugin probably won’t know JavaScript to the same extent as you. The level of control they have is dictated by the level of customisation you offer with the plugin; but, the more customisation you offer, the bigger in size the plugin will be. Therefore the entire process is a compromise between control, simplicity, and most importantly, speed!

The higher the level of abstraction the slower it will be. Higher abstractions may speed up development time but the processing time will usually be longer.

document.getElementById(‘elem’) will always be faster than $(‘#elem’)!

Food for thought…

Playing with Ubiquity

Posted in 'Cool Stuff, General, JavaScript' by James on February 7th, 2009
Playing with Ubiquity

I was originally quite sceptical about the usefulness of this "technology" but I’ve come to realize where its true value lies, here’s an overview:

The first thing to note about Ubiquity is that it’s not a new technology; it’s a platform which makes use of current technology. Technically it’s a "Firefox addon" and that’s all it will ever be to the end user, but for us it is a usable platform on which we can develop specialised commands tailored to the user.

The reasons I was initially sceptical about Ubiquity:

  • It’s not new; it takes pre-programmed commands and executes pre-programmed functionality, nothing special
  • I heard about it a while ago (like 3-4 months ago) but didn’t hear of it again until 3 days ago.
  • I could make something similar with a GreaseMonkey script. (I eventually realized I was totally wrong!)

Even after my subsequent realisation I wouldn’t say it’s a very revolutionary piece of software; essentially it’s just as I stated in the first bullet point, a pre-programmed interface with a limited comprehension (limited in that it only understands pre-programmed commands).

What can Ubiquity do?

  • It can do anything!
  • … with certain obvious limitations! ;)

Developing for Ubiquity

This is so easy; in fact, you should go and download Ubiquity right now and try it out!

Here’s a quick tutorial; we’re going to create an MDC (Mozilla Developer Center) search command so we can search on the fly (scroll down to see the end result):

Things that really bug me

Posted in 'General' by James on February 4th, 2009
Things that really bug me

I thought I’d explore a more conventional and structured approach to the traditional rant. So here goes, a few things that bug me (quite a lot) when surfing the web:

Before I begin, please note that these opinions are my own - I hope I don’t upset anyone!

Unconventional navigation

Navigation is probably the most essential aspect of a website, it’s layout and usability is of absolute importance and must not be mistook for "just another element". Conventions are there for a reason; so that people know what the hell to do when landing on your homepage. Don’t try and be clever!

People always try and be too clever by extending they’re company’s tagline or motto into the navigation. Here are some examples of BAD NAVIGATION:

  • PURPOSE | TRUST | PRIDE | RESPONSIBILITY | SCALE | FUN
  • WHAT WE DO | WHAT WE’VE DONE | WHAT WE’RE THINKING | WHO WE ARE
  • SURFACE | SUBSTANCE | SPEAK

While you may be able to decipher the meaning behind each navigation item they are definitely not conventional; Mr and Mrs Average wouldn’t find it very easy! I imagine navigating through websites with naming like that shown above would be easiest for children or people who’ve never touched the internet; it’s these people who have no preconceptions about how the internet works and what the conventions are.

Here’s a "translated" version of the above examples:

  • ABOUT US | PORTFOLIO | NEWS | POLICIES | JOBS | GAMES
  • SERVICES | PORTFOLIO | BLOG | ABOUT US
  • HOMEPAGE | ARTICLES | FORUM

The difference between the two versions is clear; it only takes an impulsive millisecond to understand the latter set while it takes a great deal longer to understand the original set!

This isn’t just conversation; I genuinely get bugged by this kind of thing - people trying to be too clever, especially when there are conventions in place.

Over responsiveness

First rule of engagement: If you’re going to give something a hover state then it should be clickable! A hover state of any type, whether it’s a change in colour or underlined text, insinuates that the element can be clicked. The only time I find this acceptable is with tabular data, it’s useful when an entire row is highlighted because it allows you to see corresponding columns clearly. Most other scenarios bug the hell out of me!

Also, I hate when a website attempts to anticipate what I’m going to do. An example of this would be when buttons trigger events onMouseDown instead of onClick.

Functionless Controls

These are normally a result of a lack of degradability. When something looks like a button and I click it and nothing happens I get annoyed (and I’d imagine most people would too!). So, please make sure JavaScript controls are not visible when JavaScript is not enabled.

Ego Inflation Badges

What’s an ego inflation badge? - Well, here are some examples:

Tacky Ego inflation badges - e.g. Valid XHTML

Feedburner stats will soon be seen in the same light as those hideous web counter LCD displays you used to find in website footers. Yes, they’re popular now but soon everyone will realize just how tacky they are. Yes, they can be integrated quite nicely into the design of a site but that doesn’t mean they’re any less egotistical.

As for the valid XHTML/CSS nonsense, I cannot stand them! Validation means nothing, it is only a means to crush bugs and any browser issues you may be experiencing, beyond that it’s just a totally unnecessary formality. If you have one of those ‘valid…’ badges a the bottom of your site, get rid of it! I used to have one ages ago but I soon came to realize how utterly pointless they are. If you do insist on having one then at least make sure your pages are actually valid! (otherwise it’s like you going to an anti-fur rally wearing a fox scarf!)

Donate!

I hate exiting the supermarket and seeing an old guy with a charity tin muttering words of plead right in my face! But I manage to walk past without punching him in the face because I say to myself, "It’s for charity; a noble cause". But I definitely draw the line when it’s not for charity - i.e. those massive Paypal donate buttons on personal websites. I’m totally okay with it on open-source projects but when it’s on somebody’s personal portfolio or blog I get annoyed. Having a ‘donate’ button (of any type) on your personal website suggests three things:

  • "I’m so crap at my job that I can’t get money by conventional means"
  • "I think I’ve helped you so much through my witty blog posts that you should pay me!"
  • "This new ‘donate’ button will make me look more professional!"

Would Jeff Atwood suddenly start demanding money to continue blogging? No! So you shouldn’t either!

Clickjacking Twitter

Posted in 'General' by James on January 20th, 2009
Clickjacking Twitter

‘Clickjacking’, if you haven’t heard of it, is a method used by malicious individuals to trick users like you into clicking something without you knowing what you’ve clicked. It’s also known as UI-redressing and only works in browsers that support frames/CSS.

The idea is simple: An iframe is positioned above what looks like a clickable button on a website. This iframe is invisible to the user (opacity:0) and so the user unknowingly clicks on the iframe which may contain anything! This can be achieved through CSS alone, no JavaScript is required. A variation of this technique involves the use of JavaScript to move the iframe around the screen inline with the user’s cursor, therefore achieving the same thing but without having to convince the user to click on a button.

Background info

I believe the original concern was related to Flash and how a user could unknowingly enable their webcam and microphone so the attacker would have access. There are some other examples shown here: http://www.grc.com/sn/notes-168.htm.

Adobe resolved this issue in October of last year with a new release of Flash Player. Obviously this only offers protection for that particular exploit - gaining access to webcam/microphone; other more rudimentary techniques still work perfectly today.