DEV Community

Cover image for I'm Sandi Metz, Ask Me Anything! [Finished]
Sandi Metz
Sandi Metz

Posted on

I'm Sandi Metz, Ask Me Anything! [Finished]

Hi, I'm Sandi Metz, author of Practical Object-Oriented Design in Ruby and 99 Bottles of OOP, and I believe in simple code and straightforward explanations. I prefer working software, practical solutions and lengthy bicycle trips (not necessarily in that order) and I write, consult, and teach about object-oriented design.

Ask me anything!

Top comments (60)

Collapse
 
annarankin profile image
Anna Rankin

Hello again! A question I forgot - shortly before I joined my current engineering team, they'd spent a few days doing a workshop with you (they called it "Sandifest" 😂). What sort of things do you do when you spend time with a development team? How do you determine what subject matter to focus on?

Again, thanks a million :D

Collapse
 
sandimetz profile image
Sandi Metz

Hey, Anna, I teach a 3-day OO course, and that may be what your folks are talking about. The course gets tuned to the group, but contains a set of foundation OO ideas that I cover for every class. It's really about how to think in OO.

Collapse
 
annarankin profile image
Anna Rankin

Awesome! Thanks :D

Collapse
 
jgregor5 profile image
jgregor5

How do I explain OOP to young students that don't know any other programming paradigms? Because classes are just representations, not the real world. Why do we need OOP?

Collapse
 
restoreddev profile image
Andrew Davis

Hi Sandi, thanks for doing this AMA. When you code, do you follow TDD religiously? I like to write tests, but have a hard time writing tests before functionality, so I tend to write tests after the fact. What downsides do you see to writing tests second?

Collapse
 
sandimetz profile image
Sandi Metz • Edited

Andrew, this is my pleasure.
Ah, TDD. I find my code turns out better if I write tests first, but I am deeply sympathetic about how hard that can be. Writing tests first can help drive you to create decoupled code. If you write tests 2nd, and then find that the tests have complicated setup, this suggests that your code is too tightly coupled together. If you write tests first, and insist on having simple setup, you'll naturally end up with nicely decoupled code.

Collapse
 
restoreddev profile image
Andrew Davis

That makes sense, thanks!

Collapse
 
maestromac profile image
Mac Siri

Would you advise your career path to other developers?

Collapse
 
kristinmars profile image
Kristin V Marsicano • Edited

Hi Sandi! Thank you for investing the time to do this AMA. I admire your work, especially your approachability as a teacher and your ability to make concepts accessible to different audiences. My question for today, however, centers around something I am currently grappling with...

How often do you context switch between writing, consulting, and teaching? Do you have any tips for streamlining this process? In particular, I find switching between writing and other non-writing tasks within a day to be somewhat challenging (some days more than others). Also, how do you avoid burn out? So basically...how do you do it all? :-)

P.s. I "met" you when someone sent me a link to one of your conference talks. I loved it so much that I read POODR (even though I did not know Ruby). I learned a lot about OO (and also about Ruby). So thank you!

Collapse
 
sandimetz profile image
Sandi Metz

Kristen, I fear that I'm terrible at context switching. I do best when I can bury myself in one thing and ignore everything else. This often means that I neglect the small things (arg, email) in order to work on big things (a book chapter, or a talk).

I'm reconciled to this quality of myself, and just have basically arranged my life so that I can work like this.

The one thing I've found is that I do my best writing early in the day. I can write prose in the morning, take a break, and then write code in the afternoon, for example. Writing prose is super painful for me, and code is always a joy, so I tend to reward myself with code, once other writing is done.

Collapse
 
ben profile image
Ben Halpern

I think I work in similar patterns, any advice on the specifics of arranging your life to fit your work style?

Collapse
 
kristinmars profile image
Kristin V Marsicano • Edited

Thank you so much for your candid response!

"I do best when I can bury myself in one thing and ignore everything else" --> your point about accepting this quality and arranging things so you can work the way that is most natural to you is super helpful! I have the same quality (I prefer to bury myself in one thing) but have been resisting accepting it. So now I am going to try to rework things so I can work the way I work best, instead of trying to convince myself I can be or have to be a context-switching-super-star.

I am also going to try your approach to writing in the morning. Typically I fill my morning with other things in effort to "get them out of the way so I can write". I'm going to flip that and write first thing in the morning so I can get to the other things in the afternoon.

Collapse
 
hanmaslah profile image
Hannah Masila

When you are dealing with optimization, which do you give more preference/weight in terms of performance. Is it time complexity or memory consumption. And how do you decide which data structure to use?

Collapse
 
ben profile image
Ben Halpern

How do you feel about static analysis tools for code coverage, code quality, styling etc.

Collapse
 
sandimetz profile image
Sandi Metz

I love them, in their place, and taken with a grain of salt. Static analysis tools can't get everything right, but they can supply an unbiased, reproducible overview of the state of code.

Like, for example:
Is it getting worse or getting better?
What parts of the code hold the most danger for someone who doesn't know the app?

I don't want to be pushed around by metrics, but I do want the insights they can give me.

Collapse
 
ben profile image
Ben Halpern

Got a list of tools you'd recommend?

Collapse
 
jgaskins profile image
Jamie Gaskins

You've mentioned Smalltalk a bit in your presentations and podcast appearances. Do you still do any Smalltalk programming?

Collapse
 
sandimetz profile image
Sandi Metz

Nope, but if I had the free time, I certainly would. Squeak looks interesting. My go-to dynamically typed OO language these days is still Ruby.

Collapse
 
lightalloy profile image
Anna Buianova

Hi, Sandi!
Thank you for your books, they are great :)
A couple of questions:

  • What do you think about Domain Driven Design, do you use it?
  • Do you have plans on writing more books?
Collapse
 
jess profile image
Jess Lee

What was it like collaborating on your newest book with Katrina, versus being the only author? How did that impact your process?

Collapse
 
sandimetz profile image
Sandi Metz

Collaborating with Katrina was equal parts delightful and a cause of great head-banging, as you'd likely expect. Let me be clear--Katrina is wonderful, it's just that the very process of collaboration requires compromise, and blending disparate ideas. This was good for the resulting book, but not necessarily welcomed in the moment.

Collapse
 
jess profile image
Jess Lee

Any memorable conflicts that you're both laughing about now?!

Thread Thread
 
sandimetz profile image
Sandi Metz

Too many, really, to pick one. Katrina and I as very different. The core lesson for me was that while it's easy to pair with someone who is like you, it's better, if you can stand it, to pair with someone who is different.

Being forced to resolve our differences improved our understanding of the material, and vastly improved that book. This only worked because, despite our head-banging, we respected one another's ideas, and believed that if we stayed at a discussion (read, argument) long enough, we would find that we actually agreed.