var name = prompt("What is your name?");
alert("Hello " + name);
So while I go through the Fundamentals of Programming class at my two-year college, I am supplementing that knowledge with Lynda.com training. I am going through the Foundations of Programming: Programming Fundamentals (overlap, I know. I wonder if all programmers think this way about learning?) I am finding it a really great course with a guy teaching who pulls no punches. He talks about compilers and interpreters and it seems like ALL desktop languages need compiling. Web languages seem more flexible, being interpreters and cross-platform.
We talked about variables and thanks to the creator of my favorite iOS workflow/Automator app Workflow, I have a solid grip on variables– just containers for data that you can reference again later in your code. I hear all the time about naming conventions– have to be careful as other people need to read your code and it needs to make sense to you and the program. It gets dicey. So up there the variable is named “name” because, well, it’s asking for a name. The prompt command brings up an interactive block where you can write your name, or anything else because the output is not dependent on the input. So you could put “shithead” and it will call up the variable name, and send an alert (another command):
See what it did there? Pretty cool.
He got into the fact that if you have dependencies on the input, say a math function or an email, if you put
and you put “shithead” in the prompt, the tab will crash because it is dependent on a data object and not some random variable like name.
So yeah. Learning is fun but I’ve been about all day– class, the gym, etc. I am tired and at 12:15 am on the East Coast, I have to eat dinner. Can’t wait to get up and get working more on Lynda.