https://www.gravatar.com/avatar/306d401b2a8c0efe0996fec60e0c90aa?s=240&d=mp

My coding journey

Disclaimer: it's just for fun

Is it burnout, or I'm just sick?

I have an issue

Staying focused on my job became so hard that I started exploring what is happening with me. What are the signs of my strange condition? Every few minutes I feel an inresistible urge to get up my chair ang go somewhere. Unfortunately, since I’m working from home, the “somewhere” means “to the fridge” so I’m constantly eating. Not good.

It looks like my level of stress or boredom is so high that all my mental systems nead a break and have to engage in something different. So I get up. Eat or drink. Clean the toilet. Set up the washing machine. And finally, chased by my conscience (whispering: “what the hell are you doing?”) I come back and sit at my desk, defeated, unmotivated, guilty. Not good.

How to explore a new codebase

How to start exploring a new codebase

Have you ever thought about a situation when you are dropped into the middle of a huge codebase and you need to somehow make your way through it? For example:

  • you were assigned to a new project
  • you switched teams
  • you were hired as a contractor or maybe
  • you want to start working on a free software project hosted in a public repo.

The question

How should you even start? What to look for? Sometimes the amount of related projects, the vast tooling or huge amount of documentation may seem just overwhelming.

Java, Go, Rust - comparison

How do Java, Go and Rust compare? Let’s dive (but not too deep) into Java, Go and Rust. Let’s compare common aspects of those languages, their popularity (Java wins), check how typesafe they are (Rust wins) and which is preredred (betwee Go and Rust, Go wins).

2023 and 2024

World

A lot has been happening in the world when you look at 2023

  • Ukraine - Russia war, Hamas - Israel war
  • Finland joins NATO
  • India exceeds China in population size
  • India lands on the moon’s south pole (Chandrayaan-3)
  • Banking crisis (buyout of Credit Suisse by UBS in Switzerland)
  • First AI Safety Summit

Just go and look at 2023 in Wikipedia, it is a really fascinating summary.

Predictions

Near the begining of 2024, a lot of people and organizations on the web published its predictions related to most promising/important technologies or trends.

Docker exercise

No amount of Udemy courses is satisfactory unless you start to solve your problems. So yesterday I created myself a problem:

Write a commandline application, dockerize it, use it, push it to dockerhub.

It seems like a very humble endeavour, and I had a lot of fun anyway.

Golang app

I’ve learned that in order to write to a file I can use os.Open call which takes flags and (hex) permissions:

Introduction to TLS, jks and keystores

Let’s face it: certifiates, key management, ssl/tls has never been any fun for any Java developer. That’s why I was also avoided this topic for as long as possible. And the time came to finally gather all I know , or rather: what I don’t know, just for reference.

Model ISO - OSI

What is ISO OSI model

ISO OSI = International Organization for Standardization Open Systems Interconnection

ISO OSI model is conceptual framework:

  • used to standardize and understand how different networking protocols and functions interact within a networks
  • consists of seven layers, each with a specific role and set of functions

Layers

Physical Layer (Layer 1):

  • the lowest layer
  • deals with the physical aspects of data transmission.
  • defines the physical medium, such as cables, electrical voltages, or optical signals, and how data is transmitted over them.
  • example: Ethernet cables, fiber optic connections, and wireless communication signals.
  • responsible for framing data for transmission and detecting and correcting errors in the data
  • manages access to the physical medium
  • resolves issues related to the physical addressing of devices on a local network.
  • examples: Ethernet and Wi-Fi

Network Layer (Layer 3):

  • focuses on routing and forwarding data between different networks or subnets.
  • uses logical addressing (such as IP addresses) to determine the best path for data to travel from source to destination
  • examples: routers operate at this layer

Transport Layer (Layer 4):

  • manages end-to-end communication and data segmentation into smaller packets.
  • provides error detection, flow control, and data integrity, ensuring that data is reliably and accurately delivered
  • examples: Protocols like TCP (Transmission Control Protocol) and UDP (User Datagram Protocol)

Session Layer (Layer 5):

  • establishes, maintains, and terminates connections between two devices or applications
  • manages session synchronization and ensures that data is delivered in the correct order
  • examples: NetBIOS and RPC (Remote Procedure Call)

Presentation Layer (Layer 6):

  • responsible for data translation, encryption, and compression.
  • ensures that data is in a format that both the sender and receiver can understand.
  • can handle data compression and encryption as needed.

Application Layer (Layer 7):

  • the topmost layer, the closest to end-users and applications
  • provides network services directly to end-users and applications (usually through language or libraryAPI) and is where most user-facing software interacts with the network
  • Common application layer protocols include HTTP (for web browsing), SMTP (for email), and FTP (for file transfer)

How to avoid switch statement in Spring Boot

In this guest post Norbert Tusiński writes on how to execute different type of behavior in situations where the type of behavior is determined by the value of some `Enum` variable. Immediate intuition is to use switch statement, however Norbert shows other possible solutions in the context of Spring Boot framework.

If not ThreadLocal then what? ScopedValue!

What is a ScopedValue?

ScopedValue is a value that can be seen and used in methods, but hasn’t been passed to them as a parameter. Untill recently this was possible in Java language by means of ThreadLocal variables. Let’s look at ThreadLocals for a moment to refresh our knowledge and let’s see what new features are being introduced by newer replacements, that is: ScopedValues.

What is the ThreadLocal variable?

ThreadLocal variables are typically declared as private global variables (static fields) and ensure that the value we read from them (using the get() method) is the same value that was previously stored in them (using the set() method) within the same thread (or the one returned by calling the protected initialValue() method that returns the initial value of the ThreadLocal variable).

What's new in Java 21?

Java 21

This is a real thing! Java 21 feels almost as a different programming language! Changes planned to be released in Sptember 2023 (in just a month!) can be roghly grouped into two categories:

Language and library changes

Here are the most important and - in my opinion - the most interesting changes that await us in Java 21. They are not revolutionary, but they make writing code - and, what is even more important, reading it - much easier.

Other changes

These are low-level changes, important for library creators (vector API, FFI, cryptography), or related to "code clean-up." They are probably less interesting for the typical programmer, although it's worth taking a look at the descriptions in JEPs to have a general idea of what they are about.

Piece by piece

Sequenced collections

We will have new interfaces which would be able to correctly model the encounter order. The API we have so far (let me say this: all Collection API) is a bit chaotic: taking first or last element from different collections has different API: