this post was submitted on 12 Sep 2024
289 points (96.2% liked)

Programmer Humor

19471 readers
1357 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 

var Turtle1 var Turtle2 var Is_Turtle

you are viewing a single comment's thread
view the rest of the comments
[–] wesker@lemmy.sdf.org 9 points 1 month ago* (last edited 1 month ago) (21 children)

Have you considered using inheritance?

[–] OttoVonNoob@lemmy.ca 4 points 1 month ago (14 children)

I'm an amateur I'm not sure what inheritance is:X? Is it like instantiateing?

[–] wesker@lemmy.sdf.org 6 points 1 month ago* (last edited 1 month ago) (10 children)

When you start learning about different paradigms, you'll likely learn much more about inheritance when learning about the Object Oriented design paradigm.

To overly simplify, you create objects that inherit attributes from other objects. It's for instance a way to create reusable patterns, that have stronger and more reliable data structures.

I made the joke comment, because for instance, you could create a Turtle class, and always know it was a Turtle. Again, an oversimplification.

EDIT: I should also add that for some reason OOP is an oddly divisive subject. Developers always seem to want to argue about it.

[–] hoshikarakitaridia@lemmy.world 7 points 1 month ago (1 children)

At this point I think there is no software dev topic that is somehow not devisive.

[–] MajorHavoc@programming.dev 1 points 1 month ago (1 children)

At this point I think there is no software dev topic that is somehow not devisive.

Now I want to try something:

"Boolean variables don't suck."

[–] hoshikarakitaridia@lemmy.world 2 points 1 month ago* (last edited 1 month ago) (1 children)

No one uses Boolean values anyway and with the amount of resources available on modern systems we can just replace them with integers and we should be fine. This also makes it easier to teach people, as they would learn less different data types.

Yes I'm a software dev :)

load more comments (8 replies)
load more comments (11 replies)
load more comments (17 replies)