Get Hooked on Hooks

React Hooks were released in February 2019 with React v16.8.0. The idea behind Hooks was to allow developers to write cleaner, less clunky code. React Hooks allow developers to use state, and other React features without having to define a class; to write code that functions like a Pure Component with state and component lifecycle methods.

Hooks are functions aptly named for their ability to ‘hook into’ React lifecycle and state within functional components (prior to Hooks this functionality was only available to class components). Hooks do not work in class components, instead allowing you to use React without classes.


Let’s Memoize!

Within React’s lifecycle of a component, the component is re-rendered when an update is made. This occurs if differences (aka difs) between React’s virtual DOM and the in-browser DOM are detected, in which case the components that contain difs (and any child components of those components) are re-rendered in-browser. If this concept is unfamiliar or you would like a refresher on the functionality of React’s virtual DOM, check out my post on the subject linked below (plug).

While this functionality is part of what makes React so great, it can easily reduce the performance of your application if you have…


Welcome Page

Planning

Approaching this project I had a heightened sense of confidence that I had not yet possessed. I finally felt like I had shed the imposter syndrome that had plagued me throughout a majority of the course. Although I have no doubt there is much more to learn on my software engineering journey (this being one of the numerous reasons I chose to pursue the field), the confidence felt like a rewarding culmination of my many hours of studying, stressing, and practice. Phewf!

As I began the planning process for this project I ran through a number of potential ideas. I…


The way in which you choose to structure your data directly affects your program’s efficiency

In this post I will be covering common data structures that you should know as a programmer, as well as what data structures are and how and why we use them. A data structure is a way of organizing and storing data. Data structures are used in just about every program or software system that has been developed. Different data structures are more efficient for different usages, and as a programmer you should understand how they differ so as to optimize your programs efficiency. The four most common ways in which data structures are utilized are accessing, searching, inserting, or…


Classes, objects, and methods are extremely important concepts in Ruby and even though you may (or may not) be using them already, in order to really understand how your code is working under-the-hood it is critical to grasp these foundational components of the Ruby language. In this post I will be covering what each of these are and how to create and use them.

Let’s Dive In

Ruby Classes

Ruby is an Object-Oriented language, meaning it relies on the concept of classes and objects to structure a program into simple and reusable pieces of code that act as blueprints to create individual…


To understand blocks, procs, and lambdas in the Ruby language, one must first understand the concept of a closure.

In programming languages with first-class functions, a function is able to be stored in a variable and passed as the argument to other functions. A closure if a first-class function with an environment- it maps to the variables in existence when the closure is called. A closure can be treated like a variable and you can pass it as an argument to a function or assign it to another variable. …


Visual Representation of HTTP Request-Response Cycle

Hyper-text-transfer-protocol (HTTP) is a procedural system for fetching resources (for example, HTML documents) that was designed by Tim Berners Lee in 1989. It is a client-server protocol, meaning requests are made by the recipient (typically the browser). HTTP is the foundation for any data exchange made on the Web and is essentially the backbone of the internet. From all of the sub-documents fetched a complete document is reconstructed, including images, layout description, text, scripts, etc.

As a web developer, an important characteristic of HTTP to understand is that it is stateless. This means there is no link between two successive…


An Important Skill to Unlock in Web Development is Knowing When and When Not to Retry

A retry is a mechanism that monitors a request, and on the detection of failure automatically fires a repeat of the request. A retry of a request should only be considered when there is a chance of success- for example, in response to error codes 500 (Internal Server Error) and 503 (Service Unavailable). Attempting to retry on any and every error is inadvisable as it wastes resources and can produce unexpected results.

Examples of errors that would not warrant retry include 400 (Bad Request)…


Errors Are a Natural Part of Web Development

I recently had an initial interview for an entry-level full-stack position with Apple and one of the questions I was not fully prepared for was regarding HTTP error codes and which class of error codes is most likely to warrant a retry. Although I was able to provide a description of the source for each HTTP error/status code class, at the time I was a little stumped by the second part of the question- on which error code class does it make the most sense to run a retry. …


First off, the Domain-Object-Model (DOM) is a representation parsed by the browser that is comprised of a document’s structure and content. It is a programming interface for HTML or XML documents that allows programs to change the document style, content, and structure. The DOM acts as a live data structure and when modified it reflects that change on screen.

Visual Representation of Basic DOM Structure

A web-page is a document that can be displayed as the HTML source or in a browser window- although they appear different- they are the same document. The DOM represents this document in browser as objects and nodes and allows for…

Denali Balser

Full-stack software engineer experienced in Ruby on Rails, React, Redux, and JavaScript based programming.

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