programming

A collection of 35 posts

Apr 12, 2018

Debug implementation

Debug implementation

In Rust, Debug is a trait that allows us to inspect the state of a struct by printing the struct to std out or, you know, whatever. Usually, we just derive debug implementations, but there are cases when that's not possible or even desirable. Here's a real world example.

Apr 10, 2018

Honestly, what am I doing?

Sometimes, I'm not sure why I write about software. Specifically, I'm not sure why I write about Rust. The community built up around the language views me as basically the root of all

Apr 5, 2018

I object!

I object!

The compiler often doesn't see the difference between imperative and object-oriented code, so try not to feel too bad about which one you write.

Apr 3, 2018

When does dynamic vs. static dispatch matter?

When does dynamic vs. static dispatch matter?

Rust allows the programmer to choose between static and dynamic dispatch pretty much on a case by case basis. In real world terms, the performance difference between the two is practically invisible; a branch is a branch is a branch. When should we choose one over the other and why?

Apr 2, 2018

Programming Challenge: Dictionary Compression

Programming Challenge: Dictionary Compression

Once upon a time, computers were slow and disks were small. Every kilobyte—nay, every byte!—was precious, and a thing to be hoarded and safeguarded against the awful ravages of time and bloat. In those days, a great many stupid things were done in the name of efficiency. Here is one.

Mar 27, 2018

Why does Euler 10 take forever?

Why does Euler 10 take forever?

Let's take a deeper look at the latest challenge with an eye toward why, exactly, it may be challenging for newer programmers. Hold onto your hat; this is a long one!

Mar 23, 2018

Programming Challenge: Euler #10

Programming Challenge: Euler #10

Everyone's done this one. I mean, well, most people have. But today I read a post by a guy who just finished this for the first time (and congratulations, by the way!), and he said his implementation took six hours to run.

Feb 28, 2018

CA2000: WELCOME TO HELL

CA2000: WELCOME TO HELL

"CA2000: Dispose objects before losing scope" sounds like good advice. Your dad might say that before you head off to college, or maybe you heard it from a Jedi master. Too bad this advice is bullshit.

Feb 23, 2018

Programming Challenge: Swap Usage

Programming Challenge: Swap Usage

How much more RAM does your system need? We all know the only correct answer to this question is "all of it," but let's curtail our goals for a moment and think about how much we can actually use.

Feb 16, 2018

Internal vs. external iteration

Internal vs. external iteration

When a colleague attempted to explain to me the benefits of internal iteration, I genuinely did not understand why he thought it was such a big deal. Now that I get it, kind of, I'm going to explain it to you.