Handmade Network»Forums
13 posts
Data oriented tutorials
Edited by HRose on Reason: Initial post
Hello, long time lurker here since the very beginning.

Firstly I want to thank everyone for all their time and energy into such a wonderful community.
Its been a big help for me and really shifted my perspective many times.
I should have really included myself in the discussion, but I let my anxiety get the better of me.
I want to change that and get more involved and contribute to online communities such as this one.

Anyway,

One day, I was being lazy(not thinking for myself) and started looking for inspiration on a data orientated approach to link list. I couldn't find any resources and then it dawned on me.

Maybe there isn't enough short form content out there to get people interested in this style of programming.
You have to seek it, be willing enough to read a whole load to then try to visualise things with a ton of trail and error. Obviously that what learning is, a ton of trail and error. But seeing that wall in front of you can be a huge turn off to new people learning.

Where as if you was to compare that to the high level Javascript, Python, C#. There's lots of different video resources and courses that really seem to then get people hooked on programming.
Maybe there are lots of people interested in how computers work or learning(once introduced) but are scared off because it seems too daunting for them. Or they get a negative experience then end up thinking less of themselves and shy away.

I was once this person but had the will power to keep at it over the many years.

So I was thinking, considering all the knowledge I have accumulated and the perspective I have. It would be good to make a video series to help people learn programming from this perspective in a friendly visual way. To show that maybe this wall in front of them is just stacks of simple like what they learned before.

Over the past couple of weeks I have been making the first video in a series on teach data orientated programming. Now that I know how to make a video, future videos should take far less work.
They idea is to show what things are and why we use them. Trying to be as visual as possible as I find what helps me solve problems easily, is picturing things in my head. Video implicitly helps get that across.

The first video is on pointers and data structures in C that is aimed at the high level programmer.
There will be more videos to help ease the high level programmer into this style of development.
Such as:
  • OS paging / virtual memory
  • CPU memory caching
  • Reading hexadecimal


later on programming some abstractions.
Such as:
  • A cross platform virtual memory abstraction
  • Custom memory allocators
  • Implementing a stack collection
  • Advanced collection data structures such as hash maps and link list


Any code used and presentations will be up on Github free to use too.
So people can download and mess around with the examples to get some first hand experience.

If you could watch the video and give me some feedback, that will be greatly appreciated.
Also if you like it and think it would help others, could you share the video?

The video is here:



Thank you for your time, and looking forward to the future :)

Henry
Miles
131 posts / 4 projects
Data oriented tutorials
Edited by Miles on
You should try to record your lines farther from the microphone for better audio, if possible. Other than that, the production value is quite good. The slides are clean and the graphics are definitely helpful.

However, you may want to think about your target audience more clearly when writing the script. It's not clear who exactly this video is aimed at, and the assumptions it makes about what viewers know or don't know seem very arbitrary. For example, you go to the trouble of explaining what an integer is, how many bits are in a byte, and that larger numbers can be stored in larger integers... but then later you assume the viewer is already familiar with hexadecimal, how memory is addressed, what x86_64 and ARM32 are, what "register size" means, what the heap is, and so on. There are also things you introduce but simply don't explain, such as how your "for_range" macro works or what exactly it does (or, for that matter, why you are using it in the tutorial video in the first place). The result of this inconsistency is that someone who is knowledgeable enough to understand the video will unfortunately also be knowledgable enough not to find it helpful.

Also, there are some dubious statements in the video, such as: "In modern systems at time of recording, the default stack size is 10MB". As far as I'm aware, default stack size differs between operating systems. On my macos machine, it's 8MB. https://docs.microsoft.com/en-us/...in32/procthread/thread-stack-size suggests it's 1MB on Windows. Or: "If the structure is large, or you want certain fields of the structure (?) you should always pass in a pointer to the structure". And the explanation of stack layout implies that local variables will be stored on stack in the order they are declared in code, which is not necessarily (and I think not usually) the case.

To be clear, my intent is not to dissect each specific point in the video. Rather, I want to encourage you to put yourself in the student's shoes more when teaching. I think that if you focus on more precisely understanding and directly addressing the gap between what a viewer already knows and what they need to know, these videos can become a very useful resources.
13 posts
Data oriented tutorials
Awesome thank you for critique :)

I shall take a look into my microphone setup again. I had a problem with it cutting out when I spoke to softly. I'll mess around with the settings and position it further away to see if I can get a better results.

Right, I can see some of inconsistencies were I chose to deeply describe some things and lightly touch on others. The thought process was give the viewer a foundation and also give them something to question to try and entice the user into looking into some things by themselves.
I do see how this could have been done better though for sure, as it does put some potential road blocks in depending on what kind of exposure the view has had.

Ah damn that 10MB stack size thing seems to be some misinformation.
Right, that "passing the pointer to a structure into a function" should have been explained better and illustrated. Rather than just thrown in at the end of the segment.
I did mention before showing the call stack that is was meant to be a abstract idea that is similar to how it works on x86.

I will go through the video and look out for any more potential road blocks.
I guess corrections will have to be a comment in the video and in the script.

Thanks again, I appreciate the time :)
Jesse
64 posts
Programmer at NASA GSFC
Data oriented tutorials
Nice!
Abner Coimbre
320 posts
Founder
Data oriented tutorials
Edited by Abner Coimbre on Reason: Initial post.
I guess corrections will have to be a comment in the video and in the script.


YouTube doesn't allow clean re-uploads? I suppose that's problematic if the comments reference something that's no longer there, and you probably don't want to start from scratch either.

Something I've seen other channels do is submit a Part 1.5 which simply makes corrections. For example, this gameboy autopsy video got corrected with a 1.5 (see the video description.)

P.S. Thanks for working on this. We once tried to do an educational series on HMN and it's no simple matter! Anyway, it's always thrilling to witness high-quality efforts come out of this community; will keep an eye out.
13 posts
Data oriented tutorials
Edited by HRose on
After letting it sit and then giving it some thought. I thought I would redo the video and add in things to make it easier to follow along. But then the video will be 40 minutes long and that not as short form as I would like. Maybe by having them as short as possible and to the point will get people interested more.

Some I'm actually thinking of trying to break them up into smaller targeted videos that I can go more in depth on each topic.
Each video will reference previous videos if road blocks will be introduced. They will also be as long as they need, but will also be under 15 minutes at the most and hopefully around 10 minutes.
This way the videos will be easier to make too.

Videos (in order):
  1. How do Integers work?
    • sized integer types
    • how the binary representation works (signed, unsigned, overflow)

  2. What is hexadecimal?
    • explain numbering system
    • how it maps to binary
    • patterns to look out for to make things easy way to remember

  3. What is a pointer?
    • this time without the call stack used as the method to explain,
      as it makes more complicated than it needs to be at this stage.
    • still use a visual representation but just say will take an address in memory
      and we pass that to a function so we can modify this type.

  4. How do arrays work?
    • show static and dynamic

  5. How do data structures work?
    • pretty much everything that was explained in the original video

  6. How does calling a function work?
    • here we can show an abstract idea and then also dig a little deeper into how different ABIs actually work.

  7. How do CPUs execute code?
    • showing the basics x86, arm, maybe others
    • show what C statements will be transformed into

  8. What is CPU cache?


what do people think?
and does anyone have ideas for how to name such videos?

also, my video ended up coming out with a load of artifacts on youtube but looks perfectly fine in the copy on my machine. Could there be anything I can do my end to help minimize this? I do wanna keep the dark theme...

Thank you :)
Simon Anciaux
1337 posts
Data oriented tutorials
I think those kind of tutorials would be better in text form. In text form I find it easier to follow as you can take your time and let things sink before continuing. It's easier to search for things (both if you know the content or don't know the content) and easier to save a local copy.

Having the script available on github helps but it's not as good as a full text article.
Miles
131 posts / 4 projects
Data oriented tutorials
I think splitting up the videos is probably a good idea, and the topic progression you laid out looks good to me. Regarding what to name them, how about naming them based on the questions you already wrote? So video 1 could be titled "How do integers work?", video 2 can be "What is hexadecimal?" and so on. I'm looking forward to seeing these!
13 posts
Data oriented tutorials
Ok so I just released "how do integers work in computers?".

Thank you for the feedback on the previous video, I have taken it into account when planning the ones after.

I think I have managed to get the audio mostly sorted out, but still can do with some minor improvements for sure.
This time I have really thought about how to teach this to a beginner, by thinking back to how I used to think before I knew anything about this topic.
I'm feeling good about this one and tried very hard not to go down a rabbit hole a lose the viewer in the detail this time XD

Anyway I won't spoil the experience too much more, so here is the video.



Looking forward to hearing some thoughts :)
Much appreciated,
Henry
Miles
131 posts / 4 projects
Data oriented tutorials
The new more focused videos are great imho. If I need to explain binary integers to someone I'll probably just point them to these as a reference from now on.