Project 4: The Rails API with Javascript

Posted by David J Forer on July 7, 2020

This project is meant to make sure you understand how to create an API as the first step and then start your journey into Javascript. My initial reactions were that it was going to be challenging but not over the top. I found out that I would be wrong!! The project ended up being challenging and extremely interesting. In this post, I will expound a little on why.

I first want to explain that this project was made up of two projects for me. I started a project that I thought would be fun and useful. I was about 80% done with the project when I realized that 1. It wouldn’t meet the qualifications, 2. I didn’t have the ability to finish it as designed, and 3. It wasn’t going to do what I initially set out. That big mistake led to me learning some precious lessons when developing a project.

First and foremost, not only design a project but also think through some of the code that will be needed. If I had thoroughly investigated upfront, I would have realized I wasn’t ready. Next tip, always read and understand the project brief. The further down the road, my coding went, the further I was from completing what I needed. I was an example of a developer scope creep, LOL! My final tip is don’t be afraid to pull the plug. If what you are designing isn’t what you thought it would be, reevaluate the plan. I went too far down the path and became increasingly frustrated! So frustrated that I didn’t want to code. I questioned if this was what I wanted to do. I didn’t set myself up for success, just failure.

A key concept I learned was the proper use of Git. Git branches work so well! Every time you start to work on a different aspect of your project, start a new branch. It keeps your project safe, you know what you are doing, and it organizes you. While I need help in doing it properly, I felt safe with experimenting, knowing that my master wouldn’t be corrupted. Another tip is don’t do things that you aren’t trying to complete in that branch! FOCUS! Many times I would add styling or start something else when I should be finishing my branch task.

Refactoring is no joke! I think a key to having a successful app is done in the refactoring. Take a second, getaway, come back, and look at the code you got to work. Many times we are nose deep in the code and can’t see the duplication or unnecessary additions. By going back and refactoring, you will notice patterns, which means you can dry your code.

So a quick recap from this project. Always read the project brief in detail and mark how you will be accomplishing every aspect of it. Think about the code needed to complete the project and whether you can do it. Do not be afraid to start over when you aren’t accomplishing your goal. Use Git effectively, and you will love coding even more. Finally, refactor your app when you can objectively look at your code. It is critical to be able to look at your code without bias. I hope this helps someone on this journey.