News for hackers. Stuff that matters.
Re:Angular 2 is terrible by candiodari on Thursday December 01, 2016 @09:55PM (#13085603)
It's far worse than this article points out. Far, far worse.

Just made a basic master-detail form example (the heroes example) in angularJS 2. The directory size that it serves from : 346 megabyte. Now that is not actually sent to the browser. In "production" mode, 28kb is sent to the browser, for a total . After everything is sent, nothing's on screen (single page web app and all that). According to my browser, it takes 3.5 seconds from first request to everything done, 0.5 seconds until "DOMContentLoaded", at which point nothing's on screen. Seconds, not hundreds of a second. I am convinced I can make PHP without AJAX perform better than this. 116 different network requests, 4 at a time.

For true "oh my fucking god what the hell" effect, see the list of necessary files here : http://plnkr.co/edit/?p=preview (link is the official demo taken from angular.io). This is everything you need to write to get 2 forms and a frontpage working, not a single compiled or temp file.

Again: This is 2 forms, one of which is master-detail.

I repeat : this is the code for 2 forms. One of which has 2 edit boxes, the other has (what is effectively) a listbox. And there's a title page.

I still don't believe it, so I'm just going to repeat it again: this is the code for 2 forms. Nothing more. Nothing the least bit complicated.

Yes my graph editor component in Delphi and all of the app code around it was less code (granted, just barely). That had dozens of forms. Load/save, binary encoding for the file, ... and even code to synchronize with another instance of the app using command pattern (sort of like google docs, except 5 years before google docs).

Did the same tutorial, just for kicks, in Delphi 7, completed it in less than a twentieth of the time I'd need to just type all the code that needs typing in javascript, got it right the first time (while I wasn't able to get the javascript right the fourth time when typing it over character-by-character from the tutorial). Total size, including compiled app, 200kb. The app itself (while dependant on Delphi runtime dll), 4 kb. With static linking 116 kb. The angular site takes >800ms to load from localhost, not counting the delay before it starts displaying (it's a single page app, nothing is on the screen when the long list of network requests finally completes). The Delphi app loads in 4ms, and I'm pretty sure the display is updated just a few ms after that. And before you ask, yes, the Delphi app does in fact support client-server.

The feedback cycle in the Delphi app is measured in milliseconds (change code to view effects of running code, or from fixed code to "test has run and confirmed code is indeed fixed"). The turnaround in angularjs 2, and this is considered fast in web land, on my quad xeon, is just over 6s, and increased depressingly fast when adding stuff. Delphi has full 2 way synch (meaning forms are constructed using code, changing the code will change the editable preview, changing the preview will change the code), angularjs doesn't just not have double syncing, it doesn't even have a preview at all, not even read only.

Debugging in Delphi is perfect. Everything about it just works. Inspect data, change it, change the code and resume, ... all of it just works. In angularjs I cannot even see the bloody data at all. You can see the "compiled" javascript version, with mangled data.

The tutorial on how to do this in angularjs is about the size of packt publishing "intro to" book (those thin ones). The tutorial on how to do it in Delphi comfortably fits on one page with a large font, with a nice big box around the one piece of code you need.

It's not even angular, not really. It's the whole web platform that's causing this utter stupidity. But yeah, angular is making it a lot worse. Skip. Do not want. GTFO.

https://en.wikipedia.org/wiki/Worse_is_better

Re:Angular 2 is terrible by throwayawnotime on Friday December 02, 2016 @06:34AM (#13087793)
Word!