Shopify's Ruby on Rails app statistics

Shopify published amazing/epic stats for their Ruby on Rails “app”:

  • 860k LoC
  • 1:1.3 code–test ratio
  • 2300 model classes
  • most classes <10 methods
  • most methods way <10 lines

Makes you wonder:

  • can you live with more types?
  • can you shrink down existing types?

Swift changed the game a bit. Now it’s very convenient to create a new type. You don’t need to do the .h/.m file dance anymore but can start a new type declaration wherever you are. (Except when you’re inside a generic type.) That makes it more likely we devs stop to shy away from smaller types.

But it’s still a job for our community’s culture to unlearn coding huge classes (massive view controller syndrome, anyone?) and splitting stuff.

Ruby has a long tradition of super-focused methods and very small classes. Swift is just as terse and powerful in that regard. Now it’s your turn to experiment with writing types for very simple tasks. Like the Extract Parameter Object refactoring, where you lift things that go together into a new type.

Can be as easy as writing:

struct DateRange {
    let start: Date
    let end: Date
}

Et voilà, there you have a new explicit concept in your code base.

App Sales and Hourly Earnings Calculated

Interested in some data about app sales? I wrote a Ruby script which parsed my worklog files for timestamps, calculate the difference, add it up and then return in a human-readable form the amount of time it took to develop Calendar Paste. So I logged about 115 hours of active development time, planning, tinkering with the website and whatnot—and I definitely spent more hours on this project before I began logging my progress.

Continue reading …