instanceof me

Oct 28

Making Wrong Code Look Wrong -

Joel Spolsky on creating coding conventions that help make wrong code obvious to your eyes. Also, the truth about the infamous Hungarian notation.

An interesting comment from the reddit conversation:

Type systems are best, static analysis a close second, but if you don’t have either this beats hope.

Oct 25

Public service announcement: You (probably) don’t need to escape quotes in strings -

This article advocates using proper unicode glyphs for quotes, like “” and ‘’ instead of ASCII straight quotes "" and '', thus removing the need to escape those in code. Some word processors or text formatters (e.g. some implementations of Markdown) automatically translate straight quotes into their proper curved equivalents.

This got me checking, out of the multiple apostrophe characters in Unicode, which was the right one for using in English as possessive (Moe’s bar) or in French for ellipsis (l’heure). Although the most used it the ASCII straight apostrophe U+0027 (or typewriter apostrophe) the recommended one is the punctuation apostrophe U+2019 ’, which also serves as a right/closing single quote.

Note that there are also separate characters for the prime sign (U+2032 ′, e.g. for feet, arcminutes and minutes) and for letter apostrophe when the apostrophe is considered as a letter in some languages.

Oct 17

A classless class—on using more classes in your HTML -

Don’t use .header ul{} if what you really mean is .site-nav{}. […] Your selectors should be as explicit as your reason for wanting to select something.

(Source: twitter.com)

Blame the Implementation, Not the Technique -

Stop me if you’ve heard this one before.

“Responsive design is bad for performance.”

“User agent detection is bad. Don’t segment the web.”

“Hybrid apps don’t work as well as native apps.”

“CSS preprocessors shouldn’t be used because they create bloated CSS.”

If you create for the web you’ve no doubt heard at least a couple of these statements. They’re flung around with alarming frequency.

There is a fundamental problem with this line of thinking: it places the blame on the technique instead of the way the technique was implemented. Generalizing in this way discredits the validity of an approach based on poor execution, and that’s a very harmful way of thinking.

(Source: twitter.com)

Oct 16

[video]

The crazy world of code -

Here’s a great comment by @eranation. I call it the crazy world of code:

I agree, I can’t keep up. I just finished learning backbone.js and now I’m found out on that it’s old news, and I should use ember.js, cross that, it has opinions, I should use Meteor, no, AngularJS, no, Tower.js (on node.js), and for html templates I need handlebars, no mustache, wait, DoT.js is better, hang on, why do I need an HTML parser inside the browser? isn’t that what the browser for? so no HTML templates? ok, DOM snippets, fine, Web Components you say? W3C are in the game too? you mean write REGULAR JavaScript like the Google guys? yuck, oh, I just should write it with CofeeScript and it will look ok, not Coffee? Coco? LiveScript? DART? GWT? ok, let me just go back to Ruby on Rails, oh it doesn’t scale? Grails? Groovy? Roo? too “Springy?” ok, what about node.js? doesn’t scale either?? but I can write client side, server side and mongodb side code in the same language? (but does it have to be JavaScript?) ok, what about PHP, you say it’s not really thread safe? they lie?? ok, let me go back to server coding, it’s still Java right? no? Lisp? oh it’s called Clojure? well, it has a Bridge / protocol buffers / thrift implementation so we can be language agnostic, so we can support our Haskell developers. Or just go with Scala/Lift/Play it’s the BEST framework (Foresquare use it, so it has to be good). of course we won’t do SOAP and will use only JSON RESTful services cause it’s only for banks and Walmart, and god forbid to use a SQL database it will never scale

(Source: tilomitra.com)

The Thing About Those Media Types -

thisisresponsive:

Great thoughts about CSS media types and media queries

Oct 12

JavaScript made everyone crazy -

Nobody seems to be happy, nobody seems to understand it … everyone is trying to change it, pretending to make it better … and again, nobody seems to realize it has been here since ever, it has been working in any field, it does everything, and it keeps getting faster!

On a related note, see All Right, Gentlemen!.

TypeScript

Sep 14

[video]

Sep 12

[video]