Stop using these wrong.

  Рет қаралды 9,486

Nathan Baggs

Nathan Baggs

8 ай бұрын

When should you use a pointer or a reference?
💭 All views are my own 💭

Пікірлер: 18
@demikr8115
@demikr8115 8 ай бұрын
I’d definitely be interested in a video on what every version of C++ adds fundamentally if that makes sense? Like C++11, C++17, etc. specifics
@nathanbaggs
@nathanbaggs 8 ай бұрын
That’s actually on my idea list!
@alicewyan
@alicewyan 6 ай бұрын
@@nathanbaggs as a lapsed C++ programmer (stopped in 2013 and didn't fully learn C++11), I'd love to watch that video, I sometimes think of updating my C++ knowledge but not sure how to get started, it's overwhelming!
@suncrafterspielt9479
@suncrafterspielt9479 8 ай бұрын
Your videos are insanely useful. Usually content on youtube only scratches the surface in my experience
@damouze
@damouze 4 ай бұрын
While my main programming language of choice is plain old C, sometimes I do de(vo)lve into C++. I never understood the benefit of references compared to pointers (and I still don't, but that's not on you), but then again I maybe old-fashioned. I _want_ my objects to be nullable because that's the main way I signal to the caller that something went awry. Maybe I am a poor old sod who refuses to know any better ;-) I found your video interesting and it did clear up a couple of things. Even in my university days when I first learned C++, references were an obscure abstract topic that neither the professor nor my fellow-students (who were way more proficient with the language than I was) were willing to discuss. The same applied to templates. So I left them alone and instead continued to code in C and assembly.
@NonTwinBrothers
@NonTwinBrothers 7 ай бұрын
Just discovering this channel. You're pretty good at explaining C++ concepts! (no pun intended) I think you could do a video where you take some code (create_enitity for example) and "work up" to the final implementation. Like starting with the basic idea, and then changing the pointer to unique, explain the move semantics, etc.
@florian3421
@florian3421 8 ай бұрын
Very cool video! I'm currently looking a lot into how all the low level stuff works under the hood because its very interesting to me but find it quite hard to find good learning resources about some of it and your channel has helped me a lot. Would be really awesome if you could make a video about windows PE executables where you explain how they are structured and go through every byte of a very simple and small executable which e.g. just returns exit code 0 or some. Thanks!
@nathanbaggs
@nathanbaggs 8 ай бұрын
Glad you’re finding it useful, thanks for the idea!
@sharpfang
@sharpfang 5 ай бұрын
Interestingly, Java references are much more similar to C++ references, just wrapped in a dereferencing syntactic sugar hiding the pointer underneath.
@NeuwDk
@NeuwDk 8 ай бұрын
I sometimes use std::optional instead of pointers when I need the equivalent of a nullable pointer. I don't know if it's a good idea, but somehow I tell myself that the type-system is holding my hand more when doing this, compared to a raw pointer.
@alexxv.1519
@alexxv.1519 5 ай бұрын
The biggest offender is the ampersand and ptr on the side of the variable name
@weckar
@weckar 7 ай бұрын
Just use a reference to a pointer. Easy peazy lemon cheesy
@saultube44
@saultube44 6 ай бұрын
Copying a passing value, That's an error, you can address its value directly, in a Data Segment
@nineinchwhales
@nineinchwhales 8 ай бұрын
Great video as ever
@nathanbaggs
@nathanbaggs 8 ай бұрын
Thanks!
@steevevinson
@steevevinson 8 ай бұрын
Please never stop thx
@skeleton_craftGaming
@skeleton_craftGaming 5 ай бұрын
I mean, ideally what you would do is make a wrapper in class for unique pointer that statically asserts that it's not null at construction time...
Can you fit a whole game on a stamp?
8:27
Nathan Baggs
Рет қаралды 74 М.
I Made A Virus - I Instantly Regretted It
12:44
Nathan Baggs
Рет қаралды 18 М.
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 101 МЛН
Заметили?
00:11
Double Bubble
Рет қаралды 3,5 МЛН
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 725 М.
How Do Hackers Actually Cheat In Games?
12:38
Nathan Baggs
Рет қаралды 29 М.
Why Don't You Make Your OWN Game Engine?
7:23
Skeffles
Рет қаралды 5 М.
you will never ask about pointer arithmetic after watching this video
8:01
Low Level Learning
Рет қаралды 230 М.
Unfixable Apple Exploit - How It Really Works
28:43
Nathan Baggs
Рет қаралды 15 М.
Use Arc Instead of Vec
15:21
Logan Smith
Рет қаралды 134 М.
Enums considered harmful
9:23
Matt Pocock
Рет қаралды 193 М.
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 280 М.
5 Good Python Habits
17:35
Indently
Рет қаралды 365 М.
PLEASE Use These 5 Python Decorators
20:12
Tech With Tim
Рет қаралды 95 М.
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 101 МЛН