Skip to content
Home » best practice

best practice

Creating random names for test data

A Notes/Domino application that hasn’t been tested with a large random data set may develop poor performance as it accumulates more data — long after the development team has moved on to other things.

NotesStream performance

Lars Berntrop-Bos posted a comment concerning the LotusScript NotesStream class and his practice of reading as large a block as he possibly could to optimize performance. I decided to run a test to see how much difference that made. The results are as follows: Block size (bytes) Runtime to read a large file (seconds) 512 10.30 1024 5.09 2048 2.75 4096 1.49 8192 0.86 16384 0.52 32768 0.35 65536 0.26 Each of these cases is doing the same amount of work — reading every byte in the same large binary file. The effect of increasing the block size is dramatic — the largest possible block size was 40 times faster than a 512-byte block. 216 bytes is the upper limit of the NotesStream.Read method, because that’s the maximum number of elements in the array datatype… Read More »NotesStream performance

Can you please translate?

Ok, it’s my blog so I get to vent. Here is a fact: 80% of text fields on Notes forms would be improved with an input translation formula. This is the best formula for most cases: @Trim(@ReplaceSubstring(@ThisValue; @Char(9):@Newline; ” “)) Rarely do we really want to allow tabs, leading or trailing spaces in a text field. Sometimes newlines, but the formula is easily adjusted to allow that. Of the remaining 20% many are identifiers that shouldn’t contain any whitespace. @ReplaceSubstring(@ThisValue; @Char(9):@Newline:” “; “”) I’m working on a tool called The Developer’s Friend that contains, among other things, some database design reports and fixup tools. I think I’ll add one to list the input translations for all fields so you can easily scan down the list and find ones that need something more than the nothing… Read More »Can you please translate?

The forgotten logical operators

Here’s something I notice in a lot of other people’s code I look at, which has always bothered me. This isn’t language-specific — I see it everywhere. Programmers create logical expressions with the boolean operators And, Or, and Not. It seems to require a sort of sideways view of things to apply the additional operators that work with boolean values, Eqv and Xor (or to use their non-bitwise counterparts which more people might recognize offhand, = and != (<> in LotusScript). This neglect often results in inefficient and hard-to-read logical expressions. For instance, suppose the code needs to test the assertion: “Either a and b are both 0, or neither is 0.” I often see such a test written as: If (a = 0 And b = 0) Or (a <> 0 And b <>… Read More »The forgotten logical operators