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.
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…
setTimeout() functions, and describe how we used
setTimeout() to create the rolling numbers effect in a game styled after a slot machine.
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…
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…
Software Engineering student at Flatiron School