Typescript. A beautiful beast

When I write code, I’m not writing it to get the job done, and I’m not writing it for myself. I’m writing it for the next person who reads or writes it.

Writing code that compiles isn’t difficult for most people who writes code professionally, and similarly, writing bugs isn’t difficult. The former is how it should be, but we should strive to limit the ability of future developers to write bugs.

This is why, when I write code, I strive for compile-time safety: I want your IDE to tell you “this won’t work” before your tests do — or…


Credits for this beautiful graphic

Not all data is created equally — and not all data should be stored the same way. Similar to learning about HashMaps, Linked Lists, Heaps, etc., it’s important to know the different ways to store data in your Flutter App to create the best user experience possible.

For instance, what happens when you don’t need to deserialize a whole object — just a single field or value? It doesn’t make sense grabbing a whole config.json from memory when all you need is a single boolean field, like isDarkMode=false. …


The best Website on the internet :)

Some Flutter packages are must-includes in each flutter project I create, because they make development so much easier.

Whether it be because they make local data storage easy, or allow you to completely replace parts of your app with a single package, there are some packages that I automatically include in my Flutter projects before I even start coding.

If you’re working on an app and want to release your app quickly, you’re going to want to know about these Flutter packages.

If there are any packages that are must-includes for you, leave a comment and let me know —…


Beautiful :)

Typescript is an amazing language — one that allows us to do everything JavaScript can in a tenth of the debugging time. These tips will mostly be for:

  • reducing bugs, by writing more explicit and understandable code
  • pack more value into your code without reinventing the wheel.

If you already know these, then congrats! You’re a TS Legend — maybe share some of your wisdom with me in the comments (and read my other article with 5 seperate tips!).

Here’s 5 advanced TypeScript tips that will allow you to write better TypeScript Code.

1. The “is” operator / Type Guards

Swagger is really, really helpful to see…


Loader by Ahmed Emran

When loading up a Single Page Application like React, Vue, or Angular, you’ll spend several seconds staring at a blank, white HTML page. These several seconds are the perfect time for your inner UI/UX to go absolutely crazy — the user doesn’t have to click anything, they just needed to be distracted so that they don’t click away!

I’ve recently taken to building some crazy, over the top loaders here. While it seems pointless, it can add so much life to an app. A fun animation can create an awesome feel for the app without being intrusive at all. …


What a beautiful footer! If only we could fix it to the bottom of the page…

One of the “big 3” CSS questions is the following:

How do I keep my footer hugging the bottom of the page?

After answering this question on Reddit for the 5th time, I decided that a blog post was necessary. Here’s how.

(Aside: If you’re wondering, the other 2 “big 3" CSS questions are “how do I center elements” and “why aren’t my styles applying”).

tl;dr and full code at bottom.

The Setup

First, we’ll take a look at the setup HTML. Here’s some minimal HTML:

<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> …


Flutter App Lifecycle — How to tap in

A tl;dr can be found at the bottom of this post.

Most, if not all, apps you use on your phone utilize the app lifecycle for various reasons — maybe you want to show that a user went offline when they close the app, or maybe you want to commit some critical data at the end of the session. App lifecycle is a powerful tool that you should 100% have in your Flutter toolbelt.

Usecases

Here are some usecases for app lifecycle:

  • Reporting data analytics (time user spent looking at screen, tap count, etc.)
  • Cleaning session data off system
  • Reporting…


CSS3

CSS is one of the most hated things about front end development. Often, your styles won’t do what you ask them to do — Here are 5 things that will help relieve your CSS induced headache.

1. STOP Using !important: How CSS Hierarchy Works

CSS hierarchy is something that is really confusing to front end developers, because often it’s overlooked when learning. Generally, styles don’t really conflict… until they do. When they do, developers often throw in a !important at the end of the style. While it often is the solution, it can cause many problems later down the line.

In fact, at my day job, we have…


Sometimes, state management monopoly is good; in React, there’s really only one or two state management solutions that are seen regularly. As the wild beast that 2020 was draws to a close, there seemed to be a new state management solution every month. Here’s a list of where each solution shines, so you can be confident you picked the best state management solutions for your needs.

The Basics

There are two state management solutions you can use without ever touching your pubspec.yaml file, and sometimes (more times than you’d think!) It’s enough.

SetState


A rusty iterator over element Links… get it?

In vanilla JavaScript, performing a filter on a list and then logging every element takes O(2n). In Rust, it takes O(n). Here’s why, and other cool things about Rust iterators.

We often hear that Rust iterators are lazy, but it never really clicked for me what that meant until I had to filter a list in both Rust and JavaScript (technically TypeScript, but still).

In JavaScript, a list filter looks like this:

myList.filter((t) => t !== "Filter me out")

and then to log each element, you’d chain it like this:

myList.filter((t) => t !== "Filter me out").forEach(console.log)

What happens behind…

Anthony Oleinik

Developer passionate about learning and creating things. Writing to help others learn.

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