Skip to main content

Home/ Coders/ Group items tagged scripting JavaScript

Rss Feed Group items tagged

Fabien Cadet

node.js - 5 views

    « Node's goal is to provide an easy way to build scalable network programs. In the "hello world" web server example above, many client connections can be handled concurrently. Node tells the operating system (through epoll, kqueue, /dev/poll, or select) that it should be notified when a new connection is made, and then it goes to sleep. If someone new connects, then it executes the callback. Each connection is only a small heap allocation. »
Matteo Spreafico

Classical Inheritance in JavaScript - 0 views

  • function ZParenizor2(value) { var that = new Parenizor(value); that.toString = function () { if (this.getValue()) { return this.uber('toString'); } return "-0-" }; return that; }
    • Matteo Spreafico
      This constructors lies, wondeful!
  • Again, we augment Function. We make an instance of the parent class and use it as the new prototype. We also correct the constructor field, and we add the uber method to the prototype as well.
  • This adds a public method to the Function.prototype, so all functions get it by Class Augmentation. It takes a name and a function, and adds them to a function's prototype object.
  • ...3 more annotations...
  • To make the examples above work, I wrote four sugar methods. First, the method method, which adds an instance method to a class. Function.prototype.method = function (name, func) { this.prototype[name] = func; return this; };
  • JavaScript can be used like a classical language, but it also has a level of expressiveness which is quite unique. We have looked at Classical Inheritance, Swiss Inheritance, Parasitic Inheritance, Class Augmentation, and Object Augmentation. This large set of code reuse patterns comes from a language which is considered smaller and simpler than Java.
  • I have been writing JavaScript for 8 years now, and I have never once found need to use an uber function. The super idea is fairly important in the classical pattern, but it appears to be unnecessary in the prototypal and functional patterns. I now see my early attempts to support the classical model in JavaScript as a mistake.
Matteo Spreafico

JavaScript: The World's Most Misunderstood Programming Language - 0 views

  • JavaScript, aka Mocha, aka LiveScript, aka JScript, aka ECMAScript, is one of the world's most popular programming languages
  • It was originally called LiveScript, but that name wasn't confusing enough.
  • You get lambdas without having to balance all those parens.
Zulkarnain K.

jQuery and JavaScript Coding: Examples and Best Practices - 0 views

    When used correctly, jQuery can help you make your website more interactive, interesting and exciting. This article will share some best practices and examples for using the popular Javascript framework to create unobtrusive, accessible DOM scripting effects. The article will explore what constitutes best practices with regard to Javascript and, furthermore, why jQuery is a good choice of a framework to implement best practices.
1 - 10 of 10
Showing 20 items per page