🔥 Discussion 🔥 ES6 Classes. Good or Evil?
  • DonjonMaister DonjonMaister Now 100%

    This is an excellent take! 👏

    That said you should strive to use both functions and classes. If you can simplify your functions to allow mostly any primitive input, that’s great. It can be reused many times throughout your code. But if you have certain operations that only work with one type, then don’t be afraid to use a class

    This advice looks sound. I'll definitely take it into consideration.

    1
  • 🔥 Discussion 🔥 ES6 Classes. Good or Evil?
  • DonjonMaister DonjonMaister Now 100%

    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? 😮

    1
  • The difference between an instance variable and a static variable.
  • DonjonMaister DonjonMaister Now 100%

    Fun fact: I made this meme to explain my classmates static variables.

    2
  • Lemoa is now on Flathub
  • DonjonMaister DonjonMaister Now 100%

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

    4
  • Only true web developers
  • DonjonMaister DonjonMaister Now 100%

    Yes. Spiders are the superior web developers. They're especially good at eliminating bugs.

    17
  • Cryptographic hash functions calculator on-line.
  • DonjonMaister DonjonMaister Now 100%

    Hey, this looks pretty good. Thanks! 👍

    1
  • 🔥 Discussion 🔥 ES6 Classes. Good or Evil?
  • DonjonMaister DonjonMaister Now 100%

    Yeah, I don't fully understand it either 😅.

    2
  • 🔥 Discussion 🔥 ES6 Classes. Good or Evil?
  • DonjonMaister DonjonMaister Now 100%

    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! ❤️

    2
  • 🔥 Discussion 🔥 ES6 Classes. Good or Evil?
  • DonjonMaister DonjonMaister Now 100%

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

    3
  • 🔥 Discussion 🔥 ES6 Classes. Good or Evil?
  • DonjonMaister DonjonMaister Now 100%

    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.

    1
  • 🔥 Discussion 🔥 ES6 Classes. Good or Evil?
  • DonjonMaister DonjonMaister Now 100%

    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
  • 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.

    6
    6

    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.

    20
    30
    The Password Game
  • DonjonMaister DonjonMaister Now 100%

    I quit after I got that...

    8
  • Another day, another yak shave
  • DonjonMaister DonjonMaister Now 100%

    I've never felt so identified by a meme.

    2
  • GITar Hero
  • DonjonMaister DonjonMaister Now 100%

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

    10
  • When you incorrectly implement the stop condition in your recursive function.
  • DonjonMaister DonjonMaister Now 100%

    Thank you for the advice. Unfortunately I couldn't upload a .gif version; the website throws the following error: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data. I image that this could be the result of a file being too big (the .gif version is 5.27MB). So at the end I decided to upload the .mp4 version (799 KB).

    1
  • derp
  • DonjonMaister DonjonMaister Now 100%

    Two years later...

    14
  • 6 stages of debugging
  • DonjonMaister DonjonMaister Now 100%

    Stage 4.5: console.log() everything.

    29
  • Unlimited power
  • DonjonMaister DonjonMaister Now 100%

    Applying the (DRY) Do Repeat Yourself principle.

    2
  • Escape Room Concept
  • DonjonMaister DonjonMaister Now 100%

    Even if you DO escape, there is no guarantee that you'd leave with your sanity intact.

    14
  • I’ll fight anyone who disagrees
  • DonjonMaister DonjonMaister Now 100%

    I have no problem with either. But I do have a problem with people who use the space bar instead of the tab key.

    4
  • cross-posted from: https://programming.dev/post/146762 > ![](https://programming.dev/pictrs/image/a69129dc-f9fb-466a-95c1-be41f7609ec6.png)

    86
    10

    ![](https://programming.dev/pictrs/image/a69129dc-f9fb-466a-95c1-be41f7609ec6.png)

    49
    2
    https://programming.dev/pictrs/image/7dcd76ad-6ae4-406c-b2a0-b62eb3dd9c20.mp4

    cross-posted from: https://programming.dev/post/108936 > ![](https://programming.dev/pictrs/image/38203005-e141-4ad2-8e4f-fa6dbcce64a3.mp4)

    7
    4
    DonjonMaister Now
    6 23

    DonjonMaister

    DonjonMaister@ programming.dev

    TTRPG fan and programmer.