Sorting through the Script (AJ vs. Dan Shappir) - JSJ 519
Want to watch AJ and Dan Shappir do battle LIVE? You’re in the luck! In this episode, the jabberers go deep on the nuances of var, what we can all learn from C++ about coding, and Dan’s go-to remedies for keeping your Script nice, neat, and not-chaotic. In This Episode 1.The ONE rule you need know about var (and how it affects the future of JavaScript) 2.Why C++ allows variables to execute the code while JavaScript doesn’t (and what we learn from this difference 3.The biggest drawback to all of JavaScript’s recent changes (and how to avoid tripping over yourself) 4.Dan’s go-to remedies for keeping your Script tidy and variables obedient
Show Notes
Want to watch AJ and Dan Shappir do battle LIVE? You’re in the luck! In this episode, the jabberers go deep on the nuances of var, what we can all learn from C++ about coding, and Dan’s go-to remedies for keeping your Script nice, neat, and not-chaotic.
In This Episode
- The ONE rule you need know about var (and how it affects the future of JavaScript)
- Why C++ allows variables to execute the code while JavaScript doesn’t (and what we learn from this difference
- The biggest drawback to all of JavaScript’s recent changes (and how to avoid tripping over yourself)
- Dan’s go-to remedies for keeping your Script tidy and variables obedient
Sponsors
Picks
- AJ- Mario Kart Live: Home Circuit
- AJ- Deku Deals
- AJ- Node.js Best Practices
- AJ- webinstall.dev
- AJ- [CreedsOfCraftsmanship](CreedsOfCraftsmanship.com)
- Follow CoolAJ86 Live Streams:
- YouTube: https://youtube.com/coolaj86
- Twitch: https://twitch.tv/coolaj86
- Follow Beyond Code:
- Charles- Scythe | Board Game | BoardGameGeek
- Charles- New development with TopEndDevs!
- Charles- Brisket Tacos
- Dan- Reversim conference
- Dan- The 2021 Web Almanac
- Dan- Old Man's War Series
- Steve- Is Atheism Dead? | Eric Metaxas
Sponsored By:
- Top End Devs: Learn to Become a Top 5% Developer. Join our community of ambitious and engaged programmers to learn how.
- Raygun: Raygun now offers Real User Monitoring of Core Web Vitals. Start your 14-day free trial now.
- Vultr: Tired of explaining your absurdly high Big Tech cloud bills to your boss? Let me tell you about this cloud infrastructure company that’s the talk of the tech world.
Transcript
CHARLES MAX_WOOD: Hey everybody and welcome back to another episode of JavaScript Jabber. This week on our panel, we have Dan Shapir.
DAN_SHAPPIR: Hey, hey from Tel Aviv.
CHARLES MAX_WOOD: Steve Edwards.
STEVE_EDWARDS: Hello from rainy and gloomy Portland.
CHARLES MAX_WOOD: AJ O'Neill.
AJ_O’NEAL: Yo, yo, yo. Coming at you live. Live? Full stop.
CHARLES MAX_WOOD: Yeah, live. Absolutely.
STEVE_EDWARDS: From where though?
AJ_O’NEAL: Doesn't matter.
STEVE_EDWARDS: Oh, okay.
AJ_O’NEAL: My home is my castle. Stay out of it.
CHARLES MAX_WOOD: All right. I'm Charles Max Wood from Top End Devs. And yeah, we are live.
Let's quickly talk about Volta again. Their cloud server locations are opening up all over the place, just like NFTs, CBD stores, and those electric scooters you see in every major city. We mean everywhere, more than 20 locations across five continents to date, to be exact, with the simplified management UI and one click app installation marketplace, it's easy to locate cloud compute or bare metal to power your website application or business infrastructure in Sao Paulo or Stockholm or Seattle or South Korea. JavaScript Jabber listeners can try Vultr for free and to play from around the globe in 30 seconds or less today with $100 in credit. Just visit vultr.com slash Jabber, that's V-U-L-T-R dot com slash Jabber to try Vultr for free today.
CHARLES MAX_WOOD: Anyway, so today we're gonna be talking about Barlett and Const and Scope.
DAN_SHAPPIR: And yeah, I can generalize and say that we're going to talk about modern JavaScript feature, relatively modern since let them concert way back from 2015. So they're like seven years old, but modern, relatively modern JavaScript stuff that generally I like and AJ doesn't. It's perfect.
AJ_O’NEAL: No one could ask for better than that. Okay, great. And I've, I've, now I've retweeted on all the, the, my tweet abilities.
CHARLES MAX_WOOD: Awesome.
DAN_SHAPPIR: So we're doing it live and let's see how many people actually joined the stream that we started without out planning it in ahead.
CHARLES MAX_WOOD: Yeah. But yeah. So, uh, AJ, do you kind of want to give us a control on this?
AJ_O’NEAL: I absolutely do.
CHARLES MAX_WOOD: He wants to set the stage with the truth about JavaScript.
AJ_O’NEAL: Okay. Yeah. Well, we should talk about truth is out there. The truth. Yeah. Okay. So in the beginning there was VAR and the word was VAR and the VAR was with the function.
STEVE_EDWARDS: I know the quote. That's very good paraphrasing AJ. Very good.
CHARLES MAX_WOOD: I'm just waiting for lightning to hit AJ through his house.
AJ_O’NEAL: I think I'm all right. Anyway, so here's the thing. VAR is not, VAR is unique to JavaScript. It's unique to JavaScript in a good way, in a bad way. The good way that VAR is unique to JavaScript is there is one rule. Variables declared with VAR traditionally have only one scope which is to the function. So if you declare VAR out of a function, is there a scope to it? No, there's not. If you declare VAR within a loop, is there a scope to it? Well, it depends. Is there, is there a function containing the loop? It's just one rule. It's very, very simple. Now people from traditional languages might argue that because that's not the way that they're used to variables being declared in their language, that this is a bad or awkward or something, but the truth is it's very simple. There's only one rule. If VAR is declared in a function, VAR, the VAR is scoped to that function, the end. And everything about VAR can be summed up in that. And then the bad part is there's one exception and the one exception, which makes no sense because JavaScript is in asynchronous language and try catch fundamentally does not work in asynchronous languages because you cannot roll back a stack of something that happened at some point in time that is no longer on the stack and that's what try catch does, but if you declare a VAR within a try block, then if the catch executes. The bar may be accessible in the catch, but will not be accessible outside of the catch. And that's the thing that you really don't need to worry about because you shouldn't be using try catch. And you should put your bars in.
DAN_SHAPPIR: Oh my.
AJ_O’NEAL: But generally speaking, try catch is a compiler wacko mold feature.
DAN_SHAPPIR: Yeah.
AJ_O’NEAL: Doesn't do what you would expect it to do. And it doesn't, it doesn't serve a function. Try catches a bug in JavaScript.
DAN_SHAPPIR: Yeah, but you're already going down a rabbit hole. Let's, let's try to stick to bar.
AJ_O’NEAL: Okay. But, but, but it's important because that is the exception to bar.
DAN_SHAPPIR: I will add one thing. If I may, when you declare a variable using bar in the global scope, what actually happens in JavaScript is that it actually gets added as a property on top of the global object. That's the way that it is unscoped. Yeah. So and non-cancellable properties. So it can't actually be deleted, for example. So if you do a global var, if inside the browser, it's as if you, let's say called X, it's as if you created a property X on the window object.
AJ_O’NEAL: Yes. And so then let is a buggy attempt. And there's my bias right from the start. You don't want you to have it straight. It's a. It's a buggy and flawed attempt to provide something similar to variable declaration in other languages. And I say it's buggy and flawed because it must have been designed by people who don't use JavaScript because it anyway, but it gives you block scope. That's, that's what it does is. So if you declare a let within a loop, then the let is re declared ostensibly and every iteration of the loop. And if you, if you arbitrarily create a block, which JavaScript has always had the ability to do, it just didn't have any meeting because blocks, as far as I'm aware, don't do anything in JavaScript until let was introduced. And then suddenly they, they did well, they, they do in the sense that they group statements together. So you put if, and then you put a block, but you can declare a block anywhere. So anywhere you put a let, it is scoped to the curly braces that are closest to it. Or in the special case of four and maybe a few other operators, it is actually scoped to at the operator level. So it, it is declared outside of the scope of the block, but is always available inside the block. But when the block finishes, it is no longer available anymore. So the rules around let, although they're more conventional are much more complex to explain because they have a lot of edge cases. And then there's all the things where let doesn't work correctly in JavaScript, such as in a switch statement.
DAN_SHAPPIR: By the way, again, it's both defined and undefined. I'll interrupt you again. There's an excellent YouTube episode for the HTTP 203 series that Jake Archibald and Sir Madhu, in which they discuss scoping around the for looping statement. And it exactly highlights how complicated these rules can get. Let's just put it this way, there are way more scopes within a single four instructions that you will expect. We'll probably put a link to it in the show notes. It's a great episode.
AJ_O’NEAL: I am making note of that right now. So then with const, you have the opposite problem. Const is kind of, well, var doesn't mean what we think it should mean in other languages, so let's create something else that means something completely different than what it means in another language. Const you would think means is a constant, but it is not. Const is primarily the way that it's showcased in just about every tutorial you ever find is as a variable. And my beef of course, is that constants are not variables. It's in the name. It's literally a constant should be a constant. So for example, pi makes a good constant. Now, you can use the const keyword to declare constants, and I am not opposed to that at all. I think that's great. Well, except then it gets weird when you're in the rebel. But, that aside, put that aside for a second, const is for variables, and the only thing that is, the people who are pro-const, the thing that they say to excuse its existence is, well, it makes the reference immutable, which an immutable reference is not a constant A and B that is never a problem that I've had in JavaScript because C JavaScript's not a compiled language and so your tooling has to catch those errors in the first place. So that is that is pretty much my rant for our constant length. That's my answer to all the bias. Now now go tell the truth.
DAN_SHAPPIR: No I'm not going to tell the truth. Everything you said is good. I just wanted to add a few things to kind of complete the picture. So you're absolutely correct with regard to VAR, which is function scoped, unless it's global, in which case I explain what happened and what happens. And in that context, JavaScript is indeed unique. I'm not familiar with other programming languages, although I'm certain that they are where, maybe I wouldn't be surprised, I wouldn't be surprised, but I don't know where functions declared within a function, where it goes declared within a function or function scope. And so yeah. But there are other aspects of VAR which do make it somewhat problematic from my perspective. So one problem with it is the fact that it's hoisted. So wherever you put it in the...
AJ_O’NEAL: Whoa, whoa, whoa, whoa,
DAN_SHAPPIR: All it means that if you have a 10 line function and you put your var declaration in line 5, then a naive assumption would be that you could only use that variable after line 5. Well, in reality, you can also use it in lines 1 through 4 or 0 through 4 because we're JavaScript, so it's zero based, but you can use it before it's declared. And to make it even weirder, if you initialize the variable during it within the same statement as its declaration, you kind of expect the declaration and initialization to go together when in fact they don't. The declaration is actually pulled to the top of the function, but the initialization only happens actually when you do get to that line. And in all the lines in between, the variable has the value undefined. And that's kind of a weird behavior, I think. That's one issue with it. The other issue with it is that you can redeclare the variable multiple times within the same function. So you can put var like four times, five times, like var x, ten times, however many times you want, and JavaScript is perfectly fine with it. You're effectively redeclaring the same variable, which literally has no effect. And that can lead to really nasty bugs because if I have a loop within a loop and I accidentally use var i for both, then I can override, overwrite the value of the outer loop index within the inner loop index and JavaScript won't complain because that's perfectly fine. Now Douglas Crockford, who we all love, has a really simple suggestion to how to work around both these limitations. And his rule which he enforces in his JSLint, is to put all the var declarations explicitly at the top of your functions. That is, never put your var in line five unless there are only vars ahead of it. That way, you don't accidentally re-declare something because you will immediately see that there's already a declaration for that variable in that initial part. You also won't get into trouble with hoisting because effectively you've done the hoisting yourself explicitly. So there's no implicit hoisting and I can really appreciate this attitude. I just really don't enjoy writing code that way. I really don't enjoy using a certain variable, let's say towards the bottom of the function, but having to put the declaration of that variable at the very top. Now it may have to do with my built-in prejudices stemming from the fact that like you said, I've been using other programming languages which behave differently in this way. But I still don't like it. I don't like the separation of declaration from actual use, because it creates a bit of a cognitive load for me. I see all the variable names at the top before I actually know what they're going to be intended for, and maybe I'm only looking at a bit of code which uses one rather than the other, but I had to go through all of them. So I don't like it, but it's not the end of the world.
STEVE_EDWARDS: Yeah, I think it's more personal preference. I mean, I'm so used to declaring all my stuff at the top, just so that if I'm looking, if, you know, I'm down in a function and I'm, I want to know where to go look for my definitions. And so if I know they're all in one place, then it's easy to go find them and see, okay, this is what I'm going to be needing throughout the function as compared to, okay, it could be declared here or here or here. So it's, I guess maybe it's just a matter of organizational preference.
AJ_O’NEAL: So I, I look at it the same way that I would look at a require. We're declaring dependencies. first. I mean, there are times in JavaScript for mostly working around a circular dependency bug that someone else has introduced or for a particular performance because something requires 600. For example, if you need to require prettier, you might not want to require that at the top of your file because the dependencies are so huge that it actually takes countable seconds to load on VM. But anyway, that kind of weird, weird fringe case exception aside, we put all of our requires up top because we're defining this. This is the list of dependencies. This is the list of things that we're expecting to work with. And I am sympathetic to the go style way of declaring right when and where you use it. But also you'll notice that there's certain problems that crop up with that approach as well. Declaring things at the top, if you start to get a very long list or you start to feel disconnected between the variable that's at the top and where it's used on the bottom line, that's also a really strong indicator that your function's getting too long or does too many things, or is too complex, or is difficult to reason about in some way, shape, or form.
DAN_SHAPPIR: I would agree with that, but it still rubs me the wrong way. Look, let's put it this way. The language that kind of popularized the putting the declaration where the variable actually gets used is C++. Because with C, at least originally, you would also put all your variables at the top. I think that C kind of mandated that way of coding at least back in the day. Maybe that's changed since then. And C++ not only made it possible to declare your variables inside, like where they actually use rather the top it actually made it preferable to do it that way because in C++, unlike other programming languages, declaring a variable can actually cause code to execute. So you want to avoid declaring variables that you don't actually need or use in a particular flow. Now JavaScript doesn't work like that with JavaScript declaring a variable has no impact on the runtime, but like I said, I'm used to what I'm used to. And again, it's easier for me to read the code that way.
AJ_O’NEAL: So I do, I see it both ways. And I think the reason that C and JavaScript do this, I think is for the same reason, which is that it doesn't. So C enforces the hoisting. JavaScript allows you to declare it in different places, but does it in the reasonable place because where is that stored in memory, it's a stack frame. Right. So every time you enter a function, you create a stack frame and the memory is going to be allocated at the beginning of the stack frame, if I'm not mistaken. So with both C and JavaScript, this makes sense because unlike C++, where they're doing hoisting as well, because they have to hoist the memory locations to the top of the stack frame or bottom, depending on which way you're looking at it. And then it's doing an initialization somewhere else because in C++, when you declare something, there is an implicit constructor function type of thing that can run. So just by the act of something existing, it can become instantiated, right?
DAN_SHAPPIR: Exactly. I would also add though, that in JavaScript, it's not as trivial as saying that the variables are on the stack because they actually are not, because if they were, then closures will work properly. You need variables to be able to continue to exist even after you exit the function. If there are, let's say you're returning an inner function that uses, that retains that closure, so it gets more complicated. But let's not go there. So that was about VAR and let exactly like you said, let is block scoped, but that's just one of the differences with let. The other difference with let is that it's not hoisted or more accurately, it's not exactly hoisted. It's hoisted, but it behaves as if it wasn't or if it isn't. What I mean by that is that you can, if you have let X online, going back to my example, only instead of having var x, we'll have let x. If you try to use x in the lines preceding that line, you'll get an exception. You're not allowed to use x before you reach its declaration. So that's a big difference between, that's another big difference between let and var, besides their scope, which like you said, let is block scope. Now, why did I say that it's kind of hoisted? Because it's not as if X doesn't exist before the let declaration. It kind of does, only you're not allowed to use it. So it's not like you're trying to use a variable that doesn't exist and then going, let's say, maybe to the containing scope. You're trying to use a variable that you're not allowed to use yet, and you get an exception.
AJ_O’NEAL: And this is why let doesn't work in switch statements. Because it both literally it is Schrodinger's variable declaration. It exists and doesn't exist at the same time. And whether you observe it or not, I guess doesn't matter because it'll just fail. It'll, it'll fail in both cases. It'll fail if you use it. It'll fail if you don't use it. If you use lights, if you try to, if you try to use lights in a switch, you experience that first hand where it says, well, you can't use this because it's declared here. Oh, you, well, you can't use this because it's not declared here.
DAN_SHAPPIR: Well, let's put it this way. Usually if you really want to use let's in switch statements, you would actually create block scopes for the different, different cases and then use the, the lead statement within those block scopes.
AJ_O’NEAL: Which is not the way that it works in any other language. So for trying to bring conformity, this is my problem. If you're going to try to bring conformity, then don't introduce new bugs into the language that didn't exist. People. Well, that's part of my beef.
DAN_SHAPPIR: Well, here's the issue though. The thing is, is that JavaScript is not compiled ahead of time, at least by default. These days we're introducing a lot of ahead of time compilations, thanks to stuff like TypeScript and ESLint and stuff like that, but natively JavaScript is not compiled ahead of time. And consequently, all these rules about not using let before it's declared cannot be enforced at the compile time because there is no compile time.
AJ_O’NEAL: Which is another one of my problems with it. It's, it is a compile time feature for a non-compiled language that tooling already handled properly.
DAN_SHAPPIR: So what you can do though is that if you do want to have this kind of an approach, you can, like I said, use something like TypeScript or in Eastland that might enforce a rule that says, hey, you're using let before it's declared and I won't even let you compile me down into JavaScript and catch the problem that way. And I will tell you...
STEVE_EDWARDS: It won't let you use it.
AJ_O’NEAL: But all of those are already other languages anyway, so if your goal is to not use JavaScript, again, I think two of the features from TypeScript made their way in.
DAN_SHAPPIR: Well, let's put it this way. I totally agree that TypeScript is not the same language as JavaScript. It has a different name. You know, originally they kind of presented it as tooling for JavaScript. I think we're way beyond that point.
AJ_O’NEAL: Well, it's not. I wish it was great tooling for JavaScript. It comes so close to being good tooling for JavaScript. Yeah. Then you have the option. Better than nothing.
DAN_SHAPPIR: Yeah. You have the option of, you know, if you recall, we had Gil Tagall on the show talking about JS doc, so you can use it as tooling for JavaScript using JS doc, if that's really what you want to do. But again, TypeScript, the language itself is not the same as JavaScript. You might consider it a superset of JavaScript or superset of art of JavaScript,
AJ_O’NEAL: which would be a different language. A superset of a subset is a different language.
DAN_SHAPPIR: Yeah.But be that, be that as it may, or like I said, you might be using ESLint to just enforce certain rules. I don't know if I'd call that actual compilation or a different programming.
AJ_O’NEAL: It is, unless they changed it in the last year, because ESLint can't understand JavaScript, it has to, it has to transpile depending on what rules you're using. It has to transpile what you're using basically back to ES5 and then transpile it again to check it because it doesn't. It doesn't actually understand the language as standardized as works in browsers. Promise support was never added correctly. And so it needs Babel to be able to turn promises into yields so that it can check those.
DAN_SHAPPIR: It, I don't know. That's something I have no knowledge about. So I'm not going to debate the point. It's interesting. I'll check and see if I can find information about it, because if that's the case, it sounds sad, but I have no information on it. And consequently, no opinion of that.
AJ_O’NEAL: I tried to use it because it's what's popular. And I thought, well, if I can just use what everybody else is using and I can get it to work for me, then great, I'll do it. And the first thing that I tried to do with it, I was, was put in a, some sort of rule and there, there just wasn't a way to, I couldn't figure out how to do it because it required these babble plugins. And of course that's hundreds of dependencies. I think they trimmed that down a lot. Now I noticed in the latest react install, there's only a hundred dependencies instead of 12,000 or something like that. So they may have fixed it when that was fixed. That was this year. I mean last year, technically.
DAN_SHAPPIR: Well, going back to the discussion about, about bar and let to be honest, I'm not such a huge fan of let either my attitude of let yeah,
AJ_O’NEAL: why not?
DAN_SHAPPIR: Because I prefer cost.
AJ_O’NEAL: Oh no, no, now you've gone down. I need, I need the Skywalker meme. There was something that you needed in the dark side if you went straight for it. You didn't even try to stop yourself.
DAN_SHAPPIR: I know, but look at it. Well, you know, I love that meme, like, join the dark side, you've got cookies. Okay, first of all, I totally agree with you that Const is an unfortunate...
STEVE_EDWARDS: Sorry, I was a little delayed, but it was well worth it.
DAN_SHAPPIR: I totally agree with you that cons is an unfortunate name. First of all, it's unfortunate for being five characters long. It's really annoying to having to type those extra two characters every time I want to declare a variable. By the way, I recently joined Next Insurance, as that's where I now work. And there I'm focusing both on frontend and on backend. And for the backend, the programming language that we use for our backend stuff is Kotlin. So I'm in the process of learning Kotlin. And Kotlin uses var to declare variables and uses val to specify values, which are identifiers that represents values that cannot be mutated. And I very much like that normal culture. So I wish that instead of const, they would have used the word val, which first, but you know, the only downside with it is that it might be too close and confusing to bar. But it does work for Kotlin.
AJ_O’NEAL: All the places where... So one of the problems with all the changes to the language is that it makes the interpreter slower and slower and slower in terms of... There's more and more rules, there's more...
DAN_SHAPPIR: So far the V8 guys have been able to do a really bang up job and. If the language is getting any slower, nobody notices. In fact it usually just keeps on getting faster. And I have to say, I have also to say that you've got a strong representation of all of the engine makers on TC39 and features have been shot down because the various vendors have said either we can't implement this or we can, but it will just hurt performance too much. So, so features have been shot down for that reason. So if they had really been in opposition to this capability because it would really slow things down, then it would not have gone through.
AJ_O’NEAL: I meant, I meant to say parser, not interpreter, but when you, so everything that goes into the language, they want, they want it to not conflict. And I guess this shouldn't be a problem. It's like, because adding a keyword like that, does it prevent you from using you can, can you still barlet? I mean, let me try this out real quick. I don't know if you can,
DAN_SHAPPIR: I have no idea, but at the end of the day. That's not the point. You know, nobody's going to add Vali into the language now. But I'm saying that I totally agree with you that const is unfortunate and a whole bunch of newbie developers are confused by it because they assign an object into a const and they don't understand that, like you said, that what's actually mutable is the reference, not the reference object. And then they are really surprised when you mutate an object that's referenced via const.
AJ_O’NEAL: My biggest beef with const, two things, one, you can var let and this is why they wouldn't have done val because that would have caused way too many bugs. So let is not a strict keyword in the sense that let can be overwritten. So I just did var let equals one and then I can do let one. I wonder if I can still do let foo equals one. But I can still do let foo equals one. So there's huge ambiguity in the language right there, but it works out. Imagine if you had that with val, though. That'd be so confusing for all of the variables that are named val throughout code. But my, my big thing with, with const is cause at first it was just, okay, let's not call things what they are. I don't point at acne on my nose and say, Oh look, I have cancer today. Or, Oh, I just popped some cancer on my face. You know, that's, you don't go to the extreme for minor things unless you live.
DAN_SHAPPIR: All I'm saying is that I totally agree that it's an unfortunate name, but I'm not choosing the name. I'm choosing it because I like to declare immutable identifiers.
AJ_O’NEAL: But this is the problem that I have with that specifically is that then people write really crap code because you'll see nested ternary expressions and, and groupings of and, and or, and because people for some reason believe that const is a moral good. And, and so then they'll create all of this morally bad code that morally bad to me means that it's not readable. It's difficult to discern. It is. It is not built for people.
DAN_SHAPPIR: People will write bad code for any number of reasons. It doesn't mean that we should avoid a particular language constructs just because people who have not been taught the language well might misuse it. Look, I'm looking at
AJ_O’NEAL: the majority of cases are misuse.
DAN_SHAPPIR: Then yes, I'll put it from the reverse. I'll explain the way that I look at it is that. Usually when I assign a value into an identifier, in most cases, I don't want to modify the value contained within that identifier or represented by that identifier. And when I find myself in situations where I do want to modify the value represented by that identifier, I find it to be some sort of code smell that indicates that I should potentially refactor my code. Now I'm not saying that that's the case 100% of the time, but it's the case in the majority of the time.
AJ_O’NEAL: Anytime you've got a string that you want to get something out of, you want to trim the trailing new lines, the spaces, and this happens a lot in the actual...
DAN_SHAPPIR: I put it in a new identifier, the result. I called it untrimmed or untrimmed or something like that.
AJ_O’NEAL: But why? That you're holding onto memory you don't need to hold onto and your variable names are getting...
DAN_SHAPPIR: Yeah, but I'm not adding any extra information. First of all, in most cases, these micro-optimizations are meaningless. Second, if you're block scope, then these things go out of scope really quickly usually anyway. Let's put optimizations aside for a minute. I'm just looking at it from the perspective of code correctness. I find that when I need to modify variables, it- It kind of has to do with the fact that, as you know, the more experience that I gain coding, the more I lean towards a functional approach. And part of that functional approach is trying to keep things as immutable as possible and not having to mutate stuff. And generally, from my experience, when I start mutating things in JavaScript, it leads to problems. And I have no issue with like, you know, it doesn't really cost me anything to declare another identifier. Like you said, in some cases it might cause me to hang on to certain amounts of memory for longer than I otherwise would have, but you know, I trust the engine to do the right thing. And like I said, usually these types of micro-optimizations don't make any difference, but I'll give you an example
AJ_O’NEAL: they do in marketing. That's the only reason I bring it up is because someone's going to hear, oh, const is slower and bloats my memory usage. I won't use it. And that's a win for me.
DAN_SHAPPIR: I'll actually show you and give you an example where using something like a const is actually a performance benefit because when you reuse variables, when you reuse variables, then you might assign to the same variable a value of a different type. So you might have, let's say, some sort of a variable within your function called, I don't know, like temp, and you put stuff in it. I have a temporary string. I'll put it in temp. I have a temporary number. I'll put it in temp. And when you do that, then the JavaScript optimizer has a really hard job because the JavaScript optimizer is based on the fact that it is able to discern that a particular identifier or an expression has a particular type what makes it possible for it to optimize it. And once you reuse variables in that way, you kind of work against the JavaScript engine's ability to optimize the code. But it's even worse from my perspective, because the very existence of temp as an identifier is a code smell to me. The whole concept of reusing a variable means that you, by definition, give it a nondescriptive name because you make some sort of a general use of it. It's like whenever I see a package in some application called miscellaneous or tools or stuff, then you know, that's technical debt right there.
AJ_O’NEAL: And it's not,
DAN_SHAPPIR: yeah. And so when I use const, it forces me not to reuse identifier and I see that as a significant benefit.
AJ_O’NEAL: I agree with the sentiment. I agree with the sentiment that we shouldn't change types, especially if JavaScript has not evolved that if, if JavaScript compiler still can't handle variable shadowing one that makes me very sad if that's true, but two, I agree because of the history of JavaScript. Trying to do variable shadowing is probably not a good idea in JavaScript. And to define variable shadowing. I mean. So in Rust, if you get input from the user, if you were to prompt a user, what is your age? Or in JavaScript, you have a form field and the form field has a field that is age. Even if it is a type number, it always comes back as a string. And if you take some input from the command line, it's always a string. So you might have age, and then you might want to parse age and assign it to age. And in Rust, this is variable shadowing. You're declaring two completely separate variables. And you are just basically saying, it's okay. You can forget about the other one now, because what I really needed was this age that's a number. I was only calling this age that's a string age because I had to store it somewhere when I was getting it from the user and that that's, I think it's a valid logical case for, for shadowing in general, but I agree with you because historically JavaScript hasn't been able to do that and it might entice people to do more terrible things, maybe in JavaScript is better to have age stir equals get from input and then age equals parse aged or something like that. So I agree with that part. I just, what I, the part that I don't think that anything that you said, I necessarily disagree with other than I think it's kind of stupid to have multiple things, names, you should have a canonical name for something that is what you really want to use the law of what, Oh gosh, I'm forgetting the name of it. I had it in my head the other day, but when things, the law of specificity. law of specificity. So the more specific something is, the more effort you should put into or the more letters it can be, the more the more unusual it can be. But the less specific something is the more generic something is, the more normal it should be. So if if what I really want is name, then the variable that I'm using should be name. And then that would mean that the variable that comes into the function might be untrimmed name or, or something like that, because the variable that's the one I'm going to use in the most places, that's the least specific is name and the one that's the most specific untrimmed name would be the one that I'm using the fewest places and I have to do something special with because it's that's generally the law of specificity. So if you're having to create lots of extra variables to be able to make them const to me, that feels like clutter, but I think your argument is logical.
Time is of the essence when identifying and resolving issues in your software. And our friends at Raygon are here to help. Their brand new alerting feature is now available for crash reporting and real user monitoring to make sure you're quickly notified of the errors, crashes, and front-end performance issues that matter most to you in your business. Set thresholds for your alert based on an increase in error count, a spike in load time, or new issues introduced in the latest deployment, along with custom filters that give you even greater control. Assign multiple users to ensure the right team members are notified with alerts linked directly to the issue in Raygun, taking you to the root cause faster. Never miss another mission-critical issue in your software again. Try Raygon Alerting today and create a world class issue resolution workflow that gives you and your customer peace of mind. Visit raygon.com to learn more. Their simple usage plans start from as little as $4 per month with unlimited apps and users. That's raygon.com to start your free 14 day trial.
DAN_SHAPPIR: I kind of use these identifier as kind of descriptive placeholders within complex computations. Like you said that, and I actually agree with you that one of the problems with people who are kind of new to the language and try to adopt this concept of using const is that they can end up creating really complex expressions just so that they don't need to mutate because they want to avoid mutating a variable so they don't use something like a plus equals or something like that.
AJ_O’NEAL: Somebody listening in just. Responded sorry to interrupt value as number is a thing. Thank you. Austin Gill You are my personal hero today. You've taught me something in HTML that everyone deserves to know Bless you bless you
STEVE_EDWARDS: way to go Austin. He used to be one of our
DAN_SHAPPIR: So, yeah, it's great to not be alone But anyway, so I was saying that you're absolutely correct that using constant can lead to scenarios where you attempted to write really complicated and hard to understand expressions just so that you don't need to mutate. But it doesn't have to be this way. First of all, you can always just break that complex computation into a separate function, even a local function within that function, and do whatever computations you want there, return the result and, you know, assign that result into the cost. So that's one thing that you can do to remedy this situation. Another thing is very often I see the, you know, stuff like plus equals or, or other type of modifying assignments using the context of core loops. And that just goes to the fact that I prefer to use, uh, iterator methods like, uh, map and find and filter and stuff like that.
AJ_O’NEAL: Those are not on interators.
DAN_SHAPPIR: I said iteration methods. I didn't say iterators.
AJ_O’NEAL: Oh, sorry.I miss heard.
DAN_SHAPPIR: I wish that they were on the iterators. I've, we've discussed this in the past. They're not, they're just methods on arrays. But again, if I, if I want to, let's say some numbers in an array, then I use something like either a low dash sum or some, or my own implementation built with what we do, so whatever, and I wouldn't do it as a for loop and therefore again, I wouldn't need to modify variable in each iteration because I just compute the result and assign the result into an immutable identifier.
AJ_O’NEAL: So here's what I need to know about potential purists. If you needed to interleave stereo channels of audio, would you use a for loop?
DAN_SHAPPIR: I might. I'm not saying I'm religiously against it. I said, I prefer look, I, everything that I'm, everything that I'm saying is to be taken, like I said, within reason.
AJ_O’NEAL: And I just, I just want to know how far you'd go,
DAN_SHAPPIR: but I'll give you an even worse example. When I, I haven't done this in a while now, but the last time that I recall interviewing for a job, uh, and they were giving me, you know, those annoying coding exercises that they tend to do in those types of situations. I tend to, as I recall, I actually used for loops because I was trying to figure this, the problem through under pressure. And I wasn't sure which iteration method I would want to use. So it's easier. It was easier for me to just use a general for loop and go from there. In the real world, I would then go after, you know, if, if I, if I started that way, first of all, in the real world, obviously there's no, no, no such pressure. But beyond that, if I do start with a for loop, I might then go, go in afterward, refactor it into using iteration methods because I prefer the declarative approach because I find it easier to read, assuming you're familiar with the coding style.
AJ_O’NEAL: Yeah. And I think I agree. I think that there's a few that I like to use, particularly map, I find to be honest to goodness useful. When I look at code in general, I see more people abusing reduce than using reduce. And when you get to the more combinatorial methods, flat map and reduce, right. And at that point, it's just all out the window in terms of if people use them at all, they're using them wrong, except for the very, very few people that know how to use it correctly. And then it's actually less clear to read because there is so much that's baked into it's easier to chain two things together and be able to look at this in isolation and look at this side isolation than some of those iterator methods where they have extremely specific behaviors and an extremely specific use case that most people just aren't going to be familiar with in the first place.
DAN_SHAPPIR: Yeah, it's like with Unix or Linux pipes. Used in a sane way, Unix pipes or Linux pipes, the fact that you can pipe data through a series of simple, really specific applications that do a really specific thing is great. But then you pipe it through some sort of a really complex off program or something and you don't know what's going on. And AJ's fighting, so I'm scared.
AJ_O’NEAL: Well, I love to do fairly complex things. Not that I love to do it, but it's, it's not stuff that goes into production, but I will write scripts that do what they need to do to get the job done across the a hundred files. And what I'll do is in my PR or my issue for that, I'll post the script so that if by chance anyone else can understand it, they can comment on something that's wrong and that I have it as a reference if I need to undo and redo. Cause sometimes if you need to go across many files, you, but I, I actually, I'm anti-OC from the perspective that unless you are a sysadmin and you literally do not learn programming languages, then I get the case for Oc, but anybody who knows a programming language, why would you learn yet one more scripting language? When you could at that point just write it in a scripting language.
DAN_SHAPPIR: So here's the funny thing. So I had this Twitter exchange with Brendan Icke the creator of JavaScript. Oh, yeah. And I had always assumed that the inspiration for JavaScript was some sort of combination of scheme, Java, and Simula, or something like that. And he said that if there's any language, like that he thinks that the language that most inspired him in a way was actually awk. And he even kind of made this joke that JavaScript has an awkward inheritance. And where's the drum roll scene? Okay, here we go.
AJ_O’NEAL: You've got to be on the button for that, Steve. Get your fingers that they're ready. Do we actually have a little bit of latency between us?
DAN_SHAPPIR: We probably do. I mean, latency is a fact of life. But, but I wanted to...
STEVE_EDWARDS: Sorry, there's a little bit of delay when I click the button and when the sound plays, so I'm doing my best.
DAN_SHAPPIR: I do want to add, like, I know that we're running towards the end of the show and there were two important points that I wanted to make. One was that for me at the end of the day, it's a question of reference. I can appreciate people who prefer using VAR. For example, Kyle Simpson, Getify, who we all admire, is a real big proponent of VAR. He literally hates all the other options, I think, more or less. And I totally accept that. It's just like I said, it's my preference to use const, and I accept it when others don't have the same attitude. And so that's one thing. And the other thing that I wanted to say is that it's really the most important thing is to be consistent in your code base. Like if you're coming into an existing code base and you see that they're using bar throughout or let throughout, be consistent with that. Don't try to like say this, okay, I get that everything everywhere else in this code, they're coding this way. I have my own personal preferences. I'm going to code it differently. You're just creating a headache for whoever needs to maintain that, that code after you and ESLint is a great way to enforce consistency in large scales projects in this way.
AJ_O’NEAL: So this is one thing I was going to ask. Why is const at all important as a language feature when it's not a compiled language, so you don't get any of the benefits there, but you have the tooling, right? So this is my thought. If you don't, if you're the type of dev that is at the beginner level where you're not using any tooling, no one's told you about VS code or JS hand or ES Lent yet, right? Don't you just want your code to at that point, you just kind of want things to work at all. You don't want them to break midstream, right? And if you are a dev who uses tooling, what in the world does const offer you that just taking the little checkbox in your linter config while typing out true in the JSON of your linter config doesn't.
DAN_SHAPPIR: Don't exactly follow. How would you indicate that something needs to be, needs to be const or no, needs to be immutable to the linting environment without using the appropriate keyword?
AJ_O’NEAL: Well, because you're saying that, well, essentially, it seems that people are one of two camps. They're either, well, one of three camps. They're either using VAR in a possibly disciplined fashion, or they're using const in a possibly disciplined fashion, or they just do whatever, right? So if you wanted to have the discipline of const, just apply that rule to VAR, right? Just say, I don't want things, I don't want to allow mutating.
DAN_SHAPPIR: Yeah, but then you're changing the meaning or the behavior of a keyword in the language. And I have a problem with that. But you're not changing it because you're declaring lots of vars.
AJ_O’NEAL: You're just saying, hey, don't let me mutate.
DAN_SHAPPIR: Yeah. But first of all, like I said, there are certain scenarios where you actually may want to mutate. And the other thing is that I'll be potentially surprising whoever reads the code after me, because they'll be seeing var. They know that you can modify var. And all of a sudden they find out the hard way that they can and they'll be really annoyed with it. I prefer to be specific about it. So from my perspective, so my perspective is this, I totally agree with you that the use of const is, as the keyword is unfortunate, I would have preferred the different keyword that's more indicative of the fact that it's the identifier.
AJ_O’NEAL: What should that keyword be, by the way? Just like I said, curiosity.
DAN_SHAPPIR: Like I said, I get why we couldn't use val in JavaScript because it would have broken too much existing code, like you said, people use val for stuff. But I think that the fact that it's using Kotlin is a better use of the word than the const keyword is in JavaScript. Now, what other keyword would I have used? I don't know. I don't even try to think about it because it's irrelevant.
AJ_O’NEAL: Okay. Well, Rust has let and let mute. And I think that that works really well. Sometimes it's confusing because the mute can go on either side of the equation and then I get confused because I'm not used to that syntax. But anyway, I just don't, I don't know what the appropriate keyword ought to be, but I would be in, I would, I would maybe be in favor of an appropriate keyword if people didn't lie and tell people that it's religiously better and then make, encourage them to write crap code so that they don't do an if where obviously let variable equals default value if special condition variable equals special value. That's good.
DAN_SHAPPIR: And another thing that I wanted to say is that before let and cons were introduced into the language, I was familiar with, with the Douglas Crockford's approach of putting all the vals at the, all the bars at the top. I agreed that it was the right thing to do and yet I couldn't bring myself to do it. So By using let and const, at least, I code along appropriately in this regard. I don't know. I'm not sure what the term would be.
AJ_O’NEAL: There's one more thing that I wanted to mention before we end, which is another compiled versus dynamic language issue. Const and let really screw up your REPL experience. When you're just trying to test out some code real quick, test out these three lines of code and say, okay. Let me paste these in here. Oh, I need to change this. Paste this in here. Ah, that doesn't work. Let me refresh the page. Do it again.
DAN_SHAPPIR: So they actually fixed it. I did. Yeah. I'm not sure. First, first of all, you can, you can for sure use that multiple times. And I, as I recall that you cannot even this is cost multiple times, but I'm not sure if it's already in the release version of Chrome, it might be that it's all in from Canary or something like that. I think that you,
STEVE_EDWARDS: we need a breaking news.
AJ_O’NEAL: We do. Because I could have sworn, so I see that it's working in Chrome. I don't think that it works in, in node yet. I'm not sure, but I tried this recently. I recently had a problem with this recently could be anytime in the last year for me actually,
DAN_SHAPPIR: but they actually needed to do work to get it to work. So, because like you said, by default, we're working within the same scope. You've created the cons. Well, you can't create the constitute with the same name again. And likewise, you can't be declared a variable using that. So they actually had to do work within the Chrome DevTools console to actually get it to work. It's like they're creating a new scope for every line that they're executing or something along these lines or something weird like that. I don't know exactly what they're doing.
AJ_O’NEAL: My rule of thumb has become if I don't have any good reason that I want to restrict this code to be for non-embedded environments, let's say, I will use VAR. So if I need to use something such as the web crypto API or some API that only exists in evergreen browsers, that wouldn't exist in an embedded environment, such as, uh, was it duct tape JS or the Wii U or the PlayStation or something like that, if I'm, if I'm using something that I know is not going to be available in specialized environments, I'll use led. But if I'm doing something that's fairly generic, I'll just use VAR because. Why not let it work just in case somebody wants to use it in an esoteric environment? And then I use const for constants if it's actually a constant. So var for global scope and for things that don't matter, let for modern code that the virtue of what the code is, is going to enforce that somebody must have an evergreen browser anyway. And const just for constants.
DAN_SHAPPIR: And I think we need to move over to PIX soon, don't we Chuck?
CHARLES MAX_WOOD: Yeah, we should. Yep, let's do picks. Sorry, I've been pretty quiet on this one, but, uh, been interesting to listen to, but yeah, let's do picks.
Hey folks, this is Charles Maxwood from Top End Devs. And lately I've been working on actually building out Top End Devs. If you're interested, you can go to topendevs.com slash podcast, and you can actually hear a little bit more about my story about why I'm doing what I'm doing with Top End Devs, why I changed it from, uh, devchat.tv to Top End Devs. But what I really want to get into is that. I have decided that I'm going to build the platform that I always wished I had with DevChat.tv. And I renamed it to Top End Devs because I want to give you the resources that are going to help you to build the career that you want. Right? So whether you want to be an influencer in tech, whether you want to go and just max out your salary and then go live a lifestyle with your family, your friends, or just traveling the world or whatever, I want to give you the resources that are going to help you do that. We're going to have career and leadership resources in there and we're gonna be giving you content on a regular basis to help you level up and max out your career. So go check it out at topendevs.com. If you sign up before my birthday, that's December 14th. If you sign up before my birthday, you can get 50% off the lifetime of your subscription. Once again, that's topendevs.com.
CHARLES MAX_WOOD: Steve, do you wanna start us with picks?
STEVE_EDWARDS: Yes, let's start with picks. So I actually have a legit pick before I get to the highlight of the show, the dad jokes. So I just finished reading a book by an author named Eric Metaxas. He's a pretty well-known Christian author. And the book is called, Is Atheism Dead? It's a pretty new book. And in it, he really does a good job of marshaling a lot of the evidence for the historicity and scientific accuracy of the Bible and addressing a lot of claims made by the quote unquote new atheists like Richard Dawkins and Christopher Hitchens. But it's really, really a good book. I've picked before, article that he wrote for Newsweek magazine that is an excerpt from this book about some of the findings related to the physical location of the cities of Sodom and Gomorrah. And so that's part of this book, but it's really good book. It's looked sort of long, but a lot of good information in it. Now,
DAN_SHAPPIR: if I can interject before we get to the joke, I think that you can accept that things that are described in the Bible, at least some of them, are maybe historically accurate or are depictions of, you know, modified depictions of actual historical events without being either religious or an atheist. I believe that a lot of the events, things that are described in the Bible are in fact related to actual historical events. Doesn't mean that I have to be religious in order to accept that.
STEVE_EDWARDS: Yes, that's true. And although my point of view is that if you find that it's telling the truth in some things, you can go on to the historicity of the Book of Luke, for example, as another one, then why wouldn't you believe it in other things? But no, that's a whole typical discussion. I, for instance, you know, to your point, Dan, I can remember years ago reading about a course, a college course that taught the Bible is literature. Nothing more, you know, literature, you look at the poetry and the stories and some of the other things in there where you treat simply as literature without, you know, any validation for the religious aspects of it. So yeah, as such, I believe it's great. That's a great tool for that. So anyway, a couple months ago, I was flying down to Orlando, took my family on a vacation. And on the plane, I was sitting next to this guy who looked really nervous. And I asked him if he was nervous. He said, yes. And I said, Oh, is this your first time? And he said, no, I've been nervous many times before too.
DAN_SHAPPIR: Okay. I laughed before I managed to push the button.
STEVE_EDWARDS: So as programmers or developers, whatever term we want to use ourselves, what's the drug that most programmers are addicted to? Coding.Thank you very much. And then finally, what do you need to make a good movie about Broken Bones? An awesome cast.
DAN_SHAPPIR: Okay, okay.Alright, that's great.
STEVE_EDWARDS: Thank you for the laugh, I appreciate it. Anyway, that's all the picks that I have for this week. All right, Dan, what are your picks?
DAN_SHAPPIR: My picks aren't that funny, Steve.
CHARLES MAX_WOOD: I was gonna say, I didn't think it was that funny.
STEVE_EDWARDS: Actually, it's just the law, I think, to how it accidentally replays.
DAN_SHAPPIR: So anyway, I'm gonna play AJ today and I actually have quite a number of picks. My first pick has to do with the fact that, as I said during the show, I started working at Next Insurance three weeks ago at the time of this reporting. And one of the things that I want to say is that it's really tempting going into an organization, especially if they hire you for things that you have experience with, to really, you know, jump in, start making, you know, trying to push through changes, start showing your value, start trying to take over discussions. And I'm saying that's totally not the right thing to do. Especially if you're a senior, especially if you're in a leadership role, you should definitely, first things first, get the lay of the land, talk to people, understand their processes, their way of doing, going about things, learn why they do the things that they do and how they do it, who's responsible for what, and come in with humility. I think that's a very important thing and would be my first recommendation and pick. So that's number one. The other thing is I also mentioned, well actually I'm not sure if I mentioned or not, oh yeah we talked about it before the show. I participated in, for the first time in a very long time, in a real actual conference where we met together physically in the real world, not a virtual conference. It's called the Velsim conference in Israel and I spoke there. I actually spoke about JavaScript, I spoke about JavaScript Week references, which we actually had an episode about a while back, and I enjoyed myself very, very much. Just meeting people in hallways and chatting with them was awesome. One thing that did kind of get in the way is that everybody was wearing masks. In fact, everybody except the speakers were required to have, or while we were eating, were required to have masks all the time which kind of creates a sort of anonymity. It's kind of makes it difficult to recognize people, which actually gave me an idea. You know, usually in conferences you have badges. Well, my idea is why not print the same information as the badge on a mask and then give it to the people. And then at least you won't have to look down to see what that person's name is. You'll just have it on their face, which also makes it much easier for me because I tend to forget names. And so that would be my second pick of, you know, the joy of actually attending a real world conference yet again. Another pick, I don't remember if I picked this or not, but it's certainly worth repicking if I have. The Web Almanac for 2021 has come out. This is a document which kind of breaks down the shape of the web. So they have a chapter on CSS and on JavaScript usage and on markup. So for example, if you want to know, it might be really, you know, interesting things like about performance, the impact of JavaScript on performance, or it can be some really as a teric information, like what's the most popular CSS background color amongst all websites out there. It's a really interesting document, a lot of useful information about SEO, accessibility, performance, privacy, security. I'm just reading out the table of contents. So I highly recommend checking that out. And finally, I'm reading an interesting series of books, you know, not amazing literature, but I'm finding it enjoyable. It's called Old Man's War. It's a science fiction series talking about the future in which humanity finds itself in a very unfriendly universe, having to fight all the other races that exist out there. It's kind of like Star Trek in reverse. In Star Trek, you know, It's somehow all the civilizations that exist are more or less at the same degree of scientific evolution, And if you just avoid misunderstandings, then everybody can live in peace. Well, here it's the completely opposite approach of everybody really is out there to get each other and wipe each other out. But again, I find this series of books really, really enjoyable, especially if you know, suspense, apply suspension of disbelief. And those would be my picks for today.
CHARLES MAX_WOOD: All right. AJ, what are your picks?
AJ_O’NEAL: Oh, I've got some good ones today, don't you know? So first of all, now that you're able to watch this live, I get to say the thing that I say when we're actually really live on my own channel, which is that if you like this, found it entertaining or the sound of our voices just helps you fall asleep at night over there on the other side of the world. Go ahead and give us a thumbs up and sub. Wait, that's not really a pic. That's just me throwing an anchor line in. I'm gonna pick Mario Kart Live. Apps are fricking, literally amazing. I cannot, when I saw the commercial for it, I thought, take my money now. And then as time went on, I thought, nah, it's not gonna be that good. They're not really gonna figure it out. But Nintendo is the Apple of games, right? Other people can try things out. Well, actually, Nintendo fails quite often. Augmented reality is something that they've failed every single time that they've ever tried until now But yeah, Mario Kart live is awesome I can let my two-year-old play and the car will go around the track on its own If she just holds down the a button and it's in auto mode the car that the camera will just look for the gates and the car will drive through them and it keeps track of the track and even as things kind of get bumped and moved a little bit as the car might bump into them or the cat we don't have a cat but the cat might bump into them, you know, etc. It is just amazing. And then I enjoy it and you get to unlock the faster races as you progress. And so the car physically gets faster when a shell hits you there's a wind hazard. So when the wind blows, your car is actually knocked to the side. And so you can't steer to the left or to the right because the winds blowing to it. It's just it they just did a bang up amazing job. I think Mario Kart Live is awesome. I hope that you do too. You're welcome.
STEVE_EDWARDS: Hey, AJ, so yeah, we've loved Mario Kart ever since the Wii. So is this something you play like online?
AJ_O’NEAL: No, this is physical. You buy the car and you set up gates in the house. It is Phantasmagor. And I actually bought a second Switch. I went online and was able to get one used for a pretty darn good price considering that they're always out of stock. Actually, Facebook Marketplace. I got it from a guy in Lehigh just a few miles up the road. Anyway, yeah, but I actually got a second switch so that we could play independently because she being a two year old, it has a much easier time holding the thing up towards her face than she does looking at a screen and holding the controller in her hand, you know, it's a little more together. So yeah, I it was that good. Of course, I am the person who bought a Wii U to be able to play Mario Kart in full HD and spent way too much money doing that and that was literally the only game that ever came out for the Wii U aside from Smash Bros that was I guess Pikmin 3 but I didn't get that until I got the Switch. Anyway, Deku Deals I'm also going to pick because my link to Mario Kart Live is my Amazon affiliate link but if you want the best price you've got to go to Deku Deals. Deku Deals is the one to all the blah blah blah blah blah blah blah blah blah blah for anything Nintendo that you want to be able to buy and know when it's the cheapest either physical or digital or whatever. I mentioned that before, but I love that code deals. I, and, and then my technical pick is the note JS Beck best practices guide by goal, bird, yoni, goldberg, yoni. It's actually not bad. Isn't it's good.
DAN_SHAPPIR: It would be yoni Goldberg, by the way, yoni, yoni, yoni would be his first name. I
AJ_O’NEAL: 'm reading the username, but yes, thank you. Anyway. Yeah. So the guide is actually good. There's multiple contributors to it. There's a few things I disagree with, but it's an excellent guy. It's an excellent guide. I really appreciate it. They hit on a lot of points that I've also hit on over the years. And it's just good to see that I'm not alone and old man yelling at clouds. There are a couple other men out there on the fields with me. And aside from that web install.dev for all your developer tools, Creeds of Craftsmanship.com for great talks and reference material for learning to become a software engineer. It's not the stuff that I'm creating, just stuff that I'm aggregating. And then if you want to follow me on the live streams, CoolAJ86 on YouTube and Twitch and Beyond Code Bootcamp also on YouTube and Twitter for the more condensed material.
CHARLES MAX_WOOD: All right. I'm going to jump in. I do have a question on the Mario Kart thing. Does it have to be on a hard floor because most of my house is carpeted?
AJ_O’NEAL: It depends on how deep the carpet is. If it's shag carpet, it's not going to work. If it's pretty thin carpet, it can work. If it's kind of thickish carpet, then it's kind of a bumpy ride. It's not the best, but you can just take all your Amazon cardboard boxes and lay those down. But we actually have the floor in the kitchen and the floor in the living room are, it's the same room. And it's, it's actually kind of cool to have it hit the carpet and then bump up in the air a little bit. Once you unlock 200 CC and it can go fast enough to do that. It's pretty cool.
CHARLES MAX_WOOD: Yeah. Our kitchen and living room are right next to each other. And there's a long wooden transition strip there that yeah, that might be interesting, but the couch is right there too. So
AJ_O’NEAL: if the couch is only, if it's at least yay high off the ground, you can put up a gate in front of the cat couch and then have part of the course run through the couch. We've done a couple of different configurations between figure eights and circles and going under the couch, going under the table, you know, it's, it's cool. I don't know if it's a novelty item that will only be good for so many hours or if it's something that you'll come back to and enjoy over and over again for hundreds of hours, the way that I feel about normal Mario Kart, but it's at least as challenging as the normal game, but maybe more challenging because if you hit into a table, there is no, I forget his name, the turtle guy to come pick you up and pull you over and put you back on the track. If you hit a hazard, you've actually, well, in the real world, you've actually hit a hazard and have to deal with it in some way. And then the way that they, you know, obviously you can't have different tracks every single time you do a race, but the way that they do the obstacles and the hazards and the different ways of causing you trouble are interesting and fun.
CHARLES MAX_WOOD: Cool. I'm going to have to watch Deku deals. Yeah. Mario Kart's one of the ones that I play with my kids a bunch.
AJ_O’NEAL: So you can play two player locally. If you play on the TV, if you want to play handheld, then the play two player, you need to have two switches.
CHARLES MAX_WOOD: Two switches. We have two switches. All right. Good deal. And it looks like they only have Mario and Luigi. Correct. OK, good deal.
STEVE_EDWARDS: Oh bummer, I always like dry bones.
AJ_O’NEAL: Yeah, you can only play two player. You cannot play more than that. Well, you can play with or without thumbs. And then also when you're playing with a two year old, it's nice when you can play your own race and she can play her own race. You know, half, I mean, obviously you don't have to play together, but you can play together in the same actual race.
DAN_SHAPPIR: Well, I understand why you don't want to play with your two-year-old. She probably beats you like nine times out of ten.
CHARLES MAX_WOOD: Yeah. All right. Good deal. I was just curious. So, yeah. And yeah, the Deku deals. Yeah, that looks good. You might have spent some of my money anyway. I'm going to throw out a bunch of picks here. So I usually do a board game pick. So the pick I'm going to throw out this week. I need to actually make a list so that I can like mark off which ones I've done, because I'm starting to get to the point where I'm like, did I pick this one? So I'm just going to pick it. And we're going to go with it. And then if I've picked it before that I'm real sorry. And yeah, I'll go put the list together so that I know, Hey, I've picked it on these shows, but the game I'm going to pick is called Scythe and it's, it's like the, the tool you use to read the crops Scythe and the way that it works is. So it's got the hexagonal board spaces, kind of like Settlers of Catan, except it's, it's all just, you just put the board down, you don't actually like lay out the hexes and each hex actually generates different resources, like in Settlers of Catan. The difference is that you've also got an action board in front of you and you all play different characters that are different nationalities that all have different abilities that help you out, right? So you may be able to move across water in a certain way or you may be able to... So the one I played with my wife and sister and brother-in-law the other day was what I could do is I could actually, when I triggered an exploration, I could use two of the features instead of one. And so you move around the board and as your character hits certain spaces, you can do certain things. But the main functionality of the game is you have a little pawn on your action board and you move it to the action you want to take. And then you can take an action that gives you like power, which is usually what you're using for combat. Or you can get money or you can get resources or you can place workers and then make the workers work. Right. And so when the workers work, that's how you get the resources. And then as you move around the board, you can have encounters with people and you can get certain things that way you gain popularity. And then at the end of the game, what you do is you tally up all of your money basically, so you get paid for the number of hexes you control and the number of Quest you've completed and the you know different things and at the end you tally it up and whoever has the most wins and it's it's really really fun It's it's a game and it takes about an hour to play it's a little bit involved to figure out But once you get into the gameplay, it's relatively simple do the top action do the bottom action Oh, I know right yeah Yeah, you move between production and deployment and enlisting other people.
DAN_SHAPPIR: Yeah. And at the end of the day, I tell you up the things and hope to go that I've come up with the head.
CHARLES MAX_WOOD: That's right. So anyway, it's super fun game. We have it. We own the expansion to it as well. It does have a single player mode that I have not tried, but anyway, it's a way fun game. Um, it's going to be a little on the little more expensive side of games, but definitely one of my favorites. So I'm going to pick Scythe. And then for everything else, I am currently working on pulling some stuff together with top end devs. I think the next stage of things is to start releasing some of these series that I wanted to put together and putting up a summit. And so the first summit is going to be the top end dev summit, and it's going to be focused on how you get to be that top 5% of developers. So what are the things that you have to do that are kind of above and beyond what anybody else is doing to get you into that top 5%? And I'm going to have people from all over the industry come talk about basically how they made contact with other people, gain notoriety, or just practice every day so that they can essentially gain the skills and connections and personal brand that allow them to notch up. So anyway, go to topendevs.com. All the information will be there. And I should have dates by next week when we record this. But that's what's going on there. And then the last pick I have, and I've talked about the Traeger before that I used to smoke, but my family, we decided for my birthday. In other words, I decided for my birthday that I wanted to get a bunch of people together and do ribs. And so I did that. And then we were talking about getting together with some friends or with some family for New Year's Eve and we made brisket tacos. And I have to say that that's been like the best thing ever. And when you get the brisket right, oh my gosh, it is so good. So I'm going to pick brisket. That's my pick and tie that in with the Traeger smoker.
DAN_SHAPPIR: You're making me hungry, Chcuk.
CHARLES MAX_WOOD: Oh man. I'm making me hungry. All right, folks, we're going to wrap it up here and yeah, thank you all for coming and having this conversation. We'll check out the live stream, see how that went, see if we want to keep doing it. And until next time folks, max out.
For the real contact fast with Cashfly, visit C A C H E F L Y dot com to learn more.
Sorting through the Script (AJ vs. Dan Shappir) - JSJ 519
0:00
Playback Speed: