Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Wednesday, September 23, 2015

Socio-Technical Systems and the STAQ Development Manual (Redacted)

I recently wrote a development manual for STAQ (embedded below). It represents our current thinking about the best way to build enterprise SaaS software in 2015 - using a variety of techniques from several disciplines. Since I wrote this I have also become very interested in resilience engineering and the notion that web developers are primarily engaged in the construction of socio-technical systems. When I rewrite this I plan to talk about how we should try to minimize mean-time-to-recover (MTTR) instead of mean-time-between-failures (MTBF), and how continuous deployment grows a safety culture around your operations.

I redacted most of the examples that illustrate these points because they use sensitive code examples or URLs. If you want to see the rest of slides, join us!

Side note: I tweeted that "all programmers are self-taught" which was greeted by some skepticism. When I learned about socio-technical systems I thought it was a pretty good distillation of what I meant; you can go to school to learn how to write algorithms, but as far as I know, nobody is teaching classes in writing software that comprises "an interlinked, systems based mixture of people, technology and their environment."


Saturday, November 1, 2014

Notes from DC CTO summit

I really enjoyed the recent DC CTO summit. The talks were informative and there were so many of Baltimore-based CTOs that it also functioned as a Baltimore tech leadership networking event!

Here are some quick notes I took on things I want to tell my Staq colleagues about. There was a lot of other good stuff; this is me focusing on the things that apply to our company at this moment in history.
  • Joshua Szmajda showed off a really impressive use of a whiteboard for kanban. I think informal, analogue-based systems like this could make a huge difference in our team's ability to self-manage, just from being able to better visualize what projects are in progress and when they get stalled.
  • Joshua cited the kanban book Lean from the Trenches which sounds good. An audience member recommended kanbanery.com for an online version of the whiteboard.
  • Quote: "Working software is the only metric"
  • A speaker cited unpublished but credible-sounding research showing that around the world, some software teams can complete the same project 50 times faster than others. 
    • Paul Barry pointed out to me that this doesn't mean that those "50X" teams are better at all facets of software development; all we know is they were 50X better at this one particular task.
    • Reminds me of Derek Sivers's advice on how to hire programmers
  • Edward Kim gave a great talk called "Hats are the new management", describing how he distributed small but important manager jobs to each member of his team. 
    • One job we definitely could use is "Bugs Captain": a person who monitors a Bugs chat room and ensures a first responder is assigned, and monitors the quality of the response. I definitely want to stand up a separate Bugs chat room.
    • Another job: rotating responsibility each week for manual QA. Edward's team forward-deploys someone from the dev organization to help the QA testers each week. Good way to get to know all parts of an app.
    • They have a dev blog hosted on medium - supervised by a person wearing the "Blog master hat"
    • It reminded me of how the Navy divvies up collateral duties: there's a whole separate structure within each chain of command to take care of all kinds of jobs that aren't formally part of a Sailor's billet.
  • Paul Barry recommended using Optimizely for A/B testing, and encouraged us to use A/B testing as a devops tool: use it to measure the impact of new features by rolling them out to subgroups of users
    • He also recommended using "canary" tools such as measuring the exit rate of certain pages: can help you find out when a certain group of users is having problems with a certain page
  • Andrew Montalenti presented an inside look at the daily routines of the parsely remote team. I like the idea of syncing every developer to a familiar weekly rhythm
    • Start the day with a #standup chat message explaining what you're planning to work on
    • End the day with a #sitdown message explaining what you accomplished, what you're stuck on
    • Monday: bug fixing and planning day
    • Tuesday: 30 minute (virtual) staff meeting to kick off the week
    • Tuesday noon through Friday noon: uninterrupted flow time. No meetings. All coding.
    • Friday at noon: demo time
    • Friday afternoon: tie up loose ends
    • No weekend work / rest and recover

Thursday, January 9, 2014

Rockstars, ninjas, and silent technical privilege

Technically Baltimore did a nice write up of my recent appearance on the gb.tc podcast. One of the things we touched on was the continuing difficulties of tech companies with recruiting people and with attracting a more diverse set of people to the software industry. I think the best solution to both problems is for software companies to spend a lot more time and money on training people instead of trying to find the perfect person who's incredibly experienced. I plan to write more about the outcome of our own training program very soon (short answer: it worked out awesomely).

The Technically Baltimore article focuses on my off-the-cuff critique of passé, potentially harmful recruiting terms like "rockstar" and "ninja". I think that terminology unintentionally contributes to a culture of silent technical privilege that repels smart people who don't identify with those labels. The reporter also links to some further analysis of this problem, so please check out the writeup! And start using better recruiting language if you want to cast the widest net possible for talent.

Tuesday, November 5, 2013

Staying fast and good when making enterprise software

My startup Staq builds enterprise software using the techniques I've learned from building consumer web apps. As we bring more customers on and our revenue increases, we have more to lose when there's a bug in our code, and there's pressure to revert to a more traditional development process where the developers have less control. Specifically we're debating whether to move away from our current fast-paced "manual continuous deployment" process (where we're pushing code throughout the day, every day, and getting immediate feedback) to a more traditional commit-review-QA-release cycle. I have pretty strong feelings against going in that direction that I wanted to document here.

I know from experience that a process like that will inevitably slow us down, which we can't afford during this phase of hyper-growth. It can produce a boring, toxic work environment in the long run. Code you wrote today doesn't end up getting in front of a user until next week, and you've already forgotten the context to explain why you wrote that code the way you did. When there's a bug, you have to start from scratch when figuring out the problem. Feedback gets delayed, if you get it at all. 

So how we stay fast while keeping the software quality high? How do we stay fast and good?

I intend to establish a core value at Staq where we never, ever stop deploying. We make software at such a high level of quality, and our cluster immune system is so awesome, that it's nearly impossible to kill the app. When defects occur, they are so obvious and so easy to correct, that users rarely notice the problem.

In the early days there may be times when we have to compromise on this value. When that happens, I want it to feel like an ugly compromise. I want the situation to become a sign that we need to improve our systems to get back to the platonic ideal of Always Be Deploying. ("Coffee is for committers!")

Here's a partial list of strategies we came up with to make this work, most of them drawn from the lean startup movement:
  • Work in small batches: smaller changes are less likely to cause a disruption, and are easier to pinpoint when they do cause problems.
  • Don't take shortcuts: skipping tests and hacking things together ultimately add unacceptable risk and technical debt.
  • Practice five whys/root cause analysis: don't make the same mistake twice; gradually develop a cluster immune system
  • Expect 100% unit test code coverage, backed by appropriate integration and feature tests: catch problems as early as possible
  • Setup a continuous integration server: we have too many modules for any one developer to test all of them at once, so this server will become a backstop, alerting us when there is a problem in one of our modules.
  • Use Feature flags: while we are testing new features, hide them from users until they are fully baked.
  • Build staging environments that make it easy for developers to double-check their work
    • Since we're on Heroku we plan to use their awesome pipelines lab for this
    • We can also fork our database to create a sandbox for features that depend on database changes
    • This should never be construed as a required step before code can be released to production
  • Code reviews
    • Two times a day I review every commit in our system, really helps spot issues before they become problems
  • Build informative, actionable alerting systems

What else should we add to the list?

Thursday, November 1, 2012

Ruby Dependencies, Notifications, and Adjustments

Note: I originally submitted this article as a draft to the Practicing Ruby online journal. Gregory liked my concept but ultimately ask if I would mind if he wrote his own version. He did an awesome job and if you're interested in this subject I recommend you definitely read his article.

Introduction

Object-oriented programming helps organize your code in a resilient, easy-to-change way. This article aims to explore one of the concepts that trips up beginner and more experienced object-oriented programmers: how to sensibly connect a set of objects together to perform a complex task. How do you put instances of your information-hiding, single-responsibility-discharging, message-passing classes in touch with one another?

I became confused about the smartest ways to do this when I started building  Ruby apps that involved fetch large amounts of data from external services. In these projects, a Rails or Sinatra web application acted as a facade for workers querying a large set of APIs. Each API was different from the last, requiring different approaches and different dependencies. Some APIs involved five or six different steps, and in some cases each step needed to be handled by a different object.

I felt I understand object-oriented programming pretty well, yet I struggled with specifying the relationships between objects so that each object knew just enough about its peers to get the job done. My style was inconsistent. Sometimes I would inject a dependency using the constructor, and sometimes I would use a setter method. At other times it seemed more natural to have an object directly instantiate new instances of whatever objects it needed, on the fly.

All of the code examples referenced below can be found in this gist.


Object Peer Stereotypes

All of this changed when someone turned me onto the book Growing Object Oriented Software, Guided by Tests by Steve Freeman and Nat Pryce. The book has a chapter on object-oriented design styles, and includes a description of “Object Peer Stereotypes” that addressed my conundrum perfectly.

The authors divide an object’s peers into three categories: Dependencies, Notifications, and Adjustments (DNA). These are rough categories, because an object peer could fit into more than one category, but I found it to be a useful distinction. We’ll explore each of these categories as they pertain to Ruby code using an example from my real production code: a wrapper for Typhoeus I wrote called HttpRequest.

By the way, Gregory wrote about a related topic (what types of arguments to pass into a method) back in Issue 2.14. As your objects become more sophisticated you’ll find you end up passing fewer basic object types like strings, symbols, or numbers, and more of the Argument, Selector, or Curried objects that Gregory describes.

Dependencies

“Services that the object requires from its peers so it can perform its responsibilities. The object cannot function without these services. It should not be possible to create the object without them.”


“...we insist on dependencies being passed in to the constructor, but notifications and adjustment can be set to defaults and reconfigured later.”

I wrote the HttpRequest class so that I could set on_success and on_failure callbacks (where Typhoeus only provides an on_complete callback) and to encapsulate my dependency on the Typhoeus gem, in case I want to switch to another HTTP library later.

HttpRequest objects have two Dependencies: the URL of the request and a set of options for telling Typhoeus how to make the request. Here's a link to an example of HttpRequest code.


Note that I’m supplying a default for the options argument, since it’s just a hash that gets passed onto Typhoeus::Request, and it’s something you’ll have available at the same type you have the URL. Because there is a sensible default (an empty hash), you could argue that this argument is more of an Adjustment, described below.

If options was a more complex object, something that might have peers of its own, I would probably treat it as an Adjustment. I find test-driven development really helpful in cases like this because often the tests can help you feel out which approach is more appropriate (which is the whole premise of the Growing Object Oriented Software book).

Notifications



“Peers that need to be kept up to date with the object’s activity. The object will notify interested peers whenever it changes state or performs a significant action. Notifications are ‘fire and forget’; the object neither knows nor cares which peers are listening.”

In the HttpRequest example, success_callbacks and failure_callbacks are the notifications. Another object can register for success notifications like this.

Logging is another canonical notification example. Here’s a pattern I use a lot for logging.

Notifications can also be sent as arguments to a method call. I often pass a block for error handling. I find this usually involves fewer lines of code than returning a status object that must be tested for success or failure. Here's an example.


Adjustments


“Peers that adjust the object’s behavior to the wider needs of the system. This includes policy objects that make decisions on the object’s behalf...and component parts of the object if it’s a composite.”

Most of my Adjustments involve component parts of a composite object. For the API-intense project where I’m using HttpRequest, I always have one class that has overall responsibility for getting all of the data we need for each API. That “master” class just does one thing: it coordinates the activities of a set of Adjustment peers, are of which are set to sensible defaults.
This also enables simple unit testing because you can so easily set the adjustments to mock objects provided by the tests.

If you use the strategy pattern, where peer objects make decisions for your object, your Adjustment might look like this.

It could be that AdminChecker is more of a Dependency than an Adjustment, depending on how many different kinds of AdminCheckers there are and how central admin-checking is to your code. If there’s no normal default for the admin_checker value, and if you really can’t make a DataFetcher without knowing what kind of checking policies it’ll be working with, you should probably inject your admin_checker in the constructor, marking it as an important Dependency.

HttpRequestService

There’s one other facet to my HttpRequest object that I thought Practicing Ruby readers might find interesting. Because Typhoeus is concurrent, you have to queue up requests onto a shared Typhoeus::Hydra object. The requests don’t run until you invoke the hydra’s #run method. I experimented with storing the Hydra object in various places and ended up creating a factory for HttpRequest objects called HttpRequestService, below. Can you spot the dependencies and adjustments? It doesn’t have notifications, but I could see adding some instrumentation to measure HttpRequest times.

Instances of the HttpRequestService end up as Adjustment peers for the objects responsible for fetching data.

Dependency Injection Containers

Rubyists generally eschew dependency injection containers but they complement the DNA style quite well. I use dependency injection containers as the single place where my code can pull in dependencies from different sources. These dependencies sometimes involve extra setup steps or massaging, depending on whether the code is running in production mode or not, and the container is a convenient place to consolidate that kind of housekeeping code.  It often provides the sensible default for notifications and adjustments, and it’s an important part of the boot process for most of my Ruby code.

I’ve created a simple gem for this purpose called dim based on Jim Weirich’s article. If you’re interested in the topic, I highly recommend that article. Here’s a snippet of one of my container definitions.

Conslusion

Don’t hold too rigidly to these classifications; they’re more like heuristics. As Steve Freeman and Nat Pryce wrote:

“What matters most is the context in which the collaborating objects are used. For example, in one application an auditing log could be a dependency, because auditing is a legal requirement for the business and no object should be created without an audit trail. Elsewhere, it could be a notification, because auditing is a user choice and objects will function perfectly well without it.”

When considering how to organize object peers I recommend you favor what’s most understandable and flexible, even if it means deviating from the DNA pattern.

Wednesday, October 10, 2012

Developing a software education industry in Baltimore

I recorded a video for Technically Baltimore's new series "One Big Idea". My big idea is about creating a new software education industry in Baltimore:


The ideas here build on an earlier post of mine, Towards a New Paradigm for Software Education. They also dovetail nicely with something Anil Dash wrote, The Blue Collar Coder.

Wednesday, June 20, 2012

Personal creative process talk with some important books


I recently had a chance to speak at a new event in Baltimore called Midmorning Social where I was asked to speak about how I work and where I find inspiration. It ended up being one of the most personal and introspective things I've ever done. The video is embedded below, or you can watch here.

I thought a lot about all of the books that had influenced me on my current path or that just resonated with me and shaped me. I mentioned a bunch of these in the talk but left out others due to time. Since I was asked over Twitter to provide links to the books, I ended up making the following reading list. Hope you find it interesting as I really enjoyed compiling it!
  • The 4 Hour Work Week / The 4 Hour Body: very trendy amongst the Internet set, I know, but full of provocative and inspiring ideas about how to design the way you live instead of just following a pre-defined path
  • Organizing from the Inside Out: very useful technique for getting organized and staying that way
  • The Primal Blueprint: helped me plan how I exercise for maximum benefit with minimal, regular investment of energy/time
  • Why We Get Fat and What To Do About It or the more intense version Good Calories, Bad Calories: helped me figure out a healthier way to eat and lose weight; also a great example of debunking widely-accepted conventional wisdom. Good to contrast with another favorite book about eating, Omnivore's Dilemma.
  • The Cybernetic Brain: still grappling with what this book means, but my favorite part is the dissection of the ontology of unknowability as applied to the brain
  • The Song of the Dodo: the first really good nonfiction book I can remember reading, really turned me into a nonfiction fan
  • Collapse: I think about what happened to the European settlements on Greenland, and how that applies to the fate of our society, almost every day
  • Wizard and Glass: probably the best novel I've ever read, an incredible coming-of-age story. There's a powerful battle scene in the end that I recall so vividly it's like I lived it.
  • Godel, Escher, Bach and I Am a Strange Loop: awesome meditations on the nature of conciousness; the first book is also just an awesome work of art, stretching the notion of what a book can be or do far beyond anything else I've read
  • Imperial Hubris: Extremely prophetic book written in the early years of the "war on terror"; greatly influences how I think about the conflicts we're embroiled in and explains why "war on terror" belongs in quotes
  • Code: The Hidden Language of Computer Hardware and Software: being a self-taught programmer, this book really helped me understand lower levels of computational abstraction that I don't usually spend much time thinking about
  • Getting Things Done: also very trendy, but definitely changed the way I work and made me much more productive
  • Daemon: great near-future novel exploring the implications of current technology developments
  • The Warrior Elite: about Navy SEAL class 228; I washed out of class 230 and this book helped me decide to move on and not try to go back
  • Man's Search for Meaning: helped me clarify the truly important sources of happiness in life (the "pillars" that I mention in the talk
  • Hackers & Painters helped me decide to leave the Navy and become a programmer
  • The Lean Startup: really great manual for how to build things with less wasted effort in the 21st century. I reference this book in business conversations many times.
  • Rapid Development and Software Estimation: introduced me to the notion that in software you want your schedule to be very predictable, not necessarily super fast
  • Code Complete: introduced me to the notions of software quality and how to achieve it
  • Full Catastrophe Living: I ran out of time to discuss meditation, but this book helped me learn how and why to meditate, and helped me cultivate a mindfulness practice
Here's the video of the talk, about 20 minutes long:

Tuesday, November 29, 2011

Free software project update


Update 12/27/11: here's what I ended up building

I received over 20 ideas for my free software hackathon project, and also a lot of encouragement. Here's a quick note to update everyone who has expressed interested in the project.

About half of those ideas were from people who want to start businesses. I'd love to help them out but I can't go into business with someone I've never met, especially if they don't live in Baltimore. If you are in that situation I recommend you hire someone to build a prototype as that vastly increases your credibility. Better yet, you should try teaching yourself how to code so you can build it yourself.

About two-thirds of the ideas were far too ambitious for me to tackle in one week. I'm exploring those for future endeavors, though.

About three or four of them look specific enough for me to create a basic solution in a week and I'm investigating each right now. The ones I ultimately pick will be based on how responsive the original customer is and what I think my chances will be to deliver the product within one week.

People are definitely fed up with crappy software. Many of my correspondents talked about existing solutions that are too expensive, buggy, or simply too bloated. They end up hacking things together with Excel or a web calendar. Based on this simple market research I definitely can confirm the "many competitors, little competition" thesis and it's something I hope to attack with this project.

Monday, February 23, 2009

Maryland Software Entrepreneur Survey Results

Last week I asked all of the software entrepreneurs I know in Maryland to fill out a quick survey about what they kinds of help they'd like to receive in building their companies. I asked this because I want propose a project to help my fellow entrepreneurs in Maryland, but I felt I should do more listening before I do any more talking.

I promised I would anonymously summarize the results of the survey, so here's what people had to say. Ten people of very different backgrounds responded. It's totally unscientific but I think it was a fairly diverse sample.

What type of assistance would be most useful to you in starting or growing a software business in the greater Baltimore area?

  • "...an organization, funded by the state or outside investments that acts as a seed funder for startups...an Angel-like organization that invests time/resources rather than capital. Local people with ideas for new software would submit proposals and the team would decide on the top 1-3 and develop a beta. So rather than having a group of investors involved, it would be a group of developers that invest their time in exchange for equity."

  • "A mentor match-up service of some sort might be good. With our startup, we have basically had to teach ourselves everything because we didn't really have anyone to talk to who's already been through it."

  • "I think the most needed type of assistance, in my opinion, is business/legal administration. Such things as incorporating a business, accounting, taxes, payroll, accepting credit cards for products/services, etc. I might have a great idea and working app, but then need to put in almost as much work to setup and manage the business side."""

  • "A real calendar of tech events, with .ICS (so I can import into Google Calendar or Outlook or whatever I use), embeddable (just via GCal), RSS feed, twitter feed. Something where I can actually go and see a list of events hosted by Refresh, Bmore on Rails, etc...You'd think this problem was solved already, but apparently not."

  • "...some forum / roundtable type of thing where people can just talk ideas would be neat too. Perhaps OpenCoffee, with some more structure, up in Baltimore somewhere. It would be nice if something like this varied in location, so that for example, it's not always down at the hive. Then again, there is arguably some benefit in having it at a standardized location."

  • "Funding...Baltimore Angels is good, but they only meet every other month."

  • "Exposure. Needs to be more talk about what local entrepreneurs are building...have to raise the profile of Baltimore for outside money. People have to hear about what is going on in Baltimore and see it as a hub of growth and activity, and look at startups in the area as worth investing in."

  • "Support - I love the local Open Coffee...it's less than 5 people, and everyone is doing their own thing, so no one is afraid to be open and talk. It's been very helpful for me and I've found the atmosphere great."

  • "Peer groups/advisors/coaching, all of which I have found in the area."

  • "1) access to capital
    2) talented technologists
    3) universities that are engaged in the entrepreneurial world
    4) service providers (lawyers, accountants, insurance agents, PR firms, recruiters, etc) who understand start-ups, and have appropriate business models
    5) mechanisms which support the free flow of talent
    6) a cheerleading environment where mentors are easily found and entrepreneurs benefit from the region's self-promotion
    7) a culture which recognizes those who try -- even when they fail."

  • "...my greatest challenge was in recruiting talent. Finding people who have actually marketed software, or developed commercial C++ applications was an enormous challenge!"

  • "We are terribly underserved by the absence of an entrepreneurial culture at JHU. Perhaps, that's beginning to change, but it will take time to play out. I recently attended a discussion on the macroeconomic impact of entrepreneurialism at MIT; it's simply staggering!...Without the active engagement of our local universities, we'll never build a sufficient flow of new companies into our region."

What are your biggest challenges?

  • "The biggest problem is tapping into true seed money. It seems that seed money for early stage startups is virtually non-existent. There are various Angel groups in the area and there is money to be invested, but rarely are the investors ever interested in being the first dollars spent by the company.

    "Given this, it seems that a development based Angel group could help mitigate the high risk of true early stage companies such that more good ideas would get off the ground"

  • "Again, never having done this before, our biggest challenge is knowing what it is we're supposed to even do or not do as a 'real' business."

  • "One big problem with not knowing what to do, is not immediately knowing who can help you sort those things out. With regards to legal issues, we've already been through two big-name law firms that charged big $, but they had almost no experience with startups and were not able to guide us well at all."

  • "I think my biggest challenge is once I have established business and working app (which is a challenge in itself), is marketing and getting the word out as well as creating a sustainable revenue model."

  • "Knowing who to trust....and whose referrals to trust."

  • "Finding talent. Dealing with taxes."

  • "...finding leads is of course a big thing."

  • "As for products, hashing through marketing and sales plans...Putting processes in place to fill a pipeline, getting the word out, building sales efforts, etc. And 'getting the word out' - and marketing and sales in general - is different for products for a niche vs. products for the online masses. Looking for money too is a challenge...but it seems like Baltimore Angels is trying to address that."

  • "Money. Finding good people. Money"

Is there anything else you'd like to say?

  • "Go Baltimore. All of this stuff is wicked exciting. I moved here because it was the closest city to home. I'm staying because Baltimore is poised to claim a huge stake in the future of big tech happenings."

  • "I think some kind of Y Combinator in Baltimore would be great. The combination of funding, help creating a company, and ongoing support is what I would really need to create a successful software company. I also like the idea of having a group or association of small, local software companies that have weekly/monthly meetings to discuss and brainstorm and help each other out with their ideas and possibly code."

  • "I think there is still a gap between the money and then entrepreneurs. It's a hard gap to bridge."

  • "I've heard many times that there just aren't enough companies in Baltimore to justify more private equity. That's just not true! Moreover, there are micro communities emerging - such as with gaming or social media...Growing these communities brings more talent to the region, which leads to more successes."

  • "...individuals are vitally important to an entrepreneurial success. When they come together, they create new companies. When they network, they're looking to challenge themselves, often by changing jobs. Changing jobs in Baltimore's tech world is difficult due to its relatively small size and lack of a networking forum. Making it easy for individuals to meet and network not only eases the free flow of talent (one of the things that makes Silicon Valley so successful), but causes people to want to continue their association with the networking forum that's proven helpful."

  • (Several respondents graciously offered to help out or be included in any discussions, so I'll be sending some emails and things -- add a comment below if you are interested)