Posts

Showing posts from October, 2010

LIVE ACTION

Tune your web browsers to www.newtownradio.com tonight at 10pm and hear us do a live set and talk some shit until Midnight.

MONDAY

Image

JavaScript Coercion Demystified

This post is another complementary one for my front-trends slides, about performances and security behind sth == null rather than classic sth === null || sth === undefined . I have already discussed about this in my JSLint: The Bad Part post but I have never gone deeper into this argument. Falsy Values In JavaScript, and not only JavaScript, we have so called falsy values. These are respectively: 0, null, undefined, false, "", NaN . Please note the empty string is empty, 'cause differently from php as example, "0" will be considered truish, and this is why we need to explicitly enforce a number cast, specially if we are dealing with input text value. In many other languages we may consider falsy values even objects such arrays or lists: <?php if (array()) echo 'never' ; ?> #python if []: print 'never' Above example will not work in JavaScript, since Array is still an instanceof Object. Another language that has falsy values is the ...

The Layer ... Of The Layer ... Of The Layer ...

When I read tweets like this one I cannot avoid a quick comment but the reason I am posting, is simply to explain that every time we write a web page/application, we are dealing with at least 4 different layers. Moreover, this post is complementary for few slides I have introduced at front-trends, specially regarding the " avoid classic OOP emulation when not necessary " point. Layer #1: JavaScript Libraries We all know the DOM is a mess, and this is most likely the reason we chose a JS library rather than deal directly with possible problems we can have when we develop an x?HTML page. Even if many developers don't care, I keep saying that every millisecond gained in this first layer, the page itself, is important. Moreover, if we have a good understanding of the JavaScript programming language, we can easily realize that all these " Java Pretending Style Frameworks " emulating classic inheritance and OOP are not easier to maintain neither faster for what we...

Front Trends 2010 - My Talk

My talk is finished, there were probably too stuff to talk about and it was hard to make a clear point, but I am willing to better explain myself posting here about main points. Slides without me trying to show stuff online do not probably make much sense but these are here: ft2010 WebReflection Slides The benchmark I have showed that should run in any browser ( at least those A grade ) is here . During this talk I have tried to explain what each test means. You can grab the benchMark function from the source, it's simple but it ruffling did the job. The showed "problematic parent " example is here . Tests for my essential Class are here . Talk Summary I have tried to explain that sometimes we should take care of performances techniques, accordingly with the goal and the target. I have showed how things could go slow in whatever Netbook, regardless hardware acceleration. What I have not been probably able to explain , is that it's up to our common sense decide whe...

Pre Authorization Meta Tag Proposal

Under the HTML5 flag, browsers are bringing to our desktops or devices exciting features such GeoLocation , File , and many others such camera, microphone, system access, etc ... The Problem While this is good from possibilities point of view, the activation approach historically sucks. Flash and it's video or microphone activation shows a dialog that asks the user to authorize media access while browsers are lazily asking via JavaScript the same. The real life scenario we all know is definitively different when a page is using a screen reader, and this article and video about twitter UX should be enough to open our eyes: something is wrong . Solutions If we ever used an Android device, or we have download applications from whatever mobile store, we should be familiar with the installation warnings and confirmations we suppose to read and accept in order to grant application access to anything it needs to work properly. This simply means that once we accept we won't be both...

Technical Reviews: Bestsellers!

Image
Just a quick one about two technical reviews out of two I have recently done for @stoyanstefanov and @cjno for these completely different books: JavaScript Patterns and Test-Driven JavaScript Development . Right now these are both Top 10 Bestsellers and trust me: other JavaScript Jedis have been involved, you won't regret these lectures! ;-)

JavaScriptCore via Terminal

Just a quick one, maybe only for a new Mac comer as I am, I found truly annoying I have already Python , Ruby , and even PHP everywhere available in my command line but not JavaScript ? What The Fuck Even Windows runs .js files natively and since ages, I wonder why on earth after I have downlaoded the whole XCode SDK " my JavaScript " was not there available for all my needs. OK, OK, node.js is already on /bin , linked and working properly, but now I have the system default JavaScript Engine that comes automatically with WebKit or the " IE for Mac " aka Safari. How to link jsc to bin folder A title that produces zero outcome on Google, could be hopefully better addressed via this blog, and this is how I have solved: sudo ln -F /System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Resources/jsc /usr/bin The Current folde ris the link to the latest one, all those threads about the ..../A/... folder are not automatically updated if A becomes B , a...

Apple UX Fails with Mac Mini

Image
Update Following Daniel suggestion (first comment), I have grabbed a cabled keyboard and a cabled mouse from a colleague and I have been able to finish the initial procedure. Happy to be a Mac Mini user now, it works like a charm! as tweeted already , apparently there's no way I can buy a dishwasher. Last time I almost came back home with a pretty cool Samsung Blue Ray Player ... but I bought nothing, this time I did a mistake: I bought a Mac Mini . The time my new Mac Mini has been switched on is no longer than 10 minutes, and right now I am still unable to use it ... and I would like to tell you the story ... Nothing On The Package It's clean and small, no requirements or dependencies specified anywhere. Being the package obviously close, I have not been able to RTFM . The only thing I took care of was the absence of the HDMI cable ... not a big deal, I have bought one and this, at least, works like a charm! Pretty Cool And Useless Gadgets Wireless keyboard and wireless tra...

wru against wru: version 1 ready

Image
This shot has been token on 13th September 1923, when W.H. Murphy demonstrated the efficiency of his bulletproof vest, the one that sold later to NY Police Department. Above image has been historically used for different topics and the current one is " how much we trust what we sell ". Do You Trust Your UT Framework? I wasn't kidding that much when I wrote about " test the testing framework " in my precedent wru post . The overall Unit Test Frameworks code coverage is poor , specially those with all the magic behind the scene, magic that does not come for free. Use The Framework Itself To Test The Framework This is a common technique that may result in a reliability deadlock . If we trust our UT Framework and we use it to test itself, the moment we have a problem with the framework we'll never know ... or even worst, it will be too late. Don't Trust "Magic" Too Much If the framework is simple and it does not pollute each test with any sort of ...