compared with
Current by georgi.naumov
on Aug 05, 2013 10:41.

This line was removed.
This word was removed. This word was added.
This line was added.

Changes (39)

View Page History
JS has gained a lot in the last 3 years, owing to these developments:
- the only language that's universally implemented in browsers
- new virtual machine (V8) that's 20-100x faster than older implementations implementations[]
!JavaScript Performance Timeline.png!
- server-side and cloud deployments (node.js)
- a huge amount of libraries for web development.
E.g. see this list of popular libraries that Google is hosting on its distributed server network, to increase speed []
- presentation for what's coming next in JavaScript: []

ResearchSpace currently uses the following popular libraries

h2. AngularJS

If we decide (or you force us ;-) ) to use JS as the basis of RS, here's a library that could become our foundational framework.
(This below is compiled from a discussion between me and Krum Georgiev)

AngularJS is a web app framework by Google that seems very well put together.
Clean model/view separation (separation of concerns through a variation of MVC); very clean markup (declarative templates with data-binding); dependency injection, keep model & view automatically in sync; define application "routes" (URL mappings) and support deep (bookmarkable) links; attach to specific pieces of your page (doesn't want to own the page); define your own tags in html ("directives") and create components easily (providing a HTML compiler for creating your own DSL in HTML: "what HTML would have been, had it been designed for building web-apps.")

That doesn't mean we won't use other JS libraries like jQuery, Dojo, Prototype, Underscore, Backplane, etc. AngularJS doesn't try to be the only framwork, and plays well with other frameworks.
It's an MVC (MVP, MVVM, etc.) framework, that could be of real help when dealing with numerous spaghetti callbacks (jQuery or similar). The greatest benefit is that the app can more maintainable, and able to add arbitrary features much more easily. Krum: javascript MV\* frameworks are a must for every mid to large JS based project.

AngularJS *maybe* allows you to create a web app completely within the browser, and relegate the role of the backend to manipulating and serving data, but not creating UI.
All submits in AJAX, and no normal submits needed anymore ;-)

- []
4 nice examples. One shows how to store data in the cloud in a few lines (see Wire up a Backend, mongolab.js)
- []
Comprehensive tutorial, builds a mobile phone store
- []
Shows unit testing with Jasmine and Testaculous. It's in BDD-style (think RSpec and Cucumber): very easy to write and natural to read
- []
Shows end-to-end (e2e) testing in exactly the same BDD style and using similar syntax.
- APIs, modules etc

- []
Gallery of applications built with AngularJS
- [].
The DoubleClick Digital Marketing Manager and other DoubleClick Digital Marketing Platform applications are used by thousands of marketers and agencies worldwide. Google bought DoubleClick, and this is the platform that drives their advertising busienss
- []
Gallery of applications built with AngularJS
Uses HTML5 Canvas for the tag-graph. Says they'll show the source if someone's interested
- []
The DoubleClick Digital Marketing Manager and other DoubleClick Digital Marketing Platform applications are used by thousands of marketers and agencies worldwide. Google bought DoubleClick, and this is the platform that drives their advertising busienss
Uses HTML5 Canvas for the tag-graph. Says they'll show the source if someone's interested
Olympics 2012 real time live data (in Italian)

Downsides: quite steep learning curve; novel and untried. Although the tutorial is very clear on how you use it, the backend workings of it sound like black magic: some of the "wiring" is accomplished through naming convention, as in Rails.

h2. GWT

Google Web Toolkit (GWT) is used by Google to build many of their apps, eg GMail. Programs using GWT are written in Java, which is translated to JavaScript for execution on the browser.

Discussion on the angular.js forum "When is GWT appropriate, when is AngularJS appropriate?"[\!topic/angular/9P4RD3IbQwk|!topic/angular/9P4RD3IbQwk]!topic/angular/9P4RD3IbQwk
The most significant post is by Adam Bender:

* Great Development environment that makes you productive even though you have a compile step in your build

* The ability to use Google Guava library. Don't underestimate the power of having robust utility libraries to do things like argument assertions, collection traversal, exotic data structures etc. There really is nothing better than Guava when it comes to this kind of stuff. Of course because Guava is used by the GWT dev team it means that you dont have to worry about it surviving the JRE emulation - it will just work\!

* The single greatest thing about GWT for me was the programming model of Activities and Places - more commonly known as Model, View, Presenter (MVP). This programming model is a perfect fit for web application in particular where you may want to reuse logic to power different shaped views (read phone, tablet, laptop etc.). GWT really embraced this pattern to great effect

h3. GWT Cons

* It's still Java. No matter how you slice it, and how ironic it is, Java just isn't web-ui friendly. Java is not a good choice for anything programming problem that involves a lot of click handlers, or one-off listeners. Anonymous Inner Classes are just not the right way to do it\!

* Even with the speed ups you have to avoid compiling as much as possible. On my laptop (late-model quad core mac book pro) compile times range into the 2 - 3 minutes time frame. It is twice as slow on a dual core machine. That really is a long time to wait between making changes and seeing a result. Even though the GWT team have done a great job making compilation less necessary during day-to-day development it's still manages to suck time out of my dev cycle. Also, like taxes and my waist - compile times only seem to grow with time.

* Adapting 3rd party libraries is possible, but not fun and you end up writing this weird mix of "javascript-in-java multi-line comments" which never seems to format correctly in IDEs and is completely opaque to syntax highlighting apparently.

* GWT applications cant support dynamic module loading easily. Think of a portal like iGoogle where you want to include many modules, perhaps only determining which ones at run time. GWT will fight you every step of the way because GWT, due to the extreme optimization it does, likes everything in the world to be known at compile time. This means that you can't link code up in the browser which means you lose out on what I think is one of the greatest features of the web.

* Related to that last point, GWT is not very modular in and of itself. While there is the ability to do code splitting to improve load times, you still end up sucking down a lot of GWT library stuff for even the simplest hello world app. Now this may or may not matter to you, but if you have mobile dev in mind, every byte counts\!

* Angular has a healthy and vibrant community where any question you have can be answered pretty quickly.

* Testability, testability, testability\! If you are going to write code in a dynamically typed language then you have to have a fantastic tests story and Angular has created one. Both due to it's use of core test-enabling patterns like DI but also through the development of the Scenario Tester that lets me write Selenium style end-to-end tests using JavaScript as my language of choice.

* Part of being a young project means the docs and examples out there aren't quite polished down which can be quite annoying. However, this problem is getting better by the day and as far as I am concerned Angular has exceptional docs given it's limited exposure to public consumption.

* Angular has been knocked for its dirty-checking for binding approach. While I cant comment on the alternatives to much I think for the most part this is a non-issue for most apps but you'd have to evaluate your applications binding needs. This is something that we should keep in mind - dirty-checking can cause major performance problems if there is more information. For example 2000 pieces of information to a human on a single page. Anything more than that is really bad UI, and humans can't process this anyway.
For more information check this link:

h3. Bottom Line

If you have only Java developers - use GWT. If you would prefer to have a compiler help catch some, but by no means all human errors - use GWT. If you need to rely on extensive examples or documentation, for now GWT is better but that will change. If it is going to be a very large, long lived application - something static typing an the Java tooling ecosystem may help with then GWT is your option.

However, if you want to build apps from small to large and you are comfortable with JavaScript as a programming language - not just a way to make animated transitions - then Angular is the first framework to give you the power to build a proper application. One where you stop thinking about the incidental complexity and can therefore focus on the essential complexity. With Angular you can be as big or small as you want, as dynamic as you want and really use the web to its fullest potential. Don't forget that the JavaScript tooling ecosystem is getting better every day\- I can even put my JS app in Sonar now, build it with maven, run JSHint in my IDE and more. So the days of JavaScript being considered a toy language which no real project can be done in are long gone. Using Angular you can really put the lie to that line of argument.

Personally, having discovered Angular I don't think I would ever recommend GWT as a place to start for a web app. While GWT represents a truly amazing engineering success, I think it is an idea whose time has come and gone. I look forward to a future building AngularJS apps and solving problems for customers in a way that not only makes them happy, but keeps me from wanting to know my finger tips off\!

h2. Bootstrap

h1. DART

Google is working on a new web language: [].
It is a competition to JS that allows safer and more scalable programming. It has native implementations (Chrome, maybe Mozilla, node.js) but also a translator (dart2js) to JS to allow deployment on more devices.
The native implementation already outperforms V8 by 20-30% (see slide 39).