Categories
Uncategorized

DimeCast.Net’s SOLID Screencasts

This article also appears in Canadian Developer Connection.

Brick with the word "SOLID" beneath it

Following up on the previous article about the SOLID principles for object-oriented design, Steve Bohlen pointed me to a series of screencasts on DimeCasts.net covering each SOLID principle:

The screencasts are each about 12 minutes long, a perfect length for a “learning snack”.

Categories
Uncategorized

Boo-Effing-Hoo

Parody of the "You Find It, You Keep It" graphic: "You watch our ads / You throw a hissy fit"with the Apple logo.

(Click the image to get the story.)

Categories
Uncategorized

FutureRuby Talk: “Artisanal Retro-Futurism and Team-Scale Anarcho-Syndicalism” [Updated]

Update: There’s a link to a video of the same talk given at an agile conference earlier this year. See the end of the article for details.

Here are my notes from the FutureRuby presentation titled Artisanal Retro-Futurism and Team-Scale Anarcho-Syndicalism by Brian Marick.

Sticker: "Artisanal Retro-Futurism and Team-Scale Anarcho Syndicalism"

  • This talk is about economies and (dis-economies) of scale
  • The idea behind this talk got started around 2000 – 2001, when I visited agile projects and people on the teams would say things like “This is the best project I’ve ever worked on! Why do it any other way?”
  • Then, two years ago, I talked to someone who’d been doing Scrum for a year and he said “At least my job doesn’t suck as much as it used to.”
  • Hearing stuff like this, people like me – the Agile Old Guard – we get distressed. We’d much rather hear what people used to say
  • The problem is that the economies of scale that drive corporations to be larger and make more money are also diseconomies for the people working within them
  • I will differ from what Nathaniel [Talbott] said in his presentation. I believe that even the wage-slave can know “joy-in-work”
  • What used to be present in Agile projects that’s gone missing in new ones? I’ll tell you what it is: it’s Artisanal Retro-Futurism and Team Scale Anarcho-Syndicalism!
  • "Yes it’s true, not everybody immediately grasps what I mean."

 Techno-anarchy

  • First, let’s consider what “anarcho-syndicalism” is
  • Consider an agile team. The see themselves as alone in a dangerous place, where no one else is offering any help.
    • It would be nice if a “daddy” swooped in and help save them from the mean people
    • The are problems with this approach: it’s pathetic, and it often doesn’t work
  • Here’s a story for you to illustrate things:
    • An agile team was made to work in cubicles, like the rest of the company
    • Agile methods aside, cubicles are the "single worst arrangement of humans and objects in space for the purpose of developing software"
    • The team proposed changing their workspace to an open one
    • Furniture Police turned them down
    • In response, the scrum-master went to the office over the weekend. She disassembled the cubicles and changed the office layout to an open one. On Monday, she declared to the Furniture Police that “If the cubicles come back, you will have to fire me.”
    • They gave in
  • Anarcho-syndicalism is a political/economic/trade union movement
  • It peaked in 1923, and was crushed by the U.S. government in 1924
  • “Anarcho” comes from “anarchy” — they wanted to see government go away
  • “Syndic” refers to a trade union – they wanted to replace corporations with trade unions, or more simply, they wanted to see corporations go away
  • Anarcho-syndicalism has these principles
    • Worker self-management:
      • Workers decide how to control factory
      • They’re not fans of hierarchy in general
      • The aforementioned “Cubicle Incident” is an example
    • Direct action:
      • It’s about not waiting for “daddy” to swoop in and save you
      • It’s about taking action – doing something and then saying to anyone who disagrees “What are you going to do about it?
      • There was a difference of philosophies in the labour movement over direct action:
        • Some believed that they should elect/influence/bribe elected officials to pass laws to ban the burning down the houses of people on strike
        • Other believed in a more direct form of direct action: beat up or kill the people who tried to burn down the houses of people on strike
    • Worker solidarity:
      • This is the one principle that wasn’t followed in the cubicle incident
      • The scrum master could’ve been fired
      • Under worker solidarity, the entire team would’ve said “You’ll have to fire us all!”
      • (That’s okay, though: “Scrum masters are not hard to come by” – you’ve seen the courses: "Two days, $2000, you can be a scrum master!")
  • I invert the anarcho-syndicalist flag
    • I do it to reflect something the original anarcho-syndicalists didn’’t care about: team scale
    • I believe that teams should band together more
    • Sometimes it’s "our cursed individualism" that gets in the way, the need to be the Ayn Rand hero — we’d be a lot more effective if we could get past that
    • I am advocating teamsmanship
    • We need more power in the hands of the team to counterbalance the power in the corporation
    • Remember, power can be used for good, evil…or stupid
    • If the team is completely inwardly-focused, they will do stupid things
      • Completely inwardly-fcoused teams devolve into fighting over things like who gets the workspace with the most light
  • There needs to be a manifesto for software craftsmanship, to move from journeyman to master

Plate of artisanal cheeses

  • Let’s now consider what “artisanal” is
  • It’s all about the cheese
  • As an artisanal cheesemaker, I care about cheese
  • I want to make really good cheese for really good people who will enjoy the cheese
  • I care about the cheese!
  • The interests of the executives in an organization are not necessarily aligned with the owners (shareholders) or the pesky customers
  • The teams working on a software project for an organization often care more about the project than the organization’s executives do – in the software field, they are the artisanal cheesemakers
  • We – as metaphorical artisanal cheesemakers — care about the cheese, which means “we should get away with the things we want to get away with” because these things help us get our work done

Retro-futuristic cityscape

  • Now let’s consider what “retro-futurism” is
  • The future ain’t what it used to be
  • Look at all the old science magazine articles about the future: flying cars, cities underwater and on the moon and robots that clean the house. Only one of them came true!
  • "We have 60 years of envisioning the future, and all we got for it was the Roomba"
  • The unfulfilled promises are now part of popular culture: “Where’s my jetpack?"
  • Retro-Futurism is about having optimistic images of the future
  • The spirit of retro-futurism is in Infinite in All Directions by Freeman Dyson
    • Chapter 2 is pretty good
    • The book is really good at conveying a sense of possibility
    • It says that you keep finding new things when you go in the small direction, towards the sub-atomic, but you also find new things in the big direction too, towards the universe
    • You also find new things as you go outward and see the interesting complexity of life and social organization
    • It says that there’s no end to what a curious scientist could discover
    • It is permeated with a spirit of hopefulness
  • As for you and me:
    • We’re limited in most directions
    • I want to us to try to convert ourselves to infinite in all directions””
    • Holding conferences like FutureRuby is one way to do this
    • One way not to do this is to listen to people like me
      • I once had a …vigorous debate…Ron Jeffries about test-first programming
      • It was about what programmers would rather do – would they rather write tests or new code? I kept saying that “test-first is never going to work”
      • I also said: ”In two years, you’re going to ask yourself whatever happened to all those unit tests? They’ll be gone — it’s just the way the world works!”

Painting: "Liberty" (from the French Revolution)

  • As programmers, we’re used to working within constraints
  • The context in which we work makes agile hard – we need to change the context
  • Remember, you drive the context, not the other way around!
  • I’m asking you to be scrappy in defense of producing the cheese you care about, to do what you can to do the best work you can, to make the best software you can, as enthusiastically as you can. I’m asking you to practice Artisanal Retro-Futurism and Team-Scale Anarcho-Syndicalism
  • How do you do it?
    • By getting back to your workplace?
    • By harnessing the (useful) madness of crowds
    • By proselytizing the good word of Artisanal Retro-Futurism and Team-Scale Anarcho-Syndicalism
    • By visiting Arxta.net, the “global headquarters of the movement”

See the Video!

There is a video available – while it’s not the presentation Brian gave at FutureRuby, but one he gave at an agile conference earlier this year, it’s pretty much the same.

Categories
Uncategorized

The SOLID Principles, Explained with Motivational Posters

This article also appears in Canadian Developer Connection.

SOLID Seems to be Everywhere These Days

solid

Robert C. “Uncle Bob” Martin first gathered the object-oriented design principles that would eventually go under the acronym SOLID almost fifteen years ago, but the SOLID principles have been making the rounds lately.

Before I talk about the SOLID principles, let me show you where the concept has been popping up in the past few months…

SOLID at Conferences

At the Microsoft TechEd conference in May, Steve Smith gave a presentation on applying the SOLID principles to developing applications with the ASP.NET MVC framework. At around the same time, the GeeCon conference in Krakow, Poland had a couple of presentations on SOLID: Bruno Bossola gave a talk on the SOLID principles and  Lee Brandt gave a talk on spotting SOLID code “in the wild”.

SOLID at User Groups

A number of user groups have had recently presentations on SOLID, such as:

Stack Overflow on SOLID

SOLID was the topic of a recent argument that took place over a series of podcasts earlier this year:

SOLID in Blogs

SOLID has also been spotted in a number of blogs:

Will There be a Presentation on SOLID at TechDays Canada 2009?

Mmmmmmmaybe…

And Now, The Principles and Posters

The folks at LosTechies.com have created a series of Creative Commons-licenced posters that illustrate the SOLID principles. I took the posters, cleaned up the typography a little and posted them below under the same Creative Commons licence. Below each poster is an explanation of the corresponding SOLID principle. Enjoy!

Single Responsibility Principle

single_responsibility_principle

The “S” in SOLID is for Single Responsibility Principle, which states that every object should have a single responsibility and that all of its services should be aligned with that responsibility. “Responsibility” is defined as “a reason to change”, and Wikipedia does a pretty good job of explaining it:

As an example, consider a module that compiles and prints a report. Such a module can be changed for two reasons. First, the content of the report can change. Second, the format of the report can change. These two things change for very different causes; one substantive, and one cosmetic. The single responsibility principle says that these two aspects of the problem are really two separate responsibilities, and should therefore be in separate classes or modules. It would be a bad design to couple two things that change for different reasons at different times.

Open-Closed Principle

open-closed_principle

The “O” in SOLID is for Open-Closed Principle, which states that software entities – such as classes, modules, functions and so on – should be open for extension but closed for modification. The idea is that it’s often better to make changes to things like classes by adding to or building on top of them (using mechanisms like subclassing or polymorphism) rather than modifying their code.

Liskov Substitution Principle

liskov_substitution_principle

The “L” in SOLID is for Liskov Substitution Principle, which states that subclases should be substitutable for the classes from which they were derived. For example, if MySubclass is a subclass of MyClass, you should be able to replace MyClass with MySubclass without bunging up the program.

Interface Segregation Principle

interface_segregation_principle

The “I” in SOLID is for Interface Segregation Principle, which states that clients should not be forced to depend on methods they don’t use. If a class exposes so many members that those members can be broken down into groups that serve different clients that don’t use members from the other groups, you should think about exposing those member groups as separate interfaces.

dependency_inversion_principle

The “D” in SOLID is for Dependency Inversion Principle, which states that high-level modules shouldn’t depend on low-level modules, but both should depend on shared abstractions. In addition, abstractions should not depend on details – instead, details should depend on abstractions.

Bonus Reading Material on SOLID

In addition to the LosTechies.com posters, they’ve also produced a book covering the SOLID principles in detail. Go and download Pablo’’s Solid Software Development [1.4 MB PDF] now!

Categories
Uncategorized

FutureRuby Talk: “Fighting the Imperial Californian Ideology”

The final speaker at last weekend’s FutureRuby conference was Jesse Hirsh, a Toronto-based internet consultant, researcher and “talking head” on CBC Newsworld and CBC Radio. As stated on the “About” page on his site, “his passion is for educating people on the potential benefits and perils of technology.”

"California Uber Alles" patch

His presentation, Fighting the Imperial Californian Ideology, was one of the less technical talks of the conference, whose topics ran the gamut from the expected – Ruby programming, programming languages and programming techniques – to topics you might not expect, such as nutrition for nerds, George Orwell and political languages, music and politics. In the end, it was all about building the future.

Here are the notes I took during Jesse’s presentation. I took the original notes and simply turned them into full English sentences and added context and links where necessary.

The Notes

Covers of "Snow Crash" and "Imperial San Francisco"

  • Books that influenced this talk include:
    • Snow Crash by Neal Stephenson, which plays with a lot of ideas for a single novel, including:
      • The overlap of technology and philosophy
      • Ancient history and the near future (as seen from circa 1990)
      • The concept of ideologies being viral
    • Imperial San Francisco by Gray Brechin, which looks at the role that San Francisco has played in the American Empire
  • I spent my life studying Pax Americana and have noted how Californian ideology affects us all
  • The latest version of Californian ideology comes from techies and technophiles:
  • This presentation is about how Californian ideology affects us all

 Etching: "Emigrant Train - Gold Hunters 1849"

  • “California”, as we consider it, has its beginnings in 1846
    • The United States government sent surveyors down to Mexican territory and California in search of gold
    • Minerals and mines are important to empires – there was never any successful empire that wasn’t in control of its own mines
    • In 1846, the U.S. declared war on Mexico to acquire California
    • 1849 marked the beginning of the Gold Rush
  • We need to understand the term “Gold Rush” as it applies to people to work on the internet
  • The dot-com boom of the late 1990s has often been referred to as a new gold rush, and there are parallels
  • Both featured the wealthy and powerful destroying the environment

 San Francisco

  • The events of 1849 had many effects:
    • It created an elite whose wealth was based on mining that ruled San Francisco
    • It revolutionized the mining industry, with inventions such as the mineshaft
    • The mineshaft in turn affected cities:
      • At the 1893 World’s Fair in Chicago, the concept of the mineshaft was inverted and the skyscraper was born
      • Offices in skyscrapers take mining principles and apply them to human labour
      • In skyscrapers, instead of mining the earth, you mine people
    • It created William Randolph Hearst

      William Randolph Hearst

      • Hearst was from a family whose wealth had come about from mining; he was a child of the ‘49ers
      • Hearst mines are responsible for large amounts of environmental devastation:
        • 8 out of 10 “Superfund Sites” that are too expensive to clean up
        • Many environmentally devastated mine in Latin America
      • In addition to the deleterious effects of its mines, Hearst is also responsible for The Spanish-American War, a conflict “engineered by Hearst“
      • The prohibition of marijuana was also engineered by Hearst
        • Hearst owned many wood pulp-based paper mills
        • The production of paper using hemp was cheaper and was a threat to his business
  • California is the provider of armaments for the First and Second World Wars
    • Berkeley and Stanford were schools that provided brains for the military
  • California is the home of BALCO – the Bay Area Lab Cooperative – who are responsible for the designer steroids tainting Olympic and professional sports today

 The "Julia Allison" cover of Wired

  • The Californian ideology represents an elite community
  • There is a perception among its practitioners that the world is theirs for the taking
  • The ideology highlights a past that has been swept into myth
    • That past includes a “Frontier ethos”, and the frontier was not a place for fairness
  • The ideology came about around the time of the oil crisis of the 1970s, which is also when the dollar was de-linked from the gold standard and the U.S.’ influence was beginning to wane
  • It was formalized by Brand, Kelly and the global business network
  • It is a techno-utopian vision spread through publications like Mondo 2000 and later, Wired
  • Kelly’s critiques sold a false mythology of a frontier where anyone can create a business plan
  • This mythology is that of a biological techno-utopia, a hive:
    • Problem: there are many worker bees, but only one queen bee
  • It is a means by which the ruling class maintain their power
  • The idea of the Long Tail is a meme within the California ideology
    • It’s meant to engender complacency about being in the lower ranks
    • In the Long Tail, it’s more of the same: a lucky few get all the cheese

free

  • The latest manifesto is Free Cover of "Free"
    • It’s fundamentally wrong
    • It’s not the “free” part that’s wrong
      • “Free” is disruptive
      • It’s part of the social-centric desire for freedom
    • I went to the recent Free Summit held by TechDirt’s Mike Masnick, where Chris Anderson gave two keynotes
      • Why did it take us 15 – 20 years of online economic business models cause us to realize how important social relations are important? The Communists have been saying this for years
      • We are just realizing the value of social capital
      • What’s missing is the political economy of Free
    • I agree with a large portion of Free, except for one: its ethic of waste
      • Waste is the central ethic of Free
      • The thesis: Now that bandwidth, processor cycles and disk space are abundant, we must waste it. Only through waste will be we innovate
      • The problem is that “waste is an ethic that has fucked us up royally”

 Animated photo of the FutureRuby crowd

  • The counter to the waste ethic is “How do we make more with less?”
    • That is the revolutionary potential of the internet
  • This counter is revolutionary and anti-ideological
  • “In the 21st century, there’s just culture”
  • It involves holism, which is “a flip on relativism”:
    • “I’m going to take the best shit available and integrate it into a coherent vision”
  • Society is reaching a tipping point where all the stuff we techies do is mainstream:
  • We are:
    • Bowing to masters we don’t need (California)
    • Following business models based on cultures we don’t live in (once again, California)
    • Up against the California ideology, which professes freedom but delivers slavery
  • We need to:
    • Become community activists
    • Help the next generation of AOLamers
      • Remember when AOL joined the ‘net? Suddenly there was a flood of newbies and lamers “and the whole internet went to shit”
      • “Most of the people using the net are fucking idiots”
  • How do we, as the people who can create the tools, places and concepts, quickly get lamers into the metaverse of Snow Crash? It has a lot of positives:
    • Universality: Everywhere, and accessible to everyone
    • Geography: As a virtual reality environment, it provided waypoints and neighbourhoods for different purposes
    • Space: Another byproduct of its virtual reality nature – it gave a sense of place as an means of organization, vs. the “cloud of shit” of our own internet
    • We can create these neighbourhoods for people
  • There is a big problem with "doing whatever is best for business”
    • The free market “fucked us in the last year”
    • Who can you trust?
      • The people you know
      • As a techie and participant in RubyFringe, you’re already doing it; just be conscious of it
      • None of this is new
      • It’s not about ideology, but practice
      • What we think of as the nation-state is done
      • Think of the city-state instead
      • Think of (and participate in) the cities you live in
  • The struggle for human rights continues. Which side are you on?

Discussion

FutureRuby attendee Pat Allan shares his thoughts on this presentation on his blog, Freelancing Gods, in his article titled FutureRuby and Californian Conflict.

Categories
Uncategorized

Mini-Microsoft and the Sea Change

"Mini-me" in front of a Windows logo

I’m happy to see that the anonymous blogger at Mini-Microsoft is seeing the same “sea change” that I was betting on when I first joined not quite nine months ago. I agonized over the decision all through the interview process (six interviews over the period of a week), pored over articles, books and reports about the company and had phone, email and IM conversations with every Microsoftie I knew, all in an attempt to “read the tea leaves” and see if the company was sailing towards the future or stagnating in the Doldrums. While I saw some serious challenges (including a few that could induce serious facepalms), I saw opportunities to match. And with that, I signed my offer letter back in October, bought my red travel-sized accordion that same afternoon and declared myself a Sith Lord.

The painful-but-necessary process of correcting the company’s course is nowhere near done, but signs like the ones mentioned in the article are not only good news; they’re necessary. It’s like seeing that first drop in the numbers on the scale when starting a diet: while there’s still still a long way to go, it shows that you’re actually heading in the right direction, which encourages you to keep going. Just as vanishing love handles and better-fitting clothes the good signs that a dieter watches for, things like Windows 7, Bing, Silverlight and moves towards interoperability and open source are the good signs that I’ve been watching for. But yes, while we’re turning the corner, we have to watch out, ‘cause Steve Jobs might be waiting ‘round the bend, shovel in hand.

As with many companies and organizations, we’re at the start of a new fiscal year at Microsoft. Like the calendar new year, there was some looking back (as in my annual review, where it was concluded I rocked in my Rookie Year), but there was also looking forward, in the form of setting goals, on personal, team and company-wide levels. My big goal this year to contribute to that “sea change” that both the Mini-Microsoft blogger and I see, and in the process change the Microsoft, the tech world – and hey, why not the whole world? – for the better.

Categories
Uncategorized

Netbook 2009 == Laptop 2005 (or, “Netbooks Suck, Part 3)

'Zone of Suck' between smartphones and laptops that netbooks occupy.

Here’s an idea sent to me by a friend of mine who’s not a computer programmer, but a “suit” working at a Bay Street firm in Toronto (for those of you not from Canada, “Bay Street” is Canadian for “Wall Street”).

Consider two systems, with specs as shown below:

Component System A System B
Processor Intel 1.6 GHz w/ 533 MHz bus Intel 1.6 GHz w/ 533 MHz bus
Memory 1 GB RAM 512 KB RAM
Hard drive 160 GB, 5400 RPM 80 GB, 5400 RPM
Display 1024 * 600 WSVGA 1024 * 768 WSVGA
Graphics card 3D-capable graphics card, also capable of extending the screen onto an external monitor 3D-capable graphics card, also capable of extending the screen onto an external monitor
Networking 802.11b/g wifi 802.11b/g wifi
Operating system Windows XP (and probably runs Windows 7 just fine) Windows XP (and probably runs Windows 7 just fine)

 

Although the systems are quite similar, they are from two different generations of portable computer:

  • One is an IBM/Lenovo Thinkpad T42 laptop from 2005 (pictured below and to the left), and
  • The other is a Lenovo S10 netbook from 2009 (pictured below and to the right).

Which one is System A and which one is System B?

thinkpad_t42lenovo_s10

It turns out that System A is the current-model netbook and System B is the 5-year old laptop.

My friend writes:

Netbooks are nothing other than stripped down laptops stuffed into smaller boxes. You wouldn’t buy a 5 year old notebook with the expectation that it would perform like a new one, would you?

The analogy I used when I bough a netbook is that it is like the second vehicle. I use it to run around town and do the small errands. It’s small, convenient and easy on gas but for the heavy lifting or processing, I use my laptop SUV/Minivan.

Previous entries in the Netbooks Suck series of articles: