T
Todd Motto
toddmotto.com · Personal blog · on HN since 2013
Todd Motto, a front-end developer, writes tutorials and style guides on AngularJS, JavaScript, and CSS.
What HN saysHN commenters link it for JavaScript patterns such as the module pattern and replacing switch statements with object literals; one says it dilutes core material, another disputes the module pattern's value.
29HN people shared it
7linked it in comments
25stories submitted
107story points
8 years agolast shared
2013people per year2026
Most-shared posts
- 1Finally understand Redux by building your own Store3 people · 14 points · first shared 2017 · discussion on HN
- 2Try using data- attributes instead of classes for simplified CSS3 people · 8 points · first shared 2013 · discussion on HN
- 3Rethinking AngularJS Controllers3 people · 2 points · first shared 2014 · discussion on HN
- 4Opinionated AngularJS styleguide for teams2 people · 45 points · first shared 2014 · 17 comments on HN
- 5Ultimate Guide to learning angular js in 1 day2 people · 5 points · first shared 2013 · discussion on HN
- 6Everything you wanted to know about JavaScript scope2 people · 4 points · first shared 2014 · discussion on HN
- 7Is it time to drop jQuery?1 people · 9 points · first shared 2013 · 8 comments on HN
- 8Angular 3 Alpha1 people · 4 points · first shared 2016 · discussion on HN
- 9A deep dive on Angular decorators1 people · 3 points · first shared 2017 · discussion on HN
- 10TypeScript: the missing introduction1 people · 3 points · first shared 2016 · discussion on HN
- 11Building Tesla's battery range calculator with Angular 2 reactive forms1 people · 2 points · first shared 2017 · discussion on HN
- 12Echo.js, simple JavaScript image lazy loading1 people · 2 points · first shared 2013 · discussion on HN
- 13Hacking the HTML5 element with Suave.js1 people · 2 points · first shared 2013 · discussion on HN
- 14A new Angular 1.x ES2015 styleguide, the path to Angular 21 people · 1 points · first shared 2016 · discussion on HN
- 15Exploring the Angular 1.5 component() method1 people · 1 points · first shared 2015 · discussion on HN
What HN people wrote when they linked it
reitoei · 2015-09-23
I've been working pretty much exclusively with Angular for the past 18 months on some high volume financial processing systems. Shipped 3 codebases that would probably be considered 'large'. It's been one of the best development experiences I've ever had.
The learning curve is steep, but when you get into the groove, when it finally clicks, then you can really take off with it.
I love the tooling (node, Yeoman, Grunt, jshint, karma, protractor etc.). While not perfect, it's definitely helped me write better, more readable code.
The one article that helped me get to my 'gotcha' stage was this one by Todd Motto: http://toddmotto.com/rethinking-angular-js-controllers/
Theyeard · 2014-11-09
Wow, great idea. I wish this was available as a npm package.
A couple of things, sometimes the service doesn't work and returns "YUI Compressor : 0bytes (100%)" or "JSMin : 886bytes (0%)". A typo: succees.
The references section could be expanded with resources about writing JS code in a way that enables optimizations:
http://toddmotto.com/what-function-window-document-undefined-iife-real…
https://curiosity-driven.org/minimal-loader
koboll · 2019-02-22
Another compelling argument for the same position:
https://toddmotto.com/deprecating-the-switch-statement-for-object-lite…
SamuelAdams · 2019-01-31
It's pretty simple with modern tools. For example, I'm learning Angular at the moment. I needed to learn how to use an IF statement in the HTML code.
The first google result is a blog post [1] from some guy. It's helpful, but really dilutes the core material. So instead I just went directly to the angular docs [2]. This was straightforward and gave me the info I needed to know.
Now CLI manuals from tools created in the 80's and 90's? Those are trickier. I'm still trying to learn a good way to grok those tools, but so far blog posts and Stack Overflow have been better than the man files, in my experience.
[1] https://toddmotto.com/angular-ngif-else-then
[2] https://angular.io/api/common/NgIf
madeuptempacct · 2018-09-24
Yea, no, just read this:
https://toddmotto.com/mastering-the-module-pattern/
And you will never use it unless you are writing a library because Angular/React/Vue do it for you.
poxrud · 2015-01-29
One thing that definitely can be improved is using "Controller As" syntax. It solves most of the $scope issues.
Here's a good writeup: http://toddmotto.com/digging-into-angulars-controller-as-syntax/
rmsaksida · 2014-10-14
> Yes, a prerequisite to using a JavaScript framework is understanding prototypical inheritance
Obviously, but you shouldn't have to care about prototypical inheritance for simple databinding. The way view-models work in Angular leads to some complicated scenarios which, in my opinion, shouldn't exist in the first place (http://toddmotto.com/all-about-angulars-emit-broadcast-on-publish-subs…
> What?
See https://medium.com/@kentcdodds/counting-angularjs-watchers-11c5134dc2e… for an explanation.
> To date I haven't seen a coherent argument against Angular; complaints seem focused around having to learn framework specific syntax (present in any large MVC framework) or the perceived "heaviness" of the framework (suggesting the apps you're building aren't complex enough to justify something like Angular)
I have no problem with learning framework specific syntax and Angular is actually lightweight, both from an architecture and from a code weight point of view. What I do find problematic in Angular are some design decisions which often lead to complicated, and non-beautiful, code. Angular is no doubt incredibly useful, even for smaller apps, and I'm grateful for its existence. It is a step in the right direction. But I do think it has room for improvement.