An Introduction to Functional Hooks Components (useState & useEffect)

(banana for aesthetic)

There is a trending movement away from object oriented programming and towards functional programming on the front end, and we have Hooks to thank.

What are Hooks?

Hooks allow you to use state and other React features without writing a class.

Why?

Hooks provide more flexibility around implementing lifecycle methods. The lifecycle methods in a functional Hooks component (unlike those in a class component) allow you to decide how tightly or loosely coupled the methods are.

Hooks are 100% backwards-compatible, meaning they don’t contain any breaking changes.

Hooks allow you to reuse stateful logic without changing your component hierarchy. You…


feat. A Slot Machine Game

This blog will give you the low down on JavaScript’s built-in setInterval() and setTimeout() functions, and describe how we used setTimeout() to create the rolling numbers effect in a game styled after a slot machine.

setInterval() and setTimeout()

Both of these are supremely useful JavaScript built-ins. setTimeout() is easy to remember because the name is rather self-explanatory: you pass it a function and an amount of time, and it will start the timer, wait until it times out, then execute the function (only once). setInterval() is also aptly named. You pass it the same arguments: a function and a time; and it will…


An API, aka Application Programming Interface, is essentially a database of information that can be tapped into and used by external systems. By external systems, I mean a program anyone can write. There are many free APIs available that host a wealth of different topics, but you can also use Rails to create your own API from scratch.

This is a great tool for beginners, because you can populate your Rails API with literally any kind of data you want and interact with that data to create a little app of moderate substance. Sure, if you’re a mega expert (or…


An Origin Story

Programming was not my plan all along. Actually, it was never my plan. I went to a straight-laced, collegiate prep high school (shoutout The Bishop’s School) where most of my classmates went on to Ivy Leagues. I went to UC Santa Cruz, and loved every minute of it. I was lucky to find my major during freshman year. I took Intro to Linguistics and was immediately hooked. I thought I would go on to be a pediatric speech pathologist, or maybe a translator, or something entirely different. Something creative, something I could wake up every morning excited about, and something…


So you’re building your first Ruby project (how exciting!), and you come across the need to get the date, or the time, or both. Maybe this is not your first Ruby rodeo, and you just need a quick refresher on how to turn this crazy return value into something nicely readable with human eyes. Either way, this is the blog post for you.

You may know that Ruby has a class called DateTime, or Time, in the same way it has other classes like String, Integer, Object, and so forth. What is the difference between Time and Datetime? Since I’m…

Zoe Kirsh

Software Engineering student at Flatiron School

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