jeromeetienne / better.js

a better javascript in javascript
http://betterjs.org
MIT License
156 stars 22 forks source link

Post for Mozilla Hacks - bainstorming #96

Open AndraConnect opened 10 years ago

AndraConnect commented 10 years ago
AndraConnect commented 10 years ago

Presentation

Javascript is the most used language in the world. You can find it in every browser, in every machine and in most video games today. This is a fact. And yet, it is far from perfect. Every developer knows it: sometimes it can be very hard to debug. But what if I told you that there is a way to simplify the life of javascript developers once and for all?

I got inspiration from asm.js an effort led my Mozilla to debug Javascript.

AndraConnect commented 10 years ago

Body

You will discover that you can do things with javascript that you never thought possible. Better.Js fixes bugs faster, increasing the level of verification present in the code. It also monitors your code better, thus measuring more accurately what your code is actually doing. More good news? It is easy to apply and there is no need to learn a new language: it’s 100% good old javascript!

With Better.js you can actually develop private and strong typing, impossible to do in javascript up to now. It adds private/public support to javascript. With this tool you can declare a property or a function as private and better.js will check it for you. It will make sure your code is used from where is intended. With strong typing better.js helps you define the allowed type of each property of your code and it makes sure that they are respected.

This is something revolutionary! Imagine passing attributes to classes, defining which functions are private and which are not. Same thing for properties. Imagine defining and applying strong typing to your arguments. Thus checking the validity of each argument passed to your function. Same thing for strong typing for the returned value. If the function is part of a class, you can declare it as private, thus only this class will be able to use it, and once again: it's the same thing for properties!

AndraConnect commented 10 years ago

Conclusion