Learning to Code

This page is slightly different than the rest of my site. This is where I have decided to share my journey to teach myself to code.

I have always had a desire to learn how to program. I took a few computer science classes in college, and I have even attempted to learn how to program apps for iOS by watching videos from Stanford University. I have a reasonable understanding of the basics, but it never went beyond that.

I want to learn to code because whenever I see computer simulations of science and data visualizations, they inspire me. I want to create my own. There is a certain creativity, beauty, and self expression in this type of programming and I want in.

I have tried many different tutorials and books but found them hard to stick with. Recently, I ran across a YouTube channel called The Coding Train and I felt that spark again. As I watch these videos, it feels more like I am watch someone problem-solve and code rather than watching someone teaching how to code. That might sound like a small difference, but I think it is the best way to learn. 


Time to learn to code...



Nature of Code

I have recently bought Dan Shiffman's book The Nature of Code and the plan is to work through the book chapter by chapter. Some of the early material may be a bit straight forward and dare I say easy, but since I really have very little formal training in programming I want to go through everything so I can hopefully build a stronger foundation and fill in any gaps that I have. 

This is where I will be doing my best to document my progress and learning. The plan is complete the book in 2 months and then move on to some more creative work that I can transfer over to my students and my classroom. All aboard!

July 11, 2019

Ok, my original goal here was to see if I can get my canvas to be the background of this blog post...as you can see I didn't quite reach that goal. What I was able to do is draw a canvas directly into the blog editor rather than having a link to my CodePen canvas. All I needed to do was insert an html element into my blog post and then include the link to the js library that I used (p5.js) and copy and paste in my code. Everyt...

June 26, 2019

For this project, I combined multiple ideas into one creation. I first started with my "blue lightning mover" and then cleaned the code up a bit so that it would easily be created as an array of objects. This required me to move code into the Mover class and to also make a Bolt class. Obviously, this is how I should be coding from the beginning but the more I practice, the more I realize that there always has to be a balance b...

May 31, 2019

So I have recently worked on applying forces. The nice thing about this is that there can be multiple forces acting on an object at one time. This mean that we can have gravity and some other outside force such as wind and maybe that wind can be somewhat chaotic using Perlin noise. The possibilities are endless.

In this project, I wanted to connect a bunch of the ideas that I have been working with. Here there is some invisible...

May 27, 2019

 Another simple example, but here we go. For this project, the "walker" moves around the screen based on a Perlin Noise function that gives "smooth" random numbers so that motion looks more natural. Here are a few versions that I created. Some simply map the noise to a point somewhere on the screen while others use the noise to decide which direction the point will move. This second method allows me to choose my starting point...

May 26, 2019

Very simple project getting right into Dan Shiffman's book, The Nature of Code. Really this project was based on the YouTube video that goes along with the book. I may make some modifications to the project to make it my own, but really at this point I just want to get a bit farther along so I can code some more interesting and interactive projects.

It's basic, but I want to cover everything thoroughly, no stone unturned.

November 9, 2018

One of the best ways to learn is having a good problem to solve. Well, I know it has been a long time since I have worked on any coding, but I had a problem that needed solving. I've been teaching my students to combine vectors into resultants and it is a little difficult when those vectors are at different angles. I thought this would make a good visualization and would be pretty straight forward, meaning I'd have the ability...

March 6, 2018

This project was inspired by this video. It's connected to the book Vehicles, about particles and steering behaviors on those "vehicles." I know nothing about the book other than it's where a lot of the concepts used here come from. I do plan on reading the book at some point. 

Below is the first version of this project that I finally go working. When I finally found the one mistake that was causing everything to crash, I...

March 4, 2018

So I continued my circles project.  This time I decided to just code and type up a whole play-by-play. I'm going to let this project speak for itself and not really talk about it too much. There were a few times when I felt like I was stuck and spinning my wheels. Not making much progress. When that would happen I couldn't help but wonder if I was really learning. I can imagine what students feel like, especially when it is so...

February 25, 2018

It's really too long since I've posted, or really even done any coding. I can make a lot of excuses why I haven't had time for it, but what's the point of that. I have a few minutes now before bed and rather than rationalize my lack of progress I want to take a small little baby step forward in my learning. I saw a video a while ago and it seemed cool so I will use what I remember from it as inspiration (I won't watch or refer...

February 2, 2018

I saw a great video from 3blue1brown and I it got me thinking about how I could create some similar visualizations in Javascript. Here you can see I've wrapped a sine wave in a circle. There are two sliders that control the frequency of the wave and how far the wave is allowed to travel around the circle. There are some beautiful patterns that emerge from this relatively simple concept.

I know my code isn't clean or pretty and...

Please reload

  • White Instagram Icon

©2017 by Dan Varney