 Good morning, everyone. All right, so some updates, class-wise, course-wise, logistics stuff. So the TA and I decided on office hours. So there's office hours every day of the week. So the TA has Monday, Tuesday, and Friday. I have Wednesday, Thursday, and we tried to stagger the time throughout the week. We're all posted up on the syllabus and on the website. If you cannot, throughout the entire semester, you already know you can't make any of these office hours. Send me an email right now so we can move it around and maybe adjust some things or have a second office hours. So you can see the TA has three hours. I have an hour and a half a week. So please take advantage of that, four and a half hours. Questions, comments? Other questions, other comments on things? Oh, so for the Google group, you have to go to it and then you subscribe to it? Or is that how it works? So we can keep track of who's on there. Should we do it? I did it through my ASU email, but it doesn't matter. As long as you have your name or your ASU ID or something that we can link that to the LTU. Cool beans. So here we have it. You have to be approved for that, right? Yeah. Yeah, the TA will go through and approve it daily. So don't worry about that. Anything else? Last word? How did the office hours look? Any opinion? OK, good. Just one thumbs up. There you go. That guy is speaking for you all 125 of you. One thumbs out? I can't make any of those. Is that any email? Yeah, I know. We're also both available by appointment. So if you have an email, we can find a time that works. Happy to do that. No, no, no. Cool. All right. So let's get back to it. OK, so we were talking about how does your computer, how does the actual physical hardware of your computer understand your instructions and what you want it to do, right? You're the programmer. You're trying to tell this machine to do something. You want to speak English to it, right? And tell it to, I don't know, add one plus one and then show a GUI with a form. I want these form boxes. And whenever anybody inputs these values, I want to check if they're valid, right? I mean, that would be a kind of cool way to do it. But you can barely get Siri to put an appointment on your phone or remind you to do something, right? So we're not quite there yet. So we talked about programs that translate what you, the programmer, intend what you want to have happen and translate that into the assembly language that the CPU actually understands. And that's how you can actually get computation performed. We talked about compilers, which translate from a programming language to an executable binary, typically. We talked about interpreters, which look at a program in a programming language itself and then actually perform those computations themselves and perform actual behaviors. And then we talked about this new kind of term, transpiler, transpiler, which is translating basically from one programming language to another. So how do they work? Witchcraft. Witchcraft. Yes, it's witchcraft and magic. It's turtles all the way down. No, so that's why we're here. So that's why you're taking this class. For some of you, probably, how many of your CS majors? Yeah, would you rather do your course to take this Say like it's a bad thing. I think some students could interpret it as a bad thing, which is understandable. But really, I do think this is one of the most important classes that you take because you get to learn how actual compilers are built. And this is a tool that you use every single day throughout your career. You're compiling code. You're writing code. You're testing things. You're using a compiler. And so if you don't know how it works, if you have a lumberjack not knowing how a saw works or something, it's like, I don't know. I just put it against the tree and it cuts things. You want to understand your tools. And what I also really like about this class, so who loves theory and theoretical stuff? Some of you. And who loves practical, hands-on programming stuff. So this class is a mix of the two things, which is very interesting. So the theory, so why do we study theory? Why do we care about theory? Because we say, and your professors make you. Because it's fun. Because it's fun. So you know what to make. So you know what to make. Without knowing the theory behind something, we have no idea if it actually works. Yeah, if you don't know the theory behind something, how do you know that it actually works, right? I guess it can lead into new practical applications. Yeah, you could say something is theoretically possible. So can you actually, what do you need to do practically to make that work? Or if you demonstrate that, yeah, something is really practical, but the theory doesn't support that. Well, now maybe you should change your theory to match what you can actually do. So yeah, all those things, all those reasons are reasons why I like to think about it. Theory kind of tells us what's possible, right? So when we look at the theory in this class, we're going to be talking about infinite sets and what kinds of claims we make about infinite sets and grammars and languages, right? We're kind of studying something very broad and really interesting. And the great thing about this class is that theory is not just theoretical. We're going to be proving stuff more learning theorems and lemmas and proofs. We're going to actually be using that and applying that in the construction of a compiler and in the understanding of a programming language. So I think this is really key. So yeah, kind of the theory is going to enable us to define what we can and cannot do in a programming language. So you'll be able to say, hey, I want to write this programming language. I want to do this certain thing. Can I actually do that? Does the theory allow me to do that? Or what's already been proven that I know definitely I can do it? And the practice. So this is something that's really interesting. So I guess from the vague, high-level idea that I'm trying to convey about compilers, I don't know. Are you going to use them all the time? No. Probably? No? You're not going to use a compiler ever? I have to work with one. Huh? Get to work with one. Yeah, you have to work with one. Are you going to be writing a compiler? No, probably not. Maybe not. It could be in this class. But you could, right? I mean, there's nothing. All a compiler does is translate one language to another, right? I mean, at a very, very high level, that's how I think about it, is translation, one language to another. So these kinds of things happen in computing all the time, even if we don't call them a compiler. So what does a browser do? Reads web pages. Reads web pages. What's the actual, what's a web page look like? Anybody right-click and view source? Yeah. Browsers are going to translate to HTML, CSS, JavaScript, so on into an image that you can interact with. Yeah, so right, it takes this text. So the website sends you just text. Just a series of bytes. And then your browser takes that and translates it into a GUI interface that you can interact with, right? And so that is, if you think about it, that's another type of a compiler where it's compiling from HTML to a GUI interface that you can actually play with. And then you have cascading style sheets and JavaScript and all these other dynamic parts in there that's also just this translation. So browsers do it all the time. What about, how do video games save, know where you left off in between gameplays? Save files? What's a save file? Whatever the game company thinks of it. At a high level, what's a game file? What's a save file? A bunch of bytes. A bunch of bytes, right? So the game says, OK, you want to save your state. Boom, I'm going to write this file to the computer. And then later, when you come back and you say, I want to resume where I was, well, it has to take in this series of bytes and turn it into a game state, right? It's just exactly the same thing. Or if you're talking about the newer games where you have all the replays and that kind of stuff, right, it's the same thing. It's a file that just describes what happened in the game. And then later on, some other component takes that as input and runs it through the game engine and shows you what's actually happening. So all of these are all examples of compilers. They happen all the time, XML parsing, I don't know, random kinds of input, unstructured reports from some other legacy system. These things come up all the time. And so, and also building on top of that, so you can build domain-specific languages, so you can build a language specifically for flying planes or flying drones or building a game, right? These things happen all the time. Static analysis is a huge thing, so that's kind of my background. Using the compiler techniques, we're able to look at a program and say, identify what possible security vulnerabilities it has. So we say, oh, look, there's a path through the program and this data can flow from here to here and look, there can be a SQL injection vulnerability here. And that's based on in using these things, the theory and the practice here of compilers. So that's why I really like this class, all this kind of stuff. This comes up all the time, but it's not often called a compiler, but it still uses the theory of techniques we're gonna learn here. Okay, so what is this? Some language. Use an appropriate language, like. The BF. Yes. So what is BF at a high level? You don't have to say the name of it, what is it? It's an internal language. Yeah, this is a program, this is a programming language. Or this is a program written in a programming language called BF. And when you run this program in this programming language, as somebody said, it's turn complete, which means it has the exact same expressive powers as any other language. And so when you run this program, it outputs to a world. And they have online, they have a bunch of different BF interpreters, if you wanna learn more about it, the language. I'll be honest, I took this one to be, I don't know how to write BF. It's not something you do. Why would you want to? Because of that resource. It'd be cool. It was this. Is this a program? Yes. Unless it's white text that we can't see. Unless it's white text we can't see. Then it's white. So we've embedded a program in the PowerPoint slide into the pixels of the slide. Maybe. Maybe. I didn't, but it's good. Yeah, so this is white space. And this is, all the underscores here are spaces and all the slash ends are new lines and the slash t's are tabs. And so this is a program written in the programming language, white space. So just using white space characters, spaces, tabs, and new lines, you can write a turn complete program. And this outputs hello world of spaces. That's kind of cool. But if you notice, they just complete it. There's a bunch of interpreters, there's a language spec, all this kind of stuff, so you can write your own cool white space languages. What are this? Is this a program? Mm-hmm. What language is it? It looks like Python. It looks like a Python. Python, I think it could also be Ruby, I think some of you said, but I was intending it to be Python. Yeah, so this is a lot simpler than those other ones, but you know, it's a program. What about this? Yeah. Haskell. So Haskell is a crazy, lazy evaluation functional, very functional programming language. And so this is a simple hello world Haskell program. This is an x86 assembly program for output hello world. This is actually pretty easy. Once you get used to reading this kind of stuff. So which is actually a programming language? Are all of them programming languages? Yes, yes. None of them? Nothing is programming language. Some of these things are tricking you that it's really just letters on a screen and they don't mean anything until you run them through a compiler and actually perform some computation. Even if that was true, that doesn't mean that somebody couldn't retroactive would make it a programming language. Say that again? Sorry. I mean even if that was true that none of them were, it's somebody could go forward and make them into a programming language. Somebody could go forward and make them into a programming language, yeah? But wouldn't that mean that any text could be a programming language? Does it mean that any text could be a programming language? I think that means that it can. I mean, if three characters of white space can be a programming language, I feel like anything can be a programming language. Yeah, so what's the commonality? I mean, are some of them programming languages and some of them are not, some of them you've heard about, some of them are not? They're all programming languages. They're all programming languages. Everything's a program, but I compile and execute you. Programming languages is what I'm getting to. I was referring to the example. All of the examples were programming languages. All of the examples were programming languages. I mean, just text on a screen, not a programming language, but when it's got syntax and can be compiled down and executed then it is a programming language. Yeah, so they're programming languages kind of because somebody said so, right? In essence, they said, hey, I'm gonna define programs that look like this are in my programming language and these specific constructs mean this thing. So that when you see three white spaces in a row, it means print, and when you see five white spaces followed by a new line, that means add one or whatever. I have no idea how it actually works, but something like that, right? There has to be some structure to these programming languages. It can just be random gibberish, right? So if you just said, aha, that wall is a programming language. Well, it doesn't really make sense. I mean, maybe you have to have some kind of structure to it, right? Okay, so this is an overview of kind of where we're going in this class and this is program interpretation at the super high level. And this is why it's so interesting. So you have your source file, which is just in bytes. So you have a bunch of bytes coming in, right, which have essentially at this point, no meaning. There's just numbers on your hard drive, ones and zeros in the magnetic disks, or I don't really know how SSDs work. I think it's still memory or something like that. Yeah, it's just all bunch of ones and zeros. So these bytes are coming in to what we're gonna learn about a lexer. And the lexer's job is to take this sequence of bytes. It's got stuck in the loop. Okay, so the lexer takes in this, could be random input, anything, and outputs a series of more abstract tokens. It says, okay, here's an identifier, or here's a function call, or here's the definition of a function. All of the special characters that you have in your language, like all the keywords, all that kind of stuff, are listed up in the token so that that way the program can actually reason about them. Where the parser takes all this stream of tokens. So all it has is this, hey, this token, this token, this token, this token. And then tries to make sense out of it and say, hey, can this actually, is this a real program that can look like a program? So it builds up a parse tree. And this parse tree is passed to usually some kind of semantic analysis, which answers the question, is it a valid parse tree, right? So can you write a valid C program that isn't actually valid C, that's valid syntax of C, but can't execute and run? I've done that. I think we've all done that, right? So any time you have a type error, that's this, you have this problem, right? Your program may be valid syntactically C, but it's not valid C semantics. Then that valid parse tree gets passed to the back end, where the back end code then takes that and then spits out whatever you're computing to. So it can, if it's an interpreter, it's gonna perform some computation and do something. If it's like a compiler like GCC, it's gonna output an x86 binary that you can then execute. Okay, so what kind of things make a program valid? Syntax. Syntax, what is syntax? Correct. What does it ask? It's following the structure of the language. The structure of the language. Yeah, so it kind of says, from the point of validity, if you think about it, it kind of means, so what does it mean to look like a valid program? How do I separate random bytes from bytes that are actually a series of bytes that are part of my programming language? So that's what Syntax is trying to answer. What does semantics answer? The logic behind it, if it's valid logic? Yeah, so the logic behind it. So what does it mean for a program to be valid? So let's say you have something that's syntactically valid. What does it mean? What does a print statement mean? When I say a plus b, what does that actually mean? What's going to happen? And these are really important questions. These are things that you as the programmer need to know because how can you use a language? So Syntax tells you, hey, this is how you write a valid program. Syntax says, here's how to write a valid program that does what you want it to do. What about correctness? Is correctness important? Yes, absolutely. What question is it trying to answer? Did you do it right? Did you do it right? Is the program the correct one for the job, right? So is this actually the program that you wanted to write where that needed to be written? Any questions? This is kind of the high level, finishing the high level overview of the course and where we're trying to go here. We'll see. I'm gonna close out of this chat that popped up. Okay, all right. Questions? And cool. So now I'm gonna do something a little different. First, what I'm gonna do is, okay, so we're gonna do something different, something I haven't done before that I'm gonna try. So I've noticed from last semester that there were some, I don't know, so this is definitely, I think I tried to get this point across on Monday, but this is definitely the, should be one of the hardest classes you've had up to this point, programming-wise. And it's by design. So I kind of created this lecture. What I wanna talk about today is, what are some skills you should be developing now and that will help you in this class and throughout your careers that'll be a better programmer. So I talked to some of my friends who are in industry, some of my PhD students in my lab to kind of boil it down to what are, what do we think is essential as far as programming skills? And I'll say this has almost nothing to do with actual programming itself. So it's kind of more about enabling you to be more efficient and more effective as a programmer. So you need to be learning constantly. So I know, at this stage, you're probably maybe overwhelmed with all the stuff you have to learn, right? You're always, there's always something new to learn. The beauty about the industry that we're in is that never changes. So I guess unless you decide to go in and program cobalt mainframes for a living, which actually I've heard you make serious money doing because nobody knows how to program cobalt mainframes. So if you do that, you have like a job for life, but it's gonna be incredibly boring because you're gonna be programming cobalt mainframes. So that's good. So yeah, so thinking about like when I started in computer science, the hotness was Java. It was all about Java. Like all the classes were in Java, Java was the wave of the future. It was right once run everywhere. Is Java hot now? That's a cool programming language. What do you guys think? It's cool. Python, it's not super old, but yes. What else? Ruby on Rails. Ruby, Ruby on Rails, yeah. That actually came out while I was in college. It was mind blowing, it was awesome. Anything else, that's it? JavaScript. JavaScript, yeah, that's a huge one, right? So not only JavaScript in the browser, right? With Node.js, you can run JavaScript on your server side now, right? So you can write your entire web application both in JavaScript. So JavaScript on the front end for the client side and JavaScript on the back end, which is huge. And to get to take advantage of all the improvements of the JavaScript interpreters that are inside browsers, so, which is another compiler, right? It's another interpreter. Okay, so yeah, so you're, I can't guarantee many things, I don't know, in life in general in computer science, you're gonna always have to be learning whether it's Internet of Things, whether it's, I don't know, some of you are probably gonna have to do automobile programming craziness at some point because automobiles are getting more complex, computing's getting in all these different areas. I mean, you need to be able to constantly learn and constantly be learning. If you're ever at the point where you're like, man, I don't think I've learned anything in the last year, you're doing something wrong and you're setting yourself up for pigeonholing and, I don't know, stagnation really. So what are, I don't know, a couple key skills. What do you guys think is important for being able to constantly learn? What kind of skills? Learning how to use the resources that are becoming increasingly available. Yes, that's I think, that's actually why the first thing on there is searching, right? So, you have to be able to know how to search and find out your own answers, right? So, Googling for errors is obviously the first step. You know, you've got to get good at this and you've got to understand and you've got to wade through parse things. The more you do this though, the more you realize it's very tempting to just tighten an error, find that first thing, get the little command you need to type in to fix it and then go back and fix it and then never think about it again. It's very tempting because it's fast, right? Like, bam, I've got a problem, Google it, solve it. But if you don't realize why you made that problem or why that problem came up in the first place or why this fix actually helps, you're just going to do it again in the future and you're Googling that same thing and you're going to see that purple link in there that says you visited this page 20 times and you keep having this problem, right? So, you know, and it's a trade-off. Like, you're learning how to be engineers and you're going to be making trade-offs when you do things, right? So, it's about do I need to get this fixed absolutely right now or can I take the 30 seconds, the minute to maybe read all the Stack Overflow responses and all the comments, right? To understand if there's more context in there than I'm missing, why this thing came up. What could I have read? What documentation could I have read to figure out this answer, right? So, that way, you're kind of not just using the, you're not using Google as like a debugging system. You're using it to increase and learn and improve your own knowledge about the systems that you use every day. In that case, it can be very effective. Also, finding documentation, so this is something that took me a long time to do, but, you know, it's silly, but down like whatever language you're using, Python, whatever, have a local copy of the documentation. You know, storage is cheap. You can download the entire Python docs. It's just like a file sitting on your computer. You know, it's fast to search through. You can search through it very quickly. You can have it there if you're on a train or plane or whatever, you still have access to that and you can be productive. It actually makes a big difference. There's a lot less of a mental gap when you're trying to search for something and you know it's right there on your computer as opposed to, okay, let's open up Google and search for this thing that I'm having. It can be actually very helpful. What I mean by this is navigation documentation. This is the point I'd be like, what does this mean? Yeah. Maybe bookmarks within your saved document? Yeah, I think being able to, yeah, so being familiar with the documentation, yeah. So if it was like Python library, you know, you have the modules on the left. So I know if, okay, I have a problem with, how do I use OS, I don't know, P open, no, that's not an OS. I don't remember, but if I'm using some module and I want to use some feature of a class of that, where do I look in the documentation to easily do that? Or how do I, for Linux commands, which we'll kind of look at, how do I run the man command to find out more information or how do I run one of the common help options on a command so I can get more information about how this thing actually works? Okay, so you gotta be able to search. What would be another thing? What happens when you find something? Get it to the next. What was it? You have to be able to understand it. Understand it, yeah, you gotta be able to read it, right? I mean, I know this sounds, and when I talk about essential, I'm talking about the essential skills, right? You gotta be able to read and comprehend and remember what you read, right? And be able to put it in context. The thing that kills me about Ruby on Rails and some of these other languages is that you search for a problem, you find a blog post, and you see, oh yeah, you just do this thing to fix it. You go fix it, it doesn't work, and you go back and you realize that blog post was written six years ago for Ruby 1.0 or 2.0, and it doesn't apply to 4.0 or whatever the current version is. Like, it happens all the time. It's because I didn't, this is personal, I'm speaking personally. So because I didn't take the time to read the blog post to see when it was posted, to see how fresh and how relevant that information is. So what are man pages? Yeah, manual pages on Linux. So you can type, so man is just a command, thanks for manual. And you put the command you wanna learn about. So if you wanna learn about the cat command, you type man cat, and then it'll show you a nice list. Oh, look at that in a second. It'll show you all the documentation you'd ever wanna know about the cat command, all the options it has, all the cool stuff. So these things are important. Reading documentation, what about reading specifications? Is that important? Why is that important? Yeah, in the back. If what you're trying to do is even possible with what you have to go with. Yeah, so actually that's a very good, honestly this is the way I think of programming, is I have a problem I wanna solve, and I have my toolbox of languages and frameworks that I know how to apply. And so I need to know which one's appropriate for the given task. So, yeah, the specification. So this is actually important. This is one of the things we're trying to teach you in this class. So the assignments are gonna be essentially specifications. It's like, hey, if you want a program that does this, that takes in this input, performs this computation and provides this output. And just like, what happens on a compiler if you forget a semicolon, like a C program? It errors out. It errors out, right, it's not correct. It doesn't matter that it's only one character. It might error out. Okay, it might error out, that's a good point. Nine times out of 10, it will error or perform incorrectly, right? And so this is why, you know, reading the specifications is very important. It gets very important, especially in the network world, right? If you and I are gonna communicate, our programs wanna communicate with each other, we have to have some specification for how this communication should happen, right? So all HTTP, IP, SNTP, everything has a specification and the implementations of those have to follow that. If you don't follow that, then our programs gonna talk to each other and everything just falls apart. Questions? This, honestly, I had debated if this should be first or not. So what is touch typing? Yeah, in the back. Say it again. So if you can type that touch in the keyboard, that's awesome. Without looking at the keyboard. Without looking at the keyboard. Yeah, yeah, yeah. If you can, yeah. Someday that would be super awesome and then I can get rid of this. If we just plug in more grain. With the thought or with speech? With tracking your eyes. Oh, it's creepy. Weird. I think it's fun though. Just interprets your thoughts. So why is this important? We're not typists, we're not secretaries. It just makes you faster. It's not data entry specialists. Makes you faster. Makes you faster. Is that important? Yeah. Why? Because it allows you to do more, get more done, be more efficient. What's the one thing you can never get more of? Time. Time, right? Time, it's the one thing you're, well, maybe I shouldn't phrase it like this. 15 minutes you spend in this class today and you're never gonna be able to get back this class. I'm trying to make it worth your while, but you gotta think about that for everything, right? When you're programming, when you're at the computer, what else might it be important? Yeah, over there. Say it again? Checking error when you're typing. Yeah, you can check an error when you're typing, right? So if you're not looking down at your keyboard while you're typing, you can actually look at what you're doing and maybe spot errors. That's a good point. Well, I'll just hand it over to you again. Being a competent typist will save you a lot of time in typos instead of real problems. Yeah, being a competent typist can help with typos. Yeah, that definitely cuts down on typos. Don't look like a typist. Wait, so I just go back here? Like a proper technique in typing can reduce the risk of a preventative stress injury. Yeah, your wrist. So my advisor for my PhD, he has to wear like, when it's on serious writing things, he has to wear like a wrist guard, basically. Like, he's got a really bad RSI. It's a serious problem in our industry, right? Because we're in front of computers every day typing and I don't know, maybe it seems like a far away problem because you're young and your bodies are malleable and stuff. But, you know, it happens, man. We all get old and like, you don't wanna have risk problems because you don't know how to type correctly and you're going all over the place and you're spending more effort than you should to be able to type. Somebody said something else. I think you said something. I said you don't look like an idiot. Yeah, you don't look like an idiot. So that's, it sounds mean. It's not meant to be mean, but I'll tell you why this came to my attention. So my story in this domain is, I mean, I grew up on a computer, probably like many of yous, been using it since I was very, very, very young. So I thought I was an amazing type or tightest, I guess would be the correct word. So I, you know, I didn't do home row. I didn't do anything like that. I could kind of get away with not looking, but I would just go wherever. Like there's a very weird natural kind of style. And I thought it was awesome. And I thought, and all throughout college, I was like, I'm the best. Why would I ever change this? Then I got to Microsoft and it was that. It was looking like an idiot. So my group at Microsoft, we had bug triage meetings. So every week we get together, we put on the board, the screen, all the bugs that have been filed in the last week. And we go through them to decide are they duplicates? Should we fix them? Should we not fix them? What's the severity? All this kind of stuff. And normally the project manager leads those meetings, but she was gone. And so I was like, oh yeah, I'll totally step up and take those meetings. So I was new and trying to be very outgoing. I was like, yeah, I'll totally do that. As I was doing it, I realized like, oh man, I am making a lot of mistakes with people looking at me while I'm typing. And I'm leaving this meeting, right? They're seeing everything I'm typing in as I'm doing it. And when it takes you, when you're making typos and when you're typing kind of slow, it's not that you look like an idiot, but you don't look competent. And so that's, it wasn't really until that point that I realized, oh, I need to actually do something about this. So I did, I don't know if it was a half hour an hour, I practiced daily at Microsoft until I got to the point where now I can touch type, but I use home row and I'm so much faster. So this is why nobody ever told me this. This is part of the reason why I want to tell you this. So it's gonna pay dividends. It's a compounding thing, right? The earlier you start doing this, the more it's gonna impact you in your daily life and I mean the arguments against this is, well, I'm a computer scientist, right? I need to think and think about a problem and think about it and then I'll write down the solution. It doesn't matter how fast I write it down because I should be thinking more, which is valid. That's a valid argument, but the problem is if there's any kind of impedance between your thought in your brain and getting it on your screen, it's just gonna slow you down because it doesn't matter how smart you are, you're never gonna get the correct solution the first time, you're gonna have to backtrack, do different things, try different things, and if it's taking you longer than other people to do that, just to physically put keys to the keyboard, you know, you're at a disadvantage. So this is a little humble brag. So this is my word per minute score that I just did last night. I don't know. It says it's pro, that sounds super weird, but I don't know. 82 words per minute with like six errors. So yeah, it's fine. You know, I do a lot of writing. I do a lot of, it helps when I write like grants or papers or emails or anything, even without programming, yeah. Do you recommend like certain like online kind of? I couldn't get, I just, I don't remember. I just looked for like free touch typing things and I just used whichever one. Yeah, no, it was a long time ago, but I did that probably about six years ago. So yeah, if you do this now, you'll be much better. You'll be far above your peers. All right, the next topic is tricky. So we're gonna approach this. So your editor, right, your text, your editor. So I'll start this off by saying, I'm not gonna get any religious wars about what technology is better than the other because I don't think it's productive and it's not my goal right now to sway you to, you know, demand that you choose one thing or the other. But when you think about it, so programming, right, it's your brain to the computer. You want something to appear on the screen, right? So it goes through your brain and then to your fingers, right? So that's what touch typing is about, is making sure you can type, I can't do it. Okay, yeah, making sure you can type, right? Very quickly, so that part's not slow. And so the editor part is the thing that takes in what you're typing, right, and makes it on the screen. So really, I like to think of it as your editor is really your main tool, your main instrument to crash the program. And I do literally mean craft, like a craftsman crafts a- Sculptor. Yeah, like sculpting or, I don't know the tools involved in sculpting, like the chisel and hammer. And hammer, maybe more than that. Yeah, chisel and hammer or, yeah, so like chefs use the best possible knife that they can, right? The sharpest knife, even if it takes them a half hour to sharpen it every day or something or they've got to clean it in a special way, right? They're gonna use the best knife that they possibly can to cut stuff. Mechanics are gonna use the best wrench, right? Because they don't want something that's gonna break halfway through when they're underneath the car trying to fix something, right? They want to use the best possible tool. And I ran out of metaphors, I went with baking next. So bakers use the best knife. I'm sure there exist some ovens that are better than others, right? And I'm sure bakers know exactly about them where they can specify, and they have crazy different kinds of ovens where you can control humidity, all this kind of stuff which can affect whatever you're cooking or baking. And not only this, not only do they use the best, but they know the ins and outs of whatever thing that they're using, right? So the chefs know, hey, this is exactly how many times I need to sharpen this knife and this is how I need to sharpen it. Do I need to use a wet stone? Do I need to use a leather strop? You know, what's the best practices for that? And they constantly talk about it. They constantly try to, you know, get the newest or the best steel or something like that. So really investing time in learning your editor is critical, absolutely critical, because this is gonna be your best tool. So a little segway, because this is where all this is going. So we're talking about efficiency. The mouse is evil. I guess I should update this. The mouse and track that are evil. I didn't think about that. Why are they evil? Because they're not efficient. It's one less hand you have to type. One less hand. Do you type one handed? You can. I can. I mean, with the mouse, I would not type like that. I've heard of my own a couple of times. Ah, okay. When you have to, you definitely can. Yes, that's true. What else? Why are mice evil? Yeah. It's a lot slower when you compare it to like keyboard shortcuts. Yeah, so it's slow. Fundamentally, it's slow. So this is actually the best thing I took away. I took an HCI, human computer interface class at UC San Barbara. And the best thing I took away was this. So they have this model called the keystroke level model and the details aren't important, but it models how fast different user interactions are. The idea is if you're gonna build a system, before you build it, you wanna predict how fast is the user gonna be at performing a certain task, which is hard to do. You have to build the system first usually and then show it to a user and then you realize they're really slow at it. And so you have to then go back and fix it, but this allows you to do that before. And so what they did is they looked at people and they took an average of how long people take to execute certain tasks. So something like pressing a key either on the mouse or on the keyboard is if you're a very fast typist, it can be 0.08 seconds per character, just fast. Average typist is about 0.28 seconds. A slow typist is like 1.2. This is crazy. Can you think about 1.2 seconds between typing every, imagine how long it would take to type in an assignment. One Mississippi, one Mississippi, one Mississippi. You'd have to start the day at the sign just to get it done the first time. Yeah, you do have to start the day at the sign. But yes. Just get your first iteration. So these are just for pressing keys. So then for moving your hands from the keyboard to the mouse or the mouse to the keyboard, right? Because it's not an automatic thing. You have to like find the mouse and find it and then find where it is on the screen. So they measured that it's about 0.4 seconds. And then you have to point the mouse, right? You have to point the mouse cursor from wherever it is. So you have to find it, and then you have to look at your target on the screen, and then you have to move your mouse of your hand so that the digital mouse pointer moves over there, right? How long does that take? Two seconds. Two seconds? A little high. One second. One second? So it's about eight or from 0.8 to 1.1 seconds, depending on the distance that you have to go. So let's put this all together. So if you're using a mouse to do something, think about it's a simple, let's say you want to drag and drop something from the menu bar, right? So we don't know what the mouse is, we have to move to the mouse, we have to go to the menu, we have to click it, and then we have to click on one of the drop down entries, right? So we first are going to move our hands from the keyboard to the mouse, then we're going to point the mouse, then we're going to click it, then we have to point the mouse again, and then we're going to press the left mouse button, and we're going to move from the mouse to the keyboard, taking 2.82 seconds. Select one thing from the keyboard. So in 2.82 seconds on their model, you could have typed 35 characters if you're a fast typist, 10 characters if you're an average typist, or, well, 2.35 characters if you're a slow typist. So that's why all these things come together, right? So you definitely don't want to be in here, you want to get as close to that as possible because it maximizes the game. So, why do I talk about this? You want an editor where you almost never have to use a mouse. That should be your ultimate goal, is to get comfortable with whatever editor you choose, such that you never have to leave the keyboard. It's going to be slower. And yeah, I don't know, we looked at that thing. They'll say it was, I don't know, it's a difference of a second, maybe you're setting yourself a second. You got to think about every time you move your hands from your keyboard to your trackpad or your mouse, you're losing a second, a second, a second, a second, every single time. When you're moving a window around, you're losing another second, right? So your goals should be efficiency, right? I don't want anything to get in the way of me and editing text. So what editors do you guys use? I'll also guess some, but yeah. The sublime text. Huh, sublime text? Yeah, I've heard that's a good one. No path plus plus. No path plus plus. IntelliJ. IntelliJ. Vim. Vim. Eclipse. Eclipse. Is that it? Netbeams? Yeah. It's called C-Lion from JetBrains. What was it? C-Lion. C-Lion? It's a JetBrains. A C-Lion? Yeah. Oh, interesting. Okay, I know the complex. JetBrains. I've heard of it. Okay, so I'm gonna suggest two old school choices. One of them was already said, Vim. The beauty of Vim is that it's installed everywhere and it has, I'm not gonna get into it. There's tons of resources, but it has a dual mode so that you can switch between editing and writing text or composing text and Emacs. The great, the awesome thing about Emacs is it's, well, it's written in a programming language that's incredibly extensible. So you can literally write new functions. You can bind keys to different things. I'll show you something in a second. So it's super extensible. It has a single mode. Honestly, whatever, as long as you're an efficient, right, this is the key thing. Like, as long as you know that tool inside and out, you know the keyboard shortcuts and you never have to touch that dirty evil mouse again, you're gonna be good. So let's see how this works. Oh, man, we don't have time. Okay, I'm gonna go back at the end. I have an example of showing you some cool stuff you can do in Emacs, but I won't do that now. Here's some stuff if you want. So I use Emacs, so I'll push it just slightly. Lots of beginners' tutorials, some of my favorite things. I use Emacs macros all the time for manipulating and refactoring data. Okay, so editors are definitely important. The command line is also incredibly important. So you should be getting familiar with the Unix, POSX, Linux command line because it really is an amazing tool. So you can compose commands together to execute commands. You can conditionally execute commands. You can do output redirection. So you can say, run this command and output it to a file, which is very handy. You can run things in the background. You can sleep things. And, you know, it's designed not to be used with a mouse, right? So you never have to go to a mouse. I will say, you know, for all these things, there's definitely a learning curve, right? So you have to invest the time to learn it. But eventually, right, that builds up and that builds up and then you're saving a lot of time. So lots of stuff. You can find those interesting things about how to use. Oh, command line foo is really interesting. They have a lot of command line snippets for doing various things. Okay, I'm gonna try and breeze through this so I can maybe have time for demo, but I don't know. Okay, debuggers, who uses a debugger? What do the rest of you use when you have not perfect code? A defining rod. A defining rod. Is that your brain? Magic ball or witchcraft. Witchcraft, magic. Seriously, how do you find errors in your program? Usually whatever ID I end up using. A print statement. A print statement, yeah. That is a legit form of a debugger. That's true. It's very crude, I would say. And you have to be very careful because you run it, you get the output, right, and then it's done. So this is another area that I would invest time in. So the beauty about a debugger is it'll let you inspect a running program to find out what went wrong. So with a GDV and a C program, I can debug that program, I can connect to it, and then I can say, hey, what's the value in this pointer? What does this thing point to? What's this field's value? And then I can think, how did it possibly get there? So it can help me, I like it a little bit better, I mean, not a little bit. I like it better than print F debugging because I can, you don't always know the questions you want to have answered when you're doing print F debugging, right? You may think, oh, I'm gonna print out what the value of this pointer is, right? And then you run it and you're like, huh, this pointer's pointing to null, that's weird. And then you have to say, okay, now what do I need? And then you have to put in another print statement and then run the program again. So it's this efficiency thing, right? To debugger, you're connected to this process at this exact moment in time of its execution. So you can say, okay, what's the value of this pointer? Huh, it's null, that's weird. Then what's the value of this other pointer that I just copied from? Oh, that's null too, great. And then you can kind of work your way back and using your knowledge of the code that you wrote with the debugging output. And oftentimes it's really cool, it's also really great for prototyping. So as you're developing, I sometimes use a debugger because especially in languages like Python or newer languages, you can evaluate functions and expressions in the context of the currently running program. You can even do this with GDB. So you can, let's say, call one of your own functions with whatever parameters you want as it's currently not running, but as it's paused, essentially. So this gives you more insight into the program. Say, huh, what happened? This thing just got called, what happened? So I suggest if you're using your IDE's debugger, like Eclipse, it's using GDB under the hood. So GDB is the GNU debugger, I believe, I may have just made that up, but I assume that's what the G stands for. And it's a command line debugger for Linux, once again. This is where the trade-off between mouse being evil and debuggers becomes a little more fuzzy because having the visual debugger is nice because you can look at your code, you can hover over things, you can get a dropdown and sometimes you can hover over those objects so it can make exploration a little easier. But becoming familiar with GDB is definitely very helpful because other languages have other things. So Python has, is it PBB? High PBB, so far? PBB, I think it's PDB, right? Yeah, you can PDB set trace and debugs. And then this is, so this is kind of what I said. So becoming an engineer, as you know, when to use a debugger and when to use printf, these are all really important things. And these will help you in this class, it'll help you in other classes, it'll help you in your career. Yeah, being able to use these tools, right, effectively is really the goal. Any questions, so far? All right, here's some advanced topics if you wanna go, you know, a little bit more advanced. Bash scripting, so being able to write scripts so to automate frequently run tasks, all this kind of stuff, Bash is really awesome. Go to town, go crazy, edit it, customizing your editor. I have, I think I looked yesterday, well maybe, maybe I'll show you on Friday. Maybe I'll save the demos for Friday. But my Emacs file with all my customizations, I think it's like 250, 300 lines and it's just stuff I've collected over the years to do cool things or new modes or new functionality. And it's like code snippets I find online, other editors have good plugins, all that kind of stuff. And so this way you can actually shape your tool to you, right, you don't have to use whatever handle of the knife that was given to you, right, you can say, oh, you know, I'd like a little longer handle or maybe I want to change the wood out for a different substance. I don't know, steel, what else would be good? I don't know, not a nice person. But the point is, it's not just a tool that you use, right, you can actually shape it to yourself and your needs. Okay, you should definitely be learning version control systems. This maybe you can, we'll eventually get in the central. So you honestly should be learning Git because that's kind of the standard. Subversion is also good to learn. And honestly, really, you should be using that stuff for this class. It's going to happen, you know, the fact that Visual Studio ended up saving your file as all zeros for some strange reason. That's not a good excuse. You should be having backups of your data, you should be having backups of your programs. You know, this is on you, you gotta keep these things. And I guess even if what you're doing is creating different versions literally of your file with different names, as long as you're doing something, but so yeah, this is more advanced, I don't think it's absolutely necessary. Another thing that's very handy is unit testing. So if you want to learn more about how to write correct code, unit tests are a great way to start to be able to actually have some assurance that the code you wrote is actually correct. And this can help you in your classes if you get better and better because you can write a little function, write the test for it. And then now you know, great, that function is solid. And you have those tests that will carry you forward throughout the project. But that's it. Questions, I guess, before we have anything burning? All right, see you on Friday.