GithubHelp home page GithubHelp logo

twilson90 / extend.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benjaminsen/extend.js

0.0 2.0 0.0 25 KB

ExtendJS extends JavaScript with a simple yet powerful class abstraction.

Home Page: http://extendjs.org/

License: Other

JavaScript 37.41% HTML 62.59%

extend.js's Introduction

extend.js

ExtendJS extends JavaScript with a simple yet powerful class abstraction.

Info and examples at http://extendjs.org

FAQ:

The driving goal of ExtendJS are

  • Provide the simplest syntax possible, minimizing the amount of code developers needs to write.
  • Scope should always be maintained.
  • Private and public variables should be created at initialization time and be unique per class instance.
  • Both methods and variables should be overridable.
  • Small code base - the current minified version is 1.4kb.

Things that does not work as well as I would like

  • There is no support for protected variabels.
  • There is no support for static variabels.

Suggestions for improvements and extentions are very welcome.

QA:

JavaScript has great prototypical class inheritance, so why write this?
While writing, a yet to be released HTML5 game engine, I felt a need for a better way to re-use and extend basic primitives. Over the past years I also spend a large amounts of time working with C# and ActionScript 3 and I really missed the more powerful class system from those languages.
ExtendJS started out as a simple scope hack, allowing for code execution during prototypical class instantiation. From there it was trivial to add method and value copying and overloading and the project took of from there.
For more than a year I revisited the project multiple times, fixing bugs and making the syntax simpler. The version existing today is far from the original version and I must have rewritten it more than five times from scratch in an attempt to simplify and resolve issues.
I still don't understand why JavaScript needs this?
Granted, by itself ExtendJS does not do much, however it's a great base on which to build larger, JavaScript heavy, projects such as games and web applications.
You are using the reserved word super in your code and it won't run in older browsers!
Neither will the HTML5 game engine I am working on and I am perfectly happy with this choice. Do a search replace for super to sup and it will happily run in IE6.
I tried running it in strict mode, it does not work.
The code relies on arguments.callee as part of inheritance, I sadly see no pretty way to fix this. Suggestions are welcome!
I don't like how it automatically adds classes to the global scope.
A simple design choice, if you update the class to return child you can assign the classes however you like.
Your CDN is useless, it does not even support HTTPS!
I am aware; I have yet to collect the community support to put it on CDNJS. Stay tuned for updates.

extend.js's People

Contributors

benjaminsen avatar sweetroll avatar squ1rr avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.