What are “Classes” in programming and how are they distinct from functions? What about their applications?

279 views

What are “Classes” in programming and how are they distinct from functions? What about their applications?

In: 10

21 Answers

Anonymous 0 Comments

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.

You are viewing 1 out of 21 answers, click here to view all answers.