The Javascript Project
This is my fourth project for Flatiron. This time around, I had to make a single page application with Javascript. Before I get into my thought process behind the project, I have a confession. Starting with Javascript…I absolutely hated it.
Crazy, I know. However, look at it from my perspective early on. I saw the potential of Javascript. The things you could do were awesome. I could interact with a page in ways I never could before with my knowledge of Ruby and Ruby on Rails. I was legitimately excited. That being said, I also felt like I was almost starting from square one again. I had to relearn the basics, of which I had become pretty fluent in with Ruby. Methods were now functions, I felt an unshakable cognitive dissonance when iterating over data, and don’t even get me starting on OBJECT ORIENTED PROGRAMMING. I was struggling, probably not anymore than anyone else, but I was definitely more frustrated. I had forgotten what it felt like to learn again. Nothing made sense anymore, and I blamed Javascript. But it wasn't Javascript’s fault, it was my own. That being said, one day, it all just clicked. I felt like I was fluent in a language again (to some degree that is). I started having fun, and my eyes were opened to all the wonderful things Javascript had to offer. The point of this is to say, if you’re starting to work with Javascript and you’re having a hard time, take it slow and breathe, because it really is worth embracing in the end.
Going into my project I had no idea what I wanted to do. I was bouncing between ideas, but nothing really stuck. I ended up deciding on a cartoon character lister. The idea would be that you could add to a list of cartoon characters with the shows they’re in, bios, and miscellaneous other information. I was talking about this with my girlfriend one afternoon at a McDonald’s after church, and she says to me, “Why don’t you make something that actually matters?” To that I thought “okay, well damn,” but she was kind of right. I should start gearing my project ideas toward something actually useful. Even if the limited knowledge I’m walking in with won’t be a finished product by any stretch, I really should start changing how I approach things to be more useful. I looked back to my Rails project where I designed a psuedo-UpWork app. So I changed the idea to a dog breeder dog tracker. My girlfriend’s family had just welcomed a puppy into their home, and so the idea that maybe a breeder of some sort may want a way to organize their pups came to me. With this in mind, the project was a go.
Now that I knew where I wanted to go with the project, I could get a good start. First thing was setting up the Rails API, which thankfully was easy enough. I generated the API and started to think about the models I needed fo the app to work. I decided that couples and puppies were what I needed. Simple enough. I set these up and made some seed data. From this point on, I think I really came to understand Javascript better. Prior to this project, I understood many things about the language, but in separate parts. Piecing these parts together was the tough part. I needed to put in links, but prevent their default actions, I needed to add event listeners, I needed to fetch data, the list goes on. And although it was tough at first learning how some of these things worked under the scope of an application, it was awesome seeing everything start to come together. Ultimately, the application I put together allows you to grab data from the backend to display, add data, and also delete it. All of this done without a page refresh obviously. I’m not going to lie, seeing all the asynchronous “magic” happen was one of the cooler things I learned going through the course work. I do feel like I say this every time I finish a project though haha.
This project took me a long time to finish, much MUCH longer than it needed to, but I enjoyed the process a lot. Javascript is very interesting and I’m excited to keep learning about it. Since my application was simple, I don’t have more to say on it at the moment, but hopefully in the next one, I’ll have more interesting things to say with the added knowledge that I have. Thanks for reading :)