DEV Community

Discussion on: Litmus Tests in Tech

Collapse
 
kgilpin profile image
Kevin Gilpin

What’s wrong with this? Seems like the classes support in JS is a lot better now than it used to be and this is a pretty essential part of that. I like a functional style too but sometimes a class is a good option.

Collapse
 
bytebodger profile image
Adam Nathaniel Davis

I don't disagree with you. Maybe I should've been a little clearer in stating that, for the last 4-5 years, I've been almost exclusively a React dev. And in React, everything seems to be trending away from classes and toward functions. I'm on record as not "believing" in that trend - but I'm also on record as wanting to keep getting paychecks. So, for some time now, I haven't written a single class. Anywhere.

To be clear, the this keyword still "exists" in functions. But if you're writing purely in functions, I think it's a rather dodgy practice (obviously, just my opinion there) to keep using this.

Collapse
 
kgilpin profile image
Kevin Gilpin

Yeah that makes sense. this in a functional style would be weird.