A Short Introduction

Swift is quite a flexible language, providing you with many tools to modify and augment it as you seem fit. One of these augmentations is the support for custom or overloaded operators.

What Are Custom Operators?

Swift allows you to define your own operators besides the predefined set of operators, like ==, +,

Inject valuable metadata into your code

Setting variables at build-time can provide valuable metadata to our application that wasn’t available when writing the code or even at runtime. We can control feature-flags, or build information, like a version number, without updating the Go-code constantly.

Versioning a Go Project

Imagine we have version/version.go in the main package github.com/benweidig/goapp

These three…

Understand the similarities and when to use what

Series of blueprints

Even though interfaces and abstract classes have many similarities at first glance — especially after introducing default methods — they have different use cases and capabilities.

Abstract Classes
Interface or Abstract Class?
Why not use both?
Behavioral Contract vs. Shared Logic

Note: Java 8 is assumed…

Iterator + Splitting => Spliterator

Java has multiple types for traversing elements of a source. My last article showed how java.util.Iterator<T> and java.util.ListIterator<T> can be used to traverse data structures like Collections.

The concept of iterators is supported since Java 1.2, but got a new relative, java.util.Spliterator<T>, in Java 8.


Besides traversing sequences of data…

The most commonly used Stream operations

chopping board with vegetables, eggs, herbs and knife

The three methods, map, filter, and reduce, are the cornerstone of any functional programming.

Usually, our data pipelines consist of one or more intermediate operations, transforming (aka mapping) and/or filtering elements, and a terminal operation to gather the data again (aka reducing).

With just these three, we can do a…

More concise code with simpler variable declarations

Java is often criticized as being too verbose. One aspect contributing to this characterization is the requirement to specify every type explicitly, which leads to a lot of additional noise.

A new way of declaring local variables with less clutter was given to us with JDK 10 and JEP 286

How the idea of a Git helper became an invaluable tool for my company

I’m a great proponent of building our own tools. As developers, we perform many repetitive tasks, big and small. Many of these tasks might be made easier by using an appropriate tool instead.

We often concentrate too much on solving more significant problems. But sometimes it doesn’t need to be…

Ben Weidig

Software developer, entrepeneur, blogger. Mostly Java, sometimes Swift, Golang, Bash and all the other fun stuff.

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