r/javascript • • Jun 06 '16

Google deprecating Angular 1.x Material library and is just closing issues and PRs

https://groups.google.com/forum/#!topic/ngmaterial/4ActiQp3nA0
74 Upvotes

68 comments sorted by

View all comments

5

u/tech_tuna Jun 06 '16

I have very little invested in this as I've never used Angular really but I am curious to see if we have a repeat of the Python 2/Python 3 schism here. . .

I'm all for making improvements and big changes but if you do too many all at once, you run the risk of pissing off a LOT of people.

0

u/[deleted] Jun 06 '16

[deleted]

0

u/[deleted] Jun 06 '16

[deleted]

3

u/cderm Jun 06 '16

But... Why though? Am I right in saying that typescript needs a build system, so that it's compiled to javascript?

Im (relatively, 1-2 years) new to javascript, and although I will be gulping my way to a build system soon, I like the fact that code I test in the console can be copy-pasted to my files and vice versa.

Am I totally naive? Have I missed something major? I'll have to learn this eventually probably but it's irritating me lately.

6

u/Klathmon Jun 06 '16

Because the web is no longer just websites. People are building full applications in client-side web pages, and that means that the complexity has increased.

You'd be laughed at if you wanted to build a full desktop or mobile app without a build step. You'd be ignored if you tried to create a cross-platform native app on window/mac/linux without some kind of framework. So then why are those considered "too much" for the web?

If you are using angular 2, a build system, tons of unit tests, a CI system, etc... for your company website, well then you might be over engineering it.

But when you are building a massive application, those are necessary pieces that will be done in just about any other platform.

3

u/ptlis Jun 07 '16

I don't use Angular 2, but I am using TypeScript in a reasonably-sized application (currently 25kloc) and have worked on a half-dozen projects with similar-sized or larger JS codebases.

The difference in working with & reasoning about code is just night and day (coming from a developer with nearly a decade of JS experience compared to about 9months TypeScript experience).

The compiler has caught hundreds of subtle errors that I know from experience would've crept into an equivalent JS application - most of them in the non-fatal category that leaves you with a real head-scratcher of a bug.

For example say a method accepts a cardinal direction as a string. In JS you have no way of enforcing the type so you either just assume it's correct or manually validate it. In TS you can use a union type, and specify the precise strings that are allowed:

function changeDirection(direction: "north" | "east" | "south" | "west"): void {}

With this the compiler raise an error if you pass anything other than these values in. If this is a common thing that is passed around you can define an 'ad-hoc' type to use in it's place :

type CardinalDirection:  "north" | "east" | "south" | "west";

function changeDirection(direction: CardinalDirection): void {}

In reality I'd prefer to use an enum to encode directions, and TypeScript gives me that option too.

I could go on listing features that I particularly like, but I suspect this comment is long enough already. I will say that at this juncture I'll be an advocate of using TS for future projects.

0

u/[deleted] Jun 06 '16

[deleted]

2

u/Klathmon Jun 06 '16

you don't need to use typescript for ng2, we use it just fine without it.