Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For everything computer related, I use a cooking dinner example. I start by saying that hard drives are cabinets/storage closets. Memory is like your counter. Processor is the cooking apparatus (stove). You are like the system bus (moving things around, etc...). So when you boot a computer, you take your basic ingredients out of storage and put them on the counter (loading the OS). This is a loose example, but it works well.</p> <p>Now to move into OOP: an ingredient is an object, so is a tool (bowl, knife, spoon, etc...). Each one of these has properties (knife= handle_color: black, blade_type: serrated, etc...). And each one has methods/actions that you can perform with them (knife = cut(pepper)).</p> <p>Now you can take this as far as you want to. For instance, there are green, yellow and red peppers. Each one is a pepper, so you can say "inherit the pepper class" (layman: take everything you know about a pepper and apply it to this specific pepper, pepper has a color attribute, a red pepper is color=red). </p> <p>You can even separate class from instance (this particular pepper is an instance, whereas on the recipe card it's a class).</p> <p>So you could make some pseudocode:</p> <pre><code>class pepper { var color var spiciness var size } class redPepper extends pepper { construct(){ $this-&gt;color=red } } class cuttingKnife extends knife{ construct(){ $this-&gt;blade_type=serated } } class cookingPot extends pot{ construct(){ //We all know what a cooking pot is } } class stove extends apparatus{ construct(){ //We all know what a stove is } } $knife = new cuttingKnife(); $myPepper = new redPepper(); $pot = new cookingPot(); $stove = new stove(); $knife-&gt;cut($myPepper); $pot-&gt;putOn($stove); $stove-&gt;cookOn("high"); $pot-&gt;putIn("water"); $pot-&gt;putIn($myPepper); //This will boil a cut pepper </code></pre> <p>Of course, people won't necessarily understand the pseudocode, but they would understand how to boil something. They would understand the difference between a "pepper" and a "red pepper". I think you can pretty much use this analogy for any computer related thing with some minor tweeks.</p> <ul> <li>multithreading: add more burners to the stove and another cook in a single kitchen</li> <li>multicore arch.: add a second kitchen</li> <li>downloading/installing software: go to store, find food, bring home, deposit in storage</li> <li>partitioning a HDD: different cabinets/fridge could be Linux proc system (because it's special).</li> </ul> <p>Etc...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload