[Box Backup-dev] changeset [819]
Ben Summers
boxbackup-dev@fluffy.co.uk
Thu, 31 Aug 2006 13:04:24 +0100
On 31 Aug 2006, at 10:24, Martin Ebourne wrote:
> Chris Wilson <chris@qwirx.com> wrote:
>> On Windows, we cannot reuse the same recombinetemp file, because we
>> still have it open so we can't delete the old one, so we can't
>> create a
>> new one with the same name. Therefore, I added a unique part to
>> the end
>> of the filename (p). This would probably also work on other
>> platforms,
>> so I can remove the conditionality if you prefer.
>
> Yes, I would prefer please.
>
> From my point of view there is a simply scary amount of conditional
> compilation for the windows port. The problem with conditional
> compilation is that it makes development much harder on every
> platform and makes it highly likely that breakages are going to
> occur. This is because (i) large conditional compilations are
> difficult to read (ii) it is not possible to compile all the code
> on any platform. Thus as one platform makes changes the other(s)
> will break from time to time. It similarly makes testing harder.
> And some changes (such as changing the signature for a method say)
> where you could rely on the compiler to make sure you did the
> complete change will now need manual auditing instead.
>
> Having said that the priority at the moment is to get a working
> windows port merged so I'm ignoring this for now. But we should
> avoid unnecessary conditional compilation where we can and in the
> future we'll need to go back over all of this lot and rearchitect
> to reduce the conditional compilation down to a minimum. Many of
> these could be solved by better division of responsibility and
> encapsulation in the code.
I agree.
Perhaps for future work you could try and use the minimum possible
#ifdefs. For example, because you no longer have the housekeeping
process, you ifdef out everything related. However, you could have
left it all in, and just ifdefs out the code which does the actual
connection and talking, and level everything else in place. Might not
have made all that difference though.
When we come to reorganise things later, we shall use the experience
of the Win32 port to make sure it's all encapsulated nicely.
Ben