Friday, August 05, 2005

Backwards programming

I noticed an interesting manner I am programming right now. I am programming and testing all the error cases before
even attempting to perform one successful variant. This is a little backwards from what I usually have done and also
backwards from what I've seen other programmers do. It's kind of nice however since when the successful tests work then
the work is completed rather than having all the boring test cases still to work on.

Also when working in adapting code others written (or yourself where some time has passed) this works since you check
that your assumptions were correct and that the code fails where you expect it to fail and not before that and not passing
the expected failures. Thus one is always in full control.

Thursday, August 04, 2005

Great idea on Partition Management

I sat down thinking about what ways to manage your partitions in a partitioned table.
To be able to add and drop partitions in various ways for the various types of partitions
are more or less obvious. But there are a great number of other changes desirable like
merging partitions, splitting partitions, changing ranges of partitions and so forth. So
either one could define a whole battery of special commands for every special situation
(and naturally write code for each and every one of them as well).

So I found a solution where one defines the set of partitions to reorganise and then defines
the partitions to reorganise them into. This single method can be specialised to merge
partitions, split partitions, change range conditions, change list of values for partitions and
so forth.