Week in Geek – a roundup of science, technology and pop culture news with commentary each Friday
Learn to code
A couple of weeks ago in the course of writing up the goings-on at the monthly LeanDog meetup, i mentioned my growing fascination with the world of code and how a quick Internet search turned up Codecademy, a free online resource that teaches how to code interactively. A few days ago i registered with the site and started down the path of learning this skill for myself through the tools available there. After just a few days of following the recommended lessons, i can report that the journey is uber satisfying and a continual eye-opener to layer upon layer (or stack upon stack?) of clearly presented material and knowledge.
After setting up a profile, the site presents a handful of options on where to start. The one that caught my eye was “build a professional website” because i would like to do just that, simply put.
My approach to the material was as a blank slate – i know nothing of code, the terms involved or the procedure – and to that end i tackled it like i would have a college course or anything else i want to learn about. i took notes.
Starter lessons in HTML
As i dove right in to the beginner lessons, i didn’t take any time to explore the site and see what else it had to offer until a few days later. The site itself doesn’t really prompt you to, either. It wasn’t until i’d completed a few short courses that i began to poke around a bit and discover what else Codecademy had to offer, which i’ll get to in a bit. Within just a few minutes of registering i was already plunged into the world of code, the blinking cursor awaiting my input.
The first lessons are straightforward “big picture” stuff: the difference between hypertext markup language (HTML) and cascading style sheets (CSS) with examples of their implementation. Those are both terms i’ve at least seen before, if not understood, so i felt a tad more comfortable. For those who don’t know what they exactly mean, HTML establishes a structure and CSS controls the design and layout inside the structure. HTML is like a house being built – all the elements used to create a skeleton from the blueprints, and CSS describes what all those elements will look like when the project is done – what size beams and nails to use, how wide the door frame should be, what color paint goes on the walls in the master bedroom and so on.
Throughout the course of the initial lesson, you are introduced to a healthy amount of terminology and are given opportunities to implement them in practical ways, seeing the results appear on-screen in real-time as you input various lines of code. The UI is clean and easy to follow, and there are tooltips for hints and a glossary as well for those (like me) who tend to raise questions ahead of time before the lessons reach those points.
Before i knew it, i’d been guided through an introduction to some of the more common building blocks of HTML like heading elements < h1 >…, paragraphs < p >…< / p >, links and href attributes < a href=”url” >…< /a >, images and sources < img src=”url” >, bulleted lists < ul > < li >…< / li > < / ul > and div and class elements < div >…< / div > and div and class elements. [editor’s note: better put extra spaces in when you type this stuff or it’s gets interpreted on-screen as real code!]
Throughout my time working through the lessons though, i am reminded of what Reports for Trello‘s creator Brendan Malloy told me a couple of weeks ago as regards learning to code:
“You may feel like you’re just wandering, seeing things and maybe getting lost, but you’re always moving forward and getting somewhere,” he told me, explaining the code doesn’t have to be as intimidating as it might seem. “If you know English, you’re already halfway there. It’s just logical construction.”
That much i can see is true. Like any language, that of code has a syntax to follow and, as a grammar nerd, i understand how specific it can be. Needs to be, in fact – a misplaced character is not going to translate into a desired output at all. This became more clear to me in later lessons, where opportunities to freely enter code were stymying me before i flipped back through my notes and realized i was neglecting to add a semicolon at the ends of lines. Folks who know me well might find that humourous, as during the course of my job as a copy editor i often castigate their overuse with the caveat that using them requires at least a modicum of cojones.
One other thing i’d like to note, as i go through my notes from the various lessons, is that early on you are taught the term “doctype” which tells a browser what HTML version the code represents to ensure consistent display on different browsers. Although i am not that far into the courses, there has been just this one mention of the concept near the beginning of the lessons and it has not been seen since. i looked it up on my own and i think it is essentially an unclosed tag to simply explain that what follows is HTML, but i’m not 100% sure on that. If so, i wonder what other doctypes there might be.
Do it with style
After earning badges for my first lesson and building a basic HTML website, the next courses deal with CSS – the fun stuff which allows you to customize the look of the site you’re building. This course seemed a bit more straightforward to me, perhaps because the properties that are affected by CSS are more intuitively understood. Things like “color,” “font-size” and “font-family” lend themselves to easier comprehension by virtue of being called exactly what you would think they are.
Within those properties, there’s a healthy amount of wiggle room though, and i now have several other bookmarks to use as references for things like hexadecimal numbers that provide color palettes represented by six-digit codes like #9933CC and #585858. You can also use a standard RGB sequence if you prefer, with each of red, green and blue requiring a corresponding number from 0-255 (e.g. “rgb(102,153,0)”). The simplest way to change the color though is to just straight-up type in the name of the color you want to display, like red or orange. Using this method limits your choices to 140, compared to RGB and hex colors which offer an astounding 16,777,216 options!
When it comes to fonts, as i understand it there’s a smattering of “default” choices like Times New Roman, Arial and Lucida Console, with some variations among those. However, there are other sources for fonts like Google Fonts which is a free collection of 600 more to choose from. A visit there showed that each of them could be downloaded, and from there i’m not sure how they are implemented but my guess is that when you get around to uploading your finished code somewhere, the source it is drawing from (presumably, your computer) would need to have those referenced fonts on it somewhere in order to display properly.
In addition to those basic properties, there are secondary visual cues that affect text. Working through these lessons wasn’t too difficult, and by the time they were complete i had a pretty good understanding of “background-color,” “background-image,” “border,” “padding” and “margin.” When it comes to the background-image though, the example given used a URL as the image source and i am unsure how that works. Perhaps you need to upload any images you would like to display on a site like Photobucket in order to use them; that’s what i had to do in order to include The News-Herald logo on this site. In a similar manner, the choices of border types isn’t explicit through Codecademy either – at least not yet. Fortunately, the Internet is resplendent with sources of information and i very easily found several other sites as resources for this sort of information.
More than just lesson after lesson
Okay, so i’ve worked through some courses and started building a healthy knowledge base. But what else is there to find at Codecademy?
On my profile page, it shows that i have zero skills completed, but i am 53% of the way towards making a website which i imagine would give me one skill. So far, i’ve earned five badges which are kind of like video game achievements that mark milestones in your journey, and accumulated 24 points. What points do for you, what they represent and how much or little that is remains a mystery for now.
Until this morning, the “Codebits” area of my profile was blank and i had no idea what it meant. Naturally, i clicked on it to see what it was and it took me to a workspace where i could freely enter whatever code i wanted, with a window alongside to show the result. Neat-o!
Since one of my goals in learning to code is eventually creating my own website for The Long Shot, i took a crack at creating a header for the future new home of this blog. The result was far from fancy, but it did give me a sense of accomplishment that i was able to do something.
Behind the scenes, the code that tells the browser what to display looks like this:
If you’ll notice, in the top HTML image, the second line has a portion that reads “href=’style.css’/>” What that means is that since HTML and CSS are distinct documents, you have to tell the HTML part where to draw the CSS part from. In the case of Codecademy’s Codebits, both the documents are provided for you in the application. On your own, i may be mistaken but i believe you can call your document whatever you wish. For example, i could name the CSS portion “whatever.css” and as long as i reference it exactly, it ought to work.
One other thing i’d like to draw attention to is the syntax of these lines of code. As you can see, it’s written in English which, as Brendan was quoted above, puts you halfway there already. That is important to remember, as there isn’t much in the way of unrecognizable language involved (at least, not yet!). While things like hex numbers and the use of semicolons and curved brackets – and their vitally important placement – are a bit outside the norm of everyday typing, they’re not wholly unfamiliar and once you get the hang of it, not terribly difficult. Granted, this was just for the creation of a few simple text characters and some color. When it comes to something like a full-blown app or, say, a video game, there’s probably hundreds of thousands of lines of code that would make your head spin.
On a side note, speaking of video games, this did give me a greater understanding of the challenges game developers face. When i read things on game forums from players who complain about something, once in a while they’ll say “how hard can it be to just add” this-or-that. Well, it can probably get very hard. Many readers already know how immersed i am in Dungeons & Dragons Online, a game that’s been around since 2006 and seen many changes both in the product itself as well as the development team. In light of that, there’s likely lines of code that control things which are so old and perhaps simply hard to find that the team behind the game would have a hell of a time just figuring out where the thing to change even is! So, as i learn more about code, i grow to have a greater sympathy for these sorts of folks. Despite that, they and their peers put out a consumer product that people understandably want to work well, and who get frustrated when it doesn’t. But i’m willing to bet the coders working on these things are just as dedicated in their desire to present the best, most polished product they can.
In addition to just giving you a workspace to create codebits, once you’ve done so you can share them with others in the Codecademy environment. Other users can “fork” your codebit, which is a bit like repinning something on Pinterest. Once a codebit is forked, that user can modify what you’ve created on their own (without altering your own version). In this way, the Codecademy community can learn from each other – a very cool feature that lends Codecademy to its own sort of social media network that fosters sharing and collaboration. That is something very important in the coding community in general that i’ve observed, a willingness to help each other out.
The last thing i want to mention about Codecademy (for now), is the plethora of other branches it offers. A little more looking around the site revealed that there is a host of learning opportunities.
For one thing, in addition to the basic HTML and CSS courses, there are courses to learn and improve other languages like Java Script, Python and Ruby to name a few. That last one caught my attention primarily because of my experiences at LeanDog, where the people i’ve spoken with seem to use that quite a bit. Who knows, maybe one of these months during their meetups, i’ll actually be able to keep up with the discussions.
One of the most intriguing areas of the site is a place to learn to use popular APIs to make applications. APIs, or application program interfaces, are the tools used to build software applications which is an enormous industry that continues to grow. Picking up skills in this area, along with learning languages and coding in general, is a huge way to boost your own marketability for jobs in the ever-increasingly technological world we inhabit.
Finally, the last thing i engaged in was in the Goals section, which has quick, 30-minute exercises that allow you to do some pretty cool stuff. The first one on the list, and the one i worked through, was an exercise called Animate your Name. Unfortunately, i’m not skilled enough yet to figure out how to embed the results here, but i think you ought to be able to click on this link and check it out.
So that’s where i’m at so far in my quest to learn how to code. If i’m honest, it’s pretty addicting (at least to me) and i plan to stick with the courses and see how much i can learn, and hopefully build a new home for The Long Shot that looks pretty slick.
If you have any interest in learning more about code, i strongly recommend you check out Codecademy. Not only is it fun and satisfying to learn something new that has such far-reaching practical use, as i mentioned it’s a very marketable skill to acquire. Likewise, if you have kids, it couldn’t hurt to start them down the road either. Children pick things up very quickly, and learning these skills at a young age i believe will have a positive impact on their lives as our technology continues to grow and evolve.
The Hobbit: The Battle of the Five Armies
i’m proud to say that The Lord of the Rings, specifically The Fellowship of the Ring, is my favorite film. This is based on the quantifiable science of watching the extended versions of them more than any other movie (except maybe Mystery of Chess Boxing). And every time i view them, i’m simply blown away. Just a few weeks ago i watched the whole saga through again and, as always, it did not disappoint.
It also made me realize what had been nagging me about The Hobbit films, and i felt compelled to text a friend to let him know i “figured out what is wrong with The Hobbit: it’s cuz every other adventure story sucks compared to LOTR.”
Nevertheless, as a dutiful fan of Tolkien’s epic fantasy writing, i went to see The Hobbit: The Battle of the Five Armies on opening day. Sure, as i just revealed, in my eyes LOTR is the pinnacle of fantasy adventure, but that doesn’t mean i’m not going to get whisked away to Middle-earth whenever i can. Back when it was announced that The Hobbit would be extended to three films instead of two, i was confounded by naysayers because i felt that any time spent in that world was a good time.
i was wrong.
Without getting too in-depth and with a mind towards avoiding spoilers (and also towards reader compassion – this post is getting long!) here’s a summary of how i felt after seeing the final story of Peter Jackson’s grand telling of Tolkien’s beloved works.
Several times while watching this film, i thought that the editing was choppy. Scenes frequently switched between various characters in a disjointed way that was jarring and felt often unnecessary. For a short novel that was spread thin over three films (like butter scraped over too much bread?), this last movie felt like it was rushing along and cramming in too many threads. Perhaps, being the shortest run time of any of the films, dare i say it should have been a bit longer. Since they’d already turned a pair of movies into a trilogy, why not go the full nine?
i didn’t like this sequence. It was made up for the film, and implemented poorly. My favorite film critic said in one of his many film reviews that book-to-movie adaptations primarily need to capture the theme of their source rather than meticulously translate every detail, and in that i totally agree with him. Here, i think the screenwriters were basically challenged to create material on par with Tolkien, and it doesn’t measure up.
Plus, given the context of the LOTR films, it didn’t make sense to me that the characters involved would be so ignorant of Sauron’s presence in Middle-earth after including this sequence in The Hobbit.
Like Viggo Mortensen, i believe The Hobbit films rely way too heavily on CGI instead of going with makeup and prosthetics. LOTR made WETA a household name due to their incredible work on those movies, which gave them an extremely realistic quality. Actors were matched face-to-face with the orcs they fought, which looked legitimately frightening and realistically gritty and grimy. In The Hobbit movies, there’s a distinct departure from that immersion, which made the battles seem a lot less dangerous. More than once throughout watching The Hobbit, i was thinking how much it reminded me of the Star Wars prequel films, in a few ways including this one. Practical effects simply give a movie a more realistic quality that was sorely missed here.
Peter Jackson, like George Lucas, is cited as saying how much he likes the CGI and how when LOTR was made, the technology just wasn’t there to achieve this kind of vision. In response, i would counter that i’m sure practical effects and makeup have advanced in the last 13 years as well. Why not utilize the no doubt huge advances in that field, which was a proven megahit?
The Five Armies
In the book, the five armies which converge at the Lonely Mountain are dwarves, elves, humans, goblins and wargs. In the film version, it’s dwarves, elves, humans, orcs and…what? WHAT IS THE FIFTH ARMY? Bats? Trolls? It’s never clear and in fact i don’t think there is a fifth army. Maybe it’s Dain’s faction from the Iron Hills and Thorin’s company? By the time the latter joins the fray, i was wondering how much impact they could have. There’s a huge battle between thousands of combatants – are a dozen warriors really going to turn the tide? For that matter, why did they remove all their heavy-duty dwarven war gear when they decided to pitch in? Maybe it was symbolic of Thorin’s rejection of the greed that was consuming him, but for my money, if i were wading into battle against overwhelming odds, i think i’d stick with the dwarf-forged plate armor instead of a tunic and a chainmail shirt.
Speaking of armies, there’s two scenes not far apart in which a character says some particular faction is bred for a singular purpose: war. Isn’t that line also in LOTR? The first time it was uttered in The Hobbit i thought, geez, can you be any more heavy-handed with the LOTR parallels? The second time, it just sounded cheesy.
The two that stand out in my mind as failures are Kili, and the Lord of Lake-town.
In Kili’s case, i was hugely disappointed in The Desolation of Smaug when Thorin decreed he be left behind due to his injuries. What?! That irked me. The band of dwarves was steadfast and remained together for the entire quest, all of them having forsaken all else to commit to the adventure. Yes, Thorin goes a little wonky with greed and whatnot, but that really got under my skin.
When it comes to the Lord of Lake-town, i suppose my only gripe is that casting Stephen Fry was a real waste of talent. The character is hardly in either film very much and is written rather silly. Why cast a great actor like Fry and only give him a few scenes, with practically none in the Five Armies?
Emotional resonance: this movie had none of it for me. In LOTR, i truly cared about all of the characters. We watched them face incredible dangers physically, mentally, emotionally and spiritually, and by the end of Return of the King their heroism is simply inspiring. i’m not ashamed to admit that i get a little misty by the end of that film still.
The Hobbit films are missing that crucial quality to me. If i’m honest, i couldn’t even identify each of the dwarves’ names aside from Kili and Thorin, and that’s only because they’re the only ones who have any sort of subplot going on.
On that note, i suppose some other characters had notable stories taking place, like Legolas and Tauriel…who aren’t even in the book this movie was based on. Speaking of the former, a noticeably older (and thicker-faced) Legolas was given ample time to try and one-up his athletic exploits from LOTR, which came off as corny and spectacle for spectacle’s sake.
The titular character on the other hand, was remarkably likable. Martin Freeman does a wonderful job portraying Bilbo Baggins, with the kind of pathos i wanted to see in all of the principal characters. Too bad he was barely in the film!
* * * * *
Thanks for reading the eighth Week in Geek in addition to visiting The Long Shot. Of course, there were many more exciting things that happened in the world of science, technology and pop culture this week…but these were the ones that most caught my attention. If you have any news you’d like to share, drop me a line and let me know – i try to keep up with stuff but i can’t read everything!
If you would like some further reading, about some science and technology stuff that happened this week, here’s a few links i hope you find as interesting as i did:
- Skype users get real-time language translating tool
- Top 10 physics breakthroughs of 2014
- 11 startups revitalizing Cleveland
- Scientists may have finally detected a dark matter signal
- This 19-year-old college student build an artificial brain that detects breast cancer
- Don’t fear AI, says Google’s Eric Schmidt
- Comets ‘did not bring water to Earth’
- Facebook offers solution to end drunken posts
- Engineers are working for free to make Elon Musk’s Hyperloop a reality
Follow @longshotist on Twitter for frequent shares of related articles and (hopefully) humorous nonsequiters.
Week in Geek will be back next Friday, Dec. 26 and i’d love to see you here!
Remember – if you would like to contribute to The Long Shot, i’d be happy to make that happen!
Week in Geek also be appears alongside other great blogs at The News-Herald Blogs (click the logo at the top right of the page for the main site).
Thanks for reading!