An eye opener about your own biases

Even though I have been preaching about this stuff, and admitting I have non-conscious biases, it still caught me off guard to see it in myself: a web demo of Harvard’s studies on our implicit, unconscious biases that you can take yourself in 5-10 minutes (per test). 

Posted via email from a timocracy of one | Comment »

My response to the pushback on my diversity talks

After I gave a couple inflammatory talks on diversity and discrimination in the ruby community I got some feedback and pushback.

Here is my response

To use your example, plenty of hockey players are probably racist, actually, even if they don’t realize it. Not to pick on them, but part of my talk was about how pretty much everyone is, they just don’t consciously acknowledge it. I’m not talking about overt racism, just the basic assumptions of the privileged that come out in everything because they don’t realize the are privileged and how underexposed to other cultures, races, ways of life, etc, they may be. 

Athletes in all nearly white fields certainly aren’t immune to bigotry.  Having grown up a competitive bump skier I can attest to that.  Like most winter sports it’s a *very* white field.  Often bigotry is strongly linked with lack of exposure and diversity.  Due to the very fact of not having more minority and female colleagues we start sub-consciously building assumptions.  

In SF, the majority of downtown business people’s exposure to black people is the homeless.  I’d put a fiver on that negatively effectively their biases.  There are studies that watching the Summer Olympics, which has a lot black role models performing well, temporarily counters some of the sub-conscious racist bias in test subjects. And I think everyone has anecdotal experience with racists justifications they’ve overheard that negative experiences can create biases.

A large part of what sparked my initial talk, was a) @bryanl giving a talk where he had a line about it being about time we (the white audience) were the uncomfortable ones in the room.  That and then @gigglegirl4e gave a talk titled “Whose wife are you?” because that is something she hears, especially at conferences.  As long as she is hearing that…

You really should read up some on feminist theory and privilege.   I really, really don’t care if a bunch of straight white males get a little offended that they don’t realize how good they have it and how exclusionary they are.  I am queer, and yes the field is to blame. Not entirely, no.  And maybe in part it’s better than other fields, but it’s far worse than many. We are an awesome, low bullshit community, based around a very easy language to learn.  We should be the best community there is on this topic.  It’s not that I don’t love us, it’s that I do enough to have set a higher bar for my expectations.  As @dnscollective said in his far gentler, inclusive lightning talk, let’s be the industry and community we want to work in.

You think being offended at having people say the field is discriminatory and that you have biases is rough, you should sit down longer and listen, not talk to, but listen to some of the black guys or women in the field, on the topic.  Not all of them may have had a rough time, but most will be able to talk your ear off.

As for the other example, I think comparing the cultural stereotype of interior designers all being gay, to the straight, white, male predominance in ours actually offensive.  For one, it’s based on a huge assumption without any apparent research backing it.  It comes off as a defensive knee-jerk rather than having to admit that being a white male in a field making giant amounts of money, while the rest of the country swirls down the drain, might be a pretty cush situation, that being excluded from is actually a form of class warfare.  Do you think Interior Design and Ruby Programmer are equivalently powerful positions in our current economy?  Also, there are some long standing reasons for straight men not being as prevalent in Interior Design (which has actually shifted farther in the last 5 years than our field, so hah, its a straw man AND moot!) and they have mostly to do with sexism and discrimination.

Interior Design has been the domain of house-wives and openly gay men, because the “real men” were busy dominating the “real jobs.”  Do you think Jewish people were discriminating against the goyim by keeping them out of the money-changing field, during a couple hundred (or thousand?) years of European history?  By my admittedly limited reading (not being a history major), largely not, it was actually discrimination the other way that drove Jewish people into that field as one of the few jobs they were allowed.

Also, I don’t get what our whole field’s anti-intellectual and academic obsession is.  We seem fine saying “Well I haven’t read the Gang of Four, but it’s not much use anyways” or “Well I haven’t really studied this field, but I have lots of opinions based on my own person experience which is obviously applicable to the position of the historically discriminated against and oppressed.” This stretches out to me, too - I am a college drop-out.  So I do understand the bias against overly academic CS, but unfortunately, we’ve let it bleed over so far into anti-academia that we sounds like George W. Bus supporters ranting against those damn liberal (feminist) snobs, sometimes.

Usually, I just write negative responses off as the classic example of what happens when you speak to power and privilege: offense, defensiveness, and pooh pahing.  ”There isn’t any problem with black people having to use separate water fountains, they get the same water.”  Almost universally, ime, when you explain the huge difference between discrimination by the majority, by the patriarchy, by those who have always had it easier, without even realizing how much so, versus discrimination up the ladder by the oppressed, you get anger, justification, and dodging of responsibility.  

In fact DHH, is one of the few counter-examples I can think of - after the first Gogaruco, when these concepts ere explained to him he said roughly “hmm, that makes sense, if you are already the minority in the room, and here for professional development or work, that wouldn’t be very fair, to be forcefully exposed to something that highlights just how in the minority you are”

End of my response

I never sent it, because the guy in question wrote the previous email when I pinged him about posting.  And now I add him to the small pool of guys who, even when pushed hard by my intentionally inflammatory, discussion starting claims, actually listen, process, and admit that maybe those crazy feminists aren’t totally making this all up. ;)

Posted via email from a timocracy of one | Comment »

Pushback from my diversity talks

I’m anonymizing this to avoid causing a flame war for the quite reasonable guy who posted it, and because he followed up with this:

Well, I’m glad we had our conversation last week. I feel less strongly about the issue now than I did before that conversation. I think I was mostly reacting to the inflammatory nature of your talk (ie. opening with calling the audience racists, bigots, and misogynists). I’ve gone back and watched your talk on confreaks, and it doesn’t seem as inflammatory as it did that night (chalk that up to either having more perspective after our conversation, or being over the shock value of those statements).

So I feel I’ve gotten my thoughts out of my system, and don’t feel strongly enough to post them publicly.

His original thoughts are below:

I care about equality and despise discrimination, and yet I am concerned and offended by a growing trend to accuse the technology sector, and the software industry specifically, of being bigots, racists, and misogynists. Think about this question: Are the interior decorating power elite keeping straight men out of their industry? I don’t know the answer to that question, but I doubt that they are. Some may suggest that the analogy isn’t a good one, because straight men aren’t typically systematically oppressed. I’m not sure I agree with that either. I’ll return to this analogy.

I’ve not studied discrimination, oppression, women’s issues, etc. beyond that which is taught in a typical American college education and that which is generally reported in major news media. But I do have eyes, ears, an open mind, and I generally don’t see evidence of discrimination in the software development industry.

I do see that the industry is dominated by white males. There is no question of that. Furthermore, I personally would greatly welcome more diversity. But are the demographics of the software development industry an indication of systematic oppression/discrimination? Is the white male dominance a malignancy?

Surely there is discrimination. I would be foolish to suggest that it doesn’t happen. It is a sad fact that discrimination persists everywhere. So when blaming a lack of diversity of a group on discrimination, then surely the accusation is that the group discriminates more than the population on whole.

[need to flush out more of my thoughts prior to wrapping up]

Returning to the analogy of the interior decorating industry, I would argue that fewer straight men are interested in interior decorating. I would also argue that there is nothing wrong with that. To argue otherwise would to suggest that there should be a uniform distribution of interests and competencies across all genders, races, and sexual orientations. I don’t believe that belief in human equality in general means a belief in uniform distribution of interests and competencies.

[Other analogies include: Are ice hockey players racist since most ice hockey professionals are white males? I’d argue that socio-economics play a bigger role in determining someone’s likelihood of becoming a professional hockey player.]

Posted via email from a timocracy of one | Comment »

Video of the ‘Scaling your Rubyists’ the panel I organized on hiring rubyists

My upcoming speaking events

I had a blast speaking at the Database meet-up that Wellness FX put on last month where I talked about managing migrations in Mongo. I’m pumped to follow that up with speaking at Madison Ruby this coming week-end where I will be expanding the material from that initial 20 minute talk to the fuller 30 minutes allotted at Madison. I’ll definitely be fleshing out some of the positives of working with MongoMapper that I glossed over in the initial talk - namely the incredibly fun power of the DataMapper pattern combined with a schemaless datastore.  Hopefully this helps alleviate some of the anti-Mongo vibe my first talk seemed to give off; MongoHQ are speaking at Madison as well and we wouldn’t want that to lead to a pub brawl during the post conference drinking (we’re rubyists, the drinking is a given).  Don’t worry though, I won’t let that entirely keep me from speaking my mind. ;)

Next I’m organizing a panel on hiring rubyists, coming up in Sept, with some very well known names in the local ruby community. I’m honored that they all seemed to jump at the chance to do this panel with me.  As a consultant, how to deal with hiring rubyists is a question that comes up constantly and it will be great to get these 4 views on the topic posted up on the web so I can point to it and say “that’s how.”  I definitely have to say thank you to Engine Yard for graciously offering to host the event.

And to cap off my continuously expanding talk on Mongo and how to deal with your lack of schema, data validity, migrations, etc, I will literally be closing down the conference at RubyConf.  I’m hoping that even though I am speaking dead last, my immediately following Tom Preston-Werner will help motivate attendees to stay to the bitter end for my talk.  I will have already added some code examples to my nearly Bauhausian minimilist slides from the Wellness event for Madison, but talks are 45 minutes at RubyConf, so there will certainly be even more of the nitty gritty and code examples that people have been asking for.

Posted via email from a timocracy of one | Comment »

The unbearable flexibility of schemalesness

Everybody knows composition > inheritance, right? Well, this concept
becomes truly powerful when you combine the DataMapper pattern with a
schemaless datastore. In the gist below I demonstrate using MongoMapper’s plugin system to
compose objects, in place of pure inheritance, which generally ends up
as Single Collection/Table Inheritance. Nobody loves STI, and plugins
allow for ruby style multi-inheritance in your models, as you can
still pick an over-arching hierarchy of classes, but mix in various
fields and their related methods.

I think this is the real power of NoSQL: not “web-scale”, which people
have been doing with SQL for years, but instead the flexibility that
comes from defining your data type once, in your model, with the full
power of ruby. I was skeptical about key-value stores as a default
storage engine for web apps, until very recently, and still think
MySQL is the right answer for many people and projects. But my most
recent client project uses MongoMapper, and as we started to refactor
and DRY up the models, I finally saw how truly useful not being bound
to a datastore’s schema is. Migrations? Yes, you don’t get AR migrations. The ‘proper’
migrations, which only affect schema, are unneeded anyways, in a
DataMapper. And data migrations are done wrong 99% of the time
anyways, imo; pretending they are instantaneous is a mistake. In
either AR or MM you should handle you data migrations more robustly,
via code switches and async tasks to transform the data. If I get a
chance to make this a talk, I may explore that more fully.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 
#rvm use 1.9.2
#brew install mongo
#gem install mongo_mapper
#gem install bson_ext

require ‘rubygems’
require ‘mongo_mapper’

MongoMapper.database = ‘mm_demo’

module MMDemo
  module HasDoorsAndWindows
    def self.configure(model)
      model.key :doors, Integer, :default => 0
      model.key :windows, Integer, :default => 0
      model.key :sun_roof, Boolean, :default => false
    end
    
    module InstanceMethods
      def enterable?
        doors > 0
      end
      
      def well_lit?
        windows >= (doors * 5)
      end
    end
  end
end


class House
  include MongoMapper::Document
  
  plugin MMDemo::HasDoorsAndWindows
end

class Vehicle
  include MongoMapper::Document
  
  key :wheels, Integer
end

class Motorcyle < Vehicle
end

class Car < Vehicle
  plugin MMDemo::HasDoorsAndWindows
  def well_lit?
    sunroof?
  end
end

require ‘minitest/autorun’

describe “a House” do
  it “has doors” do
    House.new(:doors => 2).doors.must_equal 2
  end
  
  it “has windows” do
    House.new(:doors => 7).doors.must_equal 7
  end
  
  it “is enterable if there are any doors” do
    House.new(:doors => 0).enterable?.must_equal false
    House.new(:doors => 4).enterable?.must_equal true
  end
  
  it “is enterable if there are any doors” do
    House.new(:doors => 0).enterable?.must_equal false
    House.new(:doors => 4).enterable?.must_equal true
  end
  
  it “is well lit if there are 5x as many windows as doors” do
    House.new(:doors => 1, :windows => 5).well_lit?.must_equal true
    House.new(:doors => 1, :windows => 4).well_lit?.must_equal false
  end
end

describe “a Car” do
  it “is well lit if it has a sunroof” do
    Car.new(:sunroof => true).well_lit?.must_equal true
    Car.new(:sunroof => false).well_lit?.must_equal false
  end
end

Posted via email from a timocracy of one | Comment »

A pattern for testing class methods in ruby with rspec explicit subjects

RSpec’s subject method, both implicitly and explicitly set, is useful for declaratively setting up the context of the object under test. If you provide a class for your describe block, subject will implicitly be set to a new instance of this class (with no arguments passed to the constructor). If you want something more complex done, such as setting arguments, you can use the explicit subject setter, which takes a block.

describe Person do context "born 19 years ago" do subject { Person.new(:birthdate => 19.years.ago } it { should be_eligible_to_vote } its(:age) { should == 19 } it "should be younger than a 20 year old" do twenty_year_old = Person.new(:birthday => 20.years.ago) subject.should be_younger_than(twenty_year_old) end end end

The subject block is called after any befores. In fact, it is not called until it is referenced in the spec - the compact syntaxes of ‘it { should }’ and ‘its(:property)’ implicitly call subject as needed*. These means any method calls in the subject block reference the state of the system (like your db), at the time subject is called.

describe "the oldest person" do subject { Person.new(:birthdate => Person.oldest_person.birthdate - 1) } it "should be older than the next oldest person" do original_oldest_person = Person.new(:birthdate => 100.years.ago) subject.should be_older_than(original_oldest_person) end end

subject thus provides a decent syntax for testing method calls directly. Sometimes, though, you have methods you want to test almost purely based on what is passed into them, with few other concerns of state, for instance, when testing class methods. These specs may have a little shared set-up needed, but really the true object under test is the method call itself. In these cases it makes sense to set that as the subject, and this leads to an effective and succinct, if slightly distasteful, pattern for setting the method arguments via standard rspec ivar trickery.

describe ".first" do before { Person.create_10_people } subject { Person.first(@number_of_people) } it "should return the specified number of people" do @number_of_people = 5 subject.size.should == 5 end  it "should return a single person when so specified" do @number_of_people = 1 subject.should be_a(Person) end  it "should default to returning a single person do subject.should be_a(Person) end end

I was bemoaning the difference between ruby and more functional languages like JavaScript, where you do have ways of easily differentiating between a method reference and call (parentheses), and how that would make a pattern like this easier by letting you set the method as the subject and then call it in the spec. Then I realized, of course ruby has a way for creating a callable reference like this: a lambda.

describe ".first" do     subject { lambda { |number_of_people| Person.first(number_of_people  ) } } it { subject.call(5).size.should == 5 } it { subject.call(1).should be_a(Person) } it { subject.call.should be_a(Person) end

If I end up liking this pattern enough after some usage I’ll probably see if I can get them to accept a patch to allow passing of arguments directly into subject itself. That could possibly get a little messy in the code for subject itself, but behind the scenes gymnastics to get a nice testing syntax is what rspec is all about, after all.

*The latter syntax actual resets subject, the getter, to be the result of the property access, allowing for the intriguing abuse of syntax: ‘its(:property) { subject.should….’

Posted via email from a timocracy of one | Comment »

The new css 100% width and height with header and sidebar

It’s been a while since I’ve had to deal with making a cross-browser 100% height layout - long enough that a couple version of IE have come out since.  CSS support in IE has come a long way, so I thought I’d start fresh and try a purely standards based approach for the latest IE and standards based browsers, using the ‘display: table-*’ styles, and just do a fallback for older versions of IE (a 100% height modified Holy Grail layout that relies on the IE quirks box-model).

Unfortunately, while IE8 does support the table display styles, IE7 doesn’t, and there doesn’t seem to be any way to put IE7 in quirks mode, while keeping IE8 and every other browser in standards mode.  So I just settled on the old-fashioned approach of having one layout for all other browsers and keeping the IEs clumped together in quirks mode.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 
<!— keep IE in quirks mode —>
<!DOCTYPE html>
<html>
  <head>
<!— This following meta tag does no good since there is no way to trigger quirks
mode only in IE7. The problems with an xml prolog that triggered quirks mode were
fixed in IE7, but this meta tag was not yet introduced, so the only thing you can do
is trigger IE-wide quirks via the comment before the DOCTYPE //—>
    <meta http-equiv=“X-UA-Compatible” content=“IE=EmulateIE8” />
    <style type=“text/css”>
/*You still need an unbroken chain of 100% from the viewport down to the ‘table’
container*/
      html, body, #wrapper { margin: 0px; padding: 0px; height:100%; }

/* This is the heart of the new layout. You don’t even need to worry about
min-height vs. height issues, because table handle those fine without weird issues
when the browser window becomes smaller than the content.*/
      #wrapper { display: table; width: 100%; }
      #header { display: table-row; height: 99px; }
      #logo { display: table-cell; }
      #header_contents { display: table-cell; }
      #container { display: table-row; }
/* This is the one min-X needed, it prevents the sidebar from collapsing down to
it’s contents width when the containing div tries to shrink due to the window being
shrunk down*/
      #sidebar { display: table-cell; width: 200px;
                            min-width: 200px; vertical-align: top;}
      #content { display: table-cell; }
      
/* Fluff, purely for illustration of the containers */
      .box { width: 100px; height: 100px; background: grey; }
      #content .box { width: 300px; }
      #header_contents { border: 2px solid green; background-color: #cfc; }
      #sidebar { border: 1px solid blue; background-color: #ccf; }
      #content { border: 2px solid red; background-color: #fcc; }
    </style>
<!— The quirks mode based IE approach below. Since in that box model paddings and
margins are not additive with the contents width/height, you can just add some
paddings to the parent. For an explanation of the sidebar negative margin tricks,
google ‘holy grail css.’ And the header is just absolutely positioned over the space
created by the padding trick on the container //—>
<!—[if IE]>
<style type=”text/css”>
#wrapper, #logo, #header, #container, #sidebar, #content { display: block }
#header { position: absolute; padding-left: 200px; }
#logo { float:left; height:100%; width:200px; margin-left: -200px; }
#header_contents { height: 100%; width:100%; float:left;}
#sidebar { float: left; height: 100%; margin-left: -200px; }
#container { height: 100%; padding-top: 99px; padding-left: 200px; }
#content { height: 100%; width: 100%; float: left; }
</style>
<![endif]—>
  </head>
  <body>
    <div id=“wrapper”>
      <div id=“header”>
        <div id=“logo”>Logo</div><div id=“header_contents”>Header</div>
      </div>
      <div id=“container”>
        <div id=“sidebar”><div class=“box”>Sidebar</div></div>
        <div id=“content”>
          <div class=“box”></div>
        </div>
      </div>
    </div>
  </body>
</html>

Posted via email from a timocracy of one | Comment »

Getting back on the horse that threw me

So after about 3 years of happily working at YieldBuild, I decided it was time to try something new (or retry something old).  I’d still definitely recommend them as an employer, so let me know if you want to your resume passed along.
I’m in the process of rebooting my web contracting firm (I’ll post when I have the new rebranded web-site up) and am currently doing a gig at the the incredible Pivotal Labs; learning more about their approach to the agile way.  

I am planning on focusing on doing quick prototypes for start-ups/founders that will help them flesh out their ideas and perhaps secure funding for a next stage.  Projects initially too small for a firm like Pivotal could grow to a size they would be interested in after I help them out.
That means I’m definitely in the market for contract work again.  I’m busy 9-6 PST for a while, since Pivotal does full-time pairing and you can’t cut out easily for other stuff, but I have a some bandwidth for side-projects in the evenings and on the week-ends.  

And after that gig wraps up I’ll be looking for more larger projects - if I can get enough consistent work I may be rehiring some of my old employees.
Drop me a line if you need some ruby, javascript, html/css, etc done.

Posted via email from a timocracy of one | Comment »