When I was growing up (and you know, also now), I really liked virtual pets. I had keychains of digital pets that I took care of (see Tamagotchi), and games where I could raise and battle them (see Neopets, Digimon and Pokémon). The conceat has always been that these little critters prospered or perished by virtue of your interaction (or lack of interaction) with them. Give it plenty of food and love, and it showed affection to you and got stronger. Ignore it and it might ignore you, or even worse, leave for the digital pet cemetary. This gave the user a reason to keep going back to the software. It was a gamified feedback loop that kept the user hooked.
In Part 1, I talked about creating the backbone CRUD functionality of ThingFunder (creative name, I know) in Rails. I revisited the project recently as a learning exercise to try out some new tech. In this post, we’ll take a look at the crowdfunding problems that I’m interested in trying to solve, go over how I used Web3.js (via Metamask) and Solidity to add Ethereum smart contract functionality, and look into bettering the user experience by using AJAX/jQuery and the Handlebars templating engine to make the app load data asynchronously.
“It’s functions all the way down.” - Ancient Internet Proverb
As the internet becomes increasingly integrated with the world outside of just the desktop, the “language of the web” becomes even more relevant. Though when I first started learning JS, I had a tough time understanding why the language had become so widely adapted. It had a bunch of weird quirks that would continuously plague the codebases that I worked with, such as conditionals returning ‘true’ for things that I knew should’ve been ‘false,’ and variables strangely not being defined or defined as something unexpected in my function calls. After some reading and a lot of coding, I started understanding why these things occurred, and that understanding gave way to good coding patterns, and exposed how fun/powerful JS can be.
One unexpected error that I encountered while working on my first Rails app was in implementing a delete feature. Basically, the ActiveRecord ORM would not allow me to delete the model instance that I wanted to delete, and threw an exception like this: