I worked at a computer repair shop where technicians processed computers in the order that they came in, according to how long they predicted the repair will take. Every day they had a running list of computers that needed to be opened and tested. However, if there was an emergency where a customer needed their data right away, we could sometimes push their computer to the front of the line.

The technicians were using a priority queue in order to handle repairs, where computers with the highest priority were handled first.

Inspection of the inside of a Macbook.

When we want to process data efficiently in computer…


Files that allow other developers to use types for NPM packages without having to write their own

Photo by Jonatan Pie on Unsplash.

I’m currently working on a project using Express and React in order to practice my TypeScript and Jest chops. I’m using the NYC Benefits Screening API, and midway through writing types and interfaces for my API requests, I thought, “Wow, wouldn’t it be great if I could share my types with someone else who might want to use this API?”

After some research, I learned that I should write a type declaration file and include it in a package on NPM. …


Source: XKCD

When I was younger, I used to have files and folders randomly strewn about on my desktop and external hard drives. As I reached high school where most of my work was done on a computer, I realized that it was really difficult to find anything on my laptop since the file organization was haywire.

It took a full weekend to completely re-organize all of my files — this was before USB 3.0 came out. Other than a few hectic times in college, my files and folders stayed pretty clean, and it helped when cloud storage started to take over.

Trees


An ancient tome of advertisements.

Before the advent of cellphones and the internet, we used these things called phone books. Most of you probably know what a phone book is, but just in case: a phone book is a directory where businesses pay to list their phone numbers, usually arranged by type of business, and then alphabetically within each section.

Let’s say you hear from a friend that they used a service called “Roach-B-Gone”, but they forgot the number. Since it’s 1991, we have to look in the phone book. We open it up to around the halfway point and see an listing for “Larry…


A breakdown of stacks and queues in JavaScript.

Visual guide to stacks. Source

Stacks and Queues are probably the most self-explanatory data structures, but to some they can still seem intimidating. Let’s think of them in terms of real-world applications.

You use a stack every day when you are browsing the internet or editing text. A stack is what keeps track of the websites visited/changes made so that our back/forward and undo/redo buttons function properly. Whatever goes on top of the stack is the first thing to get removed.


Note: This is a continuation of an earlier blog that I’ve written here. If you are new to TypeScript, I highly recommend starting with the first blog before moving onto what’s below.

TypeScript is a superset of JavaScript.

Now that we’ve covered basic assignment for primitive data types and data structures, we can move onto some of the more non-traditional features that TypeScript offers us.

New Types in TypeScript

Since TypeScript is a superset of JavaScript, it has access to all the data types available in JavaScript. However, we must also remember that because TypeScript is a tool that gets compiled into JavaScript, TypeScript has access to new types.

A…

TypeScript is a superset of JavaScript

If you’ve ever used or written an API before, you know that an essential part of using it correctly is understanding the data in the response. In order to work with the data, you need to understand the shape it comes in, and the types of data within that shape. TypeScript allows us to pre-determine the shapes and types of our data in order to avoid errors and have organized code.

TypeScript is a superset of JavaScript, so any valid JavaScript is also valid TypeScript. It also means that it must be compiled into regular JavaScript before the browser or…


Merge, Quick, and Radix Sort

Recently I walked through some simple sorting algorithms with JavaScript. I use the term “simple” because the algorithms are a bit easier to understand and implement, but the downside is their time complexity is high — O() at worst. In this blog, we’re going to walk through some more complicated algorithms and aim to shorten our sorting time. (If you want to see ruby implementations, I’ve included them at the bottom of this post.)

It’s okay Avril, we’re here to make it less complicated.

Recursion

Merge and Quick Sort use a concept called recursion. Recursion is when a function calls itself…


Lists aren’t just arrays

Not that kind of link…. Source: https://yattatachi.com/tbt-how-the-legend-of-zelda-was-kinda-its-own-genre

When programmers see the word “list”, we usually immediately think “array”.

Arrays are great for storing data to iterate over, but since they have numbered indexes, manipulating elements in the array can be costly in terms of time and space complexity.

For example, if we wanted to insert a new element at the 10th index in a 100-element array, we’d have to re-index the other 90 elements after insertion.

If we need to work with a list of data that is constantly updated, we might want to use a data structure known as a linked list. …


… and all the good things and the bad things that may be

Testing and Test-Driven Development is one of the most valuable skills in a developer’s toolkit. When I say testing, I don’t mean quick manual tests like using debugger/console.log (JS) or using Pry/Byebug (Ruby). I’m talking about writing separate test files with a library like Jest (JS) or Rspec (Ruby).

“So you’re telling me I have to write code that tests the code I just wrote?”

#relatable

Why Test?

Writing tests is beneficial to your code in multiple ways.

It makes you think about your code. When writing tests, you have to think about all of the edge cases that may or may not…

Gianfranco Nuschese

Web Developer in Brooklyn, NY

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