[Omake] SVN Commit: OMake Build System (Rev. 10534)

Aleksey Nogin nogin at metaprl.org
Fri Apr 27 15:29:36 PDT 2007


On 27.04.2007 14:14, Jason Hickey wrote:

> Aleksey,
> 
> Please explain to me.
>    - Why do you take record patterns and turn them into projections?

I find the usage of record patterns in place of projections highly 
unpleasant for many reasons, including:

  - It introduces a large number of extra variables that make the code 
harder to understand (one needs to track which variable names stand for 
what). Not only that, if a function is sufficiently long, the variable 
definition end up being very far from where it is used, making figuring 
things out even harder.

  - It makes it harder to see where/how a certain record field is used.

  - It can easily result in dead code/unused variables, where the usage 
is deleted, but the pattern entry still remains (and this dead code 
would, again, make things harder to read).

>    - Why do you want to use Unix.readdir directly when it is more 
> complicated?

Because the common case is that the very first entry would be enough. No 
need to read the whole directory. The amount of code is about the same, 
I would not necessarily consider that more complicated.

>    - *Never* use wildcard exception patterns unless absolutely necessary!
>    - Do you really intend to catch Stack_overflow and Out_of_memory 
> exceptions?

In this particular case, it does not seem that unreasonable. Well, 
whatever, I changed those to explicit patterns like "Unix.Unix_error _ | 
Not_found | End_of_file".

>    - *Never* open the Unix module!

Why not? I opened Unix.LargeFile within a short FileCase module, where 
all that it does is Unix calls.

Aleksey


More information about the OMake-Devel mailing list