Wesner Moise

Coding

Early years

My first experience with computer programming was in fifth grade when I wrote programs in BASIC in school for the Commodore PET 3016. I also worked on TRS-80s and Apple II. I was familiar with the concept of computers after owning an Atari 2600 video game console in 1977. The games that I wrote quickly became popular across the schools and students would use their computer practice period to play my games instead of programming.

My first home computer was a Commodore 64, followed by a Commodore 128. I subscribed to a number of computer magazines (like Dr. Dobbs, Byte, Compute!, COMPUTE!’s Gazette, and RUN) and copied programs manually from the articles. I became familiar with the feature sets of different computer models.

Commodore BASIC was minimalist in its feature set with most features requiring direct memory manipulation with PEEKs, POKEs, and SYS.

Some programs in the magazine were written in machine language, which were a hundred times faster than interpreted BASIC. I quickly learned 6510 assembly language. At first, I had to design my code in assembly language and then translate the opcodes to 6510. I wrote an assembler and disassembler to automate the process. I decompiled both the BASIC and KERNAL(sic) ROMs to gain a complete understanding of how the computer work. Debugging was painstakingly difficult because any bug would cause the computer to HANG and it would be necessary to hit CTRL-RESTORE. The Commodore 128 introduced a monitor program similar to WinDebug including an assembler, disassembler, and memory dump.

Over the next seven years, I wrote a number of assembly language programs. I wrote games that used hardware features with sound, sprites, smooth scrolling, custom character sets. I wrote interrupt handlers that bypassed hardware limitations by changing hardware registers in the middle of a screen render; this enabled split screens and more than eight sprites. I developed code to draw bitmapped graphics primitives like lines, ellipses, polygons, proportional styled text, and paint fills. I extended BASIC and wrote new programming languages. I developed a text editor and developed a natural-language processor.

I think that I am a good software programmer. I have implemented most well-known algorithms. My replacements for library functions tend to outperform the system library by a factor of ten in runtime and memory usage. I have come up with a simplification of classic data structures. For example, red black trees can be dramatically simplified by using height information instead of colors and moving the balancing logic to the constructor, so that no operation needs to think about rebalancing the tree after a modification. This enables redblack trees more widely outside the typical application of key-value maps. Another example is a functional set data structure, in which I attempted to make every set operation sublinear. I have built 15 years ago, a segment tree data structure that takes less memory than standard implementations while allowing dynamic insertions that move ranges; this was before I was even aware of the segment trees. I care a lot about performance in software programs. I typically avoid quadratic algorithms, because performance degrades very quickly with small number. I care about UI latency and try to move all activities to separate threads.

I tend to know language details because I will review the specification closely and build a parser for that language. My Excel development manager said that he looked at my code and saw what appeared to be incorrect syntax and found that it compiled and worked. The feature in question was bitfields.

*Lastly, I leave with this one interesting fact: In a Feb 2016 Ted talk, Linus Torvald pointed to code as an example of good taste. It was a way of using double pointers to cleanly delete an item from a linked list. He possibly indirectly used code that I published in a 2003 blog post about my Microsoft Excel interview in which I wowed the interviewer by using this technique. I invented the double pointer technique and used it for over a decade before I published it, and I have never seen it used elsewhere. I included the original blog post in a separate file because my C# blog is no longer active. (https://www.ted.com/talks/linus_torvalds_the_mind_behind_linux#14:38)

  • Develops fast, if I don’t wear myself out
  • Been programming since age of 10 in assembly
  • Wrote 10X as much code as average Excel dev in Excel 97