Vim is a text editor that is included in Unix-like operating systems. It is known for being fast and efficient because it is a small application that can run in a terminal and because it can be controlled completely with your keyboard. There is no need for any menus or the use of a mouse. So why use Vim? Well if you are a programmer you will find that moving your hand to your mouse and to the arrow keys can sometimes kill your flow and slow you down. Vim can help you edit large amounts of text in fewer…


Last time I wrote about the useState hook so now I will explain what the useEffect hook does in React. The useEffect hook was developed to address some of the challenges posed by life cycle methods of ES6 class components. If you understand life cycle methods from class components, this hook is equivalent to life cycle methods componentDidMount, componentDidUpdate and componentDidUnmount. I will use an example that will show how hooks can take the place of these lifecycle methods.

First of all let’s take a look at what useEffect looks like. This hook is a function that takes in two…


I love React hooks but I know that for beginners they can be a bit confusing. I remember when I first started learning them it was kind of hard to wrap my head around them. Hooks let you use state and other React features without having to write a class. They were introduced because classes can be confusing and larger components can be a bit harder to understand. The first hook I will be going over is useState. This allows you to use state in a functional component. Let’s get started!

To explain hooks I will use an example code…


Photo by Ilya Pavlov on Unsplash

In a self-referential relationship a class can interact with itself using a join table. While brainstorming some ideas for my new Rails project I found the topic of self-referential has_many, throughrelationships. After reading about it I decided to try it out to see if it would fit what I wanted to do. At first it was a little confusing but after some practice with it, I found that it was very simple. I didn’t end up using this kind of relationship for my project but it was really fun to learn about it. These sort of relationships are very commonly…


Photo by Duncan Kidd on Unsplash

Object-Oriented Programming (OOP) is a programming paradigm based on the idea of “objects”. A programming paradigm can be thought of as a set of rules that programmers follow when writing code to help accomplish a certain task. The four pillars of OOP are those set of rules. These pillars represent the design principles that help programmers write clean code.

The four pillars are:

  • Abstraction
  • Encapsulation
  • Inheritance
  • Polymorphism

Today I am going to talk about each of these principles. Let’s take a look.

Abstraction

Abstraction is to hide the implementation details of a process. Think of the process of making pizza. There…


A week ago I had my very first technical interview with a company I was very excited about. I had only participated in mock interviews before so to have a real interview coming up was both exciting and stressing. When the day came I realized that it was actually a very fun experience. I learned a lot about how the hiring process might go for other companies. Best of all, I was given a new programming challenge to have fun with! In this post I will show you what the challenge was and the solution I came up with.

The…


Lately I have been very interested in writing tests for my code. Last week I wrote a piece on how to test Ruby code using RSpec so I thought it would be fitting to look into testing JavaScript. Every time I work on something new I make it a point to unit test and practice writing better tests. One of the biggest benefits of writing tests for your code is that it forces you to think about how your code should behave in different cases. It is easy to start writing code and forget about weird edge cases. By writing…


RSpec is a domain-specific language (DSL) testing tool that was created to test ruby code. The idea is to write tests first and then write just enough code to pass the tests and then follow with refactoring. Since RSpec is a behavior driven development (BDD) test tool it focuses on describing what an application does and whether it follows a specification. RSpec is meant to be really easy to read. Adopting a test driven approach will make you a better developer because it forces you to think critically about the program and its features. …


I always spend some part of my day practicing programming questions on CodeSignal. I make sure to never break the routine so that I can get better at solving problems. There were some easy problems at first but once in a while I stumble upon a problem that stumps me. I try and try and after a while I finally solve it. It is so satisfying and I end up feeling so good in the end. I wanted to share this coding problem because I thought it was interesting.

So like I mentioned this problem comes from CodeSignal and it…


Usually when I implement authentication I build it from scratch. Most of my projects have been like that. Even though I heard about devise I just felt comfortable building it this way because I felt that I had more choice. Finally after looking for more things to learn about I decided to give devise a try. I was very surprised with how easy it is to implement devise into rails. It makes authentication so painless. Today I am going to show how I set up devise using rails.

First we are going to start with a new application so run…

Ray Alva

Flatiron School Graduate

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store