News for hackers. Stuff that matters.
Re:Angular v8.0 by sheeshkebab on Wednesday May 29, 2019 @08:36AM (#20039345)
Angular feels like frontend framework built by backend java Spring developers, that hate frontend development.
Re:Angular v8.0 by stupidcar on Wednesday May 29, 2019 @09:29AM (#20039885)
This feels like an argument made by somebody who has never built a serious project in either, and has instead formed an opinion based on quick glance at the respective syntaxes.

To me, Angular is what HTML and the DOM would look like if they had been designed from the beginning for application development:

- Custom elements backed by controller classes. - Data-binding and event-binding syntax baked into HTML - Component style encapsulation, on by default.

React seems far more like a project created by people who dislike front-end development: As I recall the genesis of the project was to replace traditional DOM mutation with a more PHP-esque approach of updating state and re-rendering everything, just as you would do on the back-end.

Re:Angular v8.0 by shadowmint on Wednesday May 29, 2019 @09:41AM (#20040000)
Why does having a different opinion to you mean someone has no idea what they’re talking about, or has never used a thing “seriously“?

I used to love angular, then I got a job which was a “| async” dumpster fire and spent a year watching a team of smart c# developers wallow in a mire of disaster so bad it became a two week regression to change a text field on a form. So full of amazing functional statement no one, even the original authors, could touch it without breaking something in the process.

so.

Your milage may vary. I no longer particularly like angular, personally, because I find it a chore to herd inexperienced FactoryInjectorConstructorFactoryPattern angular developers into not screwing things up.

...but talented team can do well with it too, and I’ve seen people screw up react projects too.

It really is more about good practice and experience than framework, your personal preference is probably, like mine, basically irrelevant.

Re:Angular v8.0 by zdragnar on Wednesday May 29, 2019 @09:50AM (#20040113)
I've shipped products using most major FE frameworks. Those things can be had by pretty much any of them. The biggest annoyance with angular is the excessive amount of baggage and boilerplate.

Decorators aren't inheritable or composable. Because templates are strings, you need the hacky DI and superfluous module system to avoid tag name clashes.

As for React, it is nothing like PHP. JSX is a macro for function calls that return objects; as such they are first-class data structures with all of the benefits you would expect. Yes, it is just a view layer and you need to bring more stuff in if you have a big project planned.

If angular floats your boat that's great. The last time I used it was in a team of mostly C#, Java and Python enthusiasts. Once they figured out what was es2015, what was typescript, and what was Angual, the dev experience was generally reviled. (especially once they saw some react code). I generally don't say that I won't work with a technology, but after a year with it (and having years for AngularJS/1.x, React, Ember, Vue and Backbone under my toolbelt) I am content with saying that Angular sits with Backbone at the bottom of the pile of what I would choose to use again.

Re:Angular v8.0 by hesarenu on Wednesday May 29, 2019 @12:12PM (#20041980)
React seems far more like a project created by people who dislike front-end development - that seems way off. For me react is the perfect fit for front-end development. You have syntax similar to html and logic in plain javascript. Angular is like some heavy java back end framework.
Re:Angular v8.0 by ng12 on Wednesday May 29, 2019 @02:40PM (#20043795)
> React seems far more like a project created by people who dislike front-end development

This is a really poor characterization. I started using React because I love front-end and it was exactly what I wanted front-end development to be. It solved every one of the pain-points I was experiencing with a jQuery/Backbone/Handlebars stack.

Re:Angular v8.0 by sdegutis on Wednesday May 29, 2019 @10:08AM (#20040330)
Every time I look at Angular, I remember that they use string literals for both HTML and CSS which is strongly off-putting. Especially because for HTML, it becomes another template language like Vue.js, whereas React.js is just JavaScript with a simple and predictable syntax transformation.
Re:Angular v8.0 by sixbrx on Wednesday May 29, 2019 @10:26AM (#20040556)
You see the template and css as literals in little Angular examples, but the normal case is that the literals are just names of the separate html and (s)css file names.
Re:Angular v8.0 by royjacobs on Wednesday May 29, 2019 @08:39AM (#20039375)
Apart from being verbose, why is that a bad thing? Spring is used to successfully build massive applications. You can meme about Spring's AbstractFactoryBeans all day, but in the end it does what it's supposed to do.
Re:Angular v8.0 by scotchbonnet on Wednesday May 29, 2019 @09:20AM (#20039784)
I maintain a class library that is highly depended upon in the rest of our company. I don't like to introduce dependencies at my later because of that. So things like DI are all factory patterns / builder patterns. It's explicit and has kept my object lifecycle super manageable.

It feels like the people who meme about EnterpriseFactoryFactory at times just haven't hit the right use case for it.

Re:Angular v8.0 by RhodesianHunter on Wednesday May 29, 2019 @09:37AM (#20039967)
And if they do ever hit it, having never seen a reason to use it before, they instead layer over it with poorly thought out abstractions leading to unmaintainable code that they'll probably hoist onto the next dev.
Re:Angular v8.0 by porker on Wednesday May 29, 2019 @11:15AM (#20041138)
I'd like to understand this more, as being on the fringe of popular open source projects I think I experience this. Can you expand any further with pseudocode?
Re:Angular v8.0 by p2t2p on Wednesday May 29, 2019 @08:57AM (#20039559)
Recently I had to hide a bunch of functionality for certain license type in a product. Spring + AspectJ turned it into a enjoyable experience - just add one annotation, two classes, one for aspect, another for exception mapper in rest and you can mark any class as "requires certain type of license" in one like of code now.
Re:Angular v8.0 by merb on Wednesday May 29, 2019 @09:47AM (#20040074)
the problem in angular is that it's bloated. and their components generate a load of bloat. Since basically all components have a FactoryComponent thingy, which you don't see, because it gets generated. However a bigger application can easily grow to a few mbs which is a huge no-no for javascript in the browser.
Re:Angular v8.0 by vfc1 on Wednesday May 29, 2019 @08:42AM (#20039400)
It feels familiar to Java developers, due to Typescript which is also statically typed (but much better IMHO) and due to the use of decorators and classes, which are an awesome way to describe a component.

Being familiar to a large base of existing developers is a huge feature.

Re:Angular v8.0 by azimuth11 on Wednesday May 29, 2019 @09:38AM (#20039978)
React has also been using classes for a long time (although the trend is to move away from them for performance and simplicity reasons). There is also a huge upward trend of people using TypeScript with React. Personally, after using TypeScript & Angular at work, I've preferred switching to TypeScript when using React in personal projects.

My main gripe with Angular (vs. React) has been the lack of first class support for patterns (higher order components) that have been a boon for React. It does look like Angular will have more 1st class support with Ivy[1], however, higher order components are so simple with React (and even better with TS/React).

[1]: https://blog.nrwl.io/metaprogramming-higher-order-components...

Re:Angular v8.0 by preommr on Wednesday May 29, 2019 @11:20AM (#20041196)
> React has also been using classes for a long time

And this

> (although the trend is to move away from them for performance and simplicity reasons)

Make me very frustrated because things like react became very popular for their simplicity. I read the reasoning the react team gave for hooks and I am not sure it justifies having such vastly different way of building components.

Re:Angular v8.0 by asark on Wednesday May 29, 2019 @03:10PM (#20044137)
Hooks are the biggest WTF for me in React-land, which is saying something. Classes and inheritance can lead to bad situations sometimes if you use them wrong, so we'll write our own method & property lookup table with a joke UI, then just not implement inheritance so that problem doesn't come up. I mean... what?
Re:Angular v8.0 by merb on Wednesday May 29, 2019 @09:42AM (#20040019)
> although the trend is to move away from them for performance and simplicity reasons

I do not think that react classes will go away anytime soon. you can't represent state without them.

Re:Angular v8.0 by jaquers on Wednesday May 29, 2019 @09:48AM (#20040091)
https://reactjs.org/docs/hooks-intro.html

edit: Lol apparently two React devs ears were burning at the same time.

Re:Angular v8.0 by merb on Wednesday May 29, 2019 @09:58AM (#20040223)
well 16.8 (which basically was the latest version)

also btw: https://reactjs.org/docs/hooks-faq.html#do-i-need-to-rewrite...

and I still have no idea how I only do stuff on the client in a SSR environment (stuff that i did in componentDidMount)

Re:Angular v8.0 by allover on Wednesday May 29, 2019 @11:10AM (#20041082)
> and I still have no idea how I only do stuff on the client in a SSR environment (stuff that i did in componentDidMount)

The 'useEffect' hook - it won't be executed if you use e.g. ReactDOMServer.renderToString() for SSR

    useEffect(() => {
      console.log('Client side only');
    }, []);
Codesandbox: https://codesandbox.io/s/peaceful-dew-nvw83
Re:Angular v8.0 by azimuth11 on Wednesday May 29, 2019 @02:25PM (#20043622)
While you wouldn't want to leave "console.log" in your code in production, you can use them in function components just like a classes' render methods.

A better example (from the video "React Today and Tomorrow and 90% Cleaner React With Hooks" from October[1]) is something along the lines of updating document.title = `${some} Page` or possibly calling an API.

[1]: https://www.youtube.com/watch?v=dpw9EHDh2bM

Re:Angular v8.0 by allover on Thursday May 30, 2019 @08:15AM (#20050377)
The console.log was only there to illustrate that the code in useEffect's callback is only being run on the client-side (see the codesandbox I linked to).

I think it's clear from the parent I was responding to that they have better use-cases in mind :)

Re:Angular v8.0 by jaquers on Wednesday May 29, 2019 @12:24PM (#20042142)
Btw, totally agree about classes. I still like the 'look' of them for stateful components.
Re:Angular v8.0 by pennaMan on Wednesday May 29, 2019 @09:48AM (#20040086)
Re:Angular v8.0 by vikingcaffiene on Wednesday May 29, 2019 @09:13AM (#20039715)
Honestly have you ever built anything of substance w/ it? It’s an awesome framework. You really should give it a try.
Re:Angular v8.0 by murph-almighty on Wednesday May 29, 2019 @09:44AM (#20040036)
I detested working in AngularJS but I'm loving 2+. 2+ and NgRx is also pretty nice if you're trying to add state management, although sometimes it just feels like I'm using effects as boilerplate on top of API calls.
Re:Angular v8.0 by dio123 on Wednesday May 29, 2019 @09:35AM (#20039947)
Re:Angular v8.0 by romanovcode on Wednesday May 29, 2019 @09:38AM (#20039973)
Have to be honest, had to double check if this project was not satire.

https://www.jhipster.tech/

Re:Angular v8.0 by mrec on Wednesday May 29, 2019 @09:43AM (#20040027)
The name does have a certain https://html9responsiveboilerstrapjs.com/ vibe to it, yes.
Re:Angular v8.0 by rafaelvasco on Wednesday May 29, 2019 @08:52AM (#20039502)
Front-end development is inherently chaotic right now, doesn't matter the framework. Things will get better.... I'm intrigued by Svelte.
Re:Angular v8.0 by shapiro92 on Wednesday May 29, 2019 @09:53AM (#20040152)
I took a peak at Svelte and wow this seems promising. I think its heavily inspired from WPF app building
Re:Angular v8.0 by benatkin on Wednesday May 29, 2019 @09:59AM (#20040238)
I'm not crazy about the significant filenames. Maybe I should because I like significant indentation. This might help me see where those who don't like significant indentation are coming from.

https://github.com/sveltejs/realworld/blob/master/src/routes...

Re:Angular v8.0 by benatkin on Wednesday May 29, 2019 @08:58AM (#20039570)
Front-end development is really great right now, because of React, which makes it so you can develop in one language, but unlike past attempts like GWT [1], doesn't rely on leaky abstractions.

1: http://www.gwtproject.org/overview.html

Re:Angular v8.0 by OkGoDoIt on Wednesday May 29, 2019 @09:20AM (#20039788)
Everything is a leaky abstraction at some point, the question is how much of a pain is it once you do need to dive underneath?

Personally I’ve found debugging and dealing with anything non-standard in React to quickly turn into a huge mess (but given all the praise heaped on it by other developers I know, I’m willing to concede that I might be doing it wrong).

Re:Angular v8.0 by lostjohnny on Wednesday May 29, 2019 @09:10AM (#20039683)
JSX is a different language
Re:Angular v8.0 by benatkin on Wednesday May 29, 2019 @09:14AM (#20039730)
JavaScript with JSX is a single language. The tags are a syntax extension. JSX is a very non-leaky abstraction. The tags are just function calls. https://reactjs.org/docs/introducing-jsx.html#jsx-represents...
Re:Angular v8.0 by royjacobs on Wednesday May 29, 2019 @09:25AM (#20039837)
I don't buy that argument. On the one hand you claim there's no leaky abstraction, yet your argument only works if "Javascript with JSX is a single language".

Then "C++ with inline assembler" is also a single language? What about English with quotes in Japanese?

Re:Angular v8.0 by kaoD on Wednesday May 29, 2019 @09:47AM (#20040071)
JSX is syntactic sugar for JS[0]. C++ and ASM (actually, _which_ ASM?) are different languages.

[0] https://fettblog.eu/jsx-syntactic-sugar/

Re:Angular v8.0 by royjacobs on Wednesday May 29, 2019 @10:00AM (#20040245)
Since JS is the only thing you can actually use[1] in a browser you can argue that anything that runs in the browser is syntactic sugar (and in fact, Typescript is syntactic sugar).

A less flippant analogy might be macro support in Rust. It's clearly part of Rust, but the syntax is completely different and it requires IDEs to have completely separate processing just to handle it. I wouldn't consider that to be mere syntactic sugar either.

[1] Yes, yes, wasm

Re:Angular v8.0 by kaoD on Wednesday May 29, 2019 @10:06AM (#20040318)
JS and JSX are isomorphic (in the mathematical sense) hence why JSX is considered just syntactic sugar.

JS and TS aren't isomorphic (there's no inverse morphism once you go TS->JS that can bring the resulting JS back to the original TS) hence why TS is a different language (even if a superset of and compiled to JS).

Re:Angular v8.0 by lostjohnny on Thursday May 30, 2019 @05:59AM (#20049718)
> JS and JSX are isomorphic

They are not

Or, if they are, they are in the same way of a custom XML templating language that can be translated to a specific javascript library implementation and then back to XML

In the same way, is Mustache isomorphic?

    "{{title}} spends {{calc}}"
can be translated to

    `${title} spends ${calc}`
and back to

    "{{title}} spends {{calc}}"
Re:Angular v8.0 by pier25 on Wednesday May 29, 2019 @09:48AM (#20040083)
> because of React, which makes it so you can develop in one language

You may argue that JSX is a single language, but that is irrelevant since you still need to understand HTML and CSS.

Re:Angular v8.0 by Tade0 on Wednesday May 29, 2019 @09:52AM (#20040136)
My take is that it would have been so much better had the devlopers not elected to bundle Rx.js with it.
Re:Angular v8.0 by adl on Wednesday May 29, 2019 @12:53PM (#20042518)
as a Java Spring Developer that hates frontend development (and loves Java and Spring), I found this very funny :)
Re:Angular v8.0 by romanovcode on Wednesday May 29, 2019 @09:26AM (#20039854)
Great, this is why I think Angular is amazing!