Loading
Current section: Introduction to Programming Foundations 1 exercises
lesson

Intro to Introduction To Programming Foundations

Loading lesson

Transcript

00:00 Welcome to the programming foundations workshop. My name is Kent c Dodds, and I am so excited to help you get your start on your journey to becoming a software developer. This is really exciting because we're going to get from the very, very beginning of everything. I'm really only assuming that you know how to set up the workshop and how to run-in your editor. Outside of that, I'm not assuming you have any prior knowledge with any programming language whatsoever.

00:26 If you have some experience with programming already, that's all the better. But this is really for ultimate beginners who have never programmed before and just want to learn how to do that. Now, again, I am assuming that you know how to use an editor, you know how to run the workshop app and everything. And, hopefully, you're actually watching this within the workshop app right now. But with just that little bit of an introduction, we're gonna get you programming by the end of this workshop.

00:53 And we're gonna take you through more and more and more advanced concepts as we go. And, this is just I'm gonna show you a couple of the things that you can look forward to in this workshop. So, this is the preview of what the finished version of what you're working on will look like. Your programs will be pretty simple. They'll just be logging things out to the console so you can see what the inside of your program looks like, and exporting a couple of things.

01:17 And I'll show you how to do all of that. Don't you worry about it. But here, we're gonna be, talking about, building an experience that uses variables and, we'll talk about the nuances between let and const and, how you can mutate variables and stuff. It's gonna be cool. Here's an example of, us doing some comparisons between loose equality and true equality and not equals and greater than, less than, all of that stuff, these type of operators.

01:47 We talk about all the different types of data types. So strings and booleans and numbers and, big ints and symbols. We don't really use those a whole lot, but they do exist and we wanna talk about them. We talk about the concept of truthiness and falsiness in JavaScript, which is kind of a unique thing in JavaScript and and one of honestly, one of my favorite features. I use these this, feature of JavaScript quite a lot.

02:13 And we'll talk about control flow. So we've got switch statements and if statements and ternaries and try catch and, loops and everything. We talk about nested loops and creating, this kind of experience where you don't have to actually manually write it all out, but you can have it iterate and run the same code over and over again. We talk about throwing and catching errors and and all of that error handling and creating your own functions to take that little chunk of code that you got and put it somewhere else and then you can run it a bunch of times with different parameters and everything and how to make all that type safe and different ways to write functions as well. We've got our arrow functions and what implicit returns are and all of that.

02:52 And then we get into void and no never, types, which are very TypeScript specific but really, really useful. So I'm really excited for you to join me on this. I think it's gonna be a ton of fun. A couple things upfront. If you have done any JavaScript programming in the past, you might have seen a lot of semicolon usage in JavaScript.

03:13 And actually, in JavaScript, these these semicolons, typically go at the very end of a statement, which is typically on a single line. Technically doesn't need to be on a single line, but, if you were using a semicolon, but typically is on a single line. One of the features of JavaScript is what's called automatic semicolon insertion and, which basically means that you can write your program like this and JavaScript will just figure it out and it will stick the semicolons in there for you. JavaScript engines are really, really efficient at doing this and so, omitting semicolons has no perceivable impact on the performance of your application or anything else. And so as it turns out, it's actually easier to remember when to add a semicolon if you decide you don't wanna write them than it is to figure out when to not use a semicolon if you decide that you want to use them.

04:05 And so, for that reason, I actually omit semicolons in all of my JavaScript script code. I think maybe some of you watching this right now just like said, oh, there goes the credibility for Kent c dots because I really think semicolons matter a lot. They really don't. And if you're a total beginner, all you need to know is that, you can have semicolons at the end of some of the lines in your JavaScript and that is totally fine. It's not going to impact anything.

04:32 And also omitting semicolons is typically not going to impact anything either. There are some situations here and there where, whatever you start your next line, with what character you use on the next line is going to impact things. But if you're using modern tools and code formatters then, and, linting plugins and things, then those, problems will just not exist. And if you write your code the way that I do, then, yeah, you'll never run into those problems. So there you go.

05:02 That's just a little primer. This is, like a flame war that's been going on since the beginning of automatic semicolon insertion, and I am on the side of no semicolons. I think it makes it look cleaner. The other thing I wanna call out to you before we get started because we don't have an exercise on this, is comments. And so, you can add this double slash, to your line of code and that will create what's called a comment line.

05:27 So anything on that line, whatever it is, is not going to do anything in the context of your program. You can also do multiline comments, where it starts with a slash and a star and then anything between that, sequence of characters and the closing star and then a slash is going to be considered a comment as well. And then, sometimes you'll find this like space star on each line and people do that sometimes just because they think it looks nicer. But that the only important part is that opening and that closing of the comment block. And then everything outside of that is gonna be considered your code, which you are gonna be writing right now.

06:07 Let's jump into this. Thank you for joining me for the workshop. We'll see you in the exercises. This is actually not going to go into it, but I wanted to test out the Jarvis split thing. So we're gonna do that.

06:38 And we'll delete this video. Let me just get this set up.