The difference depends on if you’re talking method or actual functions.
In practice a class is an object (separate file with separate logic from another class). Typically a function is used in non-object oriented programming, but is used to separate tasks or actions in different parts of the same file. Note, methods in object-oriented programming are similar but a little different and typically work for the class they’re apart of
The big difference is that a class IS something and a function DOES something. A class can contain a bunch of IS somethings or DOES somethings (methods or functions). A function is purely the DO of something.
Latest Answers