5 ms·
I've been learning AngularJS 2 for around 2 weeks now, and I see why they push use of Typescript. They always have. AngularJS 2 was designed from the start to b
by SamUK96 10y ago
I've been learning AngularJS 2 for around 2 weeks now, and I see why they push use of Typescript. They always have. AngularJS 2 was designed from the start to be typed. To be object-orientated. At the least be object-inspired. It makes sense to be consistent. Using a non-typed and functional-structured language for a typed and object-orientated framework is pretty dumb in my eyes.
To digress a little, AngularJS 2 has been awesome, and at times can be simpler than React. The .js and .js.map file bulk with every .ts file is stupid though.
However...
Routing in AngularJS 2.
It is bad.
Very bad.
- dfsegoat 10y agoHave you tried ui-router for angularjs 2? Just curious. Routing and E2E testing are my biggest concerns for transitioning our 1.x app to Angular2 -- and I haven't had time to really dig into either in detail. https://ui-router.github.io/ng2/ https://ui-router.github.io/ng2/
- SamUK96 10y agoHmm, no, I haven't. I'm trying to learn the standard routing library for AJS2. It's very bulky and boilerplate-ish which I don't like. The amount of code and files you need for a very basic login-auth feature for a page is extremely large. I feel like, after 2 weeks, AJS2 is built for large websites for huge companies, and pointlessly complex and boilerplatey for small websites like a forum, blog, simple store/story site, etc.. I think that if you want to make hundreds of pages, AJS2 or something is your bet, but for a little thing, go with PHP 7.
- ralfn 10y agoIn your logic you equate statically typed and object oriented vs dynamically typed and functional. Object oriented programming is by origin (Smalltalk) dynamically typed. Class based programming languages (which we really shouldnt consider typical for oop) tend to borrow all their modern type features from functional programming languages. (Think polymorphism, generics, interfaces, etc.)
- spdionis 10y agoBy 'dynamically typed and functional' I think he meant javascript. Personally i wouldn't call javascript functional but...
- SamUK96 10y agoI dunno, i've talked to and seen the code of a few JS devs and they all code very function-based (i.e. little modularity, poorly refactor-able, flow is difficult to understand, <insert another consequence of functional programming>) Maybe that's just anecdotal though, since I know that JS supports some form of OOP.
- spdionis 10y agoAre you confusing functional programming with procedural programming?
- rubber_duck 10y ago>In your logic you equate statically typed and object oriented vs dynamically typed and functional. I think OP is talking about the narrower scope of Angular 2 + TS vs React + JS
- SamUK96 10y ago> In your logic you equate statically typed and object oriented vs dynamically typed and functional. Yes. JavaScript's structure is usually heavily functional and can often be non-modular. Typescript goes away from this somewhat with the construction of objects. > Object oriented programming is by origin (Smalltalk) dynamically typed. Really? Object orientation is all about forming your own types, so how could OOP have an origin in dynamic types?
- nkw 10y ago> Routing in AngularJS 2. > It is bad. I'm curious what you don't like about the Angular2 router. Since router 3.0 (agreed there were some false starts) I've found it to be a pleasure to work with.
- SamUK96 10y agoI think that there's way too much bloat/boilerplate code for the simplest of auth-based routing system. Auth service, auth-guard service, routing service, etc.. Not sure if I'm just bad though, I suppose i'll keep on trying.