Category: Code
-
Lessons on software complexity from MS Office
I learned a lot of things from Complexity and Strategy by Terry Crowley: In Fred Brooksâ terms, this was essential complexity, not accidental complexity. Features interactâââintentionallyâââand that makes the cost of implementing the N+1 feature closer to N than 1. In other words, the ability to change a product is directly proportional to the size […]
-
Type tinkering
I’m playing with typeful language stuff. Having only done a pinch of Haskell, Scala, and Go tinkering amidst Ruby work over the past ten years, it’s jarring. But, things are much better than they were before I started with Ruby. Elm in particular is like working with a teammate who is helpful but far more detail […]
-
Universes from which to source test names
A silly bit of friction in writing good tests is coming up with consistent, distinctive names for the models or object you may create. Libraries that generate fake names, like Faker, are fun for this, but they don’t produce consistent results. Thus I end up thinking too hard. Instead, I like to use names from […]
-
You should practice preparatory refactoring
When your project reaches midlife and tasks start taking noticeably longer, that’s the time to refactor. Not to radically decouple your software or erect onerous boundaries. Refactor to prepare the code for the next feature you’re going to build. Ron Jeffries, Refactoring — Not on the backlog! Simples! We take the next feature that we […]
-
Let’s not refer to Ruby classes by string
I am basically OK with the tradeoffs involved in using autoloading in Rails. I do, however, rankle a little bit at this bit of advice in the Rails guide to developing engines. In short, when configuring an engine from an initializer, youâre supposed to protect references to autoloaded application classes (e.g. models) by encoding them […]
-
Your product manager could save your day
I thought the feature I’m working on was sunk. An API we integrate with is, let us say kindly, Very Much Not Great. Other vendors provide an API where we can request All The Things and retrieve it page by page. This API was not nearly so great, barely documented, and the example query to […]
-
The occurrence and challenge of ActiveRecord lookup tables
Iâve noticed lots of Rails apps end up with database-backed lookup tables. Particularly in systems with some kind of customer or subscription management, itâs almost guaranteed that User or Customer models belong_to SubscriptionLevel or Plan models. Thus, you frequently need to query both models. If youâre looking for avoidable database work, as I sometimes have, […]
-
The right way and the practical way
Brent Simmons, Reason Number 33,483 to Hate Programming: Or I could have the superclass expose the appIsTerminating property in its header file, so that the subclass could see it. This also sucks, because a controller class has no business exposing its own copy of global application state. In the end, though, thatâs what I did. (Along […]
-
Framework and Library people
By unscientific survey, I think many developers would prefer to work in a “framework world” where many decisions of principle and organization are passed down by a vendor or architecture team. Think Rails/Django/Laravel for backends, Ember/Elm for frontends, Unity for games. These are the Framework people. Fewer developers would prefer to create their own world, building […]
-
Empathy Required
Nearly fourteen years ago, I graduated college and found my first full-time, non-apprentice-y job writing code. When I wrote code, these were the sorts of things I worried about: Where is the code I should change? Is this the right change? What are the database tables I need to manipulate? Who should I talk to before I […]