How I Got into Coding @ Andrew | 2021-07-27T00:00:00Z | 6 minutes read | Update at 2021-07-27T00:00:00Z

In today’s digitized age, we are more connected to computers than ever before.

Whether you’re a kid, a teen, or a senior, I think it’s always good to appreciate the impact computers (and computer programming) has on our lives.

We use software all the time, but not all programs can do exactly what we want them to do. Whether it’s modding a video game or building physics simulations, there’s just that feeling you get sometimes when you think to yourself,

“Man, I wish I could make a thing that could do <insert your specific task>.”

Childhood Experiences

I remember being in 5th grade sitting in the computer lab at my elementary school typing away on Nitrotype when a group of students began to huddle around one classmate. Naturally, I got out of my desk and joined in to see what was happening and what I saw blew my mind: the kid had just gotten millions of these in-game dollars assigned to his account.

The rest of the students remained skeptical, however, and I began questioning how he was able to obtain that much in-game money. He eventually gave in and showed the ‘inspect-element’ trick to us. Now, I say that there was a group of students that learned about this, but it was more like just 3-4 other students, so we held on to this unspoken power and pretended to be like gods of computers.

And after that? Well, basically an arms-race of sorts was kicked off between the other students. We’d show the entire class who could create the whackiest Nitrotype profiles using the ‘inspect-element’ trick. This competition eventually grew out of Nitrotype and into some other games like

  1. 2048
  2. Flappy Bird
  3. The World’s Hardest Game

You might be asking, “Andrew, HTML isn’t a programming language, so why are you bringing all of this up?”

You’re correct, it isn’t a programming language, but I bring this up because it was a gateway for me to programming.

The other few students who knew the HTML trick quickly began modifying the HTML source of the new games, but there was one tiny caveat to this trick: the modified portions of the source would reset after a page refresh or if the game updates the HTML element’s value.

By that time, I had begun exploring other parts of the games that could be change as well as the browser’s developer’s tools. One day, I was exploring 2048‘s code and I clicked on the ‘source’ tab and realized that there were certain variables with extremely promising names like ‘tileSpawnValue’ and such. I changed the value to something absurd like 1024 and hit ctrl+s after being prompted to do so, and upon hitting the next arrow key, a shining yellow square with a value of 1024 suddenly showed up.

I immediately showed the rest of the class this and they were all witnessing the first instance of cheated-in game values sticking around after a dynamic update like a score change.

So there it is, what I’d consider my first real encounter with programming. I did a little bit of tinkering around with other games and posted videos of the modified versions on our school’s unofficial instagram group (yes, we were like 10. I’d like to think that we were at least responsible enough to handle social media).

*Clarification: this was 2013 and the world was in an awkward transition from the era of Java web applets and Flash games to JavaScript and CSS. As a result, games like "The World's Hardest Game" had no JS for me to fiddle around with (there was this Easter Egg that let you speed through the challenges though). Flappy Bird had a JS port that I just worked with.*

I tried to learn to code using books & online resources, but I kept giving up too early.

So I kept doing what I knew how to do: just tinkering with things.

Recall that HTML changes would just revert back after a page refresh. The same happens with JS modifications (Chrome Overrides didn’t exist back then). A quick google showed that you could just save all of the source code locally and run it (and hope the other students don’t notice that the url in the search bar hasn’t changed from https://whatever… to file://…)

We were in 7th grade by then and our math teachers started us on Tenmarks, which was like this online math problem bank where you’d solve problems to get coins. You’d spend the coins to buy 10 minutes of game time playing in their virtual arcade full of lame games.

Even if the coins were lame, the rest of the class still competed to see who would get the most coins. I employed the save-source trick and impressed a bunch of people, but since this was middle school and there were a ton of new people who weren’t familiar with the two year-long ‘arms-race’ from my elementary school, I decided that it would be funny if I didn’t tell them that it was fake…

And plus, what kind of middle schooler would pass on a sudden burst of attention? 😉

If Pinocchio has taught anyone anything, it’s probably “don’t lie”. Too bad for Pinocchio, I didn’t listen, and so I was constantly asked to prove that I had a ton of tenmarks points. In the midst of a panic, I realized that the training mode in Tenmarks kept asking predictable questions. One of the questions was, “What is the negative of <insert number here>?.", which was extremely easy to automate.

So I had an idea…

What if I wrote some kind of bot that did these simple questions that gave me coins, enough coins to show everyone that I did in fact have these coins?

Long story short, I got to work.

I think a major reason why people never begin doing something is because they just don’t have that slight push over the ledge that gets the ball rolling. For me, it was my silly experiences in middle and elementary school that led me to pursue programming.

ahem tons of googling later…

Anyways, I wrote with this Python script that used the Selenium web automation library which opens up an instance of a browser and clicks buttons, reads elements, and types text according to what you programmed it to do. So I let the thing run for a couple of hours over the week and it got me enough points to convince the other students.

There’s plenty of stories to tell after that, but this tenmarks bot was probably the first one that programmed by myself instead of just modifying bits of code.

Conclusion

So these silly experiences led me to learn how to program basically.

It's not easy to learn your first programming language, but some pointers

;)

I'd give are:

  1. Pick any programming language guide that you can loosely follow.
    • It’s 2021+ now so there’s plenty of online guides (you just need this to get familiar with language syntax and language-specific features).
  2. Think of a project to get started on.
    • You should always try to work on this whenever you gain new knowledge.
  3. Don’t be afraid to google or ask for help
    • StackOverflow tends to be pretty aggressive towards new programmers, but thankfully most people have your most common questions answered already.
  4. Always try learning something new.
    • This is just general advice. Try learning something everyday!
    • Whatever you learn may not be useful, but it gives you insight and gives you new perspectives.

© 2021 - 2022 Andrew's Blog

Powered by Hugo with theme Dream.

avatar

Andrew's BlogI'll do it slowly-- just 2048 at a time.

About Me

Andrew’s blog

Fine me rambling on about things here.

First year uni student and Software Engineer with a focus on Parallel programming

Skills:

  • Python
  • C++
  • C
  • Java
  • Go
  • Javascript / Typescript
  • Lua

Technology:

  • OpenGL
  • CUDA, OpenCL
  • Git control
  • Microsoft Azure
  • Google Cloud Platform
  • Docker

– November 20th, 2021

Acknowledgements

Thanks to everyone below

g1eny0ung

for this amazing Hugo theme

Social Links