Jag har sett det vackra med OOP men jag kan inte fatta hur man plockar ut och ersätter dem förinstallerade kugghjulen för eget bruk.
Jag har bland annat läst detta stycke från en bok men fattar inte vad dem menar med att
procedural lägger vikt på funktioner medans OOP lägger vikten på variabler. Kan nån förklara detta synsätt med vardagssvenska?
The big advantage of classes is that they let you define variables and the functions that use them together in one place, while keeping the functions hidden from unrelated code. This highlights one of the key theoretical point about the object oriented paradigm.
- The procedural paradigm places most emphasis on functions, variables being treated as little more than a place to store data between functions calls.
- The object oriented paradigm shifts the emphasis to variables; the functions "back" the variables and are used to access or modify them.