Worst MockMvc Test Antipattern: Don't use ObjectMapper!

Hi again, as already promised on my Twitter Account: Just realized that a bug fix I had in mind will make me sweat and probably takes longer than expected. All of that due to "problematic" test cases. I have a feeling that there will be a new blog post soon. 😅— Marcus Eisele (@eiselems) February 18, 2020 here comes my rant post about a certain way of writing Integration Tests with MockMvc and why I consider it a bad practice. For the first time on any programmerfriend.com post, I want to use Kotlin examples, I hope you don’t mind. Let’s... [Read More]

Best Python Books in 2020

Python Crash Course Automate the Boring Stuff With Python Learning Python Effective Python Python Cookbook Fluent Python Recommending books is always opinionated, still I try to list here a few books which will be beneficial to learners of all levels of experience. I tried to pick three beginner and three advanced Python books. Let’s start with the Best Python Books for Beginners: Python Crash Course: A Hands-on, Project-based Introduction to Programming by Eric Matthes What should I tell you about this book? It is well structured. Python Crash Course starts by going over the language constructs. It explains variables, functions,... [Read More]
Tags: python books

Use Kubectl port-forwarding to Forward Ports to Localhost

More often than I’d like to admit, I use Port Forwarding to troubleshoot issues with my deployed Kubernetes services. Port Forwarding can be setup for Pods, Deployments ReplicaSets and Services. Quick reference for different resource types: The syntax is: kubectl port-forward <kubernetes-resource-name> <locahost-port>:<pod-port> For example: kubectl port-forward my-awesome-pod 1337:8080 will forward 8080 from the pod to 1337 on localhost. Pods kubectl port-forward nginx-master-345fadbad1-abcd 1337:80 alternative syntax for pods kubectl port-forward pods/nginx-master-345fadbad1-abcd 1337:80 Deploymemts kubectl port-forward deployment/nginx-master 1337:80 ReplicaSets kubectl port-forward rs/nginx-master 1337:80 Services kubectl port-forward svc/nginx-master 1337:80 After you run these commands the Pod/Deployment/ReplicaSet/Service is available on your machine on... [Read More]

Software is About People

Last year, I had a talk with a friend who was looking forward to starting his first Software Developer job. He was pumped about all the things he gonna learn. It was uplifting to listen to him. He described how he wants to spend the whole day building new frontends, new backends, new whatever. He will not leave his IDE. He will be happy. During our further conversation, I am not sure if I crushed his dreams and made him reconsider his life choices. I am really not sure. In short: I told him about all the meetings and other... [Read More]

Starting Into the New Decade - Software Engineer's Edition

First of all, I don’t want to get too technical about the start and end of decades. Personally, I would prefer the decade to had ended in 2019; yet I think 2020/12/31 will be the end of the current decade. Anyway, since I already explained that the title is technically incorrect - what else can we expect from this article? More or less the article is a personal one, I want to reflect on what happened last year and compare it with what I expected before. Luckily, I wrote a similar article at the beginning of last year Year++ -... [Read More]

Random Number Generation with Java

Random Numbers are really important. Without them there would be no Internet how we know it! This article will explain in detail how generating Random Numbers in Java works. It will introduce different technics to create Random Numbers and also cover different scenarios with ready-to-use code. Let’s first start with the basics. Generating Random Numbers with Java: Java provides at least fours ways of properly creating random numbers. 1. Using Math.random Method The most basic way of generating Random Numbers in Java is to use the Math.random() method. It doesn’t take any parameter and simply returns a number which is... [Read More]
Tags: java tutorial

Best Java Books in 2020

Introduction to Java Programming and Data Structures Head First Java Think Java Clean Code Pragmatic Programmer Effective Java Refactoring Java Concurrency in Practice Test Driven Head First Design Patterns Release It! Kotlin in Action Spring in Action Spring Boot in Action Cloud Native Java Spring Microservices in Action Learning Spring Boot 2.0 Personally, I am always on the hunt for good programming books. Books are an opinionated topic, therefore I am quite sure some people would disagree with this selection. Nonetheless let’s have a look at my opinionated selection of the best Java books to read in 2020. You might... [Read More]
Tags: java books

To All Businesspeople: Developers Need Space to Do Whatever They Want

This might sound really controversial, but I think developers should have some free time to experiment. To make it even more controversial, I believe that providing opportunities for paid experimentation is more beneficial than leaving developers to investigate tools and techniques exclusively during their leisure. Why should I pay my developers to do whatever they want? - Some Boss somewhere Developers It is generally acknowledged that developers need to stay up-to-date to be successful. For their career growth, they need to regularly sharpen their saw. Developers need to learn new things here and there, otherwise they could be in a... [Read More]
Tags: developers