R
R
redfield2012-07-06 16:25:26
JavaScript
redfield, 2012-07-06 16:25:26

What JavaScript framework do you recommend that makes it easier to write object-oriented code?

It is planned to start using the JavaScript framework to facilitate writing object-oriented code.
So far, MooTools and JS.Class are candidates.
Maybe there is a clear comparison somewhere?
The project is already using jQuery

Answer the question

In order to leave comments, you need to log in

7 answer(s)
F
freeek, 2012-07-06
@freeek

This comment comes to mind .
It's almost useless to advise here. All are comfortable.

K
Karen Kratyan, 2012-07-06
@kratkar

Write better in CoffeeScript.

E
egorinsk, 2012-07-08
@egorinsk

It is not necessary to use an object framework, it is necessary to write as simple and direct code as possible, because when developing client side code, it is important to minimize the amount of code and its execution time, and secondly, the simplicity and clarity of the code, and all the useless libraries that serve the purpose of enhancing feelings of coolness of the developer, rather than practical purposes, should be removed.

P
Pavlo Ponomarenko, 2012-07-07
@TheShock

I just used MooTools.Class in parallel with jQuery. Quite a solution.)

A
Alexey Prokhorov, 2012-07-07
@megahertz

I used at one time
github.com/shergin/legacy/ - light and simple
Mootols
ExtJS
Then I realized that OOP in its purest form is not exactly what you need in JS. For simple projects, ordinary prototypes are suitable, for something more complicated, there are either like Backbone.js

M
Mikhail Osher, 2012-07-07
@miraage

prototype?

K
Keyten, 2012-07-08
@Keyten

Write native classes. Like this:

// класс
Animal = function(name){
 this.name = name;
}
Animal.prototype.getName = function(){ return this.name }

// наследование
Cat = function(name,color){
 var animal = new Animal(name);
 this.color = color;
 for(var i in this){ // вместо этого можете использовать jQuery.extend(animal, this)
  if({}.hasOwnProperty.call(this,i))
   animal[i] = this[i];
 }
 return animal;
}
Cat.prototype.getColor = function(){ return this.color; }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question