Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@user24
Last active July 24, 2018 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save user24/a5c98ff4eb599bb47efb658f22c8e746 to your computer and use it in GitHub Desktop.
Save user24/a5c98ff4eb599bb47efb658f22c8e746 to your computer and use it in GitHub Desktop.

'Why I support humans.txt and you should too.'

<nostalgia> In 2001 I landed my first web development job on the strength of being cheap and enthusiastic. Back then "web developer" wasn't a universal term for what we do so I think my job title was simply "Programmer" (later: "Internet Programmer" and finally progressing to the dizzy heights of "Senior Database Programmer", all of which conjure images of reel-to-reel tapes and brown computers the size of bungalows.).

When I was hired, I already had a basic knowledge of HTML tables and I knew how to use JavaScript for image rollovers. CSS was an experimental feature in some obscure browsers used by geeks, like Mozilla Firebird (yes, bird) and the shareware browser Opera.

<source> One of the best things about learning web development is that you can do it on any desktop computer that has a browser and a text editor.

But the real acceleration to my learning and perhaps more importantly my enthusiasm came from a feature of the browser familiar to many: View->Source.

View source was such a powerful tool that the phrase remains strongly in the web developers lexicon to this day, even though all browsers but Chrome have dropped that phrasing, and in every browser it's hidden away under some special Developer Tools menu item.

Being able to go to yahoo.com, hit view source and understand how they were using CSS sprites by looking at their code was amazing. It excited me to know that I was, in some way, kin to the elite developers that worked there. I learned from them in the most direct way possible - by reading their code.

<today> In 2014 though, that view source menu is becoming less and less useful, if you can even find it. Now don't get me wrong, modern web inspectors are many many times better than the old ways of debugging your projects, and even for trying to "see how they did that" on websites out in the wild - so long as we're talking HTML/CSS.

But for JavaScript, the language that powers the web, the source is often loaded by ajax making it hidden from the source, minified making it hard to read or even actively obfuscated making it impossible to understand.

There are very valid technical reasons for this. The minified version of jQuery is 61% smaller than the full development version. By using an asynchronous script loader we can render the HTML before all the JS has loaded, giving the impression of faster site. These techniques all add up to faster apps, lower bandwidth bills and happier users.

There can also be legitmate business reasons for this. These days the frontend is where a lot of a company's intellectual property lies and it can make a lot of sense to want to hide your hard work from your competitors.

<clarity> I'm not disagreeing with any of that. I certainly don't want to go back to the bad old days of inline scripts copypasted onto 1000 different pages, and if you have secret sauce you want to protect that's understandable (though technically it probably contravenes the license terms of all that GPL software you're building it with[1]).

This isn't just about newbies either - there are so many fantastic resources out there now for fledging web monkeys and there are some great user-friendly places to ask questions too. It's also for us old hands - we're still learning too. Perhaps more so even.

When I see a site that does something cool, my first instinct is to reach for view source, only to be confronted with a wall of comment-stripped minified jibberjabber. Tools like firebug are brilliant for picking apart the HTML and CSS, but when it comes to the real meat, the JavaScript, the best tools and beautifiers in the world can't add the explanatory comments and clear variable names back in.

<tomorrow> What I'd really like to see adopted on a wide scale is attribution and git URLs in the production source code.

Carry on delivering the site as you currently are, with all the performance optimisations you need, I wouldn't want to interfere with that.

There is already a standard, so to avoid xkcd 927 I am supporting that: humanstxt.org.

But I would also advocate a big friendly comment block at the top of each page just to say "Hi" to the curious, with a link to your social network of choice and, most importantly, a place to download the code in its raw beauty. That can be a full git repo of the entire site, or just a place where you can say "Here's a copy of that neat dragging plugin we made, the rest of the code isn't open yet, sorry".

<footnotes>[1] See Richard Stallman's essay on the subject of mixing free JS with nonfree JS, and his similar though differently motivated solution: https://www.gnu.org/philosophy/javascript-trap.html

<acknowledgements>This post would have been much harder to write without:

https://www.duckduckgo.com

https://www.google.com

https://www.archive.org

https://www.twitter.com

https://www.stackoverflow.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment