Readit News logoReadit News
xab9 commented on Introducing Hooks   reactjs.org/docs/hooks-in... · Posted by u/sophiebits
engineeringwoke · 7 years ago
You wish we went back to bind and apply? And not being able to trace logic, state, and DOM through a labyrinth of Backbone views? We have come so far

How is static typing "mental laziness"?

xab9 · 7 years ago
The article says bind as a negative point - I perefer the new non-bound class method syntax:

``` private handleClick = (event) => {} ```

By "mental lazyness" I mean that people (as in people I have met with) piss on javascript and praise typescript and in the process they never bother to learn about javascript.

I do like vue, react, angular of course, but I don't think that you become a frontend developer from one day to the next and keep saying that typescript is _exactly_ like java (or dotnet).

xab9 commented on Introducing Hooks   reactjs.org/docs/hooks-in... · Posted by u/sophiebits
munchbunny · 7 years ago
Maybe newish coders should learn the language they are using.

It's not a language thing. OOP discipline is a coding thing in general.

And of course there is typescript (and a gazillion of languages that can be transpiled to js these days), which synergizes very well with enterprise people and java/dotnet devs who never did a line of frontend before.

You sound like you don't actually understand why people like Typescript, or, more specifically, static typing.

xab9 · 7 years ago
I "don't actually understand why people like Typescript", or lemonade, or skiing, or eating fish. I know why I like it, including static typing, and how I can find a balance with using its features (and not using some).

On the other hand I'm not trying to hide that I'm bitter about the mental lazyness around typescript - I had some bad experience with interviewers who praised ts (without ever bothering to learn the core principles of javascript) a bit too much for my taste (but again, this may just be dismissed as anecdotal evidence, which it is).

xab9 commented on Introducing Hooks   reactjs.org/docs/hooks-in... · Posted by u/sophiebits
wild_preference · 7 years ago
Eh, even in the same paragraph it says "The distinction between function and class components in React and when to use each one leads to disagreements even between experienced React developers."

Also, bits of class issues show up in the other complaints.

So, no, it's not just "what is a class" and it's a weird hill to die on. I feel like most of these responses to hooks in general just focus on the most trivial detail aka bikeshedding.

xab9 · 7 years ago
I'm focusing on classes, because it seems to me that to "React" classes are a necessary evil (or they are treating them like they were).

Hooks, suspense, context wormholes - I'm not sure if these features should be part of a view engine. React, to me, did one thing and did it well, but now... I don't know.

xab9 commented on Introducing Hooks   reactjs.org/docs/hooks-in... · Posted by u/sophiebits
tangent128 · 7 years ago
Typescript doesn't do anything ES6 & Webpack don't already do; Javascript already lets you write Java-style code if you really want to.
xab9 · 7 years ago
I know, but lately during frontend interviews I was surprised how many times I met with "I'm a developer I can do anything" type interviewers - some of them were dotnet, others were java devs and they preferred typescript, because 1. javascript is a terrible language 2. with typescript they feel right at home 3. they can use a "proper ide" (please, don't ask, I already had an argument and a rejection when I tried to ask about webstorm)
xab9 commented on Introducing Hooks   reactjs.org/docs/hooks-in... · Posted by u/sophiebits
munchbunny · 7 years ago
I can see both sides. I teach React to newish coders, and classes are easy for them to grasp...and then immediately create labyrinthine monoliths.

To be fair, that's pretty much what happens to all newish coders who are learning classes. Learning to use classes responsibly is really just part of the learning, though that seems to be the part that instructors pawn off to the next guy.

Once you learn how to use them judiciously, classes become extremely useful tools for encapsulation/abstraction where you need encapsulation/abstraction.

xab9 · 7 years ago
Maybe newish coders should learn the language they are using.

And of course there is typescript (and a gazillion of languages that can be transpiled to js these days), which synergizes very well with enterprise people and java/dotnet devs who never did a line of frontend before.

xab9 commented on Introducing Hooks   reactjs.org/docs/hooks-in... · Posted by u/sophiebits
ergothus · 7 years ago
I don't think the issue is "what is a class". It's more that the lifecycle functions get tied into the class, and you end up with a ball of highly conditional logic. It's easy for newbies to just add stuff to make it work, but end up with a mess.

React is the view layer, so the class concept of "here's some data and methods to alter it" doesn't really match with what happens - I don't know that components every should have been classes in the first place.

xab9 · 7 years ago
According to the article yes, the issue is "what is a class":

"You have to understand how this works in JavaScript, which is very different from how it works in most languages. You have to remember to bind the event handlers." etc.

xab9 commented on The State of Agile Software in 2018   martinfowler.com/articles... · Posted by u/fagnerbrack
Cthulhu_ · 7 years ago
I've been in a project like that for a while and it was actually pretty good, we got stuff done on a regular and predictable cadence.
xab9 · 7 years ago
I worked last time on a large scale project with full waterfall and heck, it was good. I knew what to do, when to do it, team lead had great domain knowledge and was a nice guy etc.

Then the company decided that products are not built fast enough, so we should be "agile". Guess we all know the rest of the story.

xab9 commented on React v16.6.0: lazy, memo and contextType   reactjs.org/blog/2018/10/... · Posted by u/sophiebits
andrewstuart · 7 years ago
I think you are exactly correct, now I give it some thought.

When I do ReactJS I'm building much more powerful UI features. The Django stuff is just a bunch of forms and that is really easy to drive.

xab9 · 7 years ago
Many "web apps" are just a bunch of forms, crud operations and occasionally static pages for eula, privacy policy, faq and other knick-knacks.
xab9 commented on React v16.6.0: lazy, memo and contextType   reactjs.org/blog/2018/10/... · Posted by u/sophiebits
danabramov · 7 years ago
Maybe you were using React for something that isn't highly interactive and thus React was adding more friction than utility?
xab9 · 7 years ago
Oh Dan, my experiences are that eight companies out of ten are using react for _anything_.

There were times when javascript === jquery. Nowdays javascript === react.

xab9 commented on Zero-day in jQuery plugin sample code exploited for at least three years   zdnet.com/article/zero-da... · Posted by u/john37386
xab9 · 7 years ago
Isn't this a click-baitish title? I would say that this is a configuration issue and not "exactly" a vulnerability and basically get off my lawn.

Reading blueimp's and larry's comments here I envy their constructivity, open mindedness and professionalism.

u/xab9

KarmaCake day427October 27, 2017View Original