Functional programming

Cleaning up legacy mess by functional composition

In my experience Vb6 is used mostly as a procedural language, with objects used without the author knowing it's actual objects (like the auto instantiating of forms.) In a lot of cases you'll inherit (no sane person would start a new greenfield Vb6 project, right?) a collection of subs and functions that are mostly global.
You'll find that after a while common functionality got called from several different places, and the original author found that something needed to be done slightly different for the latest use case.


Bending Vb6 in the functional direction

Update:Code available and developed further on GitHub

A substantial amount of my day to day work is spent maintaining a legacy VB6 codebase.
Unfortunately I also create new features for our users on slightly less ancient platforms.

This has the unwanted side effect that back in the land of VB6 i miss some of the language features from the newer platforms.

The feature I miss the most is probably an efficient way of working with collections.
In C# there's linq, in most functional languages there are som variant of map/reduce functionality.

In VB6 you have loops.


Subscribe to RSS - Functional programming