Hanselminutes Podcast 150 - Uncle Bob Martin, this time with feeling
My one-hundred-and-fiftieth podcast is up. He's back! And he's pissed! (Not really)
RWendi has a review and commentary of the past view week's goings on around Uncle Bob, Joel Spolsky and Jeff Atwood, sparked by Uncle Bob's discussion of SOLID on show number 145. There's also a breakdown at InfoQ.
In this NEW episode, Scott sits down with Robert C. Martin as Uncle Bob (@unclebobmartin) tries to put the SOLID commandments principle into some perspective.
Here's some alternate titles for this show, suggested by the folks on Twitter!
- "He's back and he's pissed."
- "Bob's your Uncle."
- "Joel Who?"
- "SOLID State"
- "I got your tests right here!"
- "Smack Overflow"
- "Pay Attention This Time: Bob Martin on SOLID"
(No, Bob's not pissed. We're just having a laugh.")
- Download: MP3 Full Show #150
- Play in your browser.
Do also remember the complete archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.
Telerik is our sponsor for this show!
Building quality software is never easy. It requires skills and imagination. We cannot promise to improve your skills, but when it comes to User Interface, we can provide the building blocks to take your application a step closer to your imagination. Explore the leading UI suites for ASP.NET and Windows Forms. Enjoy the versatility of our new-generation Reporting Tool. Dive into our online community. Visit www.telerik.com.
As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)
Enjoy. Who knows what'll happen in the next show?
Technorati Tags: SOLID,OOD,Uncle Bob,Software,Design
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
Some schools will hire experienced programmers, such as yourself or Bob Martin, to teach classes, but this is the exception. In fact, I would imagine that the more prestigious the school, the less likely they are to hire experienced programmers and the more likely they are to hire people with grants and publications.
Even the great Donald Knuth said he was surprised how hard it was to write a large software application when he worked on TeX. He said it took far more concentration than he'd expected and that he had to reduce his teaching in order to finish writing TeX. He was a great programmer and a successful academic, but he didn't fully appreciate the challenges of working on a large system until he did it.
Personally, I wish Microsoft would have fixed that bug, and many others before shipping, but the decision to ship the product with that level of quality appears to have been a good one for Microsoft.
Sure, there are some core principles of programming that apply regardless of the languages in which they are used, but you max out that space of knowledge very fast and you quickly hit the realm where theory cannot be applied to reality anymore (again: do client-server or DNA principles have any place in modern programming? Will my SOA knowledge even be marketable in another 14 months?).
While I don't agree that quality doesn't matter, I agree with a core principle of what Jeff Atwood said: quality is meaningless if your app isn't used. It's more important to make a popular app, something that's useful and relevant that you can go back and refactor correctly in the future if there is demand for it (WordPress was the example cited of crap-code that is hugely popular and should be re-written correctly at some point).
Or to paraphrase General Patton: an ugly solution that works when you need it is vastly superior to the perfect solution that won't be ready before it's irrelevant. In the world of programming this truth is proven linguistically with PHP and application-wise with tools like WordPress or Twitter (crap code, but who cares -- it serves a popular need). Getting mired down in the principles of code gets in the way of getting things done by coding. Only if you have the luxury of success, and the time and budget that comes with it, should you attempt to follow every rule in the book for writing applications correctly.
http://www.lostechies.com/blogs/derickbailey/archive/2009/02/11/solid-development-principles-in-motivational-pictures.aspx
First I would like to say that I think that software quality matters. The degree to which it is important is variable however. For example, a website that services millions of users every day like Facebook.com better have a high degree of software quality, otherwise it will crash or be very difficult to maintain. On the flipside, for an intranet website that perhaps a few employees in a particular department use, maybe the quality of the software isn't one of the top priorities of the dev team. In the latter example, it may not be worth making the quality of the software as one of the most important characteristics of it; perhaps the features are more important so more time is spent focusing on that aspect.
Regarding Joel's comments that "...excessive TDD cuts time from other activities that could benefit the software product...", I do agree that having a great software product that nobody cares about is missing the point and counterproductive; I think most people will agree with that. You don't need to sacrifice quality in order to sell a product, but time is definitely a factor and taking too MUCH time to develop the perfect product means you may be too late.
Regarding the addition of quality post-production, I personally think that quality has to be built in from the beginning, the longer you wait to add "quality", the more difficult it will be and the less impact your actions will have towards actually achieving a higher quality level. Typically adding quality later means rewriting the code and that is expensive.
Finally about young developers, mentorship and universities I agree with what you and Uncle Bob said, that it takes time for a developer to mature. Even fantastic coders need time to blossom and get exposed to different scenarios. I would emphasize that variety is equally as important as time spent developing. A developer that has only been exposed to the same environment for many years, may still be lacking the maturity to write more robust code because of the lack of experience in heterogeneous scenarios.
One way that I think colleges could improve the state of the development profession is to partner with local companies and require that students who intend to program professionally, undergo internships. This way, they can be sure that their students have a taste of what it's like to really code at the workplace and they won't be blindsided once they graduate. It's better for companies too, because they will get more qualified entry level programmers after graduation.
-SOLID principles are all about decoupling your code.
-Decoupling your code helps you write good unit tests.
-Unit tests and (if you're up to it, TDD) are great ways to have quality software.
All this has me thinking a lot about the quality of my code. (ie. testability, how decoupled it is etc) I'm not trying to adopt the SOLID principles as a commandment, but more as a guideline, which I am more than glad to follow.
This has been very enlightening and has pretty much changed the way I picture what good code should be.
Not in so many words, but what you will hear is, "Engineering is the art of doing with one dollar what any damn fool can do with two." Engineering is not about the pursuit of quality for it's own sake, it's about producing a product hat meeds the specs as efficiently as possible. The watchword in engineering is efficiency, not quality.
The other thing that struck me Bob and Scott talk about quite a bit of experience and experienced developers. Experienced does not always mean better. In fact, "'Experienced' often refers to someone who's gotten away with making the same mistakes over and over again for longer than you have."
My comments on the whole thing are here:
http://geekswithblogs.net/btudor/archive/2009/02/21/129583.aspx
Keep up the great work, Scott.
In the podcast you mentioned pain in your hands (I seem to remember that you have brought it up in a previous podcast as well).
I have had RSI problems with my arms, and I just thought I'd point you to my description of my problems, and how it was resolved (at least not getting any worse).
I wrote it up on Stackoverflow, here: http://stackoverflow.com/questions/1915/how-do-i-know-if-have-rsi-or-carpal-tunnel/57676#57676
Hope you can manage to sovle the problem, and that you can keep programming as much as you want.
Best regards,
Henrik Warne
I rather deliver half a product than a half as* product. So cut features to get there early not quality. Most of the time you can cut 30%+ of fluff in each app which will provide the time you need for that higher quality push.
I've been using this method successfully for several "REAL WORLD" projects. I've built two production apps running on ASP.NET MVC since Preview 3 using this method. I've been able to refactor these (one of the major benefits of test coverage) with each preview release with minimal effort. The bug count on these apps has been roughly the same as that of other apps I've written using the 100% code coverage mentality on more stable framework.
**WARNING** This opinion is based on REAL WORLD personal experience, not academic theory! :)
The core of your podcast is dancing around the question of "What is good enough?"
The definitions of enough vary quite dramatically from project to project and person to person.
In particular the definitions will vary by the size of the project / company. And this is where Joel and Bob really work at odds. They are coming from two completely different realms project / company. Let's say there are 4 classifications:
1. Small / Micro / Start-up
2. Medium, established niche
3. Large, thousands of users, typically a legacy base
4. Web-scale, millions of users (Google, MS)
Now Joel clearly comes from world #1. Bob is from world #3 or 4. Scott, you're from world #3 (& now #4).
For most developers in world #1 or 2, Bob's SOLID principles are at best guiding lights for solving the "next big bottleneck". (But there's a lot to be said about first having bottlenecks worth solving) There is simply not enough value generated by writing interfaces for the large mass of internal layers that are never exposed. Lots of objects simply don't need a "single responsibility", because the cost to change is very low. In my simple DB app, I don't extend more than 1% of my classes, so why do I worry about the OCP? In "Fog Creek" world, there's a lot of leeway in the term "Quality".
The cumulative sum of generating unit test for vast swaths of Maintenance screens simply doesn't justify the time spent on this screens. In fact, most people in world #1 & #2 seek out tools (like CSLA) quite specifically to generate Maintenance screens b/c they just don't justify any custom functionality.
Let's flip this into a practical application. (with no offense to Jeff here)
I can tell you right now that StackOverflow will not scale to 100x as it is currently architected. If the number of StackOverflow users grows by 100x the entire architecture will need to change. No, I've never seen the codebase, I've just listened to the podcasts (Hanselminutes and their own) but just listening to the problems it's obvious that things would need to change.
For 100x, they would need multiple databases. They would needs specialized services to push data back and forth. Your rep score would be updated every 60 minutes by a service (not in real time), there would be a server responsible for updating RSS feeds. Data about updates would be pushed to the DB and replicated to bulk insert files on the RSS server to manage the reads against the primary.
As I said above the SOLID principles would be a guiding light in solving these problems. They would need to break out interfaces for "high-communication" features and build standard interfaces for communication (Web Services, Bulk Insert files, etc.). They would need to reduce connectivity dependence, LINQ-to-SQL would suffer as tables became stored on different DBs. They would need IOC model for managing connections at a table level so that they could point connections at the right spots.
Of course, in the process of growing by 100x, they move from world #1 all of the into #3. And the nature of these SOLID principles is that they become more valuable as the scope of the project grows and the available resources to build that project also grow.
I work for an ad network, so I live in world #2 & #4. In one world we serve 100s of millions of impressions in a day. In another world, we operate a user interface with 100s of users. The definition of "Quality" varies dramatically between these worlds. In one world, we can build drag & drop UIs with MS AJAX and average response times. In another world we write these massively scalable and distributed apps with lots of interfaces and IOC and robust, error-resistant code.
When Joel talks about Bob having "never written much code", he's talking about Bob not having written very much of the type of code that Fog Creek writes. When Bob lays out the framework for a new project he simply has too many tools that do not provide value in Joel's world. When Joel lays out the framework for a new project he ignore many of the tools in Bob's framework because he's never really needed them before.
And that's OK... I mean look at StackOverflow, it already has every dev on its mailing list :). It doesn't actually have to grow 100x to cover its potential market.
Musicians are artistic and yet apply structure in the form of harmony, rhythm, scales, etc. Good programmers are like musicians.
There is great beauty in classical music. I love Bach, Mozart, Beethoven and many others. Classically trained musicians bring that music to life. Yet I would be afraid to hear most classically trained musicians improvise over a jazz chord progression. There is a place for highly-trained programmers but that is not the only effective approach to programming.
Perhaps programmers resemble musicians more than they resemble doctors, lawyers, and architects. The craft should be approached in a similar manner. What are you listening to on your iPod this week?
PS. I love your podcast and blog. Thank you for all you do for the developer community.
Comments are closed.
Attend a thousand or even a million lectures in engineering courses and you'll never hear an instructor say "quality doesn't matter".
Here's an article and a wiki about the differences between science, art, and engineering as well as reasons why software belongs as an engineering discipline, not as a "science". Google will also turn up a number of articles i
http://www.stevemcconnell.com/psd/04-senotcs.htm
http://en.wikipedia.org/wiki/Software_engineering