Matthias Noback's Avatar

Matthias Noback

@matthiasnoback.bsky.social

https://matthiasnoback.nl Work: Freelance programmer, trainer, writer, public speaker, consultant Topics: object-oriented and Domain-Driven Design, architecture, refactoring, Test-Driven Development, pair/mob programming Languages: PHP, Fortran

222 Followers  |  114 Following  |  32 Posts  |  Joined: 19.11.2024  |  1.4469

Latest posts by matthiasnoback.bsky.social on Bluesky

Preview
Fortran - Errors and error handling - Part 7 - Fatal errors Stop with error code, error message, and stack trace

New #Fortran post: "Errors and error handling - Part 7 - Fatal errors" matthiasnoback.nl/2025/07/fort...

Almost everywhere in our code should we allow errors to bubble up to higher abstraction levels, until we get to the point that we'd like to terminate the program. How to do that properly?

21.07.2025 07:19 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran - Errors and error handling - Part 6 - Guarantees The Evidence Pattern

New #Fortran post: "Errors and error handling part 6: Guarantees" matthiasnoback.nl/2025/07/fort...

If we want guarantees that data in a DT is correct, we have to use a custom constructor. Such a constructor then needs another Either return type so it can return a validated instance or an error.

18.07.2025 07:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran - Errors and error handling - Part 5 - Error propagation Error propagation and nesting

New #Fortran post: Errors and error handling part 5: Error propagation matthiasnoback.nl/2025/07/fort...

We redesign the error value so lower-level errors can be "wrapped" inside higher-level errors.

17.07.2025 06:56 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran - Errors and error handling - Part 4 - Using an Either type Dealing with parse errors

New #Fortran post: "Errors and error handling - Part 4 - Using an Either type" matthiasnoback.nl/2025/07/fort...

We consider a problem that involves parsing and find a solution to deal with errors: a parse function that returns an "Either" type, containing an error, or the expected result.

16.07.2025 06:14 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran - Errors and error handling - Part 3 - Preventing edge cases with types An alternative: the non-empty list type

New #Fortran post: Preventing edge cases with types matthiasnoback.nl/2025/07/fort...

We look at an alternative solution for calculating the average of an empty list; only offer such a procedure for a non-empty list.

15.07.2025 07:50 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran - Errors and error handling - Part 2 Optional results

New #Fortran post: "Errors & Error Handling Part 2 - Optional Results matthiasnoback.nl/2025/07/fort...

Instead of returning a success flag and use an intent(out) argument to return the actual function result, we implement an optional return value using an abstract derived type and two subtypes.

11.07.2025 07:14 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran - Errors and error handling - Part 1 - Exploration Exploring our options

New #Fortran post "Errors and error handling, part 1: Exploration": matthiasnoback.nl/2025/07/fort...

The first part in a series about dealing with errors: we explore some common approaches and what their downsides are.

10.07.2025 07:18 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran - Functional Programming Concepts - Reduce Reducing arrays to a single value

One extra #Fortran post for today: "Functional Programming Concepts - Reduce" matthiasnoback.nl/2025/06/fort...

Having discussed filter and map which transform arrays into new arrays, we still need another function: reduce, which transforms arrays into single values.

30.06.2025 12:06 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran - Functional Programming - List type Adding filter and map behavior to a list type

New #Fortran post: "Functional Programming - List Type" matthiasnoback.nl/2025/06/fort...

By introducing a list type we can bind the functional-style filter and map functions to a derived type, making it possible to "chain" multiple calls.

30.06.2025 07:35 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran - Functional Programming Concepts - Map Transforming arrays

New #Fortran post: "Fortran - Functional Programming Concepts - Map" matthiasnoback.nl/2025/06/fort...

After discussing filter functions, now it's time to work no a map function.

28.06.2025 08:47 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran - Functional programming - Closures Generic filtering

New #Fortran post: "Fortran - Functional Programming Concepts - Closures" matthiasnoback.nl/2025/06/fort...

Fortran doesn't have good support for higher-order functions and closures, can we replicate them?

27.06.2025 05:55 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran - Functional Programming Concepts - Generic Filtering Filtering arrays with other value types

New #Fortran post: "Functional Programming Concepts - Generic filtering" matthiasnoback.nl/2025/06/fort...

Fortran doesn't support generics, which would allow us to reuse the same filter function for arrays of different types of values. In this post we'll explore a work-around for this problem.

26.06.2025 07:16 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran - Functional Programming Concepts: Filter Introducing functional programming in Fortran with filtering integers

New #Fortran post: "Fortran - Functional Programming Concepts: Filter" matthiasnoback.nl/2025/06/fort...

Having looked at Object-Oriented programming concepts in Fortran, we now dive into Functional programming concepts. We start with filtering arrays of integers.

25.06.2025 10:24 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran: Enumeration, part 3 Adding more behavior and introducing enum subtypes

New #Fortran post: "Enumeration, part 3" matthiasnoback.nl/2025/06/fort...

It's surprising how much there is to explore about enumeration types, but here we are with the final part: we further improve the design by making log level an abstract type, and all the concrete levels subtypes.

20.06.2025 07:09 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran: Enumeration, part 2 Type safety, a log level factory, and operator overloading

New #Fortran post: "Enumeration, part 2" matthiasnoback.nl/2025/06/fort...

We increase type safety by narrowing the integer level argument to a derived type argument. A new factory type helps us separate responsibilities. Finally we compare levels using operator overloading.

19.06.2025 07:38 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran: Enumeration, part 1 In the post about decoration we declared log levels as follows: module logging_base ! ... integer, parameter, public :: LOG_DEBUG = 0 integer, parameter, public :: LOG_INFO = 1 integer, parameter,…

New #Fortran post: "Fortran: Enumeration, part 1" matthiasnoback.nl/2025/06/fort...

We are refactoring the integer parameters for the various log levels that we want to support. We want to accomplish type-safety and ease-of-use (pun intended).

18.06.2025 08:58 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran: Module Design Fortran projects are famous for their large modules. Actually, we may also find very large files in legacy projects written in other languages, like Java, PHP, etc. These projects sometimes have…

New #Fortran post: "Module Design" matthiasnoback.nl/2025/06/fort...

We splitt an existing module into smaller modules and put a faΓ§ade module in front of the smaller ones, so users only have to deal with a simple programming interface. Finally we fix compilation cascade with a submodule.

12.06.2025 10:23 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran: Service Composition, part 2: Decoration In the previous post we saw how to use an abstraction to compose an aggregation of services of that same abstraction. There we simply delegated a call, adding no specific behavior. But we might as…

New #Fortran post: Service Composition, part 2: Decoration matthiasnoback.nl/2025/06/fort...

In this post we explore another way of composing abstractions, which is called decoration. We prefix existing log messages with a timestamp and implement optional delegation based on a configured log level.

11.06.2025 13:53 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran: Service Composition, part 1: Aggregation With our new service abstraction logger_t we are able to easily implement more features for our logger. We can do this without affecting current user code, because their code relies only on the…

New #Fortran post "Fortran: Service Composition, part 1: Aggregation" matthiasnoback.nl/2025/06/fort...

We are ready to build more features into the logging library, using different styles of composition. First we look at aggregation.

10.06.2025 07:06 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran: Abstract Types and Deferred Procedures With the new file_logger_t type we were able to model a logger service as a derived type. Now it’s time to make the service abstract. That is, to leave out the implementation detail that it’s a file…

New #Fortran post: "Abstract Types and Deferred Procedures" matthiasnoback.nl/2025/06/fort...

We define an abstract type with deferred procedures (in OO language: an interface) for the file logger. Introducing an abstract factory allows clients to decouple and shows us how polymorphism works.

09.06.2025 08:18 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran: Modeling Services as Derived Types We’ve seen how to define a derived type to represent a point in 2D space. We were able to add a type-bound procedure to it, and finally to make its components private and define a custom constructor…

New #Fortran post: "Modeling Services as Derived Types" matthiasnoback.nl/2025/06/fort...

Derived types (DTs) can also be used for "service objects". We look at a safe refactoring from module state and subroutines to a DT with a data component and a type-bound procedure.

05.06.2025 08:04 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran: Private Data Components and Custom constructors In the previous post we have worked on the point_t derived type, turning the module procedure distance into a type-bound procedure: module geometry ! ... type :: point_t real :: x real :: y contains…

New #Fortran article: "Private Data Components and Custom Constructors" matthiasnoback.nl/2025/06/fort...

We make the data inside the derived type private (encapsulation), offer alternative ways for creating new instances (factory functions), and expose these alternatives as an abstract function.

04.06.2025 07:33 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Fortran: Type-bound Procedures In the previous post we defined a derived type point_t with real data components x and y, to represent a point in 2D space. We also wrote a function to calculate the distance between two such points:…

New #Fortran post: "Type-bound Procedures" matthiasnoback.nl/2025/06/fort... These are the equivalent of class methods, but can surprisingly still be used as regular functions.

03.06.2025 08:39 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Fortran: Derived Types We’ve seen types and variables and functions and subroutines. Now we can get to the next level and combine both variables and procedures in a so-called derived type. Declaring a derived type and its…

New #Fortran post: "Derived Types" matthiasnoback.nl/2025/06/fort... These are similar to structs or classes in other languages.

02.06.2025 07:06 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Fortran: Functions and Subroutines This post is part of a series that helps you get started with Fortran if you already have some experience programming in another language. The series isn’t supposed to be a full introduction to Fortra...

New #Fortran post: "Functions and Subroutines" matthiasnoback.nl/2025/05/fort...

31.05.2025 15:07 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Fortran: Types and Variables Declaration comes first In Fortran, every time we want to store some value in a variable, we have to explicitly declare the type and the name of the variable first. This has to happen before any other...

New #Fortran post: "Types and variables" matthiasnoback.nl/2025/05/fort...

29.05.2025 14:05 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Fortran: Programs and modules Using IFX, FPM and VS Code

Next #Fortran post: "Programs and modules" matthiasnoback.nl/2025/05/fort... It looks like this is starting to be a Fortran course for people with experience writing in other programming languages...

26.05.2025 11:34 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Running a simple Fortran program Using IFX, FPM and VS Code

Second #Fortran post: "Running a simple Fortran program" matthiasnoback.nl/2025/05/runn... Using very modern tooling :)

23.05.2025 14:04 β€” πŸ‘ 4    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

Thanks!

21.05.2025 13:56 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Hello, Fortran world! program hello_world implicit none(type, external) print *, 'Hello, world!' end program hello_world Since January 2024 I’m working with a smart group of programmers at Deltares. They create and maintai...

It's been a while, but I'm back to blogging: "Hello, Fortran world!" matthiasnoback.nl/2025/05/hell...

20.05.2025 12:59 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

@matthiasnoback is following 20 prominent accounts