this post was submitted on 21 Nov 2023
316 points (94.9% liked)

Programmer Humor

32356 readers
1330 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
all 23 comments
sorted by: hot top controversial new old
[–] xmunk@sh.itjust.works 50 points 11 months ago (3 children)

C++ the good parts exclusively uses on stack allocation and passing by const reference without ever introducing pointers.

You know this to be true.

[–] SzethFriendOfNimi@lemmy.world 39 points 11 months ago (3 children)

Pointers is a pathway to memory that some consider to be… unnatural

[–] Dudewitbow@lemmy.zip 15 points 11 months ago (2 children)

Because its essential for application use where memory management becomes extremely vital, usually due to the rom or memory to be extremely linited in size. Worrying about memory management (something C++ makes mandatory) is something not all programmers need to care about, but having automated memory mangement is also what causes bloat that comes with modern applications, due to bad programming practices of not caring about it.

[–] SzethFriendOfNimi@lemmy.world 10 points 11 months ago

Only Garbage Collectors deal in absolutes

[–] xmunk@sh.itjust.works 11 points 11 months ago

I tried to get that reference, but MemoryAccessOutOfBounds.

[–] aport@programming.dev 13 points 11 months ago (1 children)

This is basically C++ in the embedded world, and yes it's the only good C++

[–] xmunk@sh.itjust.works 2 points 11 months ago

Also Qt basically forces you into this mode... and yea, it is a better way.

[–] marcos@lemmy.world 4 points 11 months ago

Only integral unsigned numbers, no reference taking at all, no side-effect operators...

[–] _thebrain_@lemmy.dbzer0.com 36 points 11 months ago (2 children)

It sounds like a lie to me. Everyone knows there are no good parts of JavaScript.

[–] ActuallyRuben@actuallyruben.nl 1 points 11 months ago

It has some good parts, such as the ability to use for loops, and the fact you can kind of avoid using it as much thanks to it's webassembly support

[–] Duralf@lemmy.world 18 points 11 months ago

The problem is everyone disagrees on what part of C++ is good... Some like C+classes. Some like intense meta programming and some like functional programming and all are valid C++ that people advocate for.

[–] nodsocket@lemmy.world 17 points 11 months ago (2 children)

The only thing you need to know is goto statements

[–] SzethFriendOfNimi@lemmy.world 4 points 11 months ago

Switch up the paradigm… in case you forgot to break out it

[–] cupcakezealot@lemmy.blahaj.zone 13 points 11 months ago

that's still too thick a book for the good parts of javascript

[–] Potatos_are_not_friends@lemmy.world 8 points 11 months ago (1 children)

This is for any subject.

There's a LOT of things that you don't need to know. Take for example, cooking. To get good, you don't need to know how fancy tricks. You just need to know the basics very well.

But after being experienced, it's valuable to know the other 95%. Those weird edge cases.

[–] grue@lemmy.world 6 points 11 months ago

There's a difference: in this case it's not about omitting fancy tricks you don't need to know until you become an expert; it's about omitting ill-considered features that should never have existed to begin with (or, at best, features that made sense at some point in the past but don't anymore) and that nobody should ever use again no matter how expert they get.

[–] Archpawn@lemmy.world 1 points 10 months ago

The majority of dumb stuff in Javascript is that it has some counterintuitive way of doing something that it shouldn't do at all, so only teaching the good parts works. So teaching just the good parts is pretty reasonable.