Latest published articles

SQLAlchemy vs Hibernate: A Deep Dive into Python and Java ORMs

SQLAlchemy vs Hibernate: A Deep Dive into Python and Java ORMs

Introduction

When developing applications that interact with databases, Object-Relational Mappers (ORMs) help bridge the gap between relational databases and object-oriented programming. Two of the most popular ORMs are SQLAlchemy (for Python) and Hibernate (for Java). While both serve the same purpose, they have different approaches, strengths, and best use cases.

Comparing Persistent Data Sources on AWS: Choosing the Right Storage Solution

Comparing Persistent Data Sources on AWS: Choosing the Right Storage Solution

Introduction

Amazon Web Services (AWS) offers a variety of persistent storage solutions designed to meet different needs, from simple object storage to high-performance databases. Choosing the right data source depends on factors such as scalability, durability, cost, and access patterns. This guide compares the most commonly used persistent data storage options on AWS to help you make an informed decision.

Write Unit Tests First and Use AI to Generate Code That Passes Them

Write Unit Tests First and Use AI to Generate Code That Passes Them

Introduction

Many developers turn to AI to generate unit tests for existing code, but what if we flipped the process? Instead of using AI to write tests, we can write unit tests first and use AI to generate the implementation that satisfies them. This approach aligns with test-driven development (TDD), ensuring that our code meets predefined requirements and is robust from the start.

Walrus Operator

Walrus Operator

The walrus operator (:=) in Python, introduced in Python 3.8, is also known as the assignment expression. It returns the value as well as assigning it. This can reduce many lines of code and greatly simplifies the language.

Managing Hatch Dependencies in VS Code

Managing Hatch Dependencies in vs Code

I recently started using hatch for python projects, and even though hatch will manage and install dependencies for you (just modify the pyproject.toml file), I noticed the import statements could not find the dependencies. This has to do with how Python and Hatch create virtual environments.

Git Hooks

Git Hooks

Git hooks are scripts that Git automatically executes before or after specific events, such as committing changes or pushing to a repository. They allow you to customize and automate tasks related to these events, such as enforcing code style rules, running tests, or sending notifications. Hooks are useful for maintaining code quality and ensuring consistent workflows across a team. They can be set up in the .git/hooks directory of your repository and include both client-side and server-side hooks.

Recursion

Recursion

Definition of Recursion:

Recursion is a programming technique where a function calls itself in order to solve smaller instances of the same problem until it reaches a base case that does not require further recursion.

Safely retrieve properties using Supplier and Optional in Java

Safely Retrieve Properties Using Supplier and Optional in Java

The supplier allows you to pass something but not retrieve it right away. One use case is retrieving a property an object that could throw a null pointer exception. By not retrieving right away, but instead using a supplier, the supplier can be later executed inside a try/catch block and handle any exceptions thrown.