‫Welcome back.
‫And this video I would like to cover coding standards.
‫Basically, coding standards are a set of guidelines, best practices and programming styles that developers
‫followed when writing source code for a project.
‫So all big software companies follow these standards and companies have their own standards as well.
‫So these are just some examples of coding standards.
‫Of course, once you work in a company, they will tell you to write your code in a certain way because
‫that's how they do it.
‫So let's have a look at the parts of the coding standard.
‫You should always give your variables a reasonable name.
‫So while declaring a variable, the developer has to give the variable a proper name.
‫The name of the variable should be based on its use.
‫Think about what do I use this variable for?
‫And then give it a name that describes what this variable is really used for.
‫For example, if you want to store the h of the user, then a good name for that variable would be.
‫Age or user age.
‫You should also give your functions a proper name as well.
‫A function should be given a name based on the functionality it does in the code or program.
‫So functions usually do actions, right?
‫So for example, if you want to have a function that will check for internet connectivity, then you
‫call it check internet connection.
‫Then comments.
‫It's a good practice to always leave comments in your code and in big tech companies it's a must.
‫Functions should have comments which state the use and functionality of that function.
‫It helps other developers working on the same project to understand what the use of that function is.
‫And it's not just for other developers, but it's also for yourself.
‫When you come back to the code a couple of years later or even a couple of months, you will find it
‫really tough to understand your own code if you don't have proper comments and you will have to figure
‫out everything from scratch again, which will take way too much time.
‫All right.
‫Now let's explore the different types of comments you can use in your projects.
‫So there are single line comments, and this is a single line comment that you can see here.
‫It's useful to describe what variables are or what an if statement is for.
‫Then there are multi line comments used to comment more than one line.
‫It starts with a slash star and ends with a star slash.
‫So this can go over multiple lines.
‫You can add a lot of comments in there and all of that will not be interpreted by the compiler.
‫So it's just there for the developer to read.
‫And then you can use the XML documentation comments used to create documentation of functions or a class.
‫It's a typical type of commenting.
‫In C-sharp you start with three slashes, then you have the tag summary and the summary is within brackets,
‫and then you basically just fret whatever this class or function does.
‫These are pretty useful when you share your code with others because Visual Studio will recognize them
‫and display the summary when you call the method.
‫As you can see, once we hover over the methods, we will read the summary we wrote.
‫So here the cool method, for example, has a summary that says This is a cool method, and once you
‫hover over the cool method with your mouse, it will state that summary at the bottom of it, saying
‫what the method does.
‫All right, so that's it for the standard practices.
‫Of course, there are more practices that you will come across once you are actually working for a big
‫firm or in a company in general where you will learn how they decide to, for example, name their variables
‫and so forth.
‫Okay.
‫So see you in the next video.