Functions And Variables
Lets look at our naming convention for functions/variables/methods/properties.
Video Transcript
00:00Now, functions and variables, we like starting them with lower keys, alright?
00:04And that's true also for objects. Let me just write that, because, and why did I say objects?
00:08And anyone have any idea why do I include objects inside of functions and variables?
00:15Anyone has, like, a guess, why do I consider an object?
00:19I'll tell you, I consider it a variable. You guys tell me why.
00:23That is all true, and why is that? Because an object is a variable, right?
00:32Because we give an object a name. It's a variable, right?
00:35There's arrays, there's objects, there's...
00:37After it's not a class anymore, it's usually a variable.
00:41It's in a variable, so we could interact with it.
00:43If it wasn't in a variable, then we wouldn't have a way to talk to it, most of the time.
00:47Unless we use something that's called this, that we're going to talk about later on.
00:51Exactly. So, from my consideration, when you're working with functions, variable, objects,
00:55it's all the same thing. We all want to...
00:57We want to give them a name, so we will easily recognize that they're that type.
01:01Now, functions is easy enough to recognize because we usually...
01:04Now, usually, we always open and close a bracket when we use them.
01:07So, it's easy to recognize that it's a function, even if a month passed.
01:10When you look at a function, you know, okay, there's an upper closing.
01:14When I call it, there's an open and close bracket.
01:16Okay, so we know it's a function. So, we don't have to differentiate it in the code itself.
01:20And variables, I like doing camel keys.
01:23Exactly. And camel keys is just, and let's just hear a sample.
01:26So, this is going to be my function and my var.
01:30So, that way, whenever I see my function,
01:32which is probably going to have an upper and close bracket, and this could be my object.
01:36All right. So, that's the most simple differentiation between, you know,
01:41now we know a package. It's easy to recognize that it's all lowercase.
01:44Anytime we see a function, we know that it's a camel case starts with a lower case letter.
01:50And then, any following word, we're not going to put any spaces or anything.
01:53We're just going to put an uppercase and then continue with the word.
