Here’s a small experiment inspired by literate programming, future languages that aren’t plain text, and the occasional need for the same thing to be implemented in different languages. The idea is that code could can as an outline in a rich text editor and then be converted step by step into code. In the first step is psuedocode that reads well, at least to me, and at the end are working examples in JavaScript and Python.

Step 1

  • for each number n from 1 to 100, inclusive
    • let s be an empty string
    • if n is evenly divisible by 3, append “Fizz” to s
    • if n is evenly divisible by 5, append “Buzz” to s
    • if s is empty, print n
    • if s is not empty, print s

Step 2 (JavaScript)

  • for (let n=1; n <= 100; n++)
    • let s = ”
    • if (n % 3 == 0) s += ‘Fizz’
    • if (n % 5 == 0) s += ‘Buzz’
    • if (s == ”) console.log(n)
    • if (s != ”) console.log(s)

Step 2 (Python)

  • for n in range(1, 101)
    • s = ”
    • if n % 3 == 0
      • s += ‘Fizz’
    • if n % 5 == 0
      • s += ‘Buzz’
    • if s == ”
      • print(n)
    • if s != ”
      • print(s)

Step 3 (JavaScript)

for (let n = 1; n <= 100; n++) {
  let s = ''
  if (n % 3 == 0) s += 'Fizz'
  if (n % 5 == 0) s += 'Buzz'
  if (s == '') console.log(n)
  if (s != '') console.log(s)
}

Step 3 (Python)

for n in range(1, 101):
    s = ''
    if n % 3 == 0:
        s += 'Fizz'
    if n % 5 == 0:
        s += 'Buzz'
    if s == '':
        print(n)
    if s != '':
        print(s)

A poorly estimated programming task doesn’t just take longer than the estimated time. It also tends to takes longer than it would have taken if it were properly estimated, and is much more likely to not get done properly or to not get done at all.

I’m setting three resolutions for the next year:

  1. Go for a 10 mile run each month
  2. Study Spanish for at least 10 hours each month
  3. Run my first triathlon

Each of these are things that I think are very achievable, and likely not to be achieved if I don’t resolve to do them. They also don’t take up so much time and effort that they prevent me from coming up with new goals during the year.

Perfectionism is stifling.

A perfectionist should look for good strategies to get work done despite their perfectionism.

Some strategies, such as trying to fake being a non-perfectionist, are not good ones.

Under this strategy, the perfectionist works against their advantages, while making a pathetic attempt at denying their true nature.

In the past, DigitalOcean had a big security issue, and I told people that I don’t recommend using them. They responded to the issue pretty well, but I felt that the issue they had should not have happened in the first place.

Some time has passed since then without any major issues, and they hired an all-star systems administrator. Recently I was working on a project using AWS, and in my search for information, I came across some useful tutorial pages on their site. Because of this, when the time came to switch hosts for my personal site, I started using DigitalOcean and have had a great experience. I can heartily recommend them now.

Of course, they may still have major security issues, but I expect that they’ll have better than average security going forward.

Encoding to binary:

'hello'.replace(/./g, function(c) {
function pad(n) { return (n &gt; 0) ? ('0' + pad(n - 1)) : ''; }
var s = c.charCodeAt(0).toString(2);
return pad(8 - s.length) + s;
});

Decoding binary to a string:

'011101110110111101110111'.replace(/.{8}/g, function(s) {
return String.fromCharCode(parseInt(s, 2));
});