A small matter, but I would start the heap at an address other than 0x00. “Assume malloc returns 0x40” should be equally comprehensible for beginners, and pedantically correcter for people who know about null.
I started losing track of the C++ push_back example after the third memory table. I felt like I didn’t understand what had changed or why compared to the previous table, and wanted to see the code again to see what was going on. I felt like that would take too much scrolling, because the tables were so tall. I ended up skipping past the rest of that example.
I can think of two changes that would help with that. One would be having the code visible at all times in that section, making it scroll along with the page in a sidebar until it is no longer being discussed. The other would be changing that part of the document to an interactive widget that is like a slideshow of a debugger, with captions. Each “slide” would show the code with the current line highlighted, the current memory contents, and the paragraph describing what is happening. Since the memory contents would update in-place, it would be easier to see what changed from the previous contents.
A small matter, but I would start the heap at an address other than 0x00. “Assume malloc returns 0x40” should be equally comprehensible for beginners, and pedantically correcter for people who know about null.
I started losing track of the C++
push_backexample after the third memory table. I felt like I didn’t understand what had changed or why compared to the previous table, and wanted to see the code again to see what was going on. I felt like that would take too much scrolling, because the tables were so tall. I ended up skipping past the rest of that example.I can think of two changes that would help with that. One would be having the code visible at all times in that section, making it scroll along with the page in a sidebar until it is no longer being discussed. The other would be changing that part of the document to an interactive widget that is like a slideshow of a debugger, with captions. Each “slide” would show the code with the current line highlighted, the current memory contents, and the paragraph describing what is happening. Since the memory contents would update in-place, it would be easier to see what changed from the previous contents.