Hello friends,
I’m currently working on several Harbour/web projects (microservices, DBF tools, HTML engines) and I’ve been experimenting again with a more procedural, preprocessor-driven approach – intentionally without classes or OOP hierarchies.
The starting question is:
Do we really need OOP in the xBase/Harbour world – or is a modular preprocessor approach with global state actually more suitable?
My setup uses:
global module-level state variables (e.g. G_CONFIG, G_DB, G_FORM)
a preprocessor/patcher (similar to a “Harbourino” concept) that injects blocks such as -> HEADER, -> TABLE, -> FOOTER directly into the source code
modules that behave like composable building blocks, similar to modern web frameworks (Svelte, Astro, Go templates)
Observed advantages
far less overhead compared to OOP
debugging is easier because the real source code remains visible
modular structure via blocks rather than classes
very low complexity
extremely well suited for DBF/microservice workflows
clean and transparent for web-oriented template logic
Possible drawbacks
global state requires naming discipline
in larger projects things can become harder to track
dependencies may become “implicit” instead of explicit
no classic encapsulation model like in OOP
My question to you:
How do you see this in the Harbour ecosystem?
Are we using OOP simply because it “sounds modern”, even though most xBase-style applications (DBF, web templates, microservices, tools) are inherently data-driven and procedural?
Or are there concrete situations where OOP in Harbour is truly indispensable?
I’d appreciate any insights — especially practical examples where OOP shines or where a procedural + preprocessor approach turns out to be more elegant.
Best regards, Otto