Post on the software-development category, Browsing Page 2 of 4
-
Kotlin Coroutines for Android Networking
Over the years, Android developers have been doing networking with the use of some APIs from the Android SDK and other tools which always involved a lot of work. The use of Retrofit became the standard when we are talking about consuming APIs. This means having an additional layer on top of Java and the logic of our app. With the introduction of Kotlin a few years ago and with their native support for asynchronous operations with Coroutines, developers were provided with tools easier to use.Read more -
Batch Insert - Go database/sql
We may have come across the need of having to create multiple records in a single operation. Now, this can be achieved through a single insert command of course, but the more records we require to persist the longer it’ll take for this entire operation to complete. Let’s set up a basic example to go over this topic. We will be creating a list of contacts in bulk using the database/sql library in Go.Read more -
Using Go's build tags
In Go, a build tag is an indicator that is added to a piece of our code, to indicate when a package will be included in the building process. This gives us the possibility to compile different versions or parts of our application from Go, switch between them in a fast and organized way, and all from the same source code.By using the build tags we can work on integration tests in development teams, which allows us to test the updates of our code without the need to make modifications to the already tested sections of it.Read more -
My top 4 refactoring techniques in Go
Martin Fowler in his book defines refactoring as “a change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior”. This book contains a long list of refactorings techniques that mean to be applied under certain scenarios and with the intention to eliminate “code smells”. Refactorings are a very extense topic and I’ve found them to have an important role in the software development process.Read more -
Go's Locations & Alpine Docker image
My team has faced an issue with timezones repeated times: Apparently, default Locations were not present in our production deployments of our apps, that took us by surprise given locally these were present and working nicely 🤔. This is an issue I’ve faced before. Every time I wanted to show dates in a certain timezone but such timezone was not present in our production environment, Our app ended up in GMT for everything, or we had to create our own locations.Read more -
TIP: Ensuring your team uses YARN/NPM
One common Javascript flaw I see in repositories I get in touch with is the usage of both yarn.lock and npm-lock.json. This is not on purpose, in most cases is due to the lack of communication on the tooling the repo uses or different points of view on the best tooling for the problem at hand. In this short post, I’m not going to focus on communication strategies for the codebase, nor in which one is better between YARN and NPM.Read more -
Testing Buffalo Applications
Buffalo is a great tool to rapidly ship software solutions to the market, inspired by the famous Ruby on Rails framework, it brought Rapid Application Development to the Go Language. I say Buffalo, by far provides the best developer experience among other web development frameworks in Go, but I’m obviously biased by being part of the Buffalo core team. Buffalo’s existence has lead my team at Wawandco to deliver great apps within the last 2 years, and we are still delivering.Read more -
How to mock an external service for tests in GO
From my experience as a software developer, an issue that I have dealt when building an application are the dependencies for external services. A test with external dependencies where you don’t have much control can fail if there is a change in the service and the outcome is not the expected, with this in mind, we need to ensure the non-dependence of external services when running our tests. The most effective way to do this is mocking those dependencies.
In this post, I will focus on the functional tests of an application. I will also talk about how to mock an external service to not rely on it when running our functional tests.
To explain how to mock an external service, I’ll walk you step by step through an example.
Let’s say that we have an endpoint, that is using a third-party package called holidays that is making HTTP requests to an external service to get such holidays.
-
How's it like to write an Android app in 2019?
First, for Java developers only
As Android developers, there are many ways to write an app and get tired of seeing how the lack of features of the Java (Java6 by default) platform embedded in the Android SDK slows the coding process. Notice that Java6 last public update dates from 2013 and that is the version you are expected to use on Android development with Java. You can use Java8 language features but most of the powerful features can only be used in devices that are running Android 7.0 Nougat (API 24).
By May 7, 2019, Android 10 not released yet, there was a total close to 41.9% devices running Android OS prior Nougat out of 2.5 billion active devices.