the "good" parts

3 years ago by hairinmybellybutt to c/programmerhumor

xmunk 49 points 3 years ago

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

You know this to be true.

path: 0 5479408, hotness: undefined, score: 49, children: 10
SzethFriendOfNimi 40 points 3 years ago

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

path: 0 5479408 5479931, hotness: undefined, score: 40, children: 6
Dudewitbow 15 points 3 years ago

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.

path: 0 5479408 5479931 5483967, hotness: undefined, score: 15, children: 3
SzethFriendOfNimi 10 points 3 years ago

Only Garbage Collectors deal in absolutes

path: 0 5479408 5479931 5483967 5484541, hotness: undefined, score: 10, children: 0
Hazzia 1 point 3 years ago
path: 0 5479408 5479931 5483967 5533441, hotness: undefined, score: 1, children: 1
Dudewitbow 1 point 3 years ago

When you ever call new/malloc, its mandatory(dynamic allocation). For general programming, the size is usually decided at compilation.

Yes destructors will unallocate the memory, but the process of writing the destructor is part of the task of memory management

It becomes madness if you attempt to call dynamic memory outside of a class and its destructor, and hopefully the dev actually remembers to release said memory when their done.

path: 0 5479408 5479931 5483967 5533441 5533763, hotness: undefined, score: 1, children: 0
xmunk 10 points 3 years ago

I tried to get that reference, but MemoryAccessOutOfBounds.

path: 0 5479408 5479931 5481765, hotness: undefined, score: 10, children: 0
LazaroFilm 6 points 3 years ago

->

path: 0 5479408 5479931 5481277, hotness: undefined, score: 6, children: 0
aport 13 points 3 years ago

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

path: 0 5479408 5481753, hotness: undefined, score: 13, children: 1
xmunk 2 points 3 years ago

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

path: 0 5479408 5481753 5481848, hotness: undefined, score: 2, children: 0
marcos 4 points 3 years ago

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

path: 0 5479408 5480191, hotness: undefined, score: 4, children: 0
_thebrain_ 35 points 3 years ago

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

path: 0 5483547, hotness: undefined, score: 35, children: 1
SzethFriendOfNimi 4 points 3 years ago path: 0 5483547 5484589, hotness: undefined, score: 4, children: 0
Duralf 17 points 3 years 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.

path: 0 5482792, hotness: undefined, score: 17, children: 0
nodsocket 16 points 3 years ago
path: 0 5480264, hotness: undefined, score: 16, children: 2
SzethFriendOfNimi 3 points 3 years ago

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

path: 0 5480264 5484567, hotness: undefined, score: 3, children: 0
cupcakezealot 1 point 3 years ago
path: 0 5480264 5490215, hotness: undefined, score: 1, children: 0
cupcakezealot 13 points 3 years ago

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

path: 0 5490174, hotness: undefined, score: 13, children: 0
Potatos_are_not_friends 7 points 3 years ago

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.

path: 0 5484949, hotness: undefined, score: 7, children: 1
grue 6 points 3 years 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.

path: 0 5484949 5488795, hotness: undefined, score: 6, children: 0
Archpawn 1 point 3 years 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.

path: 0 6012249, hotness: undefined, score: 1, children: 0
Bankenstein 1 point 3 years ago
path: 0 5480212, hotness: undefined, score: 1, children: 0
programmerhumor
programmerhumor

@lemmy.ml

login for more options
43751
1628
1552

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

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

go to feed...