Adventures in Coding


Thoughts on programming, web development, and tech

A Brief History of Code

I have training as a historian from my academic studies, and have been interested in the history of computing for a long time. Looking at coding from a historical perspective is a good way to review some of the more popular programming paradigms, and why they came to be used. In some ways, the dominant paradigms reflect the ways that computers were used at any given point in time, responding to the needs of users and to the challenges of developers


The Power and Pitfalls of JavaScript as a frontend to Rails

For this project, I again turned to my academic research in Tibetan Buddhism for inspiration. This is an app to allows you to explore monasteries and Tibetan Buddhist figures, and the relationships between them. A monastery can have many figures, obviously, but a Buddhist figure can also have many monasteries–their home monastery, but those they inhabited briefly to obtain an education, those they founded, and others they may have been connected to. This app would allow researchers to see that famous figures were influenced by a wide range of traditions through their connections to different monasteries. The many-to many relationship between monasteries and figures can be easily modelled in Rails with an SQL database, while JavaScript provides a frontend for a simple, one page interface in which users can explore monasteries, figures, and the relationships between then, and add new monasteries and figures, and their associations, to the database.


Creating a research app with Rails

This project was the most challenging that I have done so far at Flatiron. I learned a valuable lesson about the importance of planning. My initial idea was to create a project that would be useful to people in religious studies, the focus of my pre-coding career. I first planned out the models for the texts, authors, religious traditions, projects and notes that researchers can track.


Making Web Apps with Sinatra

Sinatra is a simple framework that allows you to make web apps with Ruby, a good way to learn the basics of HTTP, SQL databases, and RESTful routes in preparation for Ruby on Rails. I chose to create a travel log in which users could create records of places they have visited, and see the travels of other users. It was loosely inspired by the website Most Traveled People , which allows users to record their progress in a competition of who has travelled to the most locations in the world. In addition to Sinatra, the app uses Active Record to provide easy access to an SQL database, and the gem bcrypt to handle password security.


CLI Data Gem Project

I found this first portfolio project to be challenging yet ultimately rewarding. I chose to get data from the Spotify API because I am a big music nerd and knew that Spotify was a rich source of data about music (for an example that goes in far greater depth than my project, see http://everynoise.com/). First I set up the environment, basic file structure, and requirements (including dotenv and httparty which are needed to get data from the API). I divided my code into three classes, CLI, Artist and API. I first wrote the code that didn’t need data from the API: the CLI with its menu-driven interface, and an initial draft of the Artist class that initialized artist objects that the CLI could get data from. At first I just put placeholder data arrays in the Artist class, leaving the API for later. I created the methods to print the data in a numbered list, as follows:

def print_numbered_list(array)
    array.each_with_index do |item, index|
      puts "#{index + 1}. #{item}"
    end
  end

(this is the generic version, that I later made to make the code more DRY)