Skip to content

Instantly share code, notes, and snippets.

@radwomenunazhang
Last active August 17, 2020 21:48
Show Gist options
  • Save radwomenunazhang/6f6ff6139b39f45f818645d2f07deb3c to your computer and use it in GitHub Desktop.
Save radwomenunazhang/6f6ff6139b39f45f818645d2f07deb3c to your computer and use it in GitHub Desktop.
public with sharing class Welcome {
//Welcome! I'm a comment and I'm here to tell you what this particular class file is for. The developer who created this class added
//me so that future developers, like yourself, would have a quick little introduction to what this class does.
//The two little slashes tell the compiler* that everything following on this line is a note
//for humans and not code that needs to be executed
// (* A compiler is the computer program that translates this code into executable computer instructions)
//But you know what? This set of comments is already several lines long and getting longer. I'm tired of typing two slashes every time
/*There. That's better. the '/*' tells the compiler that there are multiple lines of comments coming. It knows everything on this line
and any following lines
and lines
and lines
and lines will continue to be comments
until it sees a */
//Ok, let's get started!
public static void youDoThisPart() {
/*Your assignment is to write two comments below this one. They should describe the few lines of code you se below.
Simply describe what the code is doing based on what you learned from readings and in class.
Make one as a single line comment using the // notation. Make the other one a multi line comment using the /* notation.
When you're done, save this file so that it is compiled and stored in Salesforce. */
// The code below declares a variable integer as i and assigns the value of 2 to i.
Integer i;
i = 2;
/* The below line declares the variable string as s
and assigns 'My String' as the value.*/
String s = 'My String';
}
public static void letsTalkAboutIndents() {
//As you look through the sample code in this org, and other places, you'll probably notice it looks pretty tidy
//That is the magic of indenting. Through simply keeping logical groupings indented the same number of spaces
//and then indenting sub-sections further, you always know what section you're in
//Take a look at different classes in the sample code for this org, and even if you're not quite sure what it's doing yet
//you should see that the indenting makes logical groupings easier.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment