Podcast Lookup

Get Programming with JavaScript

CyberSecurity Summary

  • September 11, 2026
  • 22 min
Episode page
About this episodeA hands-on introduction to coding for beginners using the JS Bin online sandbox. The text utilizes a continuous project called The Crypt…
A hands-on introduction to coding for beginners using the JS Bin online sandbox. The text utilizes a continuous project called The Crypt, a text-based adventure game, to demonstrate how specific programming concepts build a complex application. Part 1 focuses on core building blocks, beginning with variables to store and manipulate individual pieces of data like player names or scores. It then introduces objects, which allow developers to organize related data into cohesive groups using key-value pairs. By following the development of the game's players and locations, readers learn to transition from loose variables to structured, encapsulated data. This practical approach emphasizes learning by doing and provides a roadmap for mastering JavaScript from the console to the browser.

You can listen and download our episodes for free on more than 10 different platforms:
https://linktr.ee/cyber_security_summary

Get the Book now from Amazon:
https://www.amazon.com/dp/1617293105?lv=shuf&channelId=500&plpRedirect=mhFallback&linkCode=ll2&tag=cvthunderx-20&linkId=c643c5d42f29477fc559956697123470&language=en_US&gaOptInStatus=true&ref_=as_li_ss_tl

Discover our free courses in tech and cybersecurity, Start learning today:
https://linktr.ee/cybercode_academy

Transcript

From the publisher

This transcript comes from the podcast’s own feed, shown as the publisher wrote it.

Get Programming with JavaScript

00:00—
  1. Speaker 1

    Every time you click a button on your favorite website or swipe across the screen, you're instantly triggering this cascade of microscopic, invisible robots.

  2. Speaker 2

    Oh yeah, like thousands of.

  3. Speaker 1

    Them, exactly thousands, and they are executing these highly specific, really ruthlessly logical instructions in like a frashment of millisecond. And we've all gotten so used to this seamless digital universe that we kind of just treat it like magic.

  4. Speaker 2

    Right. It creates this illusion of a glowing, impenetrable box. You ask for something, the box glows and the result just magically appears. You know, we rarely think about the actual architecture holding the whole thing together.

  5. Speaker 1

    But today we are pausing time to look at exactly what those microscopic robots are made of. Welcome to the deep Dies. We're taking a stack of notes drawn entirely from this really fascinating book, Get Programming with JavaScript by John R. Larson.

  6. Speaker 2

    It's a great foundational text.

  7. Speaker 1

    It really is, And our mission today is to give you a shortcut to being well in full armed about how software is actually built. We're going to strip away the intimidating jargon to reveal the the elegant logical building blocks underneath it all.

  8. Speaker 2

    Yeah, getting past all that gatekeeping terminology.

  9. Speaker 1

    Exactly, We're going to trace the journey from writing a single line of raw text all the way to architecting the foundation of an entire interactive world, specifically a text based adventure game that Larsen builds in the book called The Crypt. Oh.

  10. Speaker 2

    The crypt is such a perfect sandbox.

  11. Speaker 1

    For this, it is. Okay, let's untack this. Where do we even begin When the goal is to stop treating the machine like magic and you know, actually start speaking its language.

  12. Speaker 2

    Well, we really have to begin with the philosophy of learning it. Larson introduces this core philosophy early in the text, which is that learning follows thinking.

  13. Speaker 1

    Learning follows thinking.

  14. Speaker 2

    Yeah, meaning you cannot learn the architecture of software by like passively reading a book or listening to some abstract lecture. Understanding code requires you to actually manipulate the logic yourself, your hands dirty. Exactly. You have to force your own brain to translate a human intention into a strict machine instruction.

  15. Speaker 1

    Which means stepping out of the theoretical and getting into an environment where you can actually, you know, brak things. I kind of think of it like learning how to cook by actually burning a few meals in the kitchen rather than just staring at a recipe book.

  16. Speaker 2

    That is a perfect analogy, and it's precisely why Larsen centers the initial experience around this tool called js bin jaspin. Yeah, Remy Sharp, who's the creator of jspin, he actually wrote the ForWord for the book, and he designed this tool as a totally online sandbox. It is a completely isolated, no mistakes barred development.

  17. Speaker 1

    Environment, and it requires zero setup, right, literally zero.

  18. Speaker 2

    You just open your browser, you dismiss this little robot mascot.

  19. Speaker 1

    Oh right, Dave the binbo.

  20. Speaker 2

    Yeah, Dave Binbot. You dismiss him, and then you're just staring directly at the console panel.

  21. Speaker 1

    It's like jumping straight into a flight simulator. You type that legendary first command that every programmer learns, right, console dot log Hello World.

  22. Speaker 2

    And you hit run yes, And there is this immediate raw power in that execution loop.

  23. Speaker 1

    It's magical. You just type text and the computer instantly responds. Right.

  24. Speaker 2

    Because you issue an instruction and the machine obeys it instantly, that execution loop fundamentally shifts how you interact with the computer. You stop being just a consumer of the magic box and you become a commander.

  25. Speaker 1

    I love that consumer to commander.

  26. Speaker 2

    But you know, because it is a strict environment, it also introduces you to the concept of merciless feedback.

  27. Speaker 1

    Oh boy, the red text.

  28. Speaker 2

    A red text js BINN does not infer your intentions. If you forget a semi coolin or if you know, misspell a command by one letter, it immediately throws this bright red error message at you.

  29. Speaker 1

    And reading through the notes, I noticed how much emphasis ll are some places on those errors. He really frames them not as failures, which is how we usually take them, but as the computer just rigidly asking for clarification.

  30. Speaker 2

    Yeah, and honestly, that stripped feedback is the only way to build resilience in programming. I mean, a machine cannot bridge the gap of human ambiguity, right doesn't know what you meant to say exactly. You delete a character, the system breaks, you put it back, the system runs perfectly. It forces you to adopt this standard of absolute precision. And that's the foundational mindset you have to have before you can even start designing complex systems like a game.

  31. Speaker 1

    So, okay, you're in this simulator, You're learning precision, you're commanding the console. But a world without state is entirely static. If we're going to build an interactive game like the crypt we need to track what's actually happening. We need a way to manage data.

  32. Speaker 2

    We need to allocate memory, and that is where the concept of variables comes into play. Variables, Yeah, variable isn't just a label. It's an actual dedicated space in the computer's memory that you reserve to hold specific data and you can retrieve it or mutate it later.

  33. Speaker 1

    Let's look at the hypothetical app Larson mentions to illustrate this because it's hilarious. It's called the fruitinator. Oh yeah, the fruitinator.

  34. Speaker 2

    So imagine a player running around splitting fruit with a smoothie nine millimeter as.

  35. Speaker 1

    One does naturally, and if they shoot a strawberry they get fifty points. But if they managed to hit a tricky cum quat, well that's worth a hundred points. To make that game work, the program needs a reserved space in memory to track the score, right.

  36. Speaker 2

    It needs a variable exactly, and the syntax for that is pretty straightforward. You use the var keyword, you name it, and you use the assignment operator, which is just the equal sign to give it a value.

  37. Speaker 1

    And as the state of the game changes, like as the player hits that cumquat, the program has to reach back into that specific memory address and update the value.

  38. Speaker 2

    It does, which brings up the huge challenge of organization because in a massive code base, you might have thousands of these memory spaces, right, So Larsen really emphasizes using highly descriptive, human readable naming conventions for variables, like using camel case formatting, where the.

  39. Speaker 1

    First word is lowercase and the next word is capitalized.

  40. Speaker 2

    Yeah, exactly. So instead of naming a variable CPCH or just X, you name it cost per hour with a capital P and H.

  41. Speaker 1

    Because if you don't, you're going to confuse yourself.

  42. Speaker 2

    Later, oh one hundred percent. That is a critical architectural habit. You aren't just writing code that a machine can execute. I mean, machine doesn't care if you call your variable x or super califragilistic.

  43. Speaker 1

    It's all the same to the machine.

  44. Speaker 2

    Exactly. You are writing code that future developers can understand and maintain, and often you know that future developer is just you, like six months from now, desperately trying to figure out what a variable named Q was supposed to track.

  45. Speaker 1

    I've been there. It's not fun so clear. Naming acts as embedded documentation precisely, but even with descriptive names, having thousands of loose variables floating around the game engine just sounds like a nightmare. Yeah. Like, if we're building the crypt we have player names, health stats, inventory items, locations.

  46. Speaker 2

    Yeah, it's a lot of data.

  47. Speaker 1

    If all of those are independent variables, the global scope of the program just becomes this massive clut warehouse.

  48. Speaker 2

    It leads to what developers call global variable pollution pollution.

  49. Speaker 1

    Wow.

  50. Speaker 2

    Yeah, because when everything is loose, the risk of data colliding or being accidentally overwritten it just skyrockets. So to manage that risk, you have to encapsulate the data.

  51. Speaker 1

    And Larsen uses this fantastic analogy for this in the book The First Aid Kit.

  52. Speaker 2

    It's such a good visual, right, because if.

  53. Speaker 1

    You're going on a hike, you don't carry a bandage in your left pocket and scissors in your right pocket, and I don't know a bottle of antiseptic in your shoe.

  54. Speaker 2

    That would be absurd.

  55. Speaker 1

    You pack them all into one single container. You pass the whole kit around, and when you need something, you open the kit and pull out just the scissors, and.

  56. Speaker 2

    In JavaScript that container is called an object.

  57. Speaker 1

    An object.

  58. Speaker 2

    Okay, yeah, so instead of managing disconnected variables, for say player one name and player one health, you define a single player object. You use curly braces to group all that related state into one name space using key value pairs.

  59. Speaker 1

    So applying that to the crypt let's say the player's name is Chondra and her health is fifty. Later on, when Candor takes damage from a trap, you don't have to go hunting for some loose health variable. You just use dot notation like player dot health to drill directly into that specific container and update the value exactly.

  60. Speaker 2

    It creates this beautifully clean, hierarchical structure your chunking information conceptually, which allows you to model real world entities inside the machine.

  61. Speaker 1

    Okay, so objects keep our data perfectly organized in these little first aid kits. But data just sitting in a kit is completely static. I mean, a game where a player's stats just sit in memory isn't much of a game? Definitely not. How do we actually make the program act on this organized data over and over again?

  62. Speaker 2

    To create action? You need to automate behavior, and for that you need functions.

  63. Speaker 1

    Functions.

  64. Speaker 2

    Yes, they are the mechanisms that take your static data and actually do something.

  65. Speaker 1

    Meaningful with it. Okay, I want to push back on this for a second, on behalf of a pragmatic beginner.

  66. Speaker 2

    Sure, go for it.

  67. Speaker 1

    Because Larsen used an example of displaying the stats of three different movies. I think it was inside out Specter.

  68. Speaker 2

    In Star Wars, right, I remember that.

  69. Speaker 1

    And to print the title, directors and actors to the console it takes about five lines of code per movie. Honestly, isn't it just faster for me as a beginner to write those five lines, highlight them, and copy paste them two more times? It is tempting, right, Why introduce an entirely new architectural layer when copy paste solves my problem in ten seconds?

  70. Speaker 2

    Well, copy pasting solves the immediate problem, sure, but it creates a long term architectural nightmare. How so it introduces massive redundancy. Let's trace the life cycle of that copied code. You've got your fifteen lines print in the three movies. But tomorrow you decide the output is hard to read. You want to insert a blank dashed line between each movie to separate them visually.

  71. Speaker 1

    Oh, I see the trap.

  72. Speaker 2

    Yeah, because you copied and pasted, you now have to manually hunt down every single instance of that movie block across your entire code base and update it one by one.

  73. Speaker 1

    Which just fine for three movies.

  74. Speaker 2

    But exactly what if you scale up to one hundred movies? You are suddenly spending hours doing manual data entry. Just add a dashed line.

  75. Speaker 1

    So function solve this update nightmare.

  76. Speaker 2

    They do by implementing a principle called code on demand.

  77. Speaker 1

    Code on demand, Yeah, a.

  78. Speaker 2

    Function allows you to define a block of logic exactly. Once you wrap those five lines of display code inside a function named, for example, show movie info, then instead of rewriting the logic, you just call that function whenever you need it.

  79. Speaker 1

    So it's like a central command. Right.

  80. Speaker 2

    If you decide to add that dash line, you go to the central function definition, you modify it in that one single place, and every instance across your entire program inherits the update instantly.

  81. Speaker 1

    That shifts your role entirely. You stop being this like typist manually managing lines of texts, and you become an architect, building reusable tools.

  82. Speaker 2

    It is the ESTs of managing complexity. You abstract the repetitive tasks away. So you can actually focus on higher level logic.

  83. Speaker 1

    But looking at it, there is a potential flaw in how we've set this up so far. If our show movie info function relies on a variable that was defined somewhere else in that global warehouse we talked about, isn't that dangerous? Very dangerous? Like if the function is hardwired to look for a specific variable, what happens if that variable gets renamed or deleted by accident?

  84. Speaker 2

    The function immediately breaks. That is called tight coupling. When a function depends on the external environment to have specific data sitting in specific places, it becomes incredibly brittle.

  85. Speaker 1

    Reading Larsen's notes, I cracked up at how he described these brittle functions. He calls them rock God musician.

  86. Speaker 2

    It's so brilliant.

  87. Speaker 1

    Why does he use that specific comparison for a line of code.

  88. Speaker 2

    Though, because it perfectly captures the arrogance of a poorly written function. Think about it. A rock God musician demands that a very specific bowl of like green M and ms must be waiting in their dressing room before they will even consider walking on stage.

  89. Speaker 1

    Right, the eminem's aren't there.

  90. Speaker 2

    They throw a tantrum and the show is canceled. A tightly coupled function does the exact same thing. If the exact global variable it expects isn't present, the whole program crashes.

  91. Speaker 1

    So we do not want arrogant rock god functions. We want easygoing, portable session musicians who will perform anywhere as long as you just hand them their.

  92. Speaker 2

    Instruments exactly, And to achieve that, we use parameters and arguments to decouple the function from the global scope.

  93. Speaker 1

    Okay, let's clarify that terminology because I hear parameter and argument used interchangeably all the time, but they represent different parts of this decoupling process, right they do.

  94. Speaker 2

    So think of parameters as the empty placeholders the function creates for itself in the dressing room. Okay, When you architect the function, you define parameters inside the prophesies say play your name and play your health. The function is formally declaring I don't care about the outside world, but to do my job, I expect to be handed two pieces of information when I'm called.

  95. Speaker 1

    So the parameters are the empty boxes waiting to be filled, which means the arguments are the actual data.

  96. Speaker 2

    Yes, exactly. The arguments are the specific values you pass into those boxes at the exact moment you execute the function.

  97. Speaker 1

    So if I call showplayer health Candra.

  98. Speaker 2

    Fifty, the string candra and the number fifty are the arguments. The function safely ingests them, runs its internal logic, and finishes its job without ever needing to look out at the global scope.

  99. Speaker 1

    It makes the function entirely self contained, like you could rip that function out of the crypt drop it into a completely different game engine, and as long as you pass it the right arguments, it's going to execute flawlessly.

  100. Speaker 2

    And this modularity becomes exponentially more powerful when you introduce the return keyword.

  101. Speaker 1

    Your return keyword yeah.

  102. Speaker 2

    Because up until now, our functions have basically been dead ends.

  103. Speaker 1

    Right. They do a job and stop.

  104. Speaker 2

    They perform an action like printing text to a screen, but they don't give the larger program anything back to work with. The data goes in, gets processed, and basically vanishes.

  105. Speaker 1

    So how does return change that?

  106. Speaker 2

    It allows a function to evaluate data and then hand the calculated result back to the main program. Larsen uses a great example of a plumber calculating a bill.

  107. Speaker 1

    Oh where are this?

  108. Speaker 2

    You write a total cost function. It takes three parameters, a slack call out fee, an hourly rate and the hours worked.

  109. Speaker 1

    So if a plumber charges a thirty dollars fee a forty dollars hourly rate and works for three hours, you pass those arguments in, so it's like total costs thirty forty.

  110. Speaker 2

    Three exactly, and the function acts as this isolated processing plant. It calculates thirty plus one twenty internally, arriving at one fifty. Then it uses the return keyword to output that value return one fifty.

  111. Speaker 1

    Got it.

  112. Speaker 2

    The crucial architectural concept here is that the function call itself is literally dynamically replaced by the output in your code. Wait really yeah, The code total cost thirty forty three effectively becomes the number one fifty in your larger script.

  113. Speaker 1

    Oh wow, which means you can now compose functions together. You can take that return one fifty and immediately pass it as an argument into a caxulate tax function, or subtract it from a budget variable.

  114. Speaker 2

    Precisely, the output of one isolated machine becomes the raw material for the next. It allows you to build these massive, intricate pipelines of logic where data flows cleanly from one self contained puzzle piece to another.

  115. Speaker 1

    Without ever polluting the global memories exactly. Okay, here's where it gets really interesting. Oh yeah, we know how to pass individual arguments to isolate our functions. But as a game like the crypt scales, passing individual data points just gets messy. I mean, if I want a function to process a player's turn, I have to pass their name, health location, current weapon, their inventory array status effects.

  116. Speaker 2

    It's too much. Passing ten different arguments in a very specific sequence is incredibly fragile.

  117. Speaker 1

    Because if I swap the order of two arguments by mistake.

  118. Speaker 2

    The game suddenly thinks the player's weapon is their health score and it crashes.

  119. Speaker 1

    Right, So what's the solution.

  120. Speaker 2

    This is where we combine our two major concepts. We emerge the first aid kits with the code on demand.

  121. Speaker 1

    Oh objects meaning functions.

  122. Speaker 2

    Yes, instead of passing a fragile list of primitive arguments, you just pass the entire object into the function.

  123. Speaker 1

    You just hand the processing plant the entire first aid kit.

  124. Speaker 2

    It creates incredibly clean architecture. Larsen illustrates this by passing a planet object into a calculate size is function. The function only requires a single parameter, now the object itself.

  125. Speaker 1

    Okay, so it takes the whole planet object.

  126. Speaker 2

    Right, and once the object is inside the function can unpack it, read the planet's radius, perform complex geometry, and then instantly attach brand new properties like area and volume directly onto the object before returning it.

  127. Speaker 1

    So the object goes into the function, gets upgraded, and comes out with new capabilities exactly. But the relationship between objects and functions goes even deeper than that, right, because functions don't just process objects, they can actually live inside them.

  128. Speaker 2

    Yes, when a function is a sign as a property of an object, it becomes what we call a method a method, and this is the foundation of object oriented design. It allows you to create names.

  129. Speaker 1

    Larsen spacer object is the perfect showcase for why name spaces matter.

  130. Speaker 2

    It really is. In any complex program, you end up with dozens of small utility functions, for instance, functions to format text right, adding blank lines, wrapping texts in dashed boxes, and denting paragraphs. Right. If you leave all those formatting functions loose in the global scope, they clutter your environment.

  131. Speaker 1

    Yeah, you wouldn't want a generic function just named box floating around, so someone else might write a physics function named box and suddenly the two are.

  132. Speaker 2

    Colliding exactly, So instead you create a single dedicated object called spacer, and you attach all your formatting functions to it as methods.

  133. Speaker 1

    Oh I see. So now when you want to format a textbox in your game, you call spacer dot box. Right, the functionality is buddle directly with the name space. You know exactly where your tools live, and they are protected from colliding with the rest of the codebase.

  134. Speaker 2

    And you know, while we are exploring methods attached to objects, there is a behind the scenes technical secret. Larsen reveals about strings that completely blew my mind when I first understood the mechanics of it.

  135. Speaker 1

    Yes, you were practically vibrating when you read that section, Yeah, because it completely subverts what we've just learned about objects and primitive data.

  136. Speaker 2

    It really does. So we've established that objects are these complex structures you architect with properties and methods, right, and primitive data like a simple string of text, just a word like Jupiter wrapped in quotes, is just basic data. Technically, it is not an object, right.

  137. Speaker 1

    It doesn't have namespace, it doesn't have methods attached to it. It's just a raw value.

  138. Speaker 2

    But in JavaScript you can take that raw string Jupiter and call a method directly on it.

  139. Speaker 1

    Wait, how you can.

  140. Speaker 2

    Type jupiter dot two uppercase and the system instantly returns the word Jupiter in all capital letters.

  141. Speaker 1

    But hold on, If methods only exist inside objects, how can a raw piece of text execute a method.

  142. Speaker 2

    That is the invisible genius of the language's engine. JavaScript knows that strings are primitive, but it also knows developers need to format them constantly. So the exact millisecond you attempt to call a method like to uppercase on a simple string, the engine secretly.

  143. Speaker 1

    Intervenes, secretly intervenes.

  144. Speaker 2

    Yeah, it takes your primitive text and instantly wraps it inside a temporary, invisible string object that contains all those complex formatting methods.

  145. Speaker 1

    So it upgrades the text into an object behind your back.

  146. Speaker 2

    Yes, it creates the object, borrows the formatting method to capitalize your word, hands you the result, and then instantly destroys that temporary object to free up memory before you even realize it happened.

  147. Speaker 1

    That is astonishing. It's like having an invisible phantom workforce. You ask a simple piece of text to do something incredibly complex, and the agent just spins up an entire architectural structure in the background does the heavy lifting. And obliterates the evidence before the next line of code even runs.

  148. Speaker 2

    It is a masterclass in garbage collection and memory management. The engine gives you the immense power and convenience of complex object methods without forcing you to permanently sacrifice the memory required to store every single word as a massive object.

  149. Speaker 1

    It really makes you realize how much aggressive optimization is happening under the surface of every single.

  150. Speaker 2

    Web page, which brings us back to that illusion of the glowing box. You know, the magic isn't magic, it's just greath takingly efficient logic.

  151. Speaker 1

    So what does this all mean for you? Whether you are gearing up to write your first text adventure or you're just trying to understand the digital ecosystem you interact with every single day.

  152. Speaker 2

    Well beyond the syntax understanding how variables, objects, functions, and methods interact, it's really about learning a new paradigm for problem solving.

  153. Speaker 1

    Oh absolutely.

  154. Speaker 2

    Programming forces you to look at a chaotic reality and synthesize it into modular systems.

  155. Speaker 1

    You're learning how to chunk related information to reduce mental load, which is exactly what objects do. And you're identifying repetitive patterns and automating them to prevent errors, which what functions do?

  156. Speaker 2

    You start to view large problems not as insurmountable monoliths, but as a series of small, decoupled systems that just need to pass the correct arguments to one another. You basically optimize your own workflow the same way you optimize code.

  157. Speaker 1

    Which leaves me with a final, slightly provocative thought to ponder. Inspired by this entire journey, We've just spent this time dismantling the digital world, realizing that everything on our screens is ultimately just a massive, intricate collection of encapsulated objects passing properties into isolated functions.

  158. Speaker 2

    Yeah, it is a giant, cascading web of structured inputs and predictable outputs.

  159. Speaker 1

    So how much of our own human behavior could be mapped using the exact same architecture?

  160. Speaker 2

    Oh wow?

  161. Speaker 1

    Think about your daily routines, your ingrained habits, your emotional responses to stress. Are we in some way just executing highly optimized functions responding to external arguments like when someone cuts you off in traffic? Is that just an argument being passed into your stress response function, returning a very predictable output based on the state of your internal variables that day?

  162. Speaker 2

    It's a really helling framework for introspection. Are we consciously architecting our responses or are we just running legacy code that we never bothered to.

  163. Speaker 1

    Decouple something to mull over. The next time you find yourself stuck in a repetitive loop, maybe it's time to check your dependencies and write a new function. Thank you so much for joining us on this deep dive. Keep exploring, keep questioning, and remember even the most complex digital castles in the world are built from the exact same microscopic, logical grains of sand.