12 ms·
I've focused on backend for the last 7 years or so, so I've been kind of out of contact with the frontend world. Recently I started working on a personal projec
by alansammarone 9y ago
I've focused on backend for the last 7 years or so, so I've been kind of out of contact with the frontend world. Recently I started working on a personal project, and I thought it would be a good time to learn some of the modern tools people have been using for frontend dev.
I was completely baffled by the myriad of options out there, how complex they look (note I've been working on very high performance, distributed backend applications, so complexity on itself is not an issue), and how it's very unclear when to use any one of them or what each one is good for. I tried Angular and React, and both feel like almost a different language. You have to learn their internals to work effectively with them, and it often looks like they create more complexity then the original complexity they were trying to reduce. I have no problem learning new things, in fact, I love it! It just feels like there are other things to learn that will stick around for longer - JS frameworks/libraries seem to be very hype-driven these days. What are your thoughts on this?
- oulu2006 9y agoJust learn vue.js, and use the associated vue libraries, vue-router, vuex, etc. Start with: https://nuxtjs.org/ https://nuxtjs.org/ And go from there, I wouldn't waste my time with Angular, and React is much more complicated than Vue.
- clarus 9y agoThis is very subjective. I feel React is conceptually simpler (no custom templating language) and less opinionated (no official state management system like Vuex for example).
- mrout 9y agoVuex is no more tied to Vue than Redux is to React.
- shangxiao 9y agoYour response is a bit disingenuous. > no custom templating language JSX may not be a templating language but you still need to consider it when comparing with other framework's languages > less opinionated The community is though, if you don't do things with redux, react-router, etc then you're considered odd. Any job you pick up with react is sure to use those.
- mamp 9y ago> The community is though, if you don't do things with redux, react-router, etc then you're considered odd A bit disingenuous there. In general people find Redux quite complicated and it everyone acknowledges it requires quite a bit of boilerplate when used in the default way. Quite a few like MobX, or using their own state management. I've found the community to be very open to alternatives and helpful.
- debaserab2 9y agoI've used neither of those libraries in any of the production React apps I've made.
- boubiyeah 9y agoMe neither, thank god.
- oulu2006 9y agoYou've mentioned one of the exact reasons why I found Vue.js so much simpler. It's highly opinionated, which for 95% of the time, in my experience, is exactly what I want. I found myself much much more open to JS library fatigue with React; the ecosystem is so vast that it's hard to figure out which particular store I need, or which routing library I want or what form library I need and so on. I've seen a number of people complain about this, especially new comers. I find the opinionated nature of Vue.js so refreshing, especially for newcomers, which the OP is, hence why Vue.js is a much better option to begin with. And continue with, but that's a decision I guess the OP can make further down the road.
- debaserab2 9y agoYou don't need a route library. You don't need a form library. What do you need a routing library for? Have a single controller component (usually the most outer shell app component) and sprinkle in further functionality (e.g. history pushState) as necessary. Don't build it out until you actually need it. I've never needed a "form library" because forms are almost always interactive in some specific way. Using a form library is almost always guaranteed to just get in the way. You don't need to have a global state management library either if you have a good grasp of your apps data structures and how they need to be passed into components. I find with React I get the opposite of javascript fatigue: it's so easy to build anything you need once you understand react that you won't need to search for all those libraries and code snippets.
- oulu2006 9y agoI guess we have completely different approaches to software development. I really hate reinventing the wheel, especially when good quality production tested solutions are out there. React libraries, quality wise, I've found hit or miss. I find Vuex a very nice global store and the tooling (chrome plugin etc..) is top-notch.
- debaserab2 9y agoYou won't be reinventing the wheel for things like global state management and javascript routers. I promise. These libraries are huge solutions to problems that may or may not be huge - and in most of the cases I've seen, YAGNI. The concept of maintaining application state is nothing specific to SPA's. What is new is the idea that every application must have a global data store where all state is saved. This is a trend and not always necessarily a best practice. This isn't a matter of reinventing the wheel, it's a matter of using an oversized solution for an undersized problem.
- raphinou 9y agoDid I miss something or there's no explanation of what nuxtjs is on their website?
- ycmbntrthrwaway 9y agohttps://nuxtjs.org/guide https://nuxtjs.org/guide
- christilut 9y agoDon't start with nuxt. Start with the Vuejs tutorial on their website. Vuejs docs are amazing and one the big reasons why people enjoy starting Vue. Nuxt docs are so-so and can be quite confusing.
- noir_lord 9y agoAgree with this. I tend not to use "quick starts" especially when using something new since you a) don't learn the internal gubbins b) are more fucked when something breaks. When I started with WebPack and TypeScript I deliberately started from an empty webpack.config.js and an empty tsconfig.js and added in stuff as I went at the end I had a decent understanding of what everything in both files actually did and they only did what I wanted. I've never found a quick start that helped me (in terms of total time) since the time spent fixing it when it breaks always exceeds the time taken from just doing it manually the first time, after I understand what I'm doing then I'll consider the quick starts.
- musashizak 9y agoPoi is a good webpack wrapper for vue. Is a webpack with zero config
- oulu2006 9y agoI guess I should have been more specific here, my bad. Reading the Vue.js docs online is of course the first port of call; the documentation is very good, so much better than Reacts. One of the few occasions I've been able to learn a good majority of the project without resorting to googling for tutorials and other community contributed resources. I recommended Nuxt as a good "this is how you put a enterprise ready Vue.js project together" so the OP would learn some good habits in project layout early on.
- computerex 9y agoI tried to like VueJs but just couldn't. Seems just like another Angular 1.x like framework. I am done with HTML template API's. So many failed attempts using this concept. Anyone remember Polymer? That's what I thought.
- scottmf 9y agoNuxt is the Vue version of Next, which I highly recommend for quickly bootstrapping a production-ready React app with server-side rendering and so on.
- wolco 9y agoFor me I picked up React pretty quickly but I was using old school includes in the browser with the babel compiler. I tried moving to a newer version and start using with npm and webpack and I got a little lost. Started using the php framework laravel it has a mix package build in that makes everything very simple. My advice for backend developers is to use either the laravel framework or standalone npm laravel's mix package. With a simple command preseyts for vue, react, bootstrap come out of the box to allow you to focus on writing code vs setting up webpack or gulp or grunt and managing that yourself
- jbergens 9y agoThere is nwb and create-react-app that takes care of initial configuration now. Unless you're gonna write everything from scratch you're gonna need to learn npm though.
- zebra9978 9y agohi, im helping build a fairly vanilla ecommerce site in either reactjs/vue. I want it to be entirely server-side rendered with high SEO visibility. However.. (and this is the big point), have the same APIs exposed for mobile apps as well. How do I do this ? Any templates to explore this pattern ? It is fairly straightforward to do this in rails, but in the world of react/vue, it seems that the whole community is geared towards rich client-side applications with low SEO.
- jbergens 9y agoThere are many examles, like next.js. Or search for isomorphic or universal js.
- davedx 9y agoYeah, there is a lot of (developer driven) hype around new tools. I see it as both negative (hard to keep up, confuses those new to JS) and positive (lots of innovation and people trying many ways to solve things). If you want to learn a front end framework, pick one that's got a lot of community support (Angular, React, maybe Ember or Vue) and focus on it. Don't get distracted. Even when things change, it'll be good for a long while.
- pkstn 9y agoTry RE:DOM: https://redom.js.org https://redom.js.org ;)
- onion2k 9y agoI feel the same way about backend development. I stick to express.js because I know it, but I'm aware of at least a dozen other Node frameworks, and hundreds for other languages. Frontend is far from unique in growing in complexity as the web has changed.
- wruza 9y agoAs a desktop developer, I rarely ever touched backends. Though they are not "modern js", it was close enough to that madness to stay away from it. Otoh, I can't remember a time when I couldn't easily grasp any of Qt, Gtk, whateverTk toolkits in few hours. A month ago we started a project with a custom backend (on me) and had to choose a frontend option for our frontend-employee to use. It feels like hell, really. We picked Angular2 randomly after few probes and it seems that out project has more quirks, hacks and LoC than if we just coded it in pure js with heavy templating help from e.g. perl backend. I don't know where it all goes about the web. Before, when I heard about new cool js framework, I thought "well, guys do The Technology". Now that I'm forced to dive into it, I see that they just reinvent square wheels in a wrong ways that were polished a decades ago in regular desktop apps. Not to blame or insult good frontend people here and everywhere, but it feels like en masse they don't understand the programming essence at all. Sorry, but UI development was never HARDER than today. My colleague feels the same, having more than 15 years of html/css/js experience. My thoughts are we're throwing it out next week and generate all ui with decent server-side scripts, leaving /js/util.js of 1kloc as a broker and generic table sorter.
- deleted 9y ago[deleted]
- sbergot 9y agoI hate to be that guy but you are confusing simplicity and familiarity. > I can't remember a time when I couldn't easily grasp any of Qt, Gtk, whateverTk toolkits in few hours When I tried those things, I had a hard time making an hello world app in two hours because of dependency/build/tooling issues. However I was able to grasp angular 2 in two hours probably because I am more familiar with the frontend ecosystem. It would be like saying that because you knew english & german and was able to quickly learn swedish, you should be able to learn russian easily. > Not to blame or insult good frontend people here and everywhere, but it feels like en masse they don't understand the programming essence at all. Sorry, but UI development was never HARDER than today. My colleague feels the same, having more than 15 years of html/css/js experience. 15 years ago the js applications were nowhere as complex as they are today. So obviously things are a bit more difficult IF you want a rich application. If you just want to make a simple document you don't need all those librairies. > We picked Angular2 randomly after few probes and it seems that out project has more quirks, hacks and LoC than if we just coded it in pure js with heavy templating help from e.g. perl backend This is your first project with a very unfamiliar tech. This was an expected outcome. > My thoughts are we're throwing it out next week and generate all ui with decent server-side scripts, leaving /js/util.js of 1kloc as a broker and generic table sorter. And that's a perfectly reasonable option, especially if you don't have someone with more experience in frontend tech to keep things sane.
- snarfy 9y agoThe only thing that really sticks are the fundamentals like algorithms and design patterns. The tools always change. If you want to be a stronger developer down the road focus on the fundamentals. JS may seem hype driven because it is very active. I think you're right that it is hype driven as well simply due to human nature. We all fall for it on the rest of the internet. We fall for it when working with frameworks too. I mean, how many of us didn't really read the React license before building an app with it?
- hasenj 9y agoI've been doing frontend for several years and largely agree with what you're saying. It's not just frontend though; the entirety of all ecosystems springing around dynamic languages seem to suffer the same phenomenon.
- siddhant 9y agoI actually blogged about exactly this topic last year. As a backend developer (and a new entrant to the JS world), the one thing I was looking for from a JS framework was that it should scale with my application. And somehow none of the frameworks do well on that metric, except VueJS. Here's the post if you're interested -https://sgoel.org/posts/non-technical-reasons-why-i-like-vue/ https://sgoel.org/posts/non-technical-reasons-why-i-like-vue...
- fiatjaf 9y agoReact can do it, and any other virtual-dom framework. Your problem is that you're looking for a framework, but these are just libraries.
- siddhant 9y agoActually I'm just looking to get things done. I'm pretty sure React can do all those things and much more. But speaking as a backend dev, getting to a state where I can write useful code was faster with Vue than with React.
- spankalee 9y agoThis is why Web Components are so important. It's great to have so much innovation, but when each innovation is incompatible with the next it makes it very difficult to actually use the better things. You can't incrementally adopt them, you have to port an entire application. This in turn makes it harder for new entrants to get adoption, even if they're better in some ways, because they need to reach a critical mass before many people are willing to put in the effort to, and accept the risk of, porting a whole app. If we establish the base component layer and interop with the platform and other components - which Web Components does - then people can innovate on the internals of components, things like how and when DOM is updated. This is mostly what's being focused on anyway, the component models themselves are usually pretty comparable. Not to mention that Shadow DOM is incredible and just fixes CSS. If Firefox finishes up their Web Components implementation soon, we'll be at 3/4 major browsers with native Web Components support. I think more people will take them as a given for basing their UI libraries on.
- ausjke 9y agoI did look into web components and google polymer, great idea, still somehow not gaining much traction as they should.
- spankalee 9y agoI work on Polymer, and I think we're well on the way to fixing that. Our uptake with large enterprises is quite good already, we're just not very popular with the HN crowd... yet. Our annual summit starts Tuesday, and the talks are live-streamed, check them out for some updates: https://summit.polymer-project.org/schedule https://summit.polymer-project.org/schedule
- ausjke 9y agoThanks. Looking forward to the live stream.
- mbrumlow 9y agoI tried to push polymer at my work (I use it for personal projects). The problem I came into is I am a backend guy trying to convince that polymer and web components are the only sane way that I have ever seen to do web dev. To many people were set it their own ways had just flat out did not want to learn something new. They could not put down react and redux for two seconds. Admittedly I am not a front end developer, but when I did get some to have conversations many of them went like this -- How do you do xyz in polymer / web components -- Umm seems to be a concept your framework had to create at a work around, that is not something you will need to worry about any more. So what did we end up with? Some use react, some use ZK!?!, some just stick with straight up html/css/js -- oh and we have some angular too, but that fell apart because the guy doing it tried to do some weird shit with making some sort of tight integration with zk... Side rant, if I have somebody send me that video about how react just had to be created to fix unread notification count at facebook one more time... Webdev is a mess in my opinion and coming from the backend / systems side of things polymer / web components is the only thing that looks sane to me. Beyond what the component looks like I think a push in this direction will hopefully remove the requirement for a "web developer" vs just another developer who can work on any part of the project.
- chuckdries 9y agoThey are super hype driven, now let me hype you for my personal fav. Vue is the most similar to vanilla JS that I've used so far. It stays out of your way and works like you expect it to. I like that it only handles the render layer. It says to you "Give me a template and give me data. The data is up to you, I'll handle keeping the template up to date." I'd love to use webcomponents but they're not going to totally replace these toolkits and right now the polyfill you need is atrociously slow.
- spankalee 9y ago> polyfill you need is atrociously slow The polyfills haven't been slow since Polymer 0.8/1.0 when we switched away from the "full" Shadow DOM polyfill and to the much lighter-weight ShadyDOM shim (which trades a little spec compliance that Polymer hides, for speed). Polymer demos, like for HNPWA, are consistently among the fastest, even beating the speed-focused React clones.
- deleted 9y ago[deleted]
- lopatin 9y agoI keep reiterating this point, but people keep calling React complex, it's not. React is raw simplicity. As far as I'm aware it's the most minimal API for creating sufficiently complex UIs. It's so minimal that it's hard to build full apps in because it says "not my problem" to questions such as routing, global state management, you name it. And that's fair. I still maintain that it's a tool for pros. But the responsibility that it does take on, I believe it does so in the most simple way possible. And you don't need to be aware of React internals to use it effectively. The details of the component lifecycle are not internals, but part of the public API.
- look_lookatme 9y agoIt's easy to say React is simple if you are looking at, say, a barebones create-react-app. But most production React apps I have worked on (I work at an consultancy) seem to accrete complexity faster than functionality. I used to chalk this up to me not "getting it". Now I think it has more to do with the desire to incorporate newness into React apps. Stuff like ripping out routers to replace with another router but then the old router was rewritten so lets replace it with that one again. That kind of stuff happens, and even it is preferable to someone deciding to incorporate something like [shudder] styled-components half way through a project. This kind of stuff almost always incorporates new abstractions that will increase surface complexity. In the interest of avoiding a rant, I won't start with people monkeying with context or not understanding the effects of setState. React should be judged by the quality of it's ecosystem and extant production code, and I would argue that if you survey these things often you will find plenty of unnecessary complexity.
- cloverich 9y agoI have to agree w/ lopatin overall: React is a tool for professionals. And I think it addresses your arguments very well. Being open source and powerful, its reached for by people left and right who do not (yet) understand how to architect well constructed applications. And the results are predictable: Needless complexity, bloated apps, bad ui. Personally, I don't read any more into it than that.
- 9y ago
- jaredklewis 9y ago> I was completely baffled by the myriad of options out there, how complex they look (note I've been working on very high performance, distributed backend applications, so complexity on itself is not an issue), and how it's very unclear when to use any one of them or what each one is good for. I tried Angular and React, and both feel like almost a different language. You have to learn their internals to work effectively with them, and it often looks like they create more complexity then the original complexity they were trying to reduce. I have no problem learning new things, in fact, I love it! It just feels like there are other things to learn that will stick around for longer - JS frameworks/libraries seem to be very hype-driven these days. What are your thoughts on this? I hear this sentiment a lot, but it always irks me. There seems to a general feeling amongst programmers new to front-end development that the current popular libraries have been over engineered and that the constant changes are driven by more by hype than actual need. From my view, the complexity in these libraries is mostly a reflection of the complexity of the underlying platform. Browsers and their JS engines are now monstrously complex and implement a horrifying number of web standards. When compared with browsers, something like the C++ compiler or the JVM suddenly looks childishly simple (and I'm not saying those things are simple). For example, it may not be apparent at first why something like React is a good idea, because it takes some knowledge of the performance characteristics of browser rendering to understand that. As for the churn, the libraries have been changing because the world has been changing. Back in the day, HTML was rendered server side and people used jQuery with little snippets of JS to modify small sections of the DOM. It only made sense to do that. But JS engines started to get really fast. Browsers finally started to use the DOM standards. People started working on solutions for all of JS's many warts, like not having any sort of module system and there being no good solution for package management. All these things came together in just a handful of years and suddenly it was possible to do actually cool stuff in browsers. Writing a browser based photoshop or itunes was no longer just the domain of tech giants like Google. When the world is literally turned upside down, that does shake things around a bit. So, if you are coming to web development from the backend, I don't think there is an easy path. The platform is complex. And just the idea of writing single page applications is only about 7 years old. That the first handful of years were somewhat chaotic is not surprising. But that aside, I would recommend to start with React and Redux.
- vmware513 9y agoIf you are looking for a matured and easy to use solution, which follows convention over configuration pattern, so it helps to be the job done, I would highly recommend Ember.js Especially useful for us who come from backend world, so many concept will be familiar. You can learn the whole framework in a few days from www.yoember.com or from www.emberjs.com Especially the toolset and addon ecosystem will suprise you, so easy and fast. You will love it.
- vmware513 9y agohttp://ember.js.com http://ember.js.com http://yoember.com http://yoember.com
- keymone 9y agoi feel like i would've had similar feelings had i not learned (and pretty much fell in love with) clojure some years ago. now whether it's backend or frontend or even seamless code sharing between both - i am totally covered. react wrappers in clojure get unreal synergies with language design choices (immutable by default, convenient nested data structure manipulation, etc), things like this one - http://maksm.net/crypto-calculator/ http://maksm.net/crypto-calculator/ is 100 lines of code including html templates. obviously this all means having to learn another language but i dont need to touch js ever again and i'll take that trade any day.
- fnordsensei 9y agoWhere can I find the source code for the above?
- keymone 9y agodidn't have it published anywhere yet but there you go: https://github.com/keymone/cryptick/blob/master/src/cryptick/core.cljs https://github.com/keymone/cryptick/blob/master/src/cryptick... it's a hacky little thing i threw together in couple hours so don't expect any best practices or idiomatic clojure[script]
- psteeleidem 9y agoWeb components do not have a great story about passing complex data. If you want to pass typed data (not just strings) then declarative HTML suffers since HTML parses all attribute values as strings. You can use JavaScript properties to provide typed data to Web component custom elements, but properties cannot be provided declaratively in HTML and now you have two ways of providing data. With that said, I think there is value in building UI components in Marko and offering web component custom elements as one option for embedding your Marko-based UI component into a page (using a small UI bridge layer... something that we plan on open sourcing). --Marko author
- vborovikov 9y agoTake a look at IntercoolerJS. It's just a simple library, not a framework. I found it as the easiest way to deal with modern frontend programming. http://intercoolerjs.org/ http://intercoolerjs.org/