Studying the Alexei Frounze Protected Mode Tutorials

Programming, for all ages and all languages.
Post Reply
User avatar
~
Member
Member
Posts: 1226
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Studying the Alexei Frounze Protected Mode Tutorials

Post by ~ »

The tutorials seem to be here more cleanly:
http://members.tripod.com/protected_mode/alexfru/pmtuts.html


I'm currently trying to study paging.

I'm carefully studying TUT08, the tutorial about paging.

What I'm seeing is that the code contains a lot of functions to pack the basic functionality.

But it seems like the functionality central to each tutorial isn't packed, it's just laid as code in main().

For example, the paging tutorial hasn't packed the code to find free 4096 blocks, allocate, fill, enable/disable paging, into functions like the rest of basic functionality.


It makes the key concepts harder to reuse than the common bulk of basic functions.

At least it allows people to practice packing those special functions, for example packing the paging code in main() into a set of reusable paging functions.

I think that this is an important thing to point out to make these tutorials more understandable, and to develop additional packed code elements here to make the main ideas of each tutorial much more reusable and easy to visualize.
YouTube:
http://youtube.com/@AltComp126

My x86 emulator/kernel project and software tools/documentation:
http://master.dl.sourceforge.net/projec ... 7z?viasf=1
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Studying the Alexei Frounze Protected Mode Tutorials

Post by Brendan »

Hi,
~ wrote:But it seems like the functionality central to each tutorial isn't packed, it's just laid as code in main().

For example, the paging tutorial hasn't packed the code to find free 4096 blocks, allocate, fill, enable/disable paging, into functions like the rest of basic functionality.

It makes the key concepts harder to reuse than the common bulk of basic functions.
The entire point of any tutorial is to teach. To do this example code is deliberately simplified and presented in a way to make it easier to teach, and is therefore not intended to be used in real software and not intended to re-used in real software.

The single biggest problem with a lot of tutorials is that they have compilable example code in the first place. They should use psuedo-code that can't be compiled, or have no code, to make sure that the reader actually does learn and doesn't just "copy & paste" without learning anything. That way people wouldn't make the insane "let's reuse something that was never intended to be reused" assumption.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Sik
Member
Member
Posts: 251
Joined: Wed Aug 17, 2016 4:55 am

Re: Studying the Alexei Frounze Protected Mode Tutorials

Post by Sik »

Brendan wrote:The single biggest problem with a lot of tutorials is that they have compilable example code in the first place. They should use psuedo-code that can't be compiled, or have no code, to make sure that the reader actually does learn and doesn't just "copy & paste" without learning anything. That way people wouldn't make the insane "let's reuse something that was never intended to be reused" assumption.
Really, they shouldn't even be teaching a given algorithm unless that's the whole thing they're trying to teach (in other words, avoid pseudocode at all costs too). They should just tell people what things they're supposed to do then leave them to figure out how to write code that achieves said goal. Bonus points because it'll let the programmer integrate things nicely according to their chosen design.

I think the problem is that a lot of people write tutorials with code thinking that'll help beginners, when the only thing they achieve with that is just let them copypaste code without looking at the problem and then go to forums to pester other people asking why their stuff doesn't work =P
User avatar
hgoel
Member
Member
Posts: 89
Joined: Sun Feb 09, 2014 7:11 pm
Libera.chat IRC: hgoel
Location: Within a meter of a computer

Re: Studying the Alexei Frounze Protected Mode Tutorials

Post by hgoel »

Sik wrote:
Brendan wrote:The single biggest problem with a lot of tutorials is that they have compilable example code in the first place. They should use psuedo-code that can't be compiled, or have no code, to make sure that the reader actually does learn and doesn't just "copy & paste" without learning anything. That way people wouldn't make the insane "let's reuse something that was never intended to be reused" assumption.
Really, they shouldn't even be teaching a given algorithm unless that's the whole thing they're trying to teach (in other words, avoid pseudocode at all costs too). They should just tell people what things they're supposed to do then leave them to figure out how to write code that achieves said goal. Bonus points because it'll let the programmer integrate things nicely according to their chosen design.

I think the problem is that a lot of people write tutorials with code thinking that'll help beginners, when the only thing they achieve with that is just let them copypaste code without looking at the problem and then go to forums to pester other people asking why their stuff doesn't work =P
I disagree. Not being given any pseudocode makes the tutorial potentially ambiguous (as language is), the last thing someone getting started on a new project needs is having to spend a ton of time dealing with unfamiliar concepts, trying to get them to work with nothing concrete to go on. Normal language just isn't strict enough to help a beginner gain the confidence and understanding he/she needs to continue. You'll end up with less pestering over why their code doesn't work, but it'll be because they just gave up instead of trying to solve their problem, the few who would get past would be the lucky few who happened to interpret the tutorial correctly or did end up 'persting' people.

Instead, pseudocode prevents copy-paste while still defining things strictly enough to follow. I know that I wouldn't have been able to get into osdev if I hadn't been able to initially learn stuff by either copypaste + experimentation or by following pseudocode and translating it into my own code. That gave me the confidence to actually try my own designs and to try and work without tutorials. I'd be okay with no copypaste simply because not enough people bother with the experimentation phase, and I feel that I would have been able to pull through with just pseudocode as well.
"If the truth is a cruel mistress, than a lie must be a nice girl"
Working on Cardinal
Find me at [url=irc://chat.freenode.net:6697/Cardinal-OS]#Cardinal-OS[/url] on freenode!
Post Reply