Great Article on Stack vs. Heap in the CLR
Moderator: Coders of Rage
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Great Article on Stack vs. Heap in the CLR
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Great Article on Stack vs. Heap in the CLR
I think the heap vs stack portion of this article is a huge "no shit" for a developer of a natively compiled language... Whether you're using a garbage collector or not, heap management and fragmentation still exists (only you have to care about it even more), and the stack operates in exactly the same manner. An allocation is literally a pointer addition. A deallocation is a pointer subtraction.
He didn't mention that the stack is also more conducive towards caching either... All the variables of a function are spatially local on the stack, and parent functions' stack frames and their closest childrens' stack frames are temporally local.
He didn't mention that the stack is also more conducive towards caching either... All the variables of a function are spatially local on the stack, and parent functions' stack frames and their closest childrens' stack frames are temporally local.
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Great Article on Stack vs. Heap in the CLR
For a very strict definition of "developer", sure. But there are a lot of people calling themselves developers these days who couldn't even describe a stack data structure, let alone differentiate between the two types of memory allocation.Falco Girgis wrote:I think the heap vs stack portion of this article is a huge "no shit" for a developer of a natively compiled language...
I posted this as a helpful introduction for someone who has not studied data structures proper but has heard the terms "stack" and "heap" thrown about colloquially without explanation. I also found the tidbit about the stack being an implementation detail in the CLR informative.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Great Article on Stack vs. Heap in the CLR
Just because you call yourself something clearly does not make it so...dandymcgee wrote:For a very strict definition of "developer", sure. But there are a lot of people calling themselves developers these days who couldn't even describe a stack data structure, let alone differentiate between the two types of memory allocation.Falco Girgis wrote:I think the heap vs stack portion of this article is a huge "no shit" for a developer of a natively compiled language...
If you don't know the difference between the stack and the heap, you aren't a developer. Sorry.
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Great Article on Stack vs. Heap in the CLR
+1Falco Girgis wrote:Just because you call yourself something clearly does not make it so...
If you don't know the difference between the stack and the heap, you aren't a developer. Sorry.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- bbguimaraes
- Chaos Rift Junior
- Posts: 294
- Joined: Wed Apr 11, 2012 4:34 pm
- Programming Language of Choice: c++
- Location: Brazil
- Contact:
Re: Great Article on Stack vs. Heap in the CLR
Wait... what have I been working with all these years, then?Falco Girgis wrote:If you don't know the difference between the stack and the heap, you aren't a developer. Sorry.