5 ms·
Honestly, when I read this kind of thing, I have absolutely no idea what would compel someone to throw away the MVC framework of their choice to logarithmically
by peteforde 8y ago
Honestly, when I read this kind of thing, I have absolutely no idea what would compel someone to throw away the MVC framework of their choice to logarithmically ramp up the complexity of their apps. Most things that people build don't need anything like this. It is of great concern that code bootcamps are now teaching JS frameworks as the default expectation.
I guess it'll be more project work for those who get brought in to bail these projects out.
- TekMol 8y agoMost things that people build don't need anything like this. True. It would be great to show examples of websites that benefit from the complexity of an extra library to handle client side state. I would think less then 1% do. For example, lets look at how HN handles state syncing. Function "toggle" in this file handles collapsing/expanding threads: https://news.ycombinator.com/hn.js https://news.ycombinator.com/hn.js function toggle (ev, id) { var on = !afind($(id), collapsed()); (on ? addClass : remClass)($(id), 'coll'); recoll(); if ($('logout')) { new Image().src = 'collapse?id=' + id + (on ? '' : '&un=true'); } ev.stopPropagation(); return false; } How would the react+redux approach look like? Is it really worth it?
- k_ 8y agoReact+redux (or just react) doesn't add much to websites. Maybe Vue.js would be a better fit when some complexity is needed in a website. I see React as a tool for building web applications, not websites. Using it for something like hacker news is not needed nor worth it, except for learning purposes or for the sake of using your favorite tech (which has its pros and cons). Edit: I use React a lot, and really like it. It's just not the perfect tool for everything, and by no means a necessary one (at least when you don't have much complexity); even if it is a good one in many cases. In the case of HN, seeing the current js [1] I find it pretty obvious that no "big tool" like React is necessary. It doesn't mean using React for a HN clone is a bad thing, one just don't have to. [1]: https://news.ycombinator.com/item?id=17915560&goto=news https://news.ycombinator.com/item?id=17915560&goto=news
- TekMol 8y agoIn my book, "website" and "web application" are equivalent. How do you define those terms?
- devilshaircut 8y agoImo, not all websites are web apps. You can certainly still create a static website using just HTML. The term "app" to me implies functionality beyond the presentational.
- k_ 8y agoI don't define them precisely either. I'll borrow an answer from stack overflow [1]: This is totally personal and subjective, but I'd say that a website is defined by its content, while a web application is defined by its interaction with the user. That is, a website can plausibly consist of a static content repository that's dealt out to all visitors, while a web application depends on interaction and requires programmatic user input and data processing. For example, a news site would be a "website", but a spreadsheet or a collaborative calendar would be web "applications". The news site shows essentially the same information to all visitors, while the calendar processes individual data. Practically, most websites with quickly changing content will also rely on a sophisticated programmatic (and/or database) backend, but at least in principle they're only defined by their output. The web application on the other hand is essentially a program that runs remotely, and it depends fundamentally on a processing and a data storage backend. [1]: https://stackoverflow.com/a/8694944/7510753 https://stackoverflow.com/a/8694944/7510753
- mattmanser 8y agoMost web applications don't need a JS framework either, so the distinction's actually worthless.
- eropple 8y agoWeb applications have interactive functionality as their focus. Websites have the consumption of what a human, and not an HTML parser, would call a "document": video, text, and images. They may not be statically served, but their code exists to facilitate the serving of what are recognizably documents. Wordpress's backend is a web application. That web application exists to drive the website that is its frontend. Not really a controversial standpoint, I don't think, except amongst the hyper-literal who but-for about comment features (hence the use of "focus" above).
- jahewson 8y agoThat’s easy, it’s <Thread/> plus a bunch of code that I’ve omitted :p
- eithed 8y agoJS can follow MVC / OO model. Simply most people don't try to do it and go with functional approach; add to this simplicity JS can be diven into, and you get the results we get where people cry that JS (jQuery) gives unmaintainable code. Reactive libraries try to address the issue by forcing you to create OO components and (to a degree) MVC patterns.
- skrebbel 8y agoI head to re-read your comment 5 times before I understood that by "MVC framework" you mean "thing that renders HTML on the server". Admittedly it's a bit of a beef of mine, but most React apps are very MVC. I even blogged about it a while ago: https://blog.talkjs.com/how-react-brought-model-view-controller-back-to-the-masses-4f3caf3a3f2f https://blog.talkjs.com/how-react-brought-model-view-control...
- js_question 8y agoI am an EE doing some web development on the side. Since a few weeks ago, my stack was mostly Flask (backend) + JQuery (frontend). My web apps were always light on the front end. Then I wanted to experiment with React. So far, I really like the declarative component design but don't like the Single Page App approach. Is there a way to render components on the server for each page individually without having to set up a new react project/web pack build step for each page?
- testb 8y agoThe search term you want is 'react ssr' or 'react server side rendering'
- js_question 8y agoFollowup question. Does it actually make sense to use React and render it server side only to get declarative component design? I can totally see the use case for React for web apps which provide a lot of user interaction on the frontend. But for all other web apps it doesn't seem to make sense as you also have to handle quite a few disadvantages (e.g. SEO unfriendly, user can't copy URL and send to a friend) Am I missing something?
- ohhellno 8y agoNext will manage your URLs and all the SSR does is generate static files for each page with the base data and loader so future requests grab static JSON versions of the pages. There is no need for it to be rendered in the server. You could do it locally and push the resulting files up. URLs will work as you expect them to.
- pjmlp 8y agoMe neither, Java and .NET MVC frameworks forever! :)