You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/posts/2013-08-15-javascript-frameworks.markdown
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,15 +13,15 @@ I am not a fan of pushing the entire rendering process to the client. I am also
13
13
14
14
My opinions on the big 4 frameworks:
15
15
16
-
# Backbone
16
+
##Backbone
17
17
18
18
I love backbone. So easy to get started. So easy to do whatever I want. However, I have a hard time believing that it can be scaled to a team size without some hard core discipline, and structure.
19
19
20
20
Backbone models and collections are freaking awesome, out of all client side frameworks I have dealt with, dealing with data is absolutely the easiest in Backbone. However, it is quickly negated by its shitty controllers/routers/ViewModel layer (if you haven't heard of a ViewModel, I think you should look up the MVVM - model view view/mode pattern). Backbone intentionally leaves this to you. I've browsed a lot of random open source projects on github that use backbone and everywhere I look there is a different way to organize things, and it feels chaotic. If you value the same things about code as I do, that is testability, modularity, readability, etc, you have to come up with your own scheme that hopefully fits all your needs. Backbone's intentional shortcomings are picked up by some frameworks that are built on top of it, like Marionnette... but man I hate frameworks on frameworks.
21
21
22
22
Finally the view. Not the view you know of from rails, I'll call that the template. The view object. I don't mind how they bind data or events, but ugh, the lack of templating kills me. You have to compile your own template (not a big deal, jquery and underscore provide decent templating functions), and inject that into DOM via some helper methods (Urghhh). So if you have a collection, and render a list, then behind the scenes modify a model/the collection, you have to go delete your own element and replace it in the right spot. I found it manageable until I rendered a form, and tried to modify the same view with some view changes, and it became hell.
23
23
24
-
# Angular
24
+
##Angular
25
25
26
26
My first attempts at angular were thwarted by horrific documentation, and my second attempt was painful because they were in progress of updating their horrific documentation to actually document the version they released. Oh and (at the time) an incredibly intimidating dependency injection strategy. They have matured and now the documentation isn't completely rubbish and the dependency injection thing actually makes sense. I am currently using angular for my side project.
27
27
@@ -33,15 +33,15 @@ Angular provides no model layer... it lets you use any plain old javascript obje
33
33
34
34
My last point is the way that angular binds its data. This has been an internal battle for me for quite some time; data and event binding via pseudo html attributes vs declared event observers and interpolation. They are very different styles. I wouldn't necessarily choose a framework because of how they bind events, but there are some tradeoffs that I have seen some highly philosophical and argumentative developers will fight over, but I'm not going to get into that here.
35
35
36
-
# Ember
36
+
##Ember
37
37
38
38
Now that ember has successfully separated its image from sprout, I think ember is very solid. Solid models/events, solid and high profile team behind it, solid (IMHO) way to declare templates, sensible view models, not bad collections. The only thing keeping me from constantly using ember js is its tight integration with handlebars (my use case for these frameworks don't align with that kind of templating, I'll explain in a sec).
39
39
40
-
# Knockout
40
+
##Knockout
41
41
42
42
Last time I tried knockout, it felt like they were cramming ajax down my throat... they seem much better about that now. It has an awkward and sometimes ridiculously verbose ways of doing things. Was built by microsoft, the inventors of MVVM... was built by microsoft so I don't give it a serious look.
43
43
44
-
# Here are some random thoughts:
44
+
##Here are some random thoughts:
45
45
46
46
I'm done with client side routing for a while, it is annoying to deal with. You have to intercept all links, and redirect it back to your own router. You have to make sure that if you fill out a form, go to another page, come back to the form that the form is emptied. If one page breaks you may have just made the user stuck without any kind of indication that they are used to. You have to basically reinvent http status codes. Github can't even get it right (if you hit the back button too fast while browsing code, you can end up on a page different from what is in your url bar. This happens to me all the time and annoys the crap out of me.) With pushstate you have to make sure every page works if you hit the refresh button.
0 commit comments