Angular 2 Learning Resources Update

Last week, I finally took the time to revamp my Angular 2 Learning Resources repo. I had moved the repo to my previous employer’s github, but since I left their 2 months ago that repo had been dormant. I’m hoping to dive into Angular 2 at my new job soon, so I thought it was time to refresh the content by removing old links, and adding links that were relevant for Angular 2.0 (final).

As always, feel free to submit a PR if you have a good link that is missing from the repo.

Book Review: Angular 2 Development with Typescript

I thought the perfect way to get this blog going again, was to start with an Angular 2 book review. This is just the first in a series (next up, is ng-book2, of which I’ve read 150 pages).

This first review is on Angular 2 Development with Typescript by Yakov Fain and Anton Moiseev. The final book is not out yet, so this review is on Meap #8 (check the book’s page for a detailed ToC and a free pdf of Chapter 1).

To start, I must mention that I’ve read this book twice. My first read, was back in May, when Angular was in the RC stage and I (and everyone else) thought there would be no further breaking changes. Once the Angular team started breaking things, I stopped reading about Angular 2 and decided to wait for things to settle down. It took a lot longer than I expected, but after Angular 2 final was released, I thought it might be safe to dive in again..and see what has changed since RC2.

I remember loving this book on my first read through. Its obvious the authors know the topic, as well as programming in general. One of my pet peeves is seeing a book that does a good job of teaching a library/framework, but does so while teaching bad programming practices. That is not a problem here. Not only will you learn solid ng2 concepts, but solid general programming principles as well.

Along with walking you through the major ng2 topics, the book ends each chapter by gradually adding features to an application…so the app grows and expands more with each chapter. I like this way of reinforcing topics, as it provides a way to read for knowledge, but also get hands-on with some code before moving on to the next chapter. The book has also been updated to reflect the final ng2 release, which means it covers the latest changes to the router and forms.

Overall, I think this is likely to be one of the best resources for learning ng2, especially right at this moment. However, I do have a couple of minor complaints. First, I wish there was a whole chapter devoted to diving further into RxJS, and I would have liked a chapter (or appendix) covering the angular-cli. Second, I found my second read-through to be a little harder than the first. The first time I read this book, during the RC phase, I (and the authors) thought their book was done and nearing release. Then the breaking changes to ng2 happened, and the authors had to update the book. Personally, I think this messed up the flow a bit. On my second read, I felt some of the topics were either rushed, or hard to follow. I’m guessing this is a side-effect of having the book complete, then having to go back and rewrite portions of it…made it feel slightly disjointed in places (or the problem could be just me struggling to understand portions of the updated sections).

Regardless of those quibbles, I would still highly recommend reading this book, if you are ready to jump into learning Angular 2. Oh, and if you don’t know ES6 or Typescript yet, those are adequately covered in the appendixes.

 

Quick Update (ES 6 Book Reviews, Angular 2.0, React)

I know things have been quiet around here lately, but I plan to resume my JavaScript book reviews soon (as in I’m reading the Zakas ES 6 book now). Due to a busy schedule at work, I needed to take a break from blogging here. But now that work is settled down (our mobile app is live in the iOS app store and the Google Play store), I plan to resume reading some new JS books. The first 2 books I plan to read are both works in progress. The thing they have in common is ES6. I really want to get serious about learning ES6, so I’ll be reading whatever I can find on it. My first two candidates are:

Understanding ECMAScript 6 by Nicholas Zakas (it is only 30% complete, but I’ll review what it there so far)

JavaScript Allonge: The Six Edition by Reg Braithwaite (this one claims to be 50% completed)

Another one I am really looking forward to is forthcoming in April is Exploring ES6 by Dr. Axel Rauschmayer. I would like to start reading that one as soon as it is available. While not specific to ES6, I’m a huge fan of the You Don’t Know JS series. While I own the Kindle edition of the latest version (Async & Performance), I just ordered the paperback from Amazon, so it will arrive tomorrow. You’ll likely see a review of that one soon

In addition to ES6, I plan to start reading up on ReactJS. The more I read about Angular 2, the less I like what I see. I’ve been trying to put a positive spin on Angular 2, but I’m just not sure I like what I see. I know minds much smarter than mine are working on it, but between the TypeScript annotations, and the weird html additions, I feel like I’m looking at some weird Java code. There is a reason I left Java to do JavaScript, and I’ve got no interest in writing JS that looks like Java. Lots of folks will disagree, but that’s just my opinion. Its tough to give up on Angular, after spending 2 years learning it inside and out. And who knows, maybe I’ll change my mind and fall in love with Angular 2 as more details emerge. Or I might dislike React once I start learning more about it. Regardless, I think now is a good time to learn React, just to become more informed about what it is, and how it differs from Angular.

So with that said, I have hopes of doing some articles on how an Angular dev learns React. And since I do PhoneGap stuff at work, I’m also highly interested in React Native.

Angular Seed Project Updated (Angular 1.3 & 6to5 Support)

Last week I spent several hours/evenings updating my Angular Seed project in Github and thought it worth mentioning here as well. The link in the previous sentence contains most of the details, but I thought I would highlight a few things…

  • It has more functionality. I signed up for a free Weather Underground account, so the seed project is now a 3 ‘view’ SPA. In the first view you enter a US zip code and you are taken to the Current Conditions view. From there you can click a link to view a 4 day forecast. Note that pretty much no error checking is done yet. The app assumes valid inputs for now.
  • It has been updated to include Angular 1.3.x. It does not actually use any of the 1.3 features yet (but will in future updates).
  • ES6 is now supported via the 6to5ify Browserify transform. Thus, if you use this project to see your new project, you can write ES6 code. At the moment, the app only uses ‘let’ and ‘const’ to prove that the ES6 transform is working. If you view the build output after running ‘grunt:build’ you’ll see that ‘let’ and ‘const’ have been transformed to var. I would like to switch from CommonJS to ES6 modules next. I’m still learning ES6 at the moment, so I’m looking forward to seeing how I can use ES6 to make Angular programming easier (or cleaner).
  • I (obviously) spent a very little amount of time making the project look nice. I tried using Angular Material Design, but had trouble getting it to work. I’ll have to revisit that later. I would actually like to move away from Bootstrap and try one of the Angular-specific UI frameworks.

Those are the biggest changes. Let me know if you have questions or problems with the app our source code.

Book Review: Effective JavaScript by David Herman

This is book 4 in my JavaScript book review series…this time I’ve just finished Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript by David Herman. I’m not going to get into a long discussion on this one, as I have just a few things to say.

If you are an intermediate (or above) JavaScript developer, this book HAS to be on your shelf (virtual or physical). I never really connected with The Good Parts by Crockford, though I’ll probably try reading it again at some point. So while a lot of people will refer to that one as one of the modern bibles of JS, I would vote for Effective JavaScript instead. Its one of the better (most effective, if you’ll pardon the pun) technical books I’ve ever read. I love the format, and would love to see more books like it. In fact, I’ve read the book 3 times now. It covers quite a few “gotchas” and edge-cases…things I don’t run into everyday. Thus, I’ve found it worthwhile to read again every 6 months or so, to refresh my memory. Instead of wasting your time discussing the details of this book, I’ll just refer you to the Table of Contents here. That should tell you everything you need to know 🙂

If you are looking to take your JS skills to the next level (I’m not a fan of that term, but couldn’t think of anything better), Effective JavaScript is a MUST read.

Book Review: AngularJS Web Application Development Cookbook

So this is the third book review in this blog series, and I’m happy to say I’ve finally found a book I can recommend. I just finished reading AngularJS Web Application Development Cookbook by Matt Frisbie. The e-book version happens to be on sale for $5 before January 6, 2015, and I highly recommend it for that price.

As the title says, this one is a cookbook. Its not a tutorial, and I wouldn’t recommend it if you are new to Angular. The book has 10 chapters, and each chapter has multiple recipes (I believe the book description claims 90+ recipes). Each recipe is comprised of 3 sections: How To Do It, How It Works, and There’s More. The How To Do It section explains the purpose of the recipe, and contains the code sample. How It Works explains the code sample in more detail, and There’s More gives additional information about the recipe.

Even though I’ve worked with Angular for 18 months, I still learned a few things in the first 5 chapters. The chapter on testing (#6), was a bit of a disappointment, but that is really the only weakness in the book. I thought chapters 7-9 were excellent, even for more advanced Angular developers. In fact, I plan to go back and re-read those chapters as I didn’t fully understand the details of some of the recipes in my first read-through. Those 3 chapters explained how to speed up your Angular apps, using promises, and covered some of the new stuff in Angular 1.3. The last chapter contained recipes on Angular hacks, and I felt these were a bit mixed. I did not like the DRY Your Controllers recipe (I can’t imagine ever implementing that recipe in real life. I would solve the problem by using Controller As), and the recipe on using $parse to reference deep objects felt a bit too hackish. But those are minor complaints. Most of the book is well-written, interesting, and full of good stuff.

Overall, this is one of the better Angular books I’ve read in the last year. If you already know some Angular, and are looking to take your skills to the next level, you should add this book to your reading list. And do it fast so you can take advantage of the $5 sale.

Book Review: Responsive Web Design with AngularJS

This is the 2nd in my series of book reviews (my previous post was the 1st book review, also an AngularJS book). This time I am reviewing another newly released book: Responsive Web Design with AngularJS by Sandeep Kumar Patel. And like the first review, this isn’t a book I can make myself recommend (sorry!).

I was looking forward to seeing what this book had to offer. Since moving from being a java developer to a front-end developer 2 years ago, I’ve spent most of my time programming JavaScript, and not enough learning css & responsive design (which is one reason I’ve started this review series, as I plan to include design books in my reviews). I also wondered, having used AngularJS a lot, what I could have missed in regards to it supporting responsive design. So when I saw a book called Responsive Web Design with AngularJS, I had to check it out.

The book is short, just 5 chapters, and only 3 of them really focus on the topic of responsive design. Below are some thoughts about each chapter.

-Chapter 1: Introduction to Responsive Single Page Application and AngularJS

First, notice the small grammatical error in the chapter title. Those grammatical errors are littered throughout the book. Not a huge deal, but I do expect better editing from a professionally published book. And I thought some of the editing issues had an affect on the material. Moving on…there isn’t much to say about this chapter. The author describes the meaning of SPA, and gives a quick overview of the features of AngularJS. While obviously not a tutorial, the overview isn’t bad.

-Chapter 2: The AngularJS Dynamic Routing-Based Approach

I’m not sure about you, but my first thought was “what the heck does the Angular router have to do with responsive design”? Turns out (at least in my opinion) the answer is nothing. The author builds a service using $provider (why?) to determine the device type (tablet, mobile, desktop) based on width, then within the router, serves 1 of 3 templates. Thus there is a completely different template (and css file) for each of the 3 device types. While I’m fairly new to responsive design, this doesn’t sound like RD to me. Does it? My opinion on the book takes a hit…let’s see what happens in the next chapter.

-Chapter 3: The AngularJS Directive-Based Approach

This chapter begins by talking about the shortcomings of the approach from the previous chapter. Good. Though it makes we wonder why a chapter was devoted to the previous topic if it wasn’t a good approach. Just to have something to talk about maybe? Anyway, in this chapter, 3 custom directives are made: one for responsive images, responsive text, and responsive item lists. I’m honestly not sure the ideas in this chapter are any better. Each of the 3 directives has some duplicate code that is used to determine the device type. The directives attach a $watcher to the $window, listening for windowResize events. The code is listening for changes to the window’s width, so that it can change the layout of the page if needed. Seems a bit messy to me, and I don’t like having this device type logic in 3 separate places. Maybe this is a good idea, and those of you with more RD experience can correct me. But I don’t see my adopting ideas from this chapter, either.

-Chapter 4: The AngularJS-Based Breakpoints for Layout Manipulation

Again, maybe it’s my lack of RD knowledge, but the design in this chapter feels downright dirty (wrong) to me. Basically, the author sets up an event-based approach to setting breakpoints for changing the page’s layout. I won’t give away all the author’s tips, but basically a couple of watchers are set up this time, and when the width changes and drops below (or goes above) one of the pre-defined breakpoints, an event is broadcast. Then listeners for this event will catch it and modify the layout accordingly. Again, not something that feel’s right to me. This feels like an abuse of the pub/sub system.

-Chapter 5: Debugging and Testing Responsive Applications

This chapter had a promising title, but it was really just a collection of debugging tools and plugins you can use. There were some I had not heard of, which is good. But there isn’t really enough explanation into how to use any of them (though that info could easily be found on the website for most of the tools mentioned)

After reading this book, I don’t feel like I know any more about proper RD with Angular than I did before I read it. I guess I did learn a few ideas that I would NOT want to repeat in my applications, though. I believe my preference is to choose a CSS framework that will take care of most of the RD logic for me, so that I’m not littering my code with hard coded device widths and conditional logic. For those of you more experienced in RD than I am…what are you thoughts?

Also, I plan to read a proper Responsive Design book soon. Anyone have any recommendations? I would prefer something published in the last 12 months. My first thought is to read this one.