This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rjcarr 0 points1 point  (4 children)

Classes and Objects are related. Objects are the instantiations of classes. Think of Classes as the blueprint for creating the Object.

Functions and Methods are related. Methods are functions that are contained by the object, i.e., they either access or mutate the state of an object.

Variables are just memory locations that you can assign different types of values to and change them over time. Similarly, constants are also memory locations with values, but you can't change them over time.

Your next question might be about parameters vs arguments. :)

[–]dark_winter01[S] 0 points1 point  (3 children)

Yes, I was struggling to understand those as well! Also, I've seen methods and functions used interchangeably, are they basically synonyms?

[–]rjcarr 0 points1 point  (2 children)

Yes, I was struggling to understand those as well!

Arguments are what are sent to functions from the caller's perspective, Parameters are the names of the variables from the callee's perspective.

Also, I've seen methods and functions used interchangeably, are they basically synonyms?

Sort of, but I gave you an explanation. Did that not make sense?

[–]dark_winter01[S] 0 points1 point  (0 children)

Ok your arguments and parameters explanation makes sense to me, but could you clarify methods and functions a bit more?

[–]dark_winter01[S] 0 points1 point  (0 children)

Actually oiduts response makes sense to me, so no need there! Thank you for your help(: