Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- prototype



  The use of Erlang in Facebook chat

Erlang  is a general-purpose concurrent, garbage-collected programming language and runtime system. It stays strong while building concurrency programs. Erlang provides language-level features for creating and managing processes with the aim of simplifying concurrent programming. It has large application in many chat service well known now such as Whatsapp and initial version of Facebook chat. Previously we have written an article Use of Erlang in WhatsApp. In this post, we will talk about...

   Facebook,Erlang     2014-02-25 07:12:36

  Understand JavaScript prototype

For an front end programming language like JavaScript, if we want to understand its OOP feature, we need to understand its objects, prototype chain, execution context, closure and this keyword in deep. If you have a good understanding on these concepts, you should be confident that you can handle this language well. The inheritance in JavaScript is not class inheritance like Java, but it adopts another mechanism-- prototype inheritance. The key to prototype inheritance is the prototype chain mec...

   JavaScript, prototype, __proto__     2013-02-02 02:34:09

  Three ways to define class in JavaScript

In object oriented programming, class is the template of object, it defines the properties and methods of a group of objects. Unfortunately, JavaScript doesn't support class, but we can have some workarounds to simulate class.1. Constructor functionThis is the classical approach, it is also the approach mentioned in many text books. It uses the constructor function to simulate class and it uses the keyword this to represent the object internally.function Cat() {  this.name = "Kelly...

   JavaScript,Class,Method,Private,Inheritance     2012-07-09 11:59:51

  Prototypes and Inheritance in JavaScript

Forget everything you know about object-oriented programming. Instead, I want you to think about race cars. Yes – race cars. Recently I was watching the 24 Hours of Le Mans –a popular racing event in France. The fastest cars in the race are the Le Mans Prototypes. Although these cars are built by car manufacturers like Audi and Peugeot, they are not cars you’ll see on the streets and highways of your home town. They are built exclusively for high-speed endurance ra...

   JavaScript,Prototype,Inheritance     2012-02-27 04:55:22

  trim() in JavaScript

In the past, JavaScript didn't define the trim() function for String object. This makes web programmers frustrated since they often need to implement this function themselves if they want to handle user inputs. The new version of ECMA-262 introduces the trim() function.15.5.4.20   String.prototype.trim ( )     The following steps are taken:     1.   Call CheckObjectCoercible passing the this value as its argument.   2.   Let S...

   JavaScript,trim(),implementation     2012-07-19 10:58:01

  this in JavaScript in detail

this in JavaScript is always confusing, it is one of the most frequently seen traps in JavaScript. this is not a good design in JavaScript(You can refer some other design flaws of JavaScript here), since it's lazy binding feature, it can be a global object, the current object or.... Some people even avoid using this in JavaScript. Actually if you master how this works, then you will know how to stay away from these traps. Let's take a look at what this points to in below situations. 1. In global...

   JavaScript,this,bind     2013-05-09 18:35:12

  C++ and Java over Python in Google products

In Google, most of the products are written in C++ and Java. They usually don't choose Python to write their product stack. What's behind the decision to choose one language over the other in Google? Let's get to read some opinions from Robert Love, a Google software engineer. Love said he couldn't imagine writing let alone maintaining a large software stack in Python. They use C++, Go, and Java for production software systems, with Python employed for scripting, testing, and tooling.There are a...

   Java,Python,Google     2014-07-20 04:39:09

  Prototypes in JavaScript

Following on from his previous article, David Chisnall explores JavaScript as an example of prototype-based object orientation. In this article, he shows how it's possible to implement more complex object models on top of this simple abstraction.My previous article, Prototypes and Object Orientation, considered the differences between class-based and prototype-based object orientation. In this article, we'll look in a bit more detail at the workings of the JavaScript object model, since it'...

   JavaScript,Prototype,Object oriented,Obj     2011-09-02 11:44:12

  Let 's write some front end codes

I've seen a lot of arguments that there is no much technical value writing web portal, I think that the vast majority of good programmers will try many different things. The low level development and machine learning are not the only technologies which are  full of wisdom and challenges, I wrote web site for a few years, it is difficult to say that this is my initial interest, although I touched on other technologies as well, I still feel building website is challenging. Front end developme...

   Front end development, JavaScript,CSS     2013-01-22 04:00:24

  JavaScript tips both novice and veteran developers can benefit from

In this post, we will share some less known but powerful JavaScript tips which can benefit both novice and veteran JavaScript developers. 1. Truncate array with array length We all know that object are passed by reference in JavaScript, but we may be bitten by this rule. Please check below example: var arr1 = arr2 = [1, 2, 3]; //Change arr1 arr1 = []; // arr2 will still be [1,2,3] arr1 and arr2 point to the same array [1,2,3] initially, later when arr1 repoints to [], the reference to arr2 is n...

   JavaScript,Array,push     2013-08-21 04:09:10