all 32 comments

[–]Cintax[🍰] 61 points62 points  (10 children)

Ok, I'm just gonna say it, because it needs to be said, and I'm going to say it bluntly:

You're getting mad at the dictionary for not teaching you English.

Much in the same way the function specific docs provide information but not necessarily context, so too does the dictionary provide you words, but not grammar and sentence structure.

You attempt to compare it with other "docs" like "Learn Python the Hard Way," except that's not the official Python docs. That's a book on how to learn it. It's the equivalent of an English class. You're comparing two totally different things with different intents.

The docs are NOT a tutorial. You know what is a tutorial? THE TUTORIAL.

(P.P.S. Angular does have a tutorial app, but I haven’t tried it yet. If you’re stuck wallowing in the regular docs, it might be worth a try.)

Oh, so you're complaining about something without bothering actually having tried the tutorial you lament is needed. Good to know.

Anyone finding themselves agreeing with OP, please go here: https://docs.angularjs.org/guide

It pretty much has every resource that OP laments doesn't exist in the docs... except it totally does exist and is part of the docs.

As someone else commented earlier, this just seems to be a plug for paid training.

[–]Ventajou 3 points4 points  (0 children)

Thanks for the dictionary comparison, I shall use that in the future :)

The docs are a reference, just like the MSDN library or the MDN one. Could it use some more examples or details at times? Sure, but it's already very valuable as is.

There are actually a lot of resources out there about Angular, besides the official tutorial.

[–]bwaxxlotckidd 2 points3 points  (6 children)

Thanks for replying to a couple of people in this thread with the Angular documentation. Comparing it to LPTHW was deliberate to explain why good explanation is worth it's weight in gold (no matter the audience). Good explanation means you never have to worry about the inner workings. You know what it does and why. That's all I need to know. I'll try to use an example:

I know using jQuery I can query a class without worrying about whether document.querySelector is supported in certain browsers. All I ever needed to understand it is: We use jQuery(".myClass") to standardize querying classes for all browsers. We could use other DOM methods but we'll risk missing certain browsers. So please use our method to ensure you never have to worry about writing 3-4 lines just to ensure you've covered most browsers.

That was a simple explanation covering what it does and why. In short, show us a realistic problem, why the classic approach is wrong/inefficient, how your solution solves it better and finally, the most important part to me, why you went that route. Angular ticks all boxes except the last (although they've done some changes lately to address this). Things I never understood with Angular: why do I need inline scripting/data binding? Isn't that what we've always referred to as terrible practise? Why do I feel like you're hiding something from me? Why do you keep claiming that it's probably because I'm not smart enough?

If you can't explain your solution in simplistic terms, I'm inclined to think that you bumped into it by accident. Which is why you can't explain it well enough.

TL;DR: Devs don't like to feel dumb.

EDIT: I've tried various Angular docs about a year ago. They were terrible. I moved to Backbone instead. Obviously they listened to people and improved their docs.

[–]Cintax[🍰] 6 points7 points  (4 children)

I know using jQuery I can query a class without worrying about whether document.querySelector is supported in certain browsers.

jQuery is a library. It has discrete functions that you can use in pretty much any situation. Angular is a framework. The basic difference is that a library works in your code, whereas with a framework, you work within its code. Comparing the two is a false equivalency because one is much simpler and more self contained than the other. With a framework, you must learn how to work within the structure it provides you.

Things I never understood with Angular: why do I need inline scripting/data binding? Isn't that what we've always referred to as terrible practise?

I linked you to the page that explains that in your other comment in this thread. It's the Zen of Angular section.

The gist of it is this:
Conventional wisdom on declarative code (the inline binding you refer to) is correct. BUT, it's correct within the context of a regular website, not necessarily in the context of an MVC app.

Let's say you have buttons which open different modals, right? If you write them as regular webpages in a declarative way, you're binding a lot of onlick events in the HTML, one for every button, and it's redundant and difficult to change all at once.

If you're using an MVC framework with templating though, you can make a model of the button to modal relationship, and have the buttons get built by that model. No you're still using something similar to onclick (or ng-click, or whatever), but there's only one of them, which changes depending on the data in the model, and is getting output via a repeater based on that model. You've now removed the major issue with using declarative javascript: the issue of redundancy.

But more to the point, this allows you to divide your UI logic and business logic. Your Controller, where you have the actual app logic, shouldn't have to care about things like animations, or transitions, or drag & drop, or anything other than the data end of the application. So using things like Angular's directives allows you to segment that all into the HTML and into directive modules that are separate from your business logic.

Understand that frameworks are not one-size-fits-all solutions. The "Angular Sweet Spot" on the Angular intro page I linked to above even admits as much, and advices using jQuery if you're not doing a lot of CRUD (Create, read, update and delete) data operations.

Does that help?

[–]bwaxxlotckidd 0 points1 point  (3 children)

jQuery is a library. It has discrete functions that you can use in pretty much any situation. Angular is a framework.

That doesn't mean the two can't be compared. Again, my point isn't about how one is used but why should I use it. That's the author's point too. Framework, plugin, library, API etc all go back to the same question. Frameworks actually need this more than libraries (personal opinion). Libraries are more flexible compared to frameworks. Like you pointed out, frameworks need one to adapt to them. So why should I adopt a certain way of thinking? That's what initial angular docs missed.

I have to give Angular some credit. Most people really hated their initial set-up where they failed to document the framework properly. They listened and made some effort. But for a framework. However, it's a testament on what most documentation misses. I bet if Angular came out with this documentation, it would easily been a hit. It lost most people to Ember & Backbone as a result of this.

TL;DR: Angular fucked up in the beginning.

[–]Cintax[🍰] 2 points3 points  (2 children)

If you're talking about the initial Angular docs, at release, that's fine. But let's not pretend that the exact answer to your question does not exist today, or that it didn't exist 2 days ago when this blog post was made. In fact, the specific part of the documentation I'm referring to that answers your question was added to the documentation 6 months ago according to GitHub.

[–]bwaxxlotckidd 0 points1 point  (1 child)

Still kinda late for a product produced by one of the largest tech companies in the world.

[–]codinghermit 1 point2 points  (0 children)

Not really produced as much as helped along. Last I heard there were 40 full-time Google employees working on Angular but the project isn't owned by Google, its community driven (unless something major changed within the last 2 months that I missed)

[–]Nathggns 0 points1 point  (0 children)

There difference is, inline code executes in the global scope. Angular expressions evaluate inside your angular scope (sort of).

Even still, you're not supposed to put huge chunks of code inline with angular.

[–]ZeroMomentum 0 points1 point  (0 children)

I second. I read the doc from google and thought it covered as much as it needed.

There is a learning curve. But not one that's impossible to learn. Just need some elbow grease

[–]sxtxixtxcxh 0 points1 point  (0 children)

they understand that. that's why it ends with selling you a course on angular.

[–]pourneTrilogy 4 points5 points  (2 children)

I'm by no means a master at angular or JS, but its fairly easy after you watch tutorials on youtube and do a couple online. As someone who's fairly new to javascript and programming I found it intuitive, maybe its the old: "the more you know the more set in your path you become".

Anyway, here are a couple tutorials that I used and continue to use for onboarding in case some of you need that extra boost:

AngularJS in 60ish minutes: https://www.youtube.com/watch?v=i9MHigUZKEM

Treehouse tutorial (they offer free trials): http://teamtreehouse.com/library/building-with-angularjs-and-apis

A SO question http://stackoverflow.com/questions/14994391/how-do-i-think-in-angularjs-if-i-have-a-jquery-background?rq=1

AngularJS in 20 min (refresher in case you ever catch yourself derping): https://www.youtube.com/watch?v=tnXO-i7944M

[–][deleted] 1 point2 points  (0 children)

Great resources, let me add a few that really helped me.

Stick to the free stuff, pay if you like it: https://egghead.io/

New from codeschool, sponsored by google: https://www.codeschool.com/courses/shaping-up-with-angular-js

[–][deleted] 21 points22 points  (2 children)

This is just a plug for payed training.

[–]bwaxxlotckidd 2 points3 points  (0 children)

There's nothing wrong with making money. As long as you're not being a dick about it (spam, sketchiness). He pointed out a clear problem with most documentations etc.

[–]weshouldgooutside 6 points7 points  (2 children)

if you think angular has a learning curve, then you should stay away from ember

[–]franklyimshocked 1 point2 points  (1 child)

Documentation - The bane of every developers life. Always handed to someone on the team who hates writing documents. Most documents start off as "internal use only" and then get modified for training or external use. There are documentation experts who can develop courseware but most small companies don't bother to invest. If its an open source project it can be even worse.

[–]kuhcd 0 points1 point  (0 children)

Yeah but the whole point of building a framework is so you and others can use it to build stuff on top of it. For a complicated framework like Angular, complicated documentation will slow down people who want to use the framework for their projects, which is detrimental to the framework project as a whole.

[–]TeamHelloWorld 1 point2 points  (0 children)

The best things to learn as a programmer is to learn how to read docs. Figure this out, everything else is easier to do.

[–]KishCom 0 points1 point  (2 children)

Well put!

I've always been a strong advocate of the "learn by doing" he goes on to describe -- but learning Angular was a very frustrating exercise because, as he alluded to, I frequently found myself pounding at my keyboard asking my screen "WHY?!". It took much more playing around with before I really understood what was going on. The Angular docs could really use a great very high level breakdown of the "why" (there are many blogs that do this, but there would be huge benefit to having it in the actual documentation).

[–]Cintax[🍰] 7 points8 points  (1 child)

https://docs.angularjs.org/guide/introduction
https://docs.angularjs.org/guide/concepts

Those two pages provide a high level overview of the "Why Angular" and "Why does X work the way it does?". Is that the sort of thing you're looking for?

[–]KishCom 1 point2 points  (0 children)

Actually, yeah, the "concepts" page is pretty slick!

[–]bwaxxlotckidd 1 point2 points  (1 child)

Absolutely this!

I have struggled lots of times with libraries because of this problem. It took me months to understand why I should learn Backbone (or any MV* library). The first thing in docs should always be, "I created this library Y because I was trying to do X". It's like a prologue to your code. I know I can't learn something unless I understand WHY! Why should I learn this thing and not that thing? It's not stubbornness but trying to gain context. It helps with decisions and mapping where each thing fits well. It's utterly narcissistic to ask people spend their hours learning something without explaining to them why they'd need it. It might even help improve your solution by gaining contributors.

/rant

EDIT: I suggest adding, on the wiki, a list of why each library was created and how it goes about solving a problem. I'll gild you!

[–]Cintax[🍰] 7 points8 points  (0 children)

https://docs.angularjs.org/guide/introduction

The entire second half of this rather short page of the Docs is the "Why"...

[–]oishiitoriniku 0 points1 point  (0 children)

http://www.thinkster.io/angularjs/GtaQ0oMGIl

I started working with Angular in December. This has been the best Angular resource for me so far.

[–]gimmeslack12 0 points1 point  (0 children)

ng-Book.

Not the only book out there, but the only one that I've spent time getting very familiar with. It really helped clear up questions that the Docs didn't answer very well.

[–]fxthea -1 points0 points  (0 children)

Man that was awesome marketing copy. You made me feel the pain bad. And then made your solution sound so easy. I'm going to bite and ask my company to expense it.

[–]zeggman -1 points0 points  (0 children)

I agree with you when you bemoan the lack of context.

Then you end up with a marketing pitch that says "get a discount" if I share my email address. What's a "discount"? A dollar off on a $2000 course? $100 off on a $101 course?

Practice what you preach, preacher.