Dot Syntax and “Intellisense”

You may have noticed as you type out these lines of code that a little window pops up right when you hit the ‘.’ key:

alt

It turns out that “Console” refers to a whole set of different built-in functions, and we access those functions by typing Console. (“Console dot”) and then the name of the thing we want to do.

But we don’t have to memorize all of these different functions, because Visual Studio has a handy tool called Intellisense that will tell us all the options available to us. Here’s how it works:

Type Console. to bring up the intellisense window. Now, as you type more letters, intellisense will search all the possibilities for you, narrowing it down according to the letters you type. Here’s what intellisense shows me if I write Console.wr:

alt

It highlights the option that’s its best guess at what we want. If the option you want is highlighted, press the enter key or the tab key, and Intellisense will go ahead and write the rest of the line for you! If you see an option in the list that’s not highlighted, you can press the up and down arrows to scroll through them, and press the Enter or tab key to write that line.

alt

Intellisense is great because it helps us explore the different options available to us, and also makes it faster to write out lines of code. It’s like we’re collaborating with the computer to write code!


Previous submodule:
Next submodule: