<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Natalie Martin</title>
    <description>The latest articles on DEV Community by Natalie Martin (@meisekimiu).</description>
    <link>https://dev.to/meisekimiu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4884%2F9145247.png</url>
      <title>DEV Community: Natalie Martin</title>
      <link>https://dev.to/meisekimiu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/meisekimiu"/>
    <language>en</language>
    <item>
      <title>W3Schools Then and Now: How Have JavaScript Tutorials Changed?</title>
      <dc:creator>Natalie Martin</dc:creator>
      <pubDate>Fri, 06 Nov 2020 17:50:25 +0000</pubDate>
      <link>https://dev.to/meisekimiu/w3schools-then-and-now-how-have-javascript-tutorials-changed-5bl0</link>
      <guid>https://dev.to/meisekimiu/w3schools-then-and-now-how-have-javascript-tutorials-changed-5bl0</guid>
      <description>&lt;p&gt;JavaScript has changed so much since it was first introduced in the mid 1990's. I don't just mean the language itself (though it has changed &lt;em&gt;a lot&lt;/em&gt; as a language). I also mean the community and culture surrounding the language as well as its place in the larger programming community. That got me thinking: how have the guides and tutorials that &lt;em&gt;teach&lt;/em&gt; JavaScript changed over the years?&lt;/p&gt;

&lt;p&gt;I first started learning JavaScript quite a while ago... about 12 years ago as of the time of this writing (at this point in writing the article, 24-year-old me realizes with great horror that she has been learning JavaScript for over half of her life now). Since I've known JavaScript for so long, I don't often find myself seeking out resources for learning JavaScript basics; typically if I need to look something up I head straight to a resource like &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference" title="I'd estimate that when I'm programming approximately 50~75% of my open browser tabs are MDN pages I forget to close"&gt;MDN's Javascript Reference&lt;/a&gt; instead of trying to parse through any tutorials. I don't even remember the last time I read a beginner JavaScript tutorial... I've definitely read beginner tutorials for frameworks and other libraries or technologies that use JavaScript, but when was the last time I read a tutorial on the base language itself?&lt;/p&gt;

&lt;p&gt;I thought it'd be interesting to go to a modern JavaScript tutorial and see how things have changed since JavaScript has blown up in popularity. But I also wanted to go back to the very first JavaScript tutorial I looked at years ago: the tutorial on W3Schools. So to keep it simple, for this article I'll be comparing the old W3Schools site with the modern version of the site. Specifically, I'm going to use the Wayback Machine's archive from 2005, since 15 years ago seemed like a nice round number (even though I started learning JS in 2008). Let's see how things have changed!&lt;/p&gt;

&lt;h3&gt;But first, a note on W3Schools&lt;/h3&gt;

&lt;p&gt;For a while, W3Schools had a bit of a bad reputation. Actually in researching for this article, I've found that &lt;a href="https://dev.to/stpaulis/is-w3schools-deprecated-why-4nh" title="I'd say W3Schools isn't deprecated but it's one of those things that the compiler warns you will be deprecated in the next version."&gt;its reputation still kind of persists.&lt;/a&gt; But it used to be a lot worse. I can't be the only one who remembers &lt;a href="https://www.w3fools.com/" title="#W3SchoolsIsOverParty"&gt;"W3Fools"&lt;/a&gt;, a site that used to list out all the problems in various W3Schools tutorials. If you visit this site now, you can see that W3Schools has since fixed those problems and the site points out that it's a decent resource for learning nowadays.&lt;/p&gt;

&lt;p&gt;Anyway, for this article we'll be going back to the days &lt;em&gt;before&lt;/em&gt; that site went up, but I couldn't not mention that elephant in the room! Now with that out of the way, let's go over how W3Schools has changed!&lt;/p&gt;

&lt;h3&gt;What is JavaScript?&lt;/h3&gt;

&lt;p&gt;Before we even get into the actual specific programming content proper, I want to talk about the introduction pages of the tutorial that explain what JavaScript even is, because I think it does a good job of communicating how exactly JavaScript's place in the programming landscape has changed over time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zY17-6k8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/12/old_js_intro.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zY17-6k8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/12/old_js_intro.png" alt="JavaScript Tutorial / [clip art of coffee cup] / JavaScript is the scripting language of the Web! / In our JavaScript tutorial you will learn how to write JavaScripts and insert them into your HTML documents, and how to make your pages more dynamic and interactive. / Start learning JavaScript!" title="I coded 3 whole JavaScripts once and then my computer blew up" width="481" height="164"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;W3Schools from 2005&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this 2005 tutorial introduction, you may notice some very... of-their-time phrases being thrown around. I love the pluralized "JavaScripts" being used. Back in the day, JavaScript was seen as a thing you would just plop onto an HTML file instead of being a much more integral part of the programming landscape, so calling individual JS files "JavaScripts" made sense. With how modern development goes, where many JS files make up whole applications, it doesn't really make sense to call anything "a JavaScript" anymore.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2ZIzeP5Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/12/new_js_intro.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2ZIzeP5Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/12/new_js_intro.png" alt="JavaScript is the world's most popular programming language. / JavaScript is the programming language of the Web. / JavaScript is easy to learn. / This tutorial will teach you JavaScript from basic to advanced. / Start learning JavaScript now" title="Sophisticated analysis reveals that the tutorial has become more green within the last 15 years." width="519" height="381"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;W3Schools from 2020&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You can see on the modern site, they still retain the "JavaScript is the [...] language of the web" description, although they have since changed "scripting language" to "programming language". This definitely represents a shift in how JS is seen as a language. These days we don't often refer to languages like JavaScript or Python as "scripting languages". Back in the day I felt like there was a certain connotation to what a "scripting language" was, in that it was an interpreted language that wasn't as sophisticated as the "&lt;em&gt;real&lt;/em&gt;" languages like Java or C++.&lt;/p&gt;

&lt;p&gt;&lt;span title="See: The Blub Paradox"&gt;Most languages are just called "programming languages" these days because I think the programming community has realized that programming in JS is just as "real" as programming in C.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;By the way, we can also see this attitude reflected further in this quote from the 2005 version of W3Schools: "JavaScript is a scripting language - a scripting language is a lightweight programming language". They further downplay the power of JavaScript in this section that clarifies the difference between Java and JavaScript:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ck7dPufb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/12/java_vs_javascript.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ck7dPufb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/12/java_vs_javascript.png" alt="Are Java and JavaScript the same? / NO! / Java and JavaScript are two completely different languages! / Java (developed by Sun Microsystems) is a powerful and very complex programming language - in the same category as C and C++." title="Okay but does JavaScript run on 3 BILLION DEVICES??? ...actually yeah probably." width="440" height="126"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;Note how they imply the difference between Java and JavaScript is that Java is powerful and complex and JavaScript is not&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In the modern version of the website, they just specify that they are two different languages and pretty much leave it at that, without putting down one language or the other.&lt;/p&gt;

&lt;h3&gt;Okay let's actually look at the tutorial content now&lt;/h3&gt;

&lt;p&gt;If I were to do a full play-by-play on every single difference between the 2005 tutorial and the 2020 tutorial, I'd be here all day, so I mainly want to focus on very specific examples from here on out. I strongly recommend you check out the &lt;a href="https://web.archive.org/web/20050203181732/http://www.w3schools.com/js/default.asp" title="btw I picked February completely at random"&gt;2005 tutorial on the Wayback Machine&lt;/a&gt; for yourself if you have the time.&lt;/p&gt;

&lt;p&gt;When I initially thought about comparing the old to the new, the first thing that came to mind that would probably be different would be the usage of document.write in the old tutorial. If you check the tutorial it is filled with document.write calls whereas the newer tutorial typically uses more modern ways to output a string (typically by changing the innerHTML of an element on the page). However, I was surprised to see them still mention document.write on their &lt;a href="https://www.w3schools.com/js/js_output.asp" title="Hey W3Schools please implement anchor ids on the sections on your tutorials pls or we'll have to reawaken W3Fools"&gt;modern tutorial,&lt;/a&gt; although their example is surrounded by warnings about how you should basically never do use it outside of testing.&lt;/p&gt;

&lt;p&gt;A lot of the code uses it in ways that make me go "oh god... I personally would not do that today". Can you see what this code is doing, and could you ever see yourself doing something similar today?&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/javascript"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;h&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;gt;This is header &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/h&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Speaking of expected changes, I was curious about how modern W3Schools would handle newer keywords like let and const. In the 2005 tutorial, they use var as that was what was used at the time, however they also define a lot of variables with no keyword at all. That &lt;em&gt;was&lt;/em&gt; pretty standard back then but... it is quite weird to see nowadays.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9hxDoEj4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/12/to_var_or_not_to_var.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9hxDoEj4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/12/to_var_or_not_to_var.png" alt="Declare a Variable / You can create a variable with the var statement: /  raw `var strname = some value` endraw  / You can also create a variable without the var statement: /  raw `strname = some value` endraw " title="Seeing this code legit gives me anxiety" width="487" height="172"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;This is not really okay anymore&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Meanwhile, I was optimistically expecting the 2020 tutorial to not even use var anymore. I was a bit surprised to see that while it does mention the new keywords, it still mainly uses var for its examples. I do understand why &lt;span title="or rather they made the decision to NOT update their tutorial to match modern standards"&gt;they made the decision to still use the older style of code,&lt;/span&gt; but from my own personal JavaScript experience I've been using the new keywords for years now so it's a bit weird to see.&lt;/p&gt;

&lt;p&gt;There are plenty of pages that haven't really evolved that much in the last decade and a half though. The &lt;a href="https://www.w3schools.com/js/js_operators.asp" title="The only new thing is exponentiation"&gt;"JS Operators"&lt;/a&gt; page in particular has very obviously evolved from the 2005 original, where some of the same tables from 15 years ago still exist, altered only slightly over the years.&lt;/p&gt;

&lt;p&gt;I actually don't really have many more things to talk about regarding the old tutorial. It is so much more basic and quite casual, probably a product of the attitude regarding JavaScript at the time of just this thing you drop into web pages to make them do little interactive things. The whole tutorial itself is just 16 pages, compared to the &lt;strong&gt;100+&lt;/strong&gt; pages that make the W3Schools JavaScript tutorial today. The modern code examples are all nicely formatted with syntax highlighting, which is a stark contrast to the uncolored code from 2005, often lacking any form of indentation at all.&lt;/p&gt;

&lt;p&gt;I strongly urge you to check out the 2005 tutorial and see just how different JavaScript was back then!&lt;/p&gt;

&lt;h3&gt;Some random things I found and want to mention real quick&lt;/h3&gt;

&lt;p&gt;Back in the day, W3Schools offered tutorials on client-side scripting languages besides JavaScript. On certain old versions of Internet Explorer, instead of using &lt;span title="sorry, I meant 'JScript'"&gt;JavaScript,&lt;/span&gt; you could use &lt;a href="https://en.wikipedia.org/wiki/VBScript" title="when are we getting Node.vbs"&gt;VBScript&lt;/a&gt; as a scripting language. So W3Schools had a tutorial on it. Although it was even more basic (no pun intended?) than the JavaScript tutorial.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SewRY8L2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/12/vbscript_tutorial.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SewRY8L2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/12/vbscript_tutorial.png" alt="VBScript Tutorial / [generic corporate stock image of a document under a magnifying glass] / VBScript is a Microsoft technology that requires Microsoft's Internet Explorer! / In our VBScript tutorial you will learn how to write VBScript, and how to insert these scripts into your HTML documents to make your Web pages more dynamic and interactive. / Start learning VBScript!" title="Thankfully none of us use any Microsoft-made client-side programming languages these days. Wouldn't that be horrible? Unless it were say, a strict syntactical superset of JavaScript that adds static typing to the language... then MAYBE I'd be intrigued." width="477" height="175"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;Imagine a world where VBScript won the "script war"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;W3Schools also had a tutorial on WMLScript, which was for scripting web pages for pre-smartphone mobile devices.&lt;/p&gt;

&lt;p&gt;Okay I &lt;em&gt;have&lt;/em&gt; to talk about one specific part about the old JS tutorial on the boolean data type. They list out (almost) all the ways you can create a false value from the Boolean constructor:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q4JepuhK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/12/booleanz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q4JepuhK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/12/booleanz.png" alt='All the following lines of code create Boolean objects with an initial value of false: / var b1=new Boolean() / var b2=new Boolean(0) / var b3=new Boolean(null) / var b4=new Boolean("") / var b5=new Boolean(false) / var b6=new Boolean(nan)' title="The only other object I can think of that also returns false is  raw `undefined` endraw " width="483" height="134"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's a pretty decent list. They then go on to show values that when passed into the Boolean constructor will return true, however back when I started learning JavaScript I misinterpreted that, much like the previous list, these were the &lt;em&gt;only&lt;/em&gt; values that would return true:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--by7cG3Yn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/12/richard.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--by7cG3Yn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/12/richard.png" alt='All the following lines of code create Boolean objects with an initial value of true: / var b1=new Boolean(true) / var b2=new Boolean("true") / var b3=new Boolean("false") / var b4=new Boolean("richard")' title="They seriously didn't even put something like  raw `new Boolean(1)` endraw  in there?" width="482" height="111"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While the "false" and "Richard" example was there to show how most arbitrary non-empty values in JS will evaluate as truthy, I thought for at least a few months that JavaScript had specifically programmed easter eggs that would evaluate "false" and "Richard" as true. It would have really helped if they explained how it really worked!&lt;/p&gt;

&lt;p&gt;Finally, I want to mention something from the modern version of W3Schools: &lt;a href="https://www.w3schools.com/w3js/default.asp" title="Where's W3.vbs though"&gt;W3.js&lt;/a&gt;. It's a JavaScript library made by W3Schools to make certain JavaScript operations simpler. Has anyone ever used this? While its source code is available, there is no public version control repository that you can contribute to or clone the project from. You just download it from their website. It doesn't even have an NPM package.&lt;/p&gt;

&lt;p&gt;While this wouldn't really be out of place if it were made in like, 2009, the download page for W3.js states that version 1.0 was released in January of &lt;strong&gt;2018,&lt;/strong&gt; although I found a StackOverflow question talking about it that apparently dates back to 2017.&lt;/p&gt;

&lt;p&gt;I guess it's good for beginners, especially for those who aren't used to using code from external libraries, but W3Schools advertises the library as if its some widely-adopted, critical piece of technology. The name "W3.js" also sounds like the library is officially affiliated with the W3C, which it is not. I find the whole thing quite odd...&lt;/p&gt;

&lt;h3&gt;So, what's the take away from all of this?&lt;/h3&gt;

&lt;p&gt;JavaScript has changed a lot and is going to continue to change in the future. And so many people are going to be learning JavaScript through various online tutorials and lessons. I think even if you're an experienced developer it can be helpful to look at how people are learning JavaScript today, and also how people &lt;em&gt;used&lt;/em&gt; to learn JavaScript.&lt;/p&gt;

&lt;p&gt;In general, JavaScript guides have gotten better since 2005. I think it's important to reflect on &lt;em&gt;how&lt;/em&gt; these guides got better, so we can hopefully continue to make improvements to our current educational resources. (Although to be fair W3Schools was in part improved by a group of people bullying them into action... so maybe ignore that part).&lt;/p&gt;

&lt;p&gt;So, when and how did you start learning JavaScript? If you're an experienced dev, when was the last time you looked at a tutorial aimed toward beginners? Did any of you find anything interesting in the old W3Schools? I'd love to see any interesting finds in the comments! Thanks for reading!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>learning</category>
    </item>
    <item>
      <title>Looking Back at the My Little Pony Game I Made in High School</title>
      <dc:creator>Natalie Martin</dc:creator>
      <pubDate>Mon, 06 May 2019 00:09:10 +0000</pubDate>
      <link>https://dev.to/meisekimiu/looking-back-at-the-my-little-pony-game-i-made-in-high-school-pp7</link>
      <guid>https://dev.to/meisekimiu/looking-back-at-the-my-little-pony-game-i-made-in-high-school-pp7</guid>
      <description>&lt;h1&gt;
  
  
  The Backstory
&lt;/h1&gt;

&lt;p&gt;I have a confession to make... I was once a "brony". I was a sophomore in high school when the My Little Pony fad was at its peak. Being a teenager who already found nostalgic charm in watching shows aimed towards little kids, I got sucked into the whole brony thing and after marathoning the entire series until I was ready for the Season 2 premiere, I began the well-known brony habit of making &lt;em&gt;everything&lt;/em&gt; I did about those talking cartoon horses. You can probably remember a time way back when it seemed like everyone's profile icons were ponies and all kinds of pony memes were flying fast. Those were the days when memes still had top and bottom text.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--67tdbJr5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/umadbro.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--67tdbJr5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/umadbro.jpg" title="thanks i hate it" alt="Pony smiling with 'u mad bro?' in ancient meme text" width="275" height="234"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;&lt;span title="Oh god, we're going to look back at today's memes with the same attitude aren't we?"&gt;An example of what passed as a meme back in those ancient days&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Anyway, back in high school I took a variety of programming classes. "Computer Programming" was a very basic class, as one would really expect from a high school elective programming class. It did give me my first opportunity to briefly play around with Linux (the idea of Linux blew my mind at the time but I never thought I'd be using it as my main OS) and also for my final project I got the opportunity to do something quite novel: Make a game prototype using nothing but HTML and JavaScript... &lt;em&gt;before HTML5 was actually a thing!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;But the class that actually had a serious impact on me as a programmer was the next level programming class, "Game Design &amp;amp; Development". It functioned more as a "Computer Programming II" course, though obviously it also focused mainly on game development. I &lt;em&gt;loved&lt;/em&gt; this class. I learned so many fundamental programming basics that those huge O'Reilly animal books never really taught me (they taught me the programming languages but more complex and abstract programming concepts either weren't discussed or flew right over my head).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SSjWpGNN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/generate.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SSjWpGNN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/generate.png" title="Past me has written some of the worst code future me will ever read" alt="A parody O'Reilly book cover that reads 'Messy Unorganized Code'" width="250" height="350"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;I did follow all of the advice in this book though&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This class was the first time I actually had to work with object-oriented code before. Prior to this course, the idea of classes and objects seemed more like nice syntactic sugar; a fancier way of making an associative array. When I finally learned the magic of inheritance and abstract classes and such I was blown away and made an unnecessarily fleshed out object architecture for a simple game we made in a Java-based tool called Greenfoot. I originally hated Greenfoot until I learned about the delights of OOP. I even had a little journal at the time and you can see my hate for it grow into "How could I live before Object-Oriented Programming? HOW?!". Anyway, here's a picture of the game I made:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BdkuW97Z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/muffinmare_titlescreen.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BdkuW97Z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/muffinmare_titlescreen.png" title="Huh. For the original class I had, we made a web portfolio to show off all of our projects. And now I'm doing it again... it's like poetry, it rhymes." alt="Title screen for my Muffin Mare game" width="512" height="384"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;Later I remade this game in C++ while trying to preserve the class structure of the original Java code. No. Just no.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That game is not the My Little Pony game I'll be talking about in this blog post. Instead, I'll be talking about my final project for the class, made in XNA Game Studio. XNA was especially impressive to me because it was my first opportunity to make a game straight from code... no drag-and-drop interfaces or even any actual "engine" code in the framework to help was actually really exciting. It was like I was a &lt;em&gt;real&lt;/em&gt; game developer!&lt;/p&gt;

&lt;h1&gt;
  
  
  Code Review Time
&lt;/h1&gt;

&lt;p&gt;I'll be going over what the actual game itself was like in the next blog post I make. In this post I'll be reviewing some of the actual engineering decisions I made for this game. And oh boy there are plenty of... decisions to review here. But to give a quick introduction to the game, it's a game inspired by roguelikes and turn-based JRPGs. Internally it was always known as "PonyRPG". I wrote a majority of the codebase in two weeks.... as a high schooler with only a very naive grasp on object oriented architecture. Oh no.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Issue #1: A Disorganized Mess
&lt;/h2&gt;

&lt;p&gt;The most glaring issue with the codebase is just how incredibly messy it is. Code is just kind of stuffed everywhere and at the time I really didn't know about any "clean" architectural design patterns. The "main" game class that contains the basic game loop and drawing loop is... &lt;strong&gt;two thousand&lt;/strong&gt; lines long. Shoved everywhere in this class are tons of nested "helper classes" that act more as structs than actual classes with methods. I thought splitting classes into their own files was stupid back then so I jammed a lot of the tinier classes into the files that used them and left it at that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wYOk6kcH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/codesample_1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wYOk6kcH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/codesample_1.png" title="Yo dawg I heard you like nested classes so I nested classes in your... eh... you get the punchline" alt="Nested classes in nested classes" width="880" height="706"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;A look at the various nested classes I use in the codebase. Most of these are all located in the massive main game class.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There are a few giant classes like this in the game's codebase, that pretty much are responsible for large sections of game logic and also have tons of subclasses and random helper functions all jammed up inside of them. Spreading out all that code into classes that have a &lt;strong&gt;Single Responsibility&lt;/strong&gt; would make the code much cleaner. There are lots groups of functions within these mega-classes that could easily be extracted into their own classes to make the code cleaner and easier to debug.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Issue #2: Enumerator? I Hardly Know Her!
&lt;/h2&gt;

&lt;p&gt;A core part of design a game's architecture is allowing the game to exist in multiple states or "screens". Title screens, loading screens, different game modes, and minigames are all examples of separate game states. You don't want code that controls the title screen to be found in the main Player class. You also want to be able to free up memory that's no longer used by game states. The game logo that shows up on the title screen should probably be unloaded after you actually enter the game, and be reloaded only after the player chooses to go back to the title screen.&lt;/p&gt;

&lt;p&gt;In &lt;em&gt;"PonyRPG"&lt;/em&gt;, the title screen graphics are never unloaded, because there's no actual state management system in the game. The game's state is fully managed by a single variable that exists in the main game class and is checked several times per frame: an Enum called "gameMode". In the main game loop there are a bunch of if statements checking what game mode we're in. So we basically end up having 4 game loops all jammed into one game loop.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n0riK6ZS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/codesample_2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n0riK6ZS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/codesample_2.png" title="#REGION CONSIDERED HARMFUL?" alt="Using an Enum instead of Polymorphic Dispatch" width="642" height="628"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;Not pictured: the massive "mode == gameMode.gameplay" section of the code&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Fortunately that's the only Enum I use for state management...&lt;br&gt;
...&lt;br&gt;
&lt;em&gt;&lt;strong&gt;OKAY, ALRIGHT,&lt;/strong&gt;&lt;/em&gt; so in the core gameplay loop I use a very similar design (anti-)pattern to manage the "inner" gameplay state. So there's another Enum that manages what state the player is in: outside of battle, inside of battle, in a scripted event, using a save point, etc. ...It's pretty bad.&lt;/p&gt;

&lt;p&gt;These various states should have been managed with actual classes. The main game loop would only be running the active state object's Update() function and through polymorphism the main game class wouldn't really know or care what state the game is in. While an Enum and Switch statement are practically functionally identical, using polymorphic dispatch is &lt;em&gt;much&lt;/em&gt; easier to contain. Instead of the main game class having a bunch of seemingly random variables everywhere, only the game states that &lt;em&gt;care&lt;/em&gt; about said random variables should even know about them. Instead of continually adding another if or case statement to my code, I just need to add a new class to the codebase and instantiate it somewhere. The game itself can be updated without having to edit the main game loop or its surrounding class at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Issue #3: No Spoilers!
&lt;/h2&gt;

&lt;p&gt;Alright this next issue isn't really that big of a deal compared to... well those previous massive architectural flaws that contaminate pretty much the entire codebase, but I think this needs to be addressed! The game is pretty data-driven, with enemies and level parameters and... well pretty much everything loaded in from external data files. That's &lt;em&gt;not&lt;/em&gt; the bad design part! I wanted to be able to mask this data to not only prevent people from tampering with it and breaking the game, and also to prevent game spoilers such as what the final boss fight will be like and such. I was &lt;em&gt;very&lt;/em&gt; protective of this game data, so I not only had it embedded into game's executable itself, I also used &lt;em&gt;AES Encryption&lt;/em&gt; to make it impossible to see it if you opened the executable in a hex editor!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HUJYghJN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/codesample_3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HUJYghJN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/codesample_3.png" title="Asynchronous Emotion Stimulator" alt="hunter2" width="880" height="312"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;Oh god, I've leaked the decryption code, oh god now people can haxxor the game!!!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This made managing the data a pain as I'd constantly have to re-encrypt any game data that I wanted to edit. This paranoia handling data also extended to the file used for saved data. I basically used encryption along with a complex "security through obscurity" style format with multiple checksums (and I'm not talking about &lt;a href="https://en.wikipedia.org/wiki/N._Senada#%22Theory_of_Obscurity%22" title="visit the frisco zoo"&gt;The Theory of Obscurity&lt;/a&gt; here). This complex method of storing saved data was so complex that the latest version of the codebase I'm criticizing right now... can't even load saved data. By adding more and more security measures I broke the saved data feature that was working perfectly fine before!&lt;/p&gt;

&lt;p&gt;I think there's definitely value in protecting data from being read and manipulated, but the way I did in this game didn't just prevent anyone playing from tampering with the data. It also hindered the development of the game and broke a feature! I probably should have kept this stuff simpler and added more basic checks.&lt;/p&gt;

&lt;h2&gt;
  
  
  It's Not All Bad
&lt;/h2&gt;

&lt;p&gt;So I've pointed out some of the glaring problems of this horrible code. Does this mean that my high school self was a bad programmer? ... Well, kind of. Though I feel it's important to think of it less in terms of how bad I was back then and more in terms of how much I have grown as a programmer since then. I mean, I was in high school, how was I supposed to know that instead of picturing game state as a finite state machine I should have been picturing it as pushdown automaton instead? This was the first game project I made straight from code, no dragging and dropping. I'm proud that I even made a (mostly) fully playable game! And I think high school me would be proud of present me roasting this code and would also be really curious how the more "professional" game developers do proper game architecture. I mean, to be fair, there's still a lot I don't know about how proper game architecture should be done.&lt;/p&gt;

&lt;p&gt;Anyway, there &lt;em&gt;are&lt;/em&gt; parts of this codebase that really aren't that bad! The data-driven design I talked about earlier was something I was really proud of when originally developing the game! My previous experiments with XNA used completely hard-coded values. This game has no actual specialized classes for enemies, instead just having a base Enemy class which is instantiated and filled with the proper enemy data from the game data!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9xHwH2Gl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/codesample_4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9xHwH2Gl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/codesample_4.png" title="Yeah I used XML; you have a problem with that?" alt="xml!" width="840" height="291"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;How the data is stored for enemies (unencrypted lol)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Another not-too-bad part of the code base revolves around the various in-game dialogues that show up. The PonyRPG.engine.TextWindow class is probably the best-designed class in the entire codebase. It covers scrolling the text 1 character at a time like old video games, wraps the text properly, and is pretty configurable with various padding and margin settings. It has a related class, PonyRPG.engine.TextWindowOptions that is just a data structure for its various options... and it exists in its own separate file instead of being a nested class stuffed somewhere else! While the code here could still be improved upon a lot, it's definitely the most pristine code here...&lt;/p&gt;

&lt;p&gt;... and the reason it's so nice is because I actually developed it outside of this project! I originally developed this class for another pony-related game I was working on in XNA and I made it as generic as possible so I could reuse it in other games I made. It has features never used in the "PonyRPG" project, like the ability to display character portraits while talking displayed, like in the Harvest Moon series.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--000GBLcu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/dd_alpha_1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--000GBLcu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/dd_alpha_1.png" title="I don't use Windows XP, this screenshot is from 2012 when I was developing this game!" alt="Old game" width="773" height="600"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;The TextWindow object in the original project it was used in&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When I first made this textbox it honestly felt magical that I could insert little video gamey dialogue boxes into my games!&lt;/p&gt;

&lt;h1&gt;
  
  
  Okay... So What's The Game Actually Like?
&lt;/h1&gt;

&lt;p&gt;Welp, I've talked enough about the game's code. I bet you're wondering what the game looks like. What's it actually called? Is the Game Design good? Was all the messy code just a sacrifice for an amazing My Little Pony fangame experience? My next blog post will be dedicated to actually reviewing the game as a game itself, and not just diving into all the problems with the code. Keep a lookout for the next post on my personal blog, it's gonna be a MESS!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ilMNK27H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/ponyrpg_title2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ilMNK27H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mew151.net/img/9/ponyrpg_title2.png" title="Hold my cupcakes, I'm going in!" alt="Twilight Sparkle..." width="795" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>xna</category>
      <category>codequality</category>
      <category>csharp</category>
    </item>
  </channel>
</rss>
