Sopwith Software Tales

Personal stories with a focus on bug hunting and coincidences, mostly from the 1980’s on, porting between Mac Classic and Windows in the early days of OO frameworks.

Member-only story

A spooky win in the braces war

Andy Dent
4 min readNov 21, 2024

--

There are many debates in programming style, outright religious wars over style of how to layout your code.

If you’re not a programmer, glad to see you here reading some stories from our world and yes, code really does look as weird as you’ve seen on TV and in the movies.

/**
Used to load a related selection.
Mainly called from dbTable::ensureRecordLoaded and dbTable::MakeTableValid.

It may seem a little backwards but think of the normal context of using this method.
We have already loaded a current record in the LHS of a relationship and now want the related
record or selection. Remember that OOFILE allows you to iterate a table without forcing
instantiation of relationships. Only when you refer to a related selection or specific
fields in a related record is the relationship instantiated.

There are three distinct cases dealt with by this method:
-# an M:N relationship, which is implemented by our member mMNlink.
-# a 1:1, 1:N or N:1 join relationship which is handled by
OOF_simpleRecordBackend::loadRelatedContextJoiningFromTo (normally via a search)
-# a 1:1, 1:N or N:1 pointer relationship using record OID's in a search or direct lookup

If mInverseField (ie: other side of relationship pointing to us) isRef() then
it contains a copy of the OID of a record in our table and we have a direct lookup (not
caring if this is 1:1 or N:1 situation).

Otherwise it is 1:N…

--

--

Sopwith Software Tales
Sopwith Software Tales

Published in Sopwith Software Tales

Personal stories with a focus on bug hunting and coincidences, mostly from the 1980’s on, porting between Mac Classic and Windows in the early days of OO frameworks.

Andy Dent
Andy Dent

Written by Andy Dent

Touchgram interactive messaging Founder looking for art, sound & advertising partners. GrandDad. Developer, designer & Martial artist 40+yrs. Australian born UK