I enjoy programming. That's why I spend my spare time learning about various programming techniques. To learn actively I decided to develop a JavaScript library. Developing a library requires abstract thinking and good discipline, and JavaScript itself is a fascinating and very expressive language. After reading the "Javascript - the good parts" book — I was eager to get to work!
The key principles of the Library
- Maintain compatability with other frameworks.
- Use JSON format instead of the "new" keyword for objects.
- Use delegation instead of prototype inheritance.
- Do not try to implement a classic OOP functionality.
- Instead embrace stateless functional programming.
- Which means lots of closures, curring, injections and callback functions.
Insights so far
What surprises me the most is that working on JavaScript made me a better PHP programmer. I found that functional programming (with curring and closures) can be as powerful as OOP.
Source code and examples
Click here to view examples or download a source code.
