Dec 23, 2014 - 4 minute read - programming science

Programming Done Right Follows The Scientific Method

AKA Good Programmers Are Doing Real Science There are a bunch of long-ish winded definitions of the scientific method, but I think a reasonable pithy description would be: Come up with a theory to explain an existing phenomena. Use that theory to come up with a falsifiable prediction. Conduct experiments to prove or disprove the truth of the prediction. Independent parties repeat #3 and reproduce the results. Now if the experiments at step three or four disprove the truth of the prediction, one of a few things can happen:

Dec 22, 2014 - 3 minute read - programming refactoring

Refactoring Serial Calls To Leaf Calls

When dealing with the problem of a long method, the simplest thing you can usually do is to break it into it’s conceptual pieces and have a series of tail called functions that call the next chunk of the computation.

So given this:

private Thing methodThatIsTooLong(TypeThing arg1, OtherType arg2) {
   // chunk1
   // chunk2
   // ....
   // chunkN

You get:

Nov 5, 2014 - 2 minute read - programming abstraction conceptual load DRY

A Source Of Over-Abstraction - Or DRY Isn't Free

In The Cult Of Abstraction I railed against the over-use of abstraction. Here, I want to talk about a particular source cause of over-abstraction I have seen (and been guilty of). Recently, while working with another team here at Spotify, I was working through some of their test code using the Helios Testing Framework, and the harness used a surprisingly complicated tree of classes to set up the various containers it used.

Sep 26, 2014 - 3 minute read - agile scrum gtd process

Doing Agile Wrong

While I’m often at odds with software frameworks (libraries are to be preferred over frameworks, generally), I’ve found that process frameworks can be very good indeed, when done right. Implementors of agile methodologies ironically can fall into the trap of doing it wrong. Why ironic? Well let’s look at the agile manifesto from the agile manifesto website: Individuals and interactions over processes and tools Working software over comprehensive documentation Customer collaboration over contract negotiation Responding to change over following a plan What I’ve heard is that in many companies they prescribe: “We do agile this way”, which breaks the first statement of agile.

Aug 2, 2014 - 2 minute read - productivity shorthand gregg

Gregg Shorthand Resources

I’ve known handywrite shorthand for a number of years, and finally decided that I should learn shorthand proper, ideally with the best bang/buck ratio, as well as minimal amount of initial learning, with being able to ramp up the amount I learn later, as time permits. I settled on Gregg shorthand, Anniversary Edition. In hunting the net in the hopes of learning Gregg, I’ve found a bunch of PDFs that I’ve found helpful.

Jul 24, 2014 - 4 minute read - kanban organization arc-m postit levenger circa rollabind GTD productivity agile agile organizer

The Agile Organizer, Part 3 - Retrospectives

(see here for the full Agile Organizer series) Retrospectives If you do Agile, it’s probable that you do something called a retrospective. At least in the ones I’ve been involved with, there’s usually a part where we go over what’s going well, and what could be changed. With the agile organizer, I’ve found that periodically doing retrospectives about the way I am using it is useful and worthwhile. If you use it, I hope you would too.

May 31, 2014 - 4 minute read - kanban organization arc-m postit levenger circa rollabind GTD productivity agile agile organizer

The Agile Organizer, Part 2

(see here for the full Agile Organizer series) In The Agile Organizer, I described the basics my organization system. In this second part, I go into some ways that I use it that weren’t covered in the first post. The Dumping Ground Sometimes, when I’m working on an idea, I just want to get the bits down, but don’t want to think, necessarily, about how they fit just yet. In such a case, I’ll have a page where I just stick the stickies to a page wherever they’ll fit, with the idea that I’ll come back to it later to sort it all out.

May 26, 2014 - 1 minute read - Java 8 functional programming

Quicksort And Java 8

In looking at functional languages, I’ve often been impressed with the clarity of implementations of Quicksort. Now that Java 8 includes lambdas, we can now do one that, while not as nice as an implementation in, say Haskell, is still quite nice. While I wouldn’t use the below code in production, as it’s choice of pivot point is naive and would go kaboom on a large sorted list from stack exhaustion, it is a nice illustration of the utility and clarity that Java 8’s lambdas when mixed with Guava functional stuff give.

Apr 26, 2014 - 5 minute read - programming lisp macros

Fun With Lisp Macros

As far as programming languages go, my truly favorite language is a Lisp. Scheme or Common Lisp are fine. I have a few hesitations about Clojure (the way it does recursion is offputting to me, but perhaps a few macros might clean it up), but for what I’ve done with it when working with Riemann, it’s been a pleasure, even if it’s slow going because I don’t do it frequently enough to have the needed bits already in my head.

In one of my previous posts, I wrote about how I’d written the website software for a website I maintain in Common Lisp. There were a few macros I wrote while building it that I thought were potentially useful and illustrative of the kinds of things you can do with macros that make Lisps cool.

In this post (there may be others later), I’ll be talking about a macro I wrote to deal with database queries. When dealing with database queries, making sure that you write/generate the queries properly with respect to escaping and bind variables, and connection caching, etc. can be a real pain, and I’m not a big fan of ORMs as they never really do what I want.

Apr 14, 2014 - 5 minute read - programming refactoring flow control

Refactoring Flow Control And Conditionals

In the course of reading various design patterns and refactoring books (like Refactoring), I noticed while flow control is sorta mentioned here and there, it’s not addressed especially well. It mostly encourages things like replacing conditional with polymorphism and replace nested conditional with guard clauses and the like, rather than finding ways to straighten out and clarify code that contains flow control and conditionals. One of my thoughts on flow control and conditionals follows one of the rules of the Zen of Python:

Apr 10, 2014 - 4 minute read - programming refactoring abstraction conceptual-load

The Cult Of Abstraction

Given that people can get really touchy on the subject, let me state this up front: I’m not saying we should tolerate lousy code. Over the course of my career, I’ve seen something that I will call “the cult of abstraction.” On the surface, this sounds like a good thing, until you need to debug their code. While on the surface, it’s all nice and pretty, and uses classic design patterns, when you actually want to find out what it does, you discover that:

Mar 26, 2014 - 11 minute read - kanban organization arc-m postit levenger circa rollabind GTD productivity agile agile organizer

The Agile Organizer

(see here for the full Agile Organizer series) For a long time, I’ve tried a multitude of personal organization systems, from the normal calendars, to online calendars, to Evernote, org-mode, and so on and nothing has ever truly worked for me. The main reason is that I’ve got a few main needs: Capture - if it never makes it in, it’s gone Ideation - have to be able to brainstorm with it Reference - for things I need frequently enough, but not so much that I keep it in my head Planning - what am I doing?