Scott - this is like listening to Bob Ross teach code. "How about some happy little binary trees over here" 👨🎨 Thanks for a soothing refresher on these topics.
Please make a video about Threads and Async Programming. I know that there are tons of videos on UA-cam, however, I would like to hear about these topics from your explanation. Thank you in advance, Scott.
I was literally going to comment the same thing! This guy puts the stress of learning this stuff at ease. Very informative, fun, and positive videos! Thanks for making these videos!!
Minor pedantic distinction. Many texts refer to stacks as an abstract data type (ADT), not a data structure. That is to say that a stack is defined in terms of the operations one can logically perform on a stack (push, pop) and not any particular implementation of a stack. A particular programming language implementation of a stack (System.Collections in C#) will use the constructs of a language (built-in data types, data structures, OO concepts/features) to implement the expected behavior. Using that definition, you are moreso using a particular implementation of a stack when you get to lower levels of abstraction such as machine language. The one instruction set architecture I'm somewhat familiar with, MIPS, uses certain calling conventions and instructions to implement the behavior of the procedure call at the machine level (jal instruction, $ra register, etc.), which includes putting the procedure parameters in an accessible location, transferring control, performing its stuff, putting return value in accessible location for caller, returning control to caller, etc.. But at the higher level abstraction of programming languages, you know how a function/method call mechanism behaves in your language. (or at least aim to) You know that your arguments passed into your functions/methods are likely either passed by value or reference and you can use that knowledge of "stack-like" behavior to either reason about your programs or debug them using the tools provided by a debugger without having to dive into the lower level details of machine code (or at least consider it for the moment). Only pointing this out to add to the conversation, not a pedantic gotcha. Great video. Always looking for new perspectives and ideas regarding these concepts and tooling and technology to explore. The memory snapshot feature in Visual Studio is something I'll add to to the toolbox.👍 Also I know next to nothing about how bytecode/virtual machine languages like Java and C# implement things like objects, handling instance variables and methods, so if anyone has anything to add, feel free to.
You know what, Scott? I always make my world a better place to live with every one of your tutorials. I appreciate you, mate! Please carry on enlightening us - I speak for most of self-taught developers.
This channel has become my favorite programming / tech channel on UA-cam, thank you Scott for taking the time to make these videos. I will share this channel with people so they can learn from you as well.
Yes! I remember learning this on my own..:) Most of today's developers (web developers) don't know much about stacks, heap memory management, CPU context switching. "Programmers" (low level) in the traditional sense have to know.
Scott, you are my personal hero. I'm an adult with a healthy C# career and yet I still want to grow up to be like you one day. Thank you from the bottom of my heart for the passion you show for the language and for teaching people. ❤
Hello Scott, great video! I want to clarify something. At 22:03 you say the object p is being passed by reference. Actually, the Person object is not passed by reference when the DoSomethingCool (p, c) method is called. Only the reference of the object in the heap is passed by value. If DoSomethingCool was called (ref p, c), it would be called by reference, and when a new assignment was made on object p, the object p in the Main method would also be affected.
Thanks for taking the time to make these videos. Even if I have a grasp of the concepts I always get a "aha!"-moment. And it's so refreshing with the one-take-format compared with the "I cannot put two coherent sentences so I must cut after a sentence"-experience that is so common atm. Keep it coming!
Straight to the point and eye-opening examples. If you're open to suggestions, here are some topics I think would make a great fit for the series: floating-point arithmetic, asynchronous programming, memory management / fragmentation, threads / multithreading and bitwise operators.
Thank you! and I am so happy to see Amharic book in your hand. with that I have seen your contribution to Microsoft product features having Amharic language
As expected, another quality video, no edits or cuts (which is really hard), demystifying what happens behind the curtains! Quick tip: you can use Ctrl+D to duplicate objects on draw.io (as you do in PowerPoint and other MS softwares).
Another great video. Thanks Scott! I have some requests for future videos: 1) deep dive how a web server like Kestrel works. For example, explain how it interacts with the networking software/hardware, how the request pipeline works, etc. 2) how the .NET Core runtime works 3) the architecture and inner workings of the C# compiler Just some suggestions. I know your time is limited and I really appreciate the videos you do take the time to make!
Nodes, pointers, registers, wow, It is like receiving a nice sandwich at a picnic...... lovely..... I studied this here at venerable Guatemala, Central America
How are you doing with learning Zulu? My cousins in Kwazulu-Natal Durban can speak Zulu fluently, but where I live they taught Southern Sotho in school. Dumela ... :) *means “Hello”. In Zulu it’s “Sawubona”. Love this series a lot, and I’ve been programming for 28 years. Thanks for creating them, your blog, and all your talks - you give back and it means a lot to me, and I’m sure many others.
Technically speaking, a stack is an "Abstract Data Type", not a "Data Structure". The difference being that an ADT doesn't specify how the data is structured in memory. You can implement a stack using different data structures, like an array, a linked list or a hash table.
Thank you for all the videos Scott! Could you make a video about compilers and/or linkers? I think there's a lot of confusion surrounding things like AOT vs. JIT compilers, what .dll files are, and how compilers do what they do, so I think making a video about it could help a lot of people! (me included)
Thanks for sharing Scott, very interesting session, sorry, but I have a question, could the forum have the answer? Why does Scott use the Power Shell many times? I don't understand, my PowerShell is very simple, does anyone know something about it that helps?
Lovely stuff (as usual). Two questions though: 1. Why do you use int for a and b, but long for c? 2. Is there a way to see (in Visual Studio for instance) if a variable is passed by reference or value, assuming that it’s not explicitly defined?
@Noceo If it helps for question 1. for example for range of int is 0-10 and range of long is 0-20, so if we declare variables a,b,c are int then by adding a and b then we cant store the value in variable c example a=5, b=7 then c=12 so int range is 0-10 so we must declare c as long this is the intention but you can declare the variables a,b,c are int if you know the bound of your inputs.
Yes and no. The .NET Core one doesn’t unless you set the environment variable COMPlus_TieredCompilation=0. The issue is that Tiered Compilation is first and faster, so the current design favors that.
Hey Scott. Thank you for the series. Could you make a video about http / https requests? Ask you like a complete novice in this question, so some examples of them would be appreciated
@@shanselmanNo worries. I should've noticed your lips weren't moving but here we are. Thanks for your videos! Somehow it calms some hectic days for me.
I need to create a REST listener service and be able to use a Powershell script to send data to that REST listener. I want to collect info, like a list of running processes, or volume size/free space, then send the JSON output to that listener. I think you are just the sort of person who will know how to do that, more importantly you're good at explaining things.
Thanks for the video. I am still confused about the relationship between the data structure and the memory allocation. If I define two ints, a and b, I understand they will both go on the stack. But then if I need to access 'a', does the stack need to first pop off 'b' to get to 'a'? Add then what happens if I later need to access 'b'?
Good question. The system internally addresses variables on the stack as offsets to a pointer to the stack, so for us, we just access any variable on the stack that is in scope.
@@shanselman I see. So it works a little differently than the stack data structures I would normally use. Thanks Scott - I appreciate the reply and am learning a lot from the videos.
Love the video, but it's really necessary to have 1/9 of the screen being your cam? specially if only 1/3 of the cam is your face? I can see that you noticed it was getting on your way all the time. Maybe you could change to full screen when doings the explanations, but have a smaller (or maybe none) box with your cam or something.
Hi, quick question: I have recently started programming (RPA) but my background is originally chemical engineering, so apologies if I´m asking something really obvious, but how/why is the variable 'person' allocated in the heap when he is explaining stack allocation? I don't see any difference from the way he defines the other variables. Thank you for all the videos, they really are useful! The "spoiler = No" bit at the end was brilliant :D :D :D
How is the first example stack allocation? It’s using the new keyword, I thought the new keyword is heap allocation, it looks to me like all you did was create an array of strings, In fact it looks really similar to the dynamic array allocation of the Vector class in c++ where you push back elements into the array
@@shanselman I feel like this topic is strong with the modern "programmers" raised on Python alone :/ Kinda funny how the older generation had better computer science education than the youngsters.
@@RheaAyase yes you are right. we can learn from one session about memory(heap & stack), function call, recursion, overflow errors in one hands-on practical code lecture. If we have some theoretical background then this kind of lessons from @Scott Hanselman help us to clearly understand the theory, organize our knowledge(concepts) and teach others and mostly uses of tools tasks such as advanced debugging (for sure we didnt learn at school).
Scott - this is like listening to Bob Ross teach code. "How about some happy little binary trees over here" 👨🎨
Thanks for a soothing refresher on these topics.
Came to say the same thing. So relaxing to listen to.
Instablaster
Please make a video about Threads and Async Programming. I know that there are tons of videos on UA-cam, however, I would like to hear about these topics from your explanation. Thank you in advance, Scott.
"Happy little stack", this guy is the Bob Ross of computers.
I was literally going to comment the same thing! This guy puts the stress of learning this stuff at ease. Very informative, fun, and positive videos! Thanks for making these videos!!
Minor pedantic distinction. Many texts refer to stacks as an abstract data type (ADT), not a data structure. That is to say that a stack is defined in terms of the operations one can logically perform on a stack (push, pop) and not any particular implementation of a stack. A particular programming language implementation of a stack (System.Collections in C#) will use the constructs of a language (built-in data types, data structures, OO concepts/features) to implement the expected behavior.
Using that definition, you are moreso using a particular implementation of a stack when you get to lower levels of abstraction such as machine language. The one instruction set architecture I'm somewhat familiar with, MIPS, uses certain calling conventions and instructions to implement the behavior of the procedure call at the machine level (jal instruction, $ra register, etc.), which includes putting the procedure parameters in an accessible location, transferring control, performing its stuff, putting return value in accessible location for caller, returning control to caller, etc..
But at the higher level abstraction of programming languages, you know how a function/method call mechanism behaves in your language. (or at least aim to) You know that your arguments passed into your functions/methods are likely either passed by value or reference and you can use that knowledge of "stack-like" behavior to either reason about your programs or debug them using the tools provided by a debugger without having to dive into the lower level details of machine code (or at least consider it for the moment).
Only pointing this out to add to the conversation, not a pedantic gotcha.
Great video. Always looking for new perspectives and ideas regarding these concepts and tooling and technology to explore. The memory snapshot feature in Visual Studio is something I'll add to to the toolbox.👍
Also I know next to nothing about how bytecode/virtual machine languages like Java and C# implement things like objects, handling instance variables and methods, so if anyone has anything to add, feel free to.
You know what, Scott? I always make my world a better place to live with every one of your tutorials. I appreciate you, mate! Please carry on enlightening us - I speak for most of self-taught developers.
This channel has become my favorite programming / tech channel on UA-cam, thank you Scott for taking the time to make these videos. I will share this channel with people so they can learn from you as well.
Yes! I remember learning this on my own..:) Most of today's developers (web developers) don't know much about stacks, heap memory management, CPU context switching. "Programmers" (low level) in the traditional sense have to know.
Scott, you are my personal hero. I'm an adult with a healthy C# career and yet I still want to grow up to be like you one day.
Thank you from the bottom of my heart for the passion you show for the language and for teaching people. ❤
Man this is the clearest explanation of call by stack and call by reference.
Hello Scott, great video! I want to clarify something. At 22:03 you say the object p is being passed by reference. Actually, the Person object is not passed by reference when the DoSomethingCool (p, c) method is called. Only the reference of the object in the heap is passed by value. If DoSomethingCool was called (ref p, c), it would be called by reference, and when a new assignment was made on object p, the object p in the Main method would also be affected.
Way to go, lots of education done here... Suddenly, the call stack doesn't look so magical anymore. Thanks for bringing it down to earth.
Thank you for your 4 levels knowledge steps and how to deal with it. That's one of the what they didn't teach in school.
Thanks for taking the time to make these videos. Even if I have a grasp of the concepts I always get a "aha!"-moment. And it's so refreshing with the one-take-format compared with the "I cannot put two coherent sentences so I must cut after a sentence"-experience that is so common atm. Keep it coming!
Do one about processes, threads, OS threads, CPU, cores etc.
Good idea!
I support this idea!
@@shanselman something similar for Channels in Go too
Straight to the point and eye-opening examples. If you're open to suggestions, here are some topics I think would make a great fit for the series: floating-point arithmetic, asynchronous programming, memory management / fragmentation, threads / multithreading and bitwise operators.
Please do an Async video. It seems like it is so hard to wrap my head around and I think you would do a great job and teaching this tricky topic.
Thank you! and I am so happy to see Amharic book in your hand. with that I have seen your contribution to Microsoft product features having Amharic language
Habtamu Desalegn Gobez! Amaseganalehu
@@shanselman egnam betam betam enamesegnalen.
Thanks, I constructed heaps, stacks, trees, nodes and so on, back at the university......
Cool! Just realised why my attempt to create fractals on a Spectrum 48K 30 odd years ago may have failed! I'd love to dig that code out now!
As expected, another quality video, no edits or cuts (which is really hard), demystifying what happens behind the curtains!
Quick tip: you can use Ctrl+D to duplicate objects on draw.io (as you do in PowerPoint and other MS softwares).
Thanks!
Even though I'm very familiar with stacks and their usage, I very much enjoy listening this :)
Another great video. Thanks Scott! I have some requests for future videos:
1) deep dive how a web server like Kestrel works. For example, explain how it interacts with the networking software/hardware, how the request pipeline works, etc.
2) how the .NET Core runtime works
3) the architecture and inner workings of the C# compiler
Just some suggestions. I know your time is limited and I really appreciate the videos you do take the time to make!
Scott, you always inspire me. Thank you! :)
Excellent presentation I actually learned something I’ve been doing.net for 15 years so thank you!
The book analogy really worked for me 😄
Nodes, pointers, registers, wow, It is like receiving a nice sandwich at a picnic...... lovely..... I studied this here at venerable Guatemala, Central America
"I'll live up here for now" had me laughing more than I want to admit xD
I'm always looking forward to your next video. I enjoy them thoroughly!
Thank you
Finally youtube recommends great stuff!!
Great video! Also love the illustrations on how we can use the VS tools like the Diagnostic Tools.
How are you doing with learning Zulu? My cousins in Kwazulu-Natal Durban can speak Zulu fluently, but where I live they taught Southern Sotho in school. Dumela ... :) *means “Hello”. In Zulu it’s “Sawubona”. Love this series a lot, and I’ve been programming for 28 years. Thanks for creating them, your blog, and all your talks - you give back and it means a lot to me, and I’m sure many others.
Basically I speak like a small child, but been married to a Zulu 20 years. I need to do better. ;)
@@shanselman lol, it’s like everything - practice, practice, practice. 👍
Technically speaking, a stack is an "Abstract Data Type", not a "Data Structure".
The difference being that an ADT doesn't specify how the data is structured in memory. You can implement a stack using different data structures, like an array, a linked list or a hash table.
Thanks! That's a fair comment. I tried to keep it simple but this is a good hair to split!
Thank you for all the videos Scott!
Could you make a video about compilers and/or linkers? I think there's a lot of confusion surrounding things like AOT vs. JIT compilers, what .dll files are, and how compilers do what they do, so I think making a video about it could help a lot of people! (me included)
Love this series!
Seeing the books: What do you use for your Zulu learning? Would it apply to other languages? Would it make a good video?
I use my wife for my Zulu learning ;)
Hey! As a South African it's cool to see you're learning Zulu or at least trying to! 😝❤
unkosikazi wami uNdebele. Sineminyaka engama-20 sishadile.
@@shanselman Hahaha Congratulations! Mr. Hanselman!! 🥳
Also, 6:00. Someone has been doing Ruby 💥
Thanks Scott! Always really informative and enjoyable to watch!
You are helping so much, OMG., I remember i learnt this too
Thanks Scott, keep it up, you make things really easy to understant!
That face in the thumbnail is priceless!
Thanks Scott very good explanation.
Did Bob Ross cut his hair and start programming?
This is awesome!
Thanks for sharing Scott, very interesting session, sorry, but I have a question, could the forum have the answer? Why does Scott use the Power Shell many times? I don't understand, my PowerShell is very simple, does anyone know something about it that helps?
Another lean and great explanation. Shared in linkedin.
Your voice ASMR I feel so sleepy 😊
Good introduction to this topic.
Lovely stuff (as usual). Two questions though:
1. Why do you use int for a and b, but long for c?
2. Is there a way to see (in Visual Studio for instance) if a variable is passed by reference or value, assuming that it’s not explicitly defined?
@Noceo If it helps for question 1. for example for range of int is 0-10 and range of long is 0-20, so if we declare variables a,b,c are int then by adding a and b then we cant store the value in variable c example a=5, b=7 then c=12 so int range is 0-10 so we must declare c as long this is the intention but you can declare the variables a,b,c are int if you know the bound of your inputs.
1. Because the maximum size of an int plus the maximum size of an int doesn’t fit in an int.
2. Good question. I don’t think so but I’ll check.
When do you decide to use VS over VS Code and what makes you want to use either?
Hey Scott, it would be cool if you could make something on the basics of computer architecture and hardware end
Thanks a lot for your video, Scott!
Scott, would like to see how Windows desktop application packaging work..more like an overview
Zulu. That was unexpected fork in a stack tutorial.
For me you are my mentor, thanks
Thank you Scott !! As always very informative indeed.
Can you please do a video on the correct usage of await async and the new awaiy for each.
i have 1 question, how come there is 9 dislikes on such an amazing video
Excellent video. This was a revelation!
_scott : String = "youKnowYourWayAroundSomeVeryPowerfulSoftwares!"
Liked! Subbed!
Hey Scott, I'm pretty sure C# compiler does do tail recursion optimization for Release compilation... it just doesn't do that for debug.
Yes and no. The .NET Core one doesn’t unless you set the environment variable COMPlus_TieredCompilation=0. The issue is that Tiered Compilation is first and faster, so the current design favors that.
The .NET framework 4.x one does, as you say, but only x64 and Release.
Hey Scott. Thank you for the series. Could you make a video about http / https requests? Ask you like a complete novice in this question, so some examples of them would be appreciated
Superb content and presentation.
Me: *starts scouring his videos*
Me: *sees this, gets ready to comment how they DID teach this*
Me: *calms down after 5s intro*
Null Revolt :)I gotchu
Talk about some random books to be found on one's desk: "calculus made easy" and "learn zulu".... lolwut
LOL, it is always nice to learn sth new from you, thank you sir.
I love your videos so much.
That pause in the beginning right? I was scrambling to check my volume 😂
lol sorry
@@shanselmanNo worries. I should've noticed your lips weren't moving but here we are.
Thanks for your videos! Somehow it calms some hectic days for me.
This will be handy for my exam!
I need to create a REST listener service and be able to use a Powershell script to send data to that REST listener. I want to collect info, like a list of running processes, or volume size/free space, then send the JSON output to that listener. I think you are just the sort of person who will know how to do that, more importantly you're good at explaining things.
Thank you soo much for this. Just came across your channel. Great explaination. (subscribed)
Happy stacks!
Thanks for the video. I am still confused about the relationship between the data structure and the memory allocation. If I define two ints, a and b, I understand they will both go on the stack. But then if I need to access 'a', does the stack need to first pop off 'b' to get to 'a'? Add then what happens if I later need to access 'b'?
Good question. The system internally addresses variables on the stack as offsets to a pointer to the stack, so for us, we just access any variable on the stack that is in scope.
@@shanselman I see. So it works a little differently than the stack data structures I would normally use. Thanks Scott - I appreciate the reply and am learning a lot from the videos.
Love the video, but it's really necessary to have 1/9 of the screen being your cam? specially if only 1/3 of the cam is your face? I can see that you noticed it was getting on your way all the time. Maybe you could change to full screen when doings the explanations, but have a smaller (or maybe none) box with your cam or something.
Good call. I can try cropping it next time.
What a wonderful video, thank you sir !
Love the thumbnail lol
Hi, quick question:
I have recently started programming (RPA) but my background is originally chemical engineering, so apologies if I´m asking something really obvious, but how/why is the variable 'person' allocated in the heap when he is explaining stack allocation? I don't see any difference from the way he defines the other variables.
Thank you for all the videos, they really are useful!
The "spoiler = No" bit at the end was brilliant :D :D :D
The difference is that “new” keyword.
@@GrahamStw oh, I see! Thank you! :)
Hi Scott, do let us know presentation software you are using for making your videos ? Looks quite handy & cool :) ..
I record with OBS
Calculus,Aramaic & Zulu an unusual combination of Interests
How is the first example stack allocation? It’s using the new keyword, I thought the new keyword is heap allocation, it looks to me like all you did was create an array of strings, In fact it looks really similar to the dynamic array allocation of the Vector class in c++ where you push back elements into the array
Yes, new is heap allocation, while the int and long are on the stack.
Wow Scott are you learning Zulu? I saw the books at 4:40. That's my home language. Thanks for the upload
Unkosikazi wami uNdebele, sineminyaka engama-20 sishadile.
@@shanselman Excellent Zulu - time to pop those Zulu books off the book stack
thank you for making this.
What's the font that you're using in notepad?
Cascadia Mono
The int value which is inside the person object stored in stack or heap?
I found the answer. stackoverflow.com/questions/6822314/where-is-value-type-inside-a-class-is-stored
The stack is just like LIFO in accounting. Weird how random disciplines relate to each other.
LIFO is also a term in cs so it's just like LIFO in general
@@diddlybop truth
This was great! Thanks
Appreciable Sir :)
Reading amharic book. Love that
Gobez!
Very informative :)
pls make one on prallel programming in c.
This is "Computer Stuff They DID Teach Me" over here in Europe. Both at high school and university.
RheaAyase definitely. I mention that at the beginning 😀
@@shanselman I feel like this topic is strong with the modern "programmers" raised on Python alone :/
Kinda funny how the older generation had better computer science education than the youngsters.
@@RheaAyase yes you are right. we can learn from one session about memory(heap & stack), function call, recursion, overflow errors in one hands-on practical code lecture. If we have some theoretical background then this kind of lessons from @Scott Hanselman help us to clearly understand the theory, organize our knowledge(concepts) and teach others and mostly uses of tools tasks such as advanced debugging (for sure we didnt learn at school).
26:29 Happy End function :)
Ok a ZULU man from South Africa can't help but notice the Learn Zulu book :)
Yebo bhudi!
Only i still wait some awesome stuff in MS Word on VBA)
i wished i watched that last year ;c
People say curly braces looks like Mustache, but I dont think so. LOL
Create video, thank you for your work :)
I want your brain scott hanseldude !!!
The dislikes are from the overflow
Thank you!!!
Do not forget to transform for your HEX getHEX.info much love!! Keep Stackin
Looking vital for a 100 year old!
I dont do birthdays in my prime!