[-] [email protected] 1 points 1 year ago

I don’t like/use the class keyword in JS, because I quite like the paradigm with prototypes & stuff, and that keyword tries to make it fit into a totally different paradigm, which doesn’t really work IMHO.

I've read somewhere that Javascript is more of a prototype-oriented language rather than an object-oriented one. Do you agree with this?

BTW, I’ve developed a few strats to have my own style in TS that I like quite a lot. I can tell more if you’re interested.

Thank you! But maybe not right now; I'm still learning the basics. Have you considered write an article about it? 😮

[-] [email protected] 5 points 1 year ago

Never heard of Lemoa, but I will definitely try. Thanks! 👍

[-] [email protected] 1 points 1 year ago

Hey, this looks pretty good. Thanks! 👍

[-] [email protected] 3 points 1 year ago

I think you should do what’s comfortable to you

Good advice, but I would like to expand outside of my comfort zone to learn different styles of programming.

but also try to adapt to the common language in each of the code bases you will be working on, so that everyone is on the same page.

Absolutely agree with you there.

Good luck in your journey!

Thank you! ❤️

[-] [email protected] 3 points 1 year ago

TypeScript is next on my list. The loose typing of JavaScript drives me a little nuts sometimes 😅.

[-] [email protected] 1 points 1 year ago* (last edited 1 year ago)

As long as you’re opting for composition over inheritance, it’s probably fine.

Totally agree with you there.

Probably on the “sparingly” end.

I'm on the same train of thought as you. I feel that relying too much on class ignores the better features that JavaScript has to offer. However, I'm sure that its application is useful on the occasion where inheritance IS (but very rarely) necessary.

[-] [email protected] 1 points 1 year ago

Yes. This seems to be one of the common arguments against "classes": they're not exactly classes in the traditional sense, and everything you can do in JavaScript can be done so without touching the class keyword. It's basically syntactic sugar that adds more confusion to the language, or so I heard. I've read this article that explains the flaws behind with this feature: https://www.toptal.com/javascript/es6-class-chaos-keeps-js-developer-up

1
submitted 1 year ago by [email protected] to c/[email protected]

cross-posted from: https://programming.dev/post/302850

Hello, everyone 👋. I am a newcomer when it comes to JavaScript. I come from an OOP background (C# and Java). I've recently learned that ES6 has a class keyword that preforms similarly (but not exactly) to common OOP languages. Normally I would be inclined to use this feature in my projects; however, it came to my attention that the usage of class in JavaScript seems to be heavily discussed (mostly in a negative light). My questions to this community are:

  • Should it be used often, sparingly, or be outright avoided?
  • What are its advantages and disadvantages?
  • Are there specific cases where the usage of class excels?

Please share your thoughts.

24
submitted 1 year ago by [email protected] to c/[email protected]

Hello, everyone 👋. I am a newcomer when it comes to JavaScript. I come from an OOP background (C# and Java). I've recently learned that ES6 has a class keyword that preforms similarly (but not exactly) to common OOP languages. Normally I would be inclined to use this feature in my projects; however, it came to my attention that the usage of class in JavaScript seems to be heavily discussed (mostly in a negative light). My questions to this community are:

  • Should it be used often, sparingly, or be outright avoided?
  • What are its advantages and disadvantages?
  • Are there specific cases where the usage of class excels?

Please share your thoughts.

[-] [email protected] 1 points 1 year ago

I quit after I got that...

[-] [email protected] 2 points 1 year ago

I Imagine the merge conflict hell that these programmers have to go through...

[-] [email protected] 3 points 1 year ago

Two years later...

2
submitted 1 year ago by [email protected] to c/[email protected]
5
submitted 1 year ago by [email protected] to c/[email protected]

[-] [email protected] 7 points 1 year ago

You would think that being named Null would probably cause a problem. But Jeffrey? lol

[-] [email protected] 1 points 1 year ago

The guy sitting on the chair is exactly how I felt when one of my friends explained what microservices they use for their company web application lol

1
submitted 1 year ago by [email protected] to c/[email protected]

view more: next ›

DonjonMaister

joined 1 year ago