5 ms·
React and its ilk doesn't even deliver on those goals. It encourages bad programming, makes terrible software practices easy and separates code so the piles of
by kristopolous 5y ago
React and its ilk doesn't even deliver on those goals. It encourages bad programming, makes terrible software practices easy and separates code so the piles of unmaintainable garbage don't smash into each other too harshly.
It doesn't actually empower anything - it acts as a scolding nanny prohibiting people from making things explode.
It does this by imposing a narrow opinion about things that's constantly changing with each release as it herds the programmer through very specific and alarmingly complicated ways of doing things.
It's fundamentally a tool of oppression, not one of expression and one of coercion and not liberation. I hate it so much.
- thunder22 5y agoWhat is your preferred alternative to react for creating a data driven web application?
- kristopolous 5y agoNormal Javascript and 10,000 hours like when mastering anything else. HTML, CSS and Javascript are already extremely high level and capable. Do some xlib programming some day if you want that to be obvious.
- LAC-Tech 5y agoA basic reactive data structure is only a few lines of JS. So user clicks something -> app state gets changed -> modify DOM in response. http://meiosis.js.org/ http://meiosis.js.org/ Here's a good description of a framework agnostic approach.
- kristopolous 5y agojs.org? That must have been a big pricetag.
- _shantaram 5y agojs.org subdomains are actually a free service run by some really nice people. As a poor student it was very nice to discover that I could have a nice domain for my project for free :p (i'll use this opportunity to plug my project, https://campfire.js.org https://campfire.js.org)
- Spivak 5y agoThis is a crazy harsh opinion to have about a templating library and the general practice of designing systems that are hard to misuse. The value of “guardrails” like type checking, borrow checking, and simple APIs is they allow you to turn your brain off when coding. I don’t write code because it’s an artistic expression of self, I write code because it’s a lowish stress job and I need to eat. In my free time I get some joy out of writing clever code but by far 99% of the code I write I want to be boring.
- kristopolous 5y agoAnd that's where we part ways. All crafts have this - the corporate musician working on commercials and tv shows that's just trying to raise a family and "The Artist" that wants a free expression of their very soul. I'm a slightly crazy person who is passionate about the liberatory potential of technology and how it reshapes society, hopefully as an empowering tool that benefits all. To quote Fred Brooks “The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination." While you are happily working within the system, doing your job competently, and enjoying the fruits of your labor. We can still be friends, but I'm going to be that wacky bird pushing the envelope, it's in my very soul and I don't think I can change that.
- kwertyoowiyop 5y agoYou’re both right. Group hug!
- Aeolun 5y agoBut do you actually have a job doing that? I want to dream as much as the next person, but I’m not being paid to dream (not to the extend you are describing anyway).
- nemothekid 5y agoI'm sorry but could you please explain? I've never heard React (or any software really) being described this way. How does React act as a scolding nanny? The language it's written in already too liberal. I can't even imagine what one could consider complicated about React (UI libraries in every language are at some level complicated). On another note, most of these complaints, IMO, aren't even specific to React. We were barreling down this future during the days of jQuery.
- kristopolous 5y agoSure, I'll take a snippet from an upcoming book of mine that I need to finish ReactJS has a wildly inflexible architecture that aggressively forces their users to conform to an orthodoxy. As an example let's say we have the following code function C() { var A = { something: () => console.log("hi") }, B = document.createElement('div'); B.onclick = () => A.something(); } This small snippet of code violates "best practices" in react and thus is almost, but not quite impossible to do. See the problem here is that B and A are directly interacting with each other. If we were to map things in react-land, they would show that C has "children" of A and B and here A and B talk to each other "horizontally" which is heretic to the purity of the orthodoxy. The hierarchical nature here is an unwavering assertion about the world. Essentially the claim is as follows: C / \ A---B The A <=> B is what forces us to wear a scarlet letter and live on the edge of the town. Therefore we no longer solve a problem. Instead, we are imposed upon us an aesthetic puritism do to a natural belief of "props down, events up". A popular way to do this basic programming technique that's been readily available in effectively every programming language since the first digital computer (Plankalkül had it in 1942) is the usual suspects either add "a new testament" to the orthodoxy, in this case with something called "redux" or figure out an acrobatic way to comply. Let's do the second. So we need to "pass down" things that will "pass up". We have a solution, now we must go backwards, first we will go into "classes" to make things more orthodox. class A { componentDidMount() { this.props.connector(this); } something() { console.log('hi'); } render() { return; } }; class B { render() { return <div onClick={ this.props.onClick }> } }; class C { constructor() { super(props); // here's our connecting function this.connector = this.connector.bind(this); this.onclick = this.onclick.bind(this); this.state = {connector: ''}; } connector(obj) { this.setState({connector: obj}); } onclick() { this.state.connector.something(); } render() { return ( <A connector={ this.connector } /> <B onClick={ this.onclick } /> ); } }; So to simplify this flow A -> B We now do C -> A -> C -> B -> C -> A Or as a diagram, we get the following: .---◢ ◣----. .▶B---▶C--. \ | ◤--'|\ ▼ / \____/ '►A-' See how we do multiple round trips passing things through C in order to maintain the hierarchy? This is how we stay within the orthodoxy If this looks like Ptolemaic astonomy, that's not a coincidence! In Ptolemaic astronomy the assumption of Earth being the center of the universe was enforced as the orthodoxy. As a result you got epicycles upon epicycles because the simpler model was forbidden. People were so committed to the more convoluted orthodoxy that anyone who questioned it was put on trial for heresy. Claiming that A -> B was even possible was the crime. The great success of React is in enforcing a new kind of authoritarianism: it enforces doctrine by explicitly disallowing heretical code.
- golergka 5y ago> piles of garbage that talentless hacks write don't smash into each other too harshly That's the entire point. Software is eating the world, and there's not enough talented engineers. We can't just wish thousands more talented engineers into existence, so instead we have to come up with tools that will make people that only have 3 months of coding school under their belt and money as their only motivation reasonably productive. If you're a god engineer, you have experience of working around constraints. That's just another one.
- edgyquant 5y agoOh yes, React is the language of “talentless hacks.” This elitism is gross and wrong and you should rethink your outlook on the world if you believe this.
- golergka 5y agoElitism? I consider myself to be one of them.
- nnoitra 5y agoThis is not true. It's not that React was specifically designed so that incompetent programmers can create apps. It's that with any good framework or technology people will always flock to the popular one. This is the exact same reason why Java is bashed and Linus prefers C programmers. An excellent programmer will write excellent code using React, in Java or in C++. It's not about the tool, it's about the one wielding it.
- cjonas 5y agoIt's hard to believe that you have serious experience in react. Or maybe you've just never seen it down correctly... I have the exact opposite take. Before react I hated UI programming so much. But the way react deals with state makes it so much easier to build and maintain complex applications. All you have to do is define how your application responds to any given state and provide explicit controls for asking to update that state. If you do that correctly, your application will be predicable and easy to reason about. The biggest challenge is it's just not the normal imperative programming model that most devs are used to. It takes time and understand to do correctly, but what doesn't?
- reboog711 5y ago> But the way react deals with state makes it so much easier to build and maintain complex applications. Real question; not being snippy... I didn't think React had any state management included. A lot of people I've spoken to seem to use Redux, a third party library for handling state. Is my understanding incorrect?
- cjonas 5y agoReacts out of the box "useState" along side the unidirectional data flow acts as a lightweight, yet very powerful form of state management. Redux takes that to the next level but is based on similar principles of "reactive" programming. For complex state heavy applications it's extremely powerful, but often overkill for many smaller applications.
- acemarke 5y agoHi, I'm a Redux maintainer. React has always had "state management" built in in the form of component state: `this.setState` in class components, and `useState/useReducer` in function components. Those work just fine. However, that _is_ limited in that you can only access state inside the current component, or pass it down the tree as props/context. If you need to access data broadly across the component tree, or the data itself does not lend itself to a tree-shaped usage pattern, or you need to minimize the number of components that re-render when you update, or you need to use it _outside_ the component tree, then you may want to look at an external state management library. I've talked about the tradeoffs in these approaches numerous times: https://blog.isquaredsoftware.com/2021/01/context-redux-differences/ https://blog.isquaredsoftware.com/2021/01/context-redux-diff... https://changelog.com/posts/when-and-when-not-to-reach-for-redux https://changelog.com/posts/when-and-when-not-to-reach-for-r... https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/ https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-... All that said: React makes writing an application with any meaningful amount of complexity _vastly_ easier to do than trying to do it with either preceding UI frameworks (AngularJS 1.x, Backbone, etc) or jQuery. It isn't perfect, but it's well-suited for a wide range of application development use cases.
- resonious 5y agoFrom your other comments you yourself admit that this is a fringe opinion, and I respect that a lot. I think one thing that would help strengthen your stance would be a plausible explanation for why people seem to actually like React and friends so much. Maybe your experience is different, but I'm often seeing people want to use React or Vue and lament the times they're stuck with JQuery or something more "old-school".