Montag, 12. März 2012

Node.js

Today I invested some time in having a look at node.js to catch up with what the hype is all about.

While doing this, I found a very helpful document "The Node Beginner Book", which I would like to share:

http://www.nodebeginner.org/

If you already have experience in creating web applications using other languages like Java, PHP, or the like, and ask yourself why someone would like to use JavaScript on the server side, then "The Node Beginner Book" is for you. The article explains the concepts of node.js for "old school programmers" and demonstrates the concepts by developing a node.js web application step by step.

What I really liked about the article is that it also shows how things should NOT be done. node.js works with a single threaded event loop as queue for operations. As long as you put non-blocking operations in the loop, node.js stays responsive and is very fast as it is avoiding the costs of having multiple threads and constantly forcing switching between them to share computation power. If you have lots of IO intense tasks in your web application that usually block your application from making progress (e.g. waiting for data to be sent/received from client/other host/database) then node.js has the potential to speed things really up and serve more concurrent connections faster and with less resources than with thread based systems. BUT you are able to totally ruin this, if you write your code "the old way" using blocking operations that block the whole event loop. If you block the event loop, there will be no thread scheduler coming for your rescue. The article gives a good example for that.

So besides the basics of node.js, the most valuable aspect of the article is that it explains the principles you have to stick to when programming to take advantage of node.js features. If you don't pass the control in your code back to the event loop as soon as possible (and defer things by using callback functions that will be called in an asynchronous manner) then you really risk blocking whole node.js, and by this turning the possible advantage of using node.js into a disadvantage.

I really liked the article, as it really points out the concepts and explains how these concepts can be implemented using JavaScript and node.js framework. As this needs a bit of a mind shift for “old school programmers” the article is especially valuable to serve as a quick start for this audience.

Happy coding! :-)

Sonntag, 4. März 2012

Porsche Commercials

Hi everybody,

I really like Porsche commercials (for whatever reason). And as spring is approaching, I’ll just post some links to my favorite videos on youtube:


http://www.youtube.com/watch?v=Xm_Z_kzose0
Porsche Boxster - Inner Fire (US)


http://www.youtube.com/watch?v=qFrIK3ybbjg
Porsche Cayman - Sturm und Drang (DE)


http://www.youtube.com/watch?v=QV2h2WXc3LY
Porsche 911 – Klassentreffen (DE)


http://www.youtube.com/watch?v=KRbzJ0L1Zn8
Porsche 911 – You know it (US)


http://www.youtube.com/watch?v=LrzCdi0W4ZA
Porsche 911 - 40 years – don’t forget it (US)


http://www.youtube.com/watch?v=4exPauh5X_w
Porsche 911 Turbo – Irrational car (US)


http://www.youtube.com/watch?v=8fUoHUoFME4
Porsche 911 Turbo – The difference (US)


http://www.youtube.com/watch?v=rVVRMAON73w
Porsche GT2 RS - Test (UK)

Happy driving! :-)