0
What's the difference between classes and functions ?
6 ответов
+ 5
Classes are box blueprints that can make boxes called Objects that store data.
Functions are a series of actions that are taken so that something meaningful can happen. Usually functions are used when there is a repeating piece of code so that repetition is avoided.
+ 1
But what classes are used for ?
+ 1
They allow you to store certain forms of data in neat packages. For example storing an array of objects that each describe name and price is better than sorting an array of names and then an array of prices (arrays are objects themselves too!)
+ 1
Any other things classes are used for ?
+ 1
Wdym? Classes are only blueprints! They don't serve any other purpose because the above stated purpose is the penultimate reason programming even exists.
0
I'm confused between functions and classes.