Atoms from Bits: Programming OpenSCAD for Laser Cutting

International Nodebots Day 2015 is July 25. I’m helping with an event in Ann Arbor and we needed over 40 robot kits for people to play with. What better time to learn how to use a new CAD package?

OpenSCAD is a great introduction to CAD for programmers that’s fun to use and easy to learn. It’s definitely not a replacement for a commercial CAD system such as Inventor or SOLIDWORKS, but I was able to create fully parametric wheel designs much quicker and easier than if I tried to use a 2D drawing program. Read more on Atoms from Bits: Programming OpenSCAD for Laser Cutting…

OpenCL for Your “Embarrassingly Parallelizable” Code

Spin had a great blog post a few days ago on Mean Shift Clustering. It’s a powerful algorithm with a ton of applications, but an Achille’s heel:

The most glaring disadvantage is its slowness. …it can take a long time to execute. The one silver lining is that, while it is slow, it is also embarrassingly parallelizable.

Read more on OpenCL for Your “Embarrassingly Parallelizable” Code…

Working with Text at the Command Line – Tools for Searching & Editing

I spend more time working with text than anything else. The multi-monitor, high-resolution graphics revolution hasn’t brought me graphics, just dozens of windows full of text. If you’re a software developer, chances are you are swimming in text too. Source code, documentation, configuration files, templates, logs–they are all searchable text. For special purpose tasks, like searching Java classes, I rely on my IDE, but for many things I run a command in a terminal. Read more on Working with Text at the Command Line – Tools for Searching & Editing…

Minimum Viable Product: Pick Any Two

As the minimum viable product idea becomes mainstream, I’m starting to hear “MVP” used to justify any minimal effort. It’s great that people want to benefit from being lean and agile, but it’s also absolutely vital that an MVP answers your important questions. There are many kinds of MVPs and most of them are anything but minimal effort. Thinking of an MVP as minimal effort risks wasting the effort completely.

Finding the Sweet Spot

In software we often balance competing goals. I’m going to deconstruct the MVP as tension between three different kinds of questions. Thinking this way helps you prioritize what you want out of your MVPs. It’s more useful than trying to find the sweet spot on a Venn diagram of potential products. Read more on Minimum Viable Product: Pick Any Two…

More Typing, Less Testing: TDD with Static Types, Part 2

In part 1 of this post I claimed it’s easy to test-drive our way into a poor design. We looked at some techniques for using types with TDD, but the examples were simple. Today I’ll walk through Kent Beck’s Money example showing where the design fails and how it can be improved with types. Read more on More Typing, Less Testing: TDD with Static Types, Part 2…

More Typing, Less Testing: TDD with Static Types, Part 1

I learned test-driven development from Kent Beck’s book Test-Driven Development By Example. It’s an excellent introduction that whets the appetite for one of my other favorites, Growing Object-Oriented Software, Guided by Tests by Steve Freeman and Nat Pryce.

Both of these books have a blind spot, though: they are completely silent about how modern static type systems might augment or even replace tests. After reading these books, it’s easy to think that “typing” mainly has something to do with keyboards. Read more on More Typing, Less Testing: TDD with Static Types, Part 1…

Visualizing Garbage Collection Algorithms

Most developers take automatic garbage collection for granted. It’s just another amazing feature provided by our language run-times to make our jobs easier.

But if you try to peek inside a modern garbage collector, it’s very difficult to see how they actually work. There are thousands of implementation details that will confuse you unless you already have a good understanding of what it’s trying to do and how they can go fantastically wrong.

I’ve built a toy with five different garbage collection algorithms. Small animations were created from the run-time behavior. You can find larger animations and the code to create them at It surprised me how much a simple animation reveals about these important algorithms.

Cleanup At The End: aka No GC

The simplest possible way of cleaning up garbage is to just wait until a task is done and dispose of everything at once. This is a surprisingly useful technique, especially if you have a way of breaking up a task into pieces. The Apache web server, for example, creates a small pool of memory per request and throws the entire pool away when the request completes.

The small animation to the right represents a running program. The entire image represents the program’s memory. Memory starts out colored black, which means it isn’t used. Areas that flash bright green or yellow are memory reads or writes. The color decays over time so you can see how memory was used, but also see current activity. If you watch carefully, you can see patterns emerge where the program begins to ignore some memory. Those areas have become garbage — they are not used and not reachable by the program. Everything else that isn’t garbage is “live”. Read more on Visualizing Garbage Collection Algorithms…

Customizing IntelliJ for Emacs Compatibility

Atomic Object has a great tradition of making and customizing tools. It’s a habit I’ve gained and lost several times over my career — keeping tools sharp requires time and effort. Fortunately, one of the best things about becoming an Atom is that all of my colleagues care deeply about software, so it’s easy to find inspiration to start making tools again.

Read more on Customizing IntelliJ for Emacs Compatibility…