Uncategorized
-
I recently had to solve the problem below during an interview. I thought I’d write down my thought process to resolve the problem, in hopes it might be useful or provide insights to other people. The problem specification: My first thought is that the lawn is of a rectangular shape. That screams matrix (2 dimension…
-
Java exceptions are great for truly exceptional conditions (things like I/O failures), but using them for expected outcomes — “user not found”, “invalid password”, “email already taken” — is expensive and semantically wrong. Since Java 17+, sealed classes + records + pattern matching give us something very close to Rust’s Result<T, E> or Kotlin’s sealed…
-
The Typestate pattern is a very interesting design approach that encodes an object’s state within its type, allowing certain operations to be restricted based on that state. This helps catch errors at compile-time rather than runtime, improving code safety and efficiency. In Java it’s not possible to implement it fully, as Java does not provide…
-
Software transactional memory is a fantastic tool to handle concurrency, avoiding the common pitfalls of deadlocks, live locks, and lack of composability of atomic operations. It’s based on the concept of transaction from the world of databases, which is very well known in the software community. Database transactions follow the ACID principle, which stands for…
-
I have recently posted an article about how you should try to keep as much documentation of the project (if not all of it) in the git repository next to the source code, in the form of markdown and Plant UML files. I’d like today to go one step further. Here’s the fundamental issue with…
-
In my 25 years of experience as a developer, the only documentation that survives is the one in the repository, next to the source code.Anything outside the source code repository dies a slow death as soon as 2 or 3 members of the team get replaced, which happens quite often.Here’s my recommendation to tackle that:1…
-
This post was originally posted on the Toptal Blog at https://www.toptal.com/qa/7-debugging-techniques-prod . Providing production support to an application is one of the most challenging aspects of software development. Developers are assigned to the maintenance team and work on patching bugs on the application. They are, however, also available on-call in case a production outage happens,…
