This course has been updated into a 4 part series! We now recommend you take the A Practical Guide to Algorithms with JavaScript course.
Transcript from the "Pseudoclassical JavaScript" Lesson
[00:00:00]
>> Bianca Gandolfo: We talked a lot about okay what is class gonna be like, how to be successful. Here are some things that are some failure patterns to be aware of. And I talked a little bit about okay this is a super intimidating topic. A lot of people are afraid of it, and I wanted just to throw it out there and also to our live streamers, what about, what is like.
[00:00:23] What goes through your head when you're feeling nervous about data structures and algorithms? Like is this a scene, where like, you're in an interview, and they're like, can you implement a hash table? And then you start crying in front of your interviewer, or your interviewer just gets up and says, you're stupid.
[00:00:40] Like what goes through your mind that makes you feel nervous, Abby?
>> Abby: Honestly feel like, at least in my experience, and I went to boot camp to learn how to code, and I have been working since then. But, most of the time when people hear that I don't have a CS background, they try to like one up me.
[00:01:01] And I'll talk about things like this that I necessarily didn't get the education for, and it's just frustrating, like it just makes me kind of upset. Because it's hard to try to have a conversation with someone's who's trying to justify why they're like better than you because they know about.
[00:01:20]
>> Bianca Gandolfo: Because they spend like $60,000 on their education.
>> Abby: Yeah yeah versus much less than that or you didn't have that option right. I went to a boot camp right out of high school just because it's the one thing I could afford to just get onto a career path quickly.
[00:01:35]
>> Bianca Gandolfo: That's awesome.
>> Abby: Thank you.
>> Bianca Gandolfo: That's awesome. Well pat on the back for that. Going to a boot camp right out of high school non easy feat, so whatever
>> Abby: It was reallly scary.
>> Bianca Gandolfo: Yeah, you're such a brave person.
>> Abby: Yeah I was one of the only women around.
[00:01:49] There weren't that many women in the whole thing, so
>> Bianca Gandolfo: Yeah, yeah, yeah, it's a whole different world, yeah. So it's just sort of like these people who are sort of belittling you because of your lack of a formal CS background, that can be uncomfortable, for sure. What else, what comes to your mind when I say, I'm gonna make you do an algorithm right now?
[00:02:13] And then you get this feeling like my God, like do you have an image or do you have a feeling? What experience do you have?
>> Bianca Gandolfo: No one, no experiences?
>> Speaker 3: I hear people saying stuff like n something, and I don't know what it means, but that pops in my head.
[00:02:34]
>> Bianca Gandolfo: Yeah, yeah, like o of n or something?
>> Speaker 3: Yeah, yeah, exactly.
>> Abby: Like n plus 1 query?
>> Speaker 3: Yeah, yeah.
>> Bianca Gandolfo: [LAUGH] Yeah, so sort of like the math and the jargon around this topic can be a little bit intimidating, and make you feel like an outsider right.
[00:02:51] Like similar to what Abby was saying, it was like those people are in the know and somehow we have all these fancy words. Which come to find out, it's not that complicated, thank God. They're are little bit complicated but we'll get through it, we'll get through it. And, after this class we'll ll be in the know together, so that's awesome.
[00:03:11] Let's see, for David it's terror, David it's like stump the chump, stump the chump, I get it. I was like, I was thinking like trip for some reason, I was like that doesn't make sense, stump the chump. So it's like, again, this idea that people are trying to trick you so they seem smart, and you're just like crying on the floor like I don't know.
[00:03:34] You have your rattle, and then they're like ha-ha, you don't know anything about data structures and algorithms!
>> Bianca Gandolfo: Anything else?
>> Speaker 4: That actually kind of happened to me.
>> Bianca Gandolfo: [LAUGH]
>> Speaker 4: So I'd only done like two or three interviews, two interviews maybe in the last eight years. Interviewing for a job, one was for Netflix, and Netflix is very algorithms heavy.
[00:04:01]
>> Bianca Gandolfo: Yeah.
>> Speaker 4: Sorry, data structures heavy. And so, there's four of them and they're all like, basically quizzing me on how to implement something. That you can't do an array an object, you have to use like, a link list or whatever and I was just like, and do it on the white board, of course.
[00:04:17]
>> Bianca Gandolfo: Yeah.
>> Speaker 4: Of course.
>> Bianca Gandolfo: Because that is really going to show you how well you can code on a keyboard right, it's on the white board.
>> Speaker 4: I it's just like to put you on the most stressful situation and see how you respond or something, I don't know it's really weird.
[00:04:35] That was actually Jaffer who actually taught our courses, he was in that room.
>> Bianca Gandolfo: He made you cry?
>> Speaker 4: Yap, Jaffer made me cry.
>> Bianca Gandolfo: [LAUGH]
>> Bianca Gandolfo: Okay one more and then I'll leave you alone.
>> Speaker 3: I don't know, I guess, what I have a feeling with algorithms and data structures is that there are often a lot of different words that mean almost exactly the same thing and so my terror is I'm gonna use the wrong word, like I say.
[00:05:07]
>> Abby: Yeah.
>> Speaker 3: A hash table, and no that's an associative array or whatever.
>> Bianca Gandolfo: Yeah, or a dictionary, a hash map, what's the difference, is there a difference, yeah totally. So again this like being an outsider and not knowing the vocabulary of the cool kids, right? I think it's a centum of the cool kids, nothing cool and then like, trying to like milk what they have for that moment in these interviews.
[00:05:36] Most interviewers are not like that, most interviewers are gonna be rooting for you or just like kind of mutually disengage. Because they're like, I wanna be coding right now, but recruiters are making me interview you. And I do need help on this project, so it would be nice if this time that I'm spending talking to you for an hour and I'm not coding.
[00:05:58] Would result in having someone on the team that can help me, meet these crazy deadlines that you know, we have to do, does that make sense?
>> Speaker 5: And I would reckon that if that's the culture that they're setting up in the interview, then you might not wanna participate in that and join the company anyway.
[00:06:16]
>> Bianca Gandolfo: Yeah, yeah, absolutely. So, part of an interview you're interviewing them, and if their culture seems really intimidating and exclusive and like you have to hop through all of these,
>> Bianca Gandolfo: Different hoops, then it might not be the kind of environment that you wanna be. Some people like that, some people are really into it, they like the challenge and there's different strokes for different folks.
[00:06:39] But, I don't think that most places are gonna be like that, but we do have this idea of this like person who's like kind of smug and like maybe mean, [LAUGH] and this is there to like make you feel stupid. And for the most part that's not their intention, so, we have all these ideas and it's usually not gonna be like that hopefully.
[00:07:07] And if not, you probably don't wanna work there, at the end of the day, all interviewing is just a learning experience, right? Whether it goes good or bad or who knows, they just never e-mail you back and you don't know what happened. You just learned either what you didn't know or you solved a new problem or you solved a problem that you knew again.
[00:07:27] So cool, all right well thank you for that thought experiment. Cuz I'm really trying to learn from you all, so you guys are studying, I'm also studying. And I'm gonna learn from you all, what is it that stops you from jumping off that cliff and doing the exercises cuz that's something I see over and over and over again.
[00:07:45] People who take my workshops and I see them later, and they're like yeah, I wish I did the exercises, cuz I would understand it better. So I'm just trying to understand the psychology. I'm not a psychologist, but it's very fascinating to me. Awesome, well, thank you. Okay, object oriented JavaScript.
[00:08:03] We have some big long words, god, on the screen, pseudoclassical. So before we even look at the slide, what do I wanna say?
>> Bianca Gandolfo: We are, before we even look at this big word and what it means, we're going to just explore,
>> Bianca Gandolfo: Just the idea of data structures really quick, what's a data structure exactly, I forgot.
[00:08:35] I have these like periodic bouts of amnesia, if you guys have taken classes with me before it's just like, I'll say something then I'll totally forget. And then I need my friends to help me, that's all of you, you saw my picture right? With us in the kitchen together, it's me and all my friends and we're cooking.
[00:08:55] And I'm just like, and back to the scooby doo analogy, like I'm not Velma here, okay? I'm Fred, who's gonna like try my best to take you down the wrong way. But might be good intentionally wrong, and then you have to come in and save the day, yeah?
[00:09:13] So what do we think is a data structure?
>> Bianca Gandolfo: Give it a guess, I haven't even told you yet.
>> Speaker 3: A way of organizing data?
>> Bianca Gandolfo: Yeah, it's a way of organizing your data, for sure.
>> Abby: I think of types of data that are allowed in it?
>> Bianca Gandolfo: Yeah, yeah, so there's some rules probably about how you organize your data, it could be related to the type.
[00:09:42]
>> Speaker 6: Do offers from the chat room as structured to contain data?
>> Bianca Gandolfo: Yep.
>> Speaker 6: A schema.
>> Bianca Gandolfo: Yeah, absolutely, so, the Internet, which is where we all live and work, right? We all live and work on the Internet, yeah. Full of data, right, can we imagine a world, just close your eyes, with no data on the Internet?
[00:10:02] What would it look like?
>> Abby: It would be boring.
>> Bianca Gandolfo: I don't even know, it's like that's even beyond my, I have a pretty good imagination, and it's beyond my imagination. So the data, so the data.
>> Speaker 6: Got a good one here.
>> Abby: Yeah?
>> Speaker 6: A container for data that fits different needs.
[00:10:18]
>> Bianca Gandolfo: I like that, yeah, that's definitely in the realm of what a data structure is. But back to why data is important, why we have to structure our data is because we live and work on the Internet, which is based basically just on data, right? If we can imagine the internet without data, how could we, 1993, I like that.
[00:10:38] What was I gonna say? Imagine a world without data, data structure. We have to structure our data cuz there's so much data out there, and we need to do stuff with it, right. Like one of the things that we do with our data? We take pictures on our cats on Instagram we post it up, right?
[00:10:57] We have friends on Facebook, maybe we're on fallen masters watching live stream of the data instruction algorithms class. Coincidentally maybe that is something you're doing, right now. All of these things require data, these things require data to be processes at increasing speeds as the Internet grows and data grows.
[00:11:21] And all the different cool things you can do on the Internet grows you need to be able to take that data, and do stuff with it. Right and I'm saying do stuff right now because there's a lot of different things that we're gonna be doing with our data through the next six days, yeah.
[00:11:38] So, we're gonna have a structure to our data structures okay? So were gonna have an underlining structure, and we're gonna do it in object-oriented style, okay? Take it back to slide object Oriented JavaScript, so we are going to use classes to keep our data structure sort of syntax and formatting inconsistent, yeah.
[00:12:08] It's an industry standard way of doing it, and we'll go specifically into what that means. We're gonna be using classes to make instances of our data structure, so a class you can kinda think of it like this is a factory, you might have heard that word before. It's like a factory that creates little stamps of your data structures right, and you can just think into your mind right now, a data structure could be a picture of a molecule, right.
[00:12:31] So we have a factory or we call it a constructor and we're make little widgets of data structures, so that we can just do that. And we'll have a consistent way of doing that across the class, there are other ways to make classes in JavaScript. We're just gonna talk about pseudoclassical, it's gonna be expected in most JavaScript interviews, yeah.
[00:12:56] Cool, so the trouble is that until recent not until recently JavaScript didn't have like a formal way of creating classes. Most languages that give you a class key word, and then you're good to go, right and you have maybe some different types of things that you could do with it but, simple, you say, keyword class perhaps, and then you're good to go.
[00:13:20] JavaScript it's not that easy, so we're gonna go slow and it's a little bit messy. ES6 or ES2015 whatever we call it these days, like Equiscript 2015, 2016?
>> Speaker 6: 2015
>> Bianca Gandolfo: 2015, thank you. Does have a class key word but we're not gonna dive into that. You can reference the interweb for more information regarding that.