Re:Improving Angular performance with 1 line of code
by blinkingled on Tuesday May 03, 2016 @10:00PM
(#11625656)
This is a case of bad defaults - why should a developer be required to write code, even if it is a one liner, to _disable_ debug? It should be the other way around - you write a single liner to enable debug.
[ Parent
| on HN ]
Re:Improving Angular performance with 1 line of code
by BinaryIdiot on Tuesday May 03, 2016 @11:29PM
(#11625966)
Correct. Debug options should never be a default. They should be enabled explicitly through the act of debugging (perhaps a flag somewhere in your web app, etc). I'm guessing it is the way it is for simplicity so someone can debug without trying to figure any of this out.
Re:Improving Angular performance with 1 line of code
by kylemuir on Wednesday May 04, 2016 @12:29AM
(#11626199)
That particular flag wasn't released until version 1.3 so by opting in rather than out it wasn't released as a breaking change.
When it was released and we tried to use it, it broke our site entirely due to third-party libraries we were using.
Re:Improving Angular performance with 1 line of code
by hinkley on Wednesday May 04, 2016 @12:24AM
(#11626172)
It should be on for test and dev builds, and off for production.
Re:Improving Angular performance with 1 line of code
by megablast on Thursday May 05, 2016 @01:55AM
(#11634249)
Just another reason to hate angular.
Re:Improving Angular performance with 1 line of code
by __derek__ on Thursday May 05, 2016 @02:29PM
(#11638600)
That's not just Angular. From the React README[1]:
> Note: by default, React will be in development mode. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages.
> To use React in production mode, set the environment variable NODE_ENV to production. A minifier that performs dead-code elimination such as UglifyJS is recommended to completely remove the extra code present in development mode.