Image for post
Image for post

The term “user experience” came into the mainstream during the 1990s because of Don Norman’s work as a researcher, but you still might not know exactly what it is or why people talk about it so much. You’ve definitely felt UX before though, both good and bad. It’s the reason you’ll leave a new website in less than 30 seconds if you can’t find what you’re looking for, or why you’ll endlessly explore another for hours because of how easy it is to use.

The difference between a good/bad user experience comes down to one thing: did the web application help the user solve their problem without confusing them? This question can be difficult to answer, but it’s extremely necessary to do at every stage of the design process. In this blog I’m going to outline why having a solid understanding of UX design is important for everyone, even if you’re a software engineer or data scientist. …


Image for post
Image for post

I have another sorting algorithm to discuss this week, and it’s called Heapsort. You can think of it as a kind of enhanced Selection Sort. It’s a little slower than Quicksort and Mergesort, but doesn’t require massive recursion or multiple arrays to properly sort a collection and therefore requires less memory. This method is a little bit more complicated than the other algorithms I’ve written about so far, and will require me to explain what a binary heap is.

Binary Heap — This data structure is a complete binary tree where every level is filled, the last level may not be depending on the tree, and all nodes are as far left as possible. Items are sorted in a unique order where all the parent nodes are greater in value, and the child nodes are less in value. This is referred to as “max heap.” There is also a “min heap” binary tree where every parent node is less in value than its children, but for Heapsort we look for the maximum value to sort elements in increasing order. …


Image for post
Image for post

Last week I introduced how to implement Bubble Sort, Insertion Sort, and Selection Sort with code examples, and in this post I’m going to show two new algorithms — Quicksort and Mergesort. Both of them rely on the “divide and conquer” principle, which will be explained in more detail later. However, in order to begin talking about these sorting methods you have to know about recursion. So what is recursion you ask?

Recursion — Essentially this technique is a process where a function continuously calls on itself, directly or indirectly, until a specific condition is met/it reaches the necessary stopping point defined in the function. With each iteration a smaller portion of the original data set is called upon. If the stopping point isn’t met or defined correctly you can get caught in an infinite loop. Using a recursive algorithm can solve certain problems very easily, and generally is better with larger data sets than the three algorithms I discussed last week. …


Image for post
Image for post

In this post I want to go over how to sort collections in Ruby, and no I don’t mean — array = [1, 5, 4, 5, 2].sort — I’m talking about using an actual algorithm to solve the problem. If you want to ace your next technical interview you’ll probably have to sort some data structure, and you’ll have to know which method to use. Today I want to discuss how to implement Bubble Sort, Insertion Sort, and Selection Sort. Let’s get started!

Bubble Sort — The idea behind this sorting algorithm is to loop through the list of unsorted items in a collection, swapping adjacent elements if they aren’t in order and adding the item with the largest value to the right end. You continue to swap until the entire array is sorted from smallest to largest. This algorithm is pretty slow because the collection may not be completely sorted after the first iteration, since you can only compare two adjoining elements at a time, and more iterations might be necessary. …


Image for post
Image for post

Preparing for technical interviews can be difficult, frustrating, and confusing at times. As I continue my job search I thought I would take some time to share what I’ve learned thus far about calculating time complexity, and big O notation. This topic wasn’t easy for me to grasp when it was first introduced at Flatiron, but the idea behind big O is actually fairly simple once you delve into it a little further. Here is a rundown of how it works, and what you need to know to start nailing those tech interview questions!

First off, when people say “big O” they’re really referring to big ϴ (“big theta”). This concept looks to evaluate the limiting behavior of a function as it approaches a specific value/infinity. Essentially you’re looking at the worst-case scenario when working with big O or the “upper asymptotic bound.” To calculate time complexity you only need to look at the term with the largest exponent, ignore coefficients/smaller terms, and you can also count the number of nested loops in your function to help determine big O. Let me demonstrate using Linear search with a Ruby implementation. In this example I’m trying to find a specific target number, let’s say 23, in a shuffled array of 60 numbers. …


Image for post
Image for post

In my previous post I discussed Rails migrations, and some important concepts to be aware of. I also mentioned how the documentation is great for answering most questions you could have about any topic. The only area I think it’s lacking is giving a bit more information about each of the Rails data types, and when to use them. I mean honestly what’s the exact difference between a :float and :decimal, or :text and :string? Read on and I can explain don’t panic!

Here is a list of all the common data types Rails has to offer:

  • :primary_key
  • :string
  • :text
  • :integer

Image for post
Image for post

Today I want to review Rails migrations, specifically some important concepts you’ll at least want to familiarize yourself with if you haven’t already. Rails makes it very easy to get a project up and running quickly, and really streamlines the whole process. I’m going to highly suggest you use Active Record as your ORM (object-relational mapping) framework so you don’t have to write custom code for your models, and because it allows you to utilize common CRUD/REST conventions that most developers use nowadays. Active Record is included by default in every new Rails app, so I’m going to assume you’re just using it. …


Image for post
Image for post

When I first started learning about closures in Ruby I was pretty confused about what the differences were between code blocks, procs, and lambdas. After reading up on them a little more, however, I discovered they aren’t that confusing. In this post I want to give a brief overview of what each of them are, because you never know when they might come in handy. I personally haven’t used procs and lambdas much in my code so far, but they’re definitely worth knowing about. Let’s dive in!

A Ruby block is a selection of code inside a do..end statement, or in between curly braces {}. Blocks act like the body of a method, and are a way to group statements together to be called at a later time. You can also pass multiple variables into your block if you need to. …


Image for post
Image for post

There have been many updates to React.js since it was released seven years ago, especially with the addition of the ES6 syntax in 2015. It’s pretty remarkable what you can do nowadays with this robust frontend framework, and in this post I want to discuss using Hooks. They’re a great feature that was introduced in React version 16.8, and allow you to use state in functional components, as well as lifecycle methods such as componentDidMount(), componentDidUpdate(), etc. There are many benefits to using them, mainly that they make code easier to read and test. Today I’m going to go over how to rewrite a basic class component as a functional component with Hooks, specifically with useState(). …


Image for post
Image for post

Today I want to go over a quick fix to an error that had me very confused when I first started my program at Flatiron. If you try to run your JSON server and see this error message “getaddrinfo ENOTFOUND localhost,” it’s happening because Webpack cannot find your localhost address. In my case one line from the Hosts file was missing on my computer and I had to figure out how to add it back in. Thankfully the solution is super easy, and can literally be solved with a few lines of code. …

About

Jacob Knopf

Full Stack Web Developer and UX Designer

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