If you are like me, you’ve been told that functional components are more efficient, cleaner, or “just better” and that you should try out using hooks. But you’ve been avoiding it. Because you’re pretty comfy using setState() and lifecycle methods and it’s working…

But today is the day, folks. We’re going to do it. Because I finally tried it out, and it was shockingly easy to refactor, and the result is refreshingly clean and easy to follow code. I’m about to lay everything out in a really simple way, so there’s nothing to lose.

So double-knot your shoe laces, quit…

Memory is something most beginner programmers take for granted. More focused on logic, syntax, and just getting it to work, we usually don’t pay attention to how we make space for our programs and their content, how much space we take up with our program, or if/how we ever free up that space we created once our program stops needing it.

In most modern languages such as Ruby, Java, Python, and Javascript, we have the luxury of never really having to worry about this; the languages take care of it all under the hood. But there are some lower level…

If you’re used to Javascript, you know that functions are pretty flexible. They’re “first-class citizens” of the language which means:

  • We can store them in a variable
  • We can store them in data structures, such as an array
  • We can use a function as a return value in another function
  • We can pass a function as an argument to a function

Wow, that’s pretty meta.

And furthermore, we can sort of do whatever we want to functions. That is, a function doesn’t really care how many arguments we define it to receive versus how many arguments we give it when…

What is bcrypt, anyway?

The name sounds pretty scary, and if nothing else, cryptic. But at the end of the day, bcrypt isn’t doing anything all that crazy. It’s just “an easy way to keep user’s passwords secure,” according to the documentation on the bcrypt Github page.

What bcrypt (and its friend the ‘has_secure_password’ macro) offers, like many other Ruby gems, is just a bundled up suite of “magic” functionality that we could actually implement using basic Ruby — it just saves us the time, the lines of code, and the hassle.

Specifically, bcrypt gives us a way to quickly and easily store user-created…

“Computer Science” is such a vague, general term that covers a wide array of concepts, applications, and knowledge. Most students that go down the path of focusing on CS have no real idea about what’s to come, and those who hasn’t been exposed to it tend to have quite skewed concepts of what it means to be a “computer scientist.”

I chose to major in CS in college because I loved programming and problem solving, and to be honest, the homework seemed like the most appealing option (think: problem sets and programs versus books and essays). After four years in…

Mary Farner

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