Recently I was searching through our application logs. The task was to extract extra context for a group of requests (ex. errors in the external provider system with the original request). For our app, we are using CloudWatch to store the logs. I have used CloudWatch Insights as out of the box tool to analyze them.

Our logs have a format like below, with each console output in a separate line:

2021-02-06T13:38:31.730Z info [some request id 1; some user id 1] Some external provider error message
2021-02-06T14:21:00.000Z …

I am not a developer. However, it’s not like I came to a software development company from a completely different world. Before joining Bright Inventions I was working at an online marketplace company that had an in-house web and mobile development team. The IT world wasn’t such a new thing to me. So I thought… Find out 4 things that surprised me about working at a software development agency.

1. Slack is the new email

I love Slack. I was introduced to it a few years ago and I fell in love with it instantly. Although, I think that the Slack team should work harder on…


Mocha.js
Mocha.js

One of our projects is running automated tests on CI/CD AzurePipelines.

For the test runner, AzurePipeline supports several test results templates but not the default Mocha spec one.

This is why tests are running on the mocha Junit reporter producing the JUnit XML result.

As there was a difference between running tests locally and on CI/CD environment, I wanted to debug the logs of the job. That what not possible as the Mocha JUnit reporter was not collecting console outputs/errors.

Mocha.js does not support multiple runners right now. The solution for that was to introduce own runner, which combines both…


The meeting starts. After 5 minutes of participating you start to wonder what it is about. It feels like a total waste of your valuable time. You lose your focus and listen with only half an ear. Probably in the meantime you start to do some of your other tasks for today. Then, if someone asks you, you don’t even know what the question was about.

Sounds familiar? Depending on the organisation, its size and culture, you have probably already experienced that several times. Good news is: you can do something about it! I have gathered some tips for the…


Introduction

TypeScript language mainly uses structural typing. In structural typing, an element is considered to be compatible with another if, for each feature within the second element’s type, a corresponding and identical feature exists in the first element’s type. Sometimes this behavior may allow us to write erroneous code.

TypeScript
TypeScript

Example

Let’s imagine a function which calculates candy price based on their weight and price per unit:

// Create a type for our candy
type Candy = {
pricePerUnit: number
weight: number
}

// Create a function from our example
const calculateCandyPrice = (candy: Candy) => candy.pricePerUnit * candy.weight

// Create a type with similar structure…


Introduction

As developers we often perform POST and PATCH requests to API from our frontend apps. When we use TypeScript, this code should be typed safely. There are multiple ways to do so. Let’s analyze one of them!

Object typing
Object typing

Prerequisite

Let’s imagine a player entity from a game:

// Create a type for our object
type PlayerType = {
hp: number
name: string
position: [number, number]
}

// We can also use interface:
interface PlayerInterface {
hp: number
name: string
position: [number, number]
}

Let’s create two functions (without safe type control as for now) to create and update our player:

Let's create…


Introduction

Covariance and contravariance — two buzzwords from a programming language’s world, what do they mean? Let’s find out in three steps!

Covariance and contravariance
Covariance and contravariance

Step 1 — Sets

This topic is not so straightforward so let’s start with an intuitive example from life with a little of mathematical knowledge. Think about a vehicle and a motorbike. Vehicle is a superset for a motorbike and motorbike is a subset for a vehicle.


You finally did it! New functionality is ready to be deployed. This new feature will revolutionize the market, will give tons of new users and other few millions on your account. Fantastic feeling, isn’t it? Once the app is in store, you start to rub your hands. But what if your app ranting suddenly goes down, people are frustrated because you have broken one of the other core functionalities by accident. Sweaty and stressed, you start to debug. Thankfully it is easy to fix. A few more clicks and the updated version lands in a store. …


A few years ago Adam outlined 8 steps to keep your API sane in his blog post which I really recommend if you haven’t seen it yet. The second step there, “be liberal in what the app accepts”, is quite a specific one because it is applicable not only to the backend side of the API but also, if not the most, the clients of that API.

Forward compatible enums in Kotlin
Forward compatible enums in Kotlin

I cannot stress enough the importance of that rule in the “offline first” apps. Let’s take a look at some example.

Example: 9GAG post tags

This is a screenshot where you can see a part of the…


productivity
productivity

Sometimes good intentions are not enough, especially while we are talking about productivity. In 1978 J.M. Darley and C.D. Batson constructed the experiment in which they tested the possible facts behind the modern version of the parable of Good Samaritan concerning altruistic behaviours. The experiment showed that the major reason why people didn’t stop to offer some help to a victim was the haste of their lives. There were different groups of people involved in the experiment, but the most peculiar one were students who were going to deliver a speech about helping others. They were in such a hurry…

Bright Inventions

Software Development Studio with expertise in mobile & web applications, Blockchain and IOT devices. https://brightinventions.pl

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