In this lecture, I'm going to talk more about identifiers. When you write code, you will see in the code tokens that we call identifiers. So we've already written code where we see int, main, paren, paren. The int is not an identifier, it's a keyword. Main is an identifier, it's the name of the function in which execution starts, and the parentheses are not part of the identifier. Parentheses get used for a function call. Now, one of the key parts in writing good documentation in any programming language is proper choice of an identifier, and we have to know the rules for how to choose an identifier, and here is a shorthand for the rules. I'm not going to do much of this, but I'm going to explain it. This is what is called a syntax equation. Identifiers sitting on the left side an identifier in C is made up of a letter or underscore character, and which you have at least one letter or underscore. This straight line means or letter or underscore. When I subscript by one, it means I have to have at least one of these. Then following it, I have a letter, or underscore, or digit, and I can have that zero or more times; the plus sign means as many times as I want. So Identifiers can be arbitrarily long. Generally speaking, you're not going to see identifiers that are more than 10 or 12 characters that would be as big an identifier as you're likely to see. In C, what conforms to this? Well, the simple one letter identifier K frequently use for integers that are auxiliary integers in writing your code. _printf, that could be an identifier, and in fact, that's probably the identifier that the systems programmers used when they design the printf function. Here is a common thing you see, two_words. When you have the two words you have two_words, see underbar or the underscore characters, I should say, the underscore character is used to separate distinct words. When you want an identifier, but in English you want to have more than one word in your description, one convention is to use underscore. Another convention is to tie the two words together with a capital, so to capitalize W the beginning of the second word, and that would also be another standard convention. What you shouldn't be doing is mixing them. Then here's another standard identifier, my_dna 23, and remember once we're past the first digit, we can use digits as well. What won't work as an identifier? The sharp character, so sharp me it's not an identifier. Sharp is not allowed anywhere, so or me sharp would not be an identifier. Here, rather than underscore, I'm using minus, and that would be the expression unary minus x. X could be an identifier but minus x is an expression, and 23 my_dna is not an identifier because the first character of that sequence is a digit, so that's not allowed. So digit is not allowed anywhere but in the first character. Underscores and alphabet are allowed anywhere including the first characters. Now, good choice of identifiers in your program help you document the program and make the program readable. Main, printf, square root, sqrt, those are actually things you'll see very commonly. Printf and square root come from standard library. And superman, if somehow you're writing some code to exhibit something to do with the character superman, maybe you'd use that as an identifier, that gives you a clear image as there is radius and i as well. It's a convention in the community, in both the programming community and mathematics community, when you want something that's for counting, you can use i, j, and k. Also you frequently can use n as another underscored integer, those would all be good choices. Of course, you have to use them for the right purpose. Here are some things that might be bad choices grx33, _pp_25, i_am_FourWords. Well, grx33 and this _pp stuff, we have no concept of what they might be. So they're not going to be readable, are not going to provide some kind of documentation. i_am_FourWords make sense, but we've mixed two conventions so that would in a way take away from the goodness of i_am_FourWords. Other things we aren't going to necessarily know if they're good or bad, let me put some up. They're going to have to have the right context. So data may or may not be good, it may not be adequately descriptive. Maybe you need height data, or weight data, or something else. Mxyzptlk, I'm not sure I'm pronouncing that right. Maybe that's an okay identifier, maybe not. Let me exit this. We look in our browser, and we look up these E cartoons. Here's Mister Mxyzptlk is a typical foe of superman. Superman always has to get him to say his name backwards, which again is very hard to pronounce. I'm not sure if gets to zoominic, whatever. Again, if you were writing some movie with Superman and Mxyzptlk, it might be an appropriate identifier. X might be an appropriate identifier especially if it's something like a coordinate in the x y plane, then it would make perfect sense. Again, we've said if we use j for integer is fine. Q may be good or bad, maybe it's obscure, maybe we're doing something like logic program, and in the logic community, P and Q are typically chosen to mean Boolean variables. If we were doing logical evaluation, P and Q might be quite appropriate. Again, that's contextual, so they might be either good or bad. Let me finish by looking at a very simple program that hopefully follows these constructs. Here's a piece of code, it's for computing the area of a circle. Notice we have main, that's an identifier. The capitalized PI would be an identifier in C, but that's a preprocessor command, and in the syntax, this must be an identifier, and then it's associated with this constant value, and it's typical. Another convention is when you have such a constant, you capitalize it. Again, there are community conventions that should be understood to make your program readable. You want an experience C programmer to say, I can read that and understand it clearly. So here we have two identifiers, area and radius, and we understand their meaning, that's how we're going to use them in the program. Double, of course, is a key word. Then we have printf, scanf, they're both standard identifiers found in the IO library and standardio.h. There's area equals PI times radius squared and so on. So this program abides by my conventions as good choice of identifiers.