News for hackers. Stuff that matters.
Re:Web Programming Is Getting Unnecessarily Complicated by pavlov on Monday July 18, 2016 @09:20PM (#12118951)
I do that. Web dev is not my main focus, but I have to deal with it all the time. I try to attack the problems with an initial prototype that's a combination of plain HTML+JS and Node.js. Instead of a database, I tend to reuse a simple Javascript class I wrote a couple of years back that provides a minimalist layer of persistence for collections using an append-only file. (It's really just a single file I copy to any new projects when it's time to store something.)

Over 90% of the time that prototype turns out to be good enough, either because the problem is abandoned or remains at a level where a rewrite isn't worth it.

So far I haven't regretted not investing time into learning Framework X every few years... Although I'm probably going to start deploying React instead of plain JS soon. The library is very useful for real-world UI problems, even though it's surrounded by a deafening amount of toolchain fetishism which tends to cloud React's fundamental simplicity.

(I'm 36, started writing C in 1990 and HTML in 1995, so I feel somewhat old in this industry already.)

Re:Web Programming Is Getting Unnecessarily Complicated by msane on Monday July 18, 2016 @10:43PM (#12119213)
I recommend avoiding React. I have never seen an ecosystem so bogged down at every turn. It also has a bad zealot problem, where Facebook has cleverly brought a lot of people to it who haven't seen anything else and are convinced it is the bee's knees.

> The library is very useful for (?) UI problems...

Components are good. But they didn't come from React and React isn't the only place to get them. Angular 1/2, Polymer, Ember are great in comparison. And so much more simple. React's position on simplicity is that the demos on the site are all 15 lines so that means it's simple right? You can't say it's complicated because it's 15 lines, see? It's "easy to reason about", i.e., "you're not smart if you don't get it".

Once you see the toolchain and ecosystem you will glimpse the price of those 15 lines.

> ...toolchain fetishism which tends to cloud React's fundamental simplicity

This is a very real thing. People who work in React spend way more time fixing toolchain stuff and trying to mix 10 artisanal-crafted "easy to reason about" libraries in order to accomplish tasks which are either solved or not even issues in other component frameworks.

Re:Web Programming Is Getting Unnecessarily Complicated by Silhouette on Tuesday July 19, 2016 @12:58AM (#12119798)
I recommend avoiding React. I have never seen an ecosystem so bogged down at every turn.

It's perfectly possible to just use React on its own, without getting bogged down with all the other buzzword-of-the-week stuff around it.

React itself has been reasonably stable for a long time in Web terms. It is much more tightly scoped and smaller in its interface than most JS frameworks. There are a couple of major design trade-offs, which often seem to get overlooked in React advocacy, but if you have a bit of experience using it and understand the practical pros and cons then you can quickly decide whether the balance is favourable for some new project.

People who work in React spend way more time fixing toolchain stuff and trying to mix 10 artisanal-crafted "easy to reason about" libraries in order to accomplish tasks which are either solved or not even issues in other component frameworks.

Some people who work with React might. Plenty of others don't.

Re:Web Programming Is Getting Unnecessarily Complicated by anupshinde on Tuesday July 19, 2016 @01:14AM (#12119869)
React is great. But the tooling around it tends to complicate things a lot. Just for example react-redux (not just redux).

When I first started with React, it felt awesome - just React still feels great. But I had just started then and then got introduced to redux (I had been using something similar custom built). That was good too, until I learnt react-redux. I get the concepts, I understand every bit of it and have used it correctly in many large apps - it is useful. But react-redux just feels awkward many times and I consistently feel something is wrong with it - but I don't know what. React-Redux just feels disconnected with the idea of independent web-components.

On a side note - If one is okay moving to Typescript, Angular2 is just amazing.

Re:Web Programming Is Getting Unnecessarily Complicated by Silhouette on Tuesday July 19, 2016 @01:29AM (#12119933)
I find the Redux ecosystem to be one of those areas that sounds great in theory, but that in practice has quite a narrow range where it's a good fit. If the web app's data model is simple enough, it can easily keep track of mutable state directly and just rerender everything on any relevant change with acceptable performance. If the model is complicated enough, the simple data stores provided by Redux and the like lack power and flexibility until you build a lot of other architecture around them, at which point you might well be better off building something catering to your project's exact needs anyway. I can see that there might be a happy zone somewhere in between, where building with tools like Redux and its surrounding ecosystem does pay off, but I've yet to work on such a project myself.
Re:Web Programming Is Getting Unnecessarily Complicated by jiyinyiyong on Wednesday July 20, 2016 @10:45AM (#12129377)
Would you like to try Respo https://github.com/respo-mvc/respo/wiki/Quick-Start if you hold similar options with me? I built Respo because I think React is not functional enough.
Re:Web Programming Is Getting Unnecessarily Complicated by thegayngler on Tuesday July 19, 2016 @02:51AM (#12120239)
Polymer while I used to like it more isn't better than Web Components and for me was harder to use than both React and Web Components. React offers up more than both Polymer and Web Components spec. With web components it's still just a glop of JavaScript in a file. So I don't quite see the benefit of being "closer to the metal" when you are not closer to the metal. The community simply hasn't embraced Polymer. React is easy for me to understand and I can use it today and Web Components aren't really a necessity at that point nor are they even supported in browsers yet.
Re:Web Programming Is Getting Unnecessarily Complicated by microcolonel on Tuesday July 19, 2016 @12:03AM (#12119531)
I frankly don't see how you could come to the conclusion that Angular 2 components are simpler than React components. I mean, in React, a component can be as simple as const MyComponent = () => <span> some markup nonsense </span>;
Re:Web Programming Is Getting Unnecessarily Complicated by msane on Tuesday July 19, 2016 @01:23AM (#12119900)
Yup that's the argument mentioned: React is "simpler", "anyone can see"...

Brevity isn't simplicity. The simplicity is being easier to install, build, read about, debug, consume APIs with, send data between, talk about to other developers... and yes, "reason" about.

    myMod.component('Foo', {
      template: '<h1>{{$and.better.templating}} {{see()}}</h1>',
      controller: function() {
        var and = {this_one: 'does_stuff'};
      }
    });
Re:Web Programming Is Getting Unnecessarily Complicated by thegayngler on Tuesday July 19, 2016 @02:31AM (#12120181)
This is not easier to reason about than returning jsx IMO... It's only 1 of the ways to build an angular 2 component. The website tutorial is using decorator syntax. Typescript Angular 2 documentation. What's wrong with just learning JavaScript and less Angular specific syntax and tooling.

Maybe I'm wrong but I feel like Angular likes to force projects to become big monoliths where people who don't understand the problem being solved are trying to architect a solution for all of the problems.

React does have jsx shock and JavaScript tooling fatigue. However, now that React is mature JavaScript tooling decision fatigue should be less of an issue. You aren't relying on one company to solve problems. You have a community solving problems for themselves. As they need it they can add it or take it away.

Re:Web Programming Is Getting Unnecessarily Complicated by warfangle on Tuesday July 19, 2016 @07:07AM (#12121021)
Why aren't you just using an interpolated string?
Re:Web Programming Is Getting Unnecessarily Complicated by grumblestumble on Tuesday July 19, 2016 @04:43PM (#12124744)
"Over 90% of the time that prototype turns out to be good enough, either because the problem is abandoned or remains at a level where a rewrite isn't worth it."

You might want to spend some introspection time on that statement.

Re:Web Programming Is Getting Unnecessarily Complicated by pavlov on Tuesday July 19, 2016 @07:33PM (#12125746)
What do you mean by that?
Re:Web Programming Is Getting Unnecessarily Complicated by rco8786 on Monday July 18, 2016 @11:43PM (#12119433)
I hope your not pushing that to any meaningful production environment
Re:Web Programming Is Getting Unnecessarily Complicated by JustSomeNobody on Tuesday July 19, 2016 @08:18AM (#12121266)
Why?

Define "meaningful".