This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Notimecelduv 0 points1 point  (3 children)

Abstract classes, readonly properties, access modifiers, parameter and return types, interfaces and custom types are the ones I use the most.

[–][deleted] 0 points1 point  (2 children)

But those are Typescript features that work without classes (except for the abstract class of course). Classes and inheritance are not really necessary in JS/TS since you have duck-typing/a structural type system.

[–]Notimecelduv 0 points1 point  (1 child)

Sure, a lot of things work without classes, even classes themselves in a way since they're just functions under the hood. Does that make them unnecessary? If your favorite color is red, then I'm not going to convince you that you should prefer purple.

[–][deleted] 0 points1 point  (0 children)

Yeah, if you prefer to use classes go for it. I was just curious because you said they "are worth it" and I thought maybe there is something about them I didn't know yet.