Writing

Photo by Christin Hume on Unsplash

1. Topics

Why most people don’t write good content, is because they write about things they are not passionate about. Only write content you will love reading yourself. If you do this, you already stand ahead of most of the other writers. It’s not about being the best, it’s about delivering good content where people can learn from.

For me, technical blogs were the most interesting, because I have a lot of knowledge about them. You should do the same and write about things you’re passionate about. Sometimes when I started to write a blog, I did not know everything about the…


PROGRAMMING

Photo by Wesley Tingey on Unsplash

As a developer, you should have heard of the term ‘DRY’ — Don’t Repeat Yourself. You should avoid writing the same sentence over and over. This doesn’t only apply for code but also for documentation. And who wants to write basic documentation for fun?

To improve and speed up contribution to a project, you need documentation. Every project you worked on, has some kind of basic Markdown documentation:

A README to describe what the project is about, how to install and start the project.

This could be a Pull Request template to instruct contributors on how to set up a…


TypeScript

Photo by Ash Edmonds on Unsplash

In TypeScript, there are multiple built-in utility (default) types. It would be a good thing to know they exist because they are handy in some situations. Some are easier to understand than others. I am going to explain them in a short and simple way, so everyone can understand them.

1 — Partial

The first one is Partial, this can make all properties optional in a type where properties originally should be required.

type Worker = {
name: string;
profession: string;
}
// Not defining 'profession' is allowed
const worker: Partial<Worker> = {
name: 'Jeroen'
}

2 — Required

The opposite one of Partial is Required


Programming

I couldn’t find any simple documentation for push notifications with Flutter, most of it was more complex than it should be. So with this guide, I want to only explain what is necessary.

Note; the article focuses on Flutter with Android

1. Getting started

I created a new project withflutter create push_messages. In the generatedpubspec.yaml you can add the following package under dependencies;

dependencies:
flutter_local_notifications: 3.0.0 // latest at time of writing

Then run flutter pub get, this will install the package.

2. Set permissions

Next, we go to;

android/app/src/main/AndroidManifest.xml

We need to add some code, this needed to show the notification even if your device…


Programming

Photo by Alexey Suslyakov on Unsplash

1: Please, be consistent

Nothing is more confusing than seeing code where there is no consistency. All the things like; formatting, casing, name conventions, documentation. It could make your life easier if they are consistent. Try to do everything in one way, and make conventions/guidelines with your co-workers. So you will generally continue to do this the same way. But for example, when reviewing each other’s code, try adapting their approach and the way they do things to understand each other.

2: Ask for help on time

When dealing with something difficult, try to ask for help on time. I made this mistake too often in the past, and be…


Programming

Photo by Devin Avery on Unsplash

An overview of only the array methods that can mutate the original array. Some of these are already well-known, and some of them aren’t used as often. Let’s get through them all, without difficult explanations.

Note: this also applies for TypeScript

Adding items

1 — push

The most well-known method is push. In the example below, we have an array of two names (strings). With push, you add an item to the end of an array.

const array = ['John', 'Jeroen'];
array.push('Peter');
console.log(array);// ['John', 'Jeroen', 'Peter']// You can also add more arguments by separating them by a comma. E.g. array.push('Bob', 'Alice').

2 — unshift

With unshift


In the above image, you see my blog post’s views since it was published in November 2018. When I published this (programming) article I didn’t earn yet money for it, because I did not distribute it.

I thought about making some extra money on Medium. But my idea was you would need a massive following, but you won’t. At the time I had only 300+ followers, but the article had by then already over 100k views.

Distributing my Medium blog post

In January 2020 I thought about distributing this article. …


Are const and final in Dart the same?

With my JavaScript/TypeScript background I was already familiar with the const keyword. In Java, you don’t have const, but the equal is final. When I started working with Dart (for Flutter) I was surprised by both of these two keywords available, for me they looked exactly the same. But of course, they are not.

Comparing the keywords

const String personConst = 'Jeroen';
final String personFinal = 'Jeroen';
personConst = 'Bob'; // Not allowed
personFinal = 'Bob'; // Not allowed

In the code above we create a const and a final variable and assign my name to both. You can’t re-assign both of them.


Small and Fast

Most developers, myself included, wait for ages to see the results of their tests. Recently I heard of this JavaScript npm package, Baretest. According to their website, they promise almost instant performance. But, the package is quite small and doesn’t have a lot of features.


Photo by Yu Kato on Unsplash

In EcmaScript/JavaScript classes, you can’t define a property or method as public or private, but luckily there is a proposal to introduce this feature (stage 3, which means a candidate for future ES versions).

In TypeScript, we already have the public and private keywords. But now in the recent 3.8 version, TypeScript introduced the EcmaScript private fields already. Let’s find out the differences.

Angular 9

The new version of Angular is just released, but it only supports TypeScript 3.6 and 3.7. So by using 3.8, it would be experimental.

TypeScript private vs EcmaScript #

According to the TypeScript 3.8 …

Jeroen Ouwehand

🔥 Software Developer from The Netherlands — Twitter/Github: Jeroenouw

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