5 ms·
I really like React. I write a lot of it. But I was introducing my gf to react and had her read the documentation, cause that’s how I learned. First, it’s reall
by hardwaregeek 4y ago
I really like React. I write a lot of it. But I was introducing my gf to react and had her read the documentation, cause that’s how I learned. First, it’s really easy to ignore the beta docs and end up learning class components. She wasn’t happy when I explained to her that what she had just learned is pretty out of date and not at all what the ecosystem uses. Second, there’s no simple explanation of forms! Oh sure it’s buried in the long intro tutorial but I’d love a one page tutorial on forms in react.
Also linting rules got way out of hand. Like a bunch of devs in the mid 10’s really decided to make linting the most annoying bunch of nitpicks around const, parameter naming, and other stuff that has no value. There’s a lint rule about naming the error parameter in catch “error”, not “err” or “e”. Who cares about this shit???
- hanniabu 4y ago> First, it’s really easy to ignore the beta docs and end up learning class components. She wasn’t happy when I explained to her that what she had just learned is pretty out of date and not at all what the ecosystem uses I was just about to start learning through the tutorials on React's site. Are they still outdated? If so, what's a good up to date tutorial I can use?
- moneywoes 4y agoTry beta.react.js
- deleted 4y ago[deleted]
- wcedmisten 4y agoThe tutorial on the beta docs page should be up to date: https://beta.reactjs.org/learn https://beta.reactjs.org/learn
- alexchantavy 4y agoThanks, as a newcomer why is this the case? Which forum posts/docs would you recommend reading and following to learn the “meta” around React?
- barrenko 4y agoAlso as a newcomer to Next.js, you start off, the tutorial seems great, then midway they announce they are switching to a new system and it's hard to be bothered after that.
- fidgewidge 4y agoOh no, I was thinking of sitting down to learn next.js. What is this midway switch you mean? Isn't it brand new?
- satvikpendem 4y agoNextJS 13 introduced an app directory which is different than file based routing (to some extent). But it's till in beta so you don't have to worry about it right now.
- leerob 4y agoIndeed, the pages directory will continue to exist for awhile. You don't need to learn app yet.
- satvikpendem 4y agoThe beta docs are just that, beta. They're being written as a replacement for the current ones but aren't yet stable. So asking "why is that the case", the answer is simply that they're rewriting old docs and aren't done yet.
- goodoldneon 4y agoWhat does your eslint config look like? AirBnB’s config is the worst offender for nitpicks
- chrsig 4y ago> First, it’s really easy to ignore the beta docs and end up learning class components. She wasn’t happy when I explained to her that what she had just learned is pretty out of date and not at all what the ecosystem uses. Yeah, that's an absolutely terrible experience. Why can't there be a modicum of stability in the ecosystem?
- KyeRussell 4y agoThe JavaScript ecosystem seems uniquely poor at this docs inconsistency stuff. It’s almost like someone lowered the bar one day, and then everyone else learned from that low bar and all think that their behaviour makes any sense whatsoever. I’ve been tinkering with a lot of mainstream JS frameworks and they pretty much all have their version of this problem. Next has their new App Directory stuff going on with its own beta docs site. It’s been a few weeks since I looked, so I can’t remember the specifics, but the messaging on the new and old docs sites was not good enough for me to immediately grok what was going on. It also made Googling near impossible. We got our long-awaited next major version of Nuxt not long ago, too. They seemingly decided that they could just change domains, put a little banner up on the old site, and make the problem go away. Again, makes Googling incredibly hard. I found myself having to remember the design and domain of the old and new sites to know if I’d accidentally stumbled on old documentation. I really want to make Nuxt work for me, but this docs experience left a bad taste in my mouth, a very specific “pre-production” taste, which is really unfortunate given Nuxt’s cadence with v3 stability. React was about as bad as Next. I found myself bouncing between the stable and beta docs consistently. All the messaging around the stability and supported use cases for Suspense is just…way too impenetrable. I’m a seasoned web application developer. I’m confident that the majority of this isn’t a “me” problem. The only docs experience I’ve had that comes close to addressing the issue appropriately is the Vue documentation. There’s a nice big switch at the top that switches the docs from favouring the old-school vs composition APIs. Of course, the underlying problem is React and Vue so solidly keeping their foot in both camps. This is just an outcome of that. I try my absolute hardest to enter the JS ecosystem with the most open of minds, and there are plenty of people working in this space that are certainly much smarter than me. I just get the impression that there are too many people that don’t have experience with other language ecosystems, or that have long since forgotten what they’re like, to the point where they’re blind to these sorts of DX shortcomings. The React Hooks / Composition API hard-left-turn smells JUST enough like Python 2 / 3 et al that I’m pretty confident in my estimate of how it’s all going to go down. History repeats, or whatever.
- satvikpendem 4y agoWith React, why not just read the beta docs only and not the current ones? The beta docs are mostly complete, it says on their home page.
- s4i 4y ago> There’s a lint rule about naming the error parameter in catch “error”, not “err” or “e”. Who cares about this shit??? That is certainly in the less important end of the linting rules spectrum. Nonetheless, conventions like these add up in larger codebases in my experience. The more consistency you have with things that repeat a lot across the code improve readability quite much because the brain is able to do more chunking over time. Of course this doesn't matter that much when you are learning a language or a framework and only have a couple of files.
- hardwaregeek 4y agoI’ve cited the same concept of consistency, and I still believe it to an extent. But I do feel like it’s folk wisdom to an extent and not necessarily backed up by evidence. Like is e vs err vs error so egregious that it really adds to mental overhead? And sometimes there are explicit reasons to not do certain “best practices”. There was that whole era of making functions as small as possible, which of course meant you needed to jump to five function definitions to get even the slightest idea of what was happening. Or when everybody insisted on const and arrow functions for everything. As well intentioned as these ideas are, they fall victim to trends and overzealous application. Any piece of advice has a trade-off and a situation where it does not apply. Therefore it’s important to remember that these ideas are fundamentally subjective guesses at how to write good code. Not gospel truth. Of course that isn’t to say linters are bad. Just that lint rule authors should be very careful to check that they are actually writing rules of value and not just nit picky folk wisdom.
- woutr_be 4y agoAre class components really considered out of date? I still prefer writing those compared to functional components. Vue is also moving in that direction with their composite API. I think it’s why I like Svelte, it’s just JavaScript.
- orangepanda 4y ago{# is it just javascript?}
- satvikpendem 4y agoIt's not, that's why I like React, I don't have to learn how to do a for loop in a custom HTML DSL again. And before anyone says it, no, JSX is not a DSL, it's just syntax sugar over JS, you can write React fully in createElement if you want.
- satvikpendem 4y agoHooks are a very useful abstraction, they are like functions but with a built in of lifecycle state (so not pure but implicitly effectful). I cut down so much code using hooks, I even use them in non JS projects even, such as in Flutter with flutter_hooks, that's how strong of an abstraction they are.