This week I gave a presentation about Software Craftsmanship at the Norwegian University of Science and Technology (NTNU) in Trondheim. There were about 50 attendees, they were enthusiastic and asked a bunch of questions. Couldn’t have asked for a better audience!

Here are some pictures:

Software craftsmanship @ NTNU

Software craftsmanship @ NTNU

Here are my slides:

How do I become a good developer?

One of the students asked me this question. I’m not sure there is a short and correct answer to this question, but I’ll try to lead you in the right direction - so that you can find some answer. Pete McBreen suggests the Apprenticeship model for learning in his Software Craftsmanship book:

“We must reverse the decline in the quality of developer training. Learning software development is not the same as being taught how to program. Apprenticeship is more effective than training to learn a craft, since it is more about learning than it is about teaching. Apprenticeship deliberately avoids the "learned helplessness" of the schooling model by making the apprentices an integral part of the software development team (chapter 12).” – Pete McBreen, Software Craftsmanship: The New Imperative

Apprenticeship is simply explained: learning by doing with guidance from an experienced fellow. Read the Wikipedia article for more information.

What does it mean for me? Well, it means that you should find someone that can teach and help you to become a better developer. Don’t expect this person to tutor you, but expect this person to give you directions. This person will tell you what books to read, what problems are worth solving, what concepts that are worth looking into, what tools to use, what Open Source project you should look into etc.

Therefore I think you can start becoming a better developer by finding someone to pair up with.

What books should I read?

The first three books that pop up in my head are:

You’ll find more suggestions here and here.

Good luck on your journey to becoming a master in the craft of Software Development!

Friday, February 05, 2010 3:45:56 PM (W. Europe Standard Time, UTC+01:00) 
  Permalink  |  Comments [1]  |  View blog reactions  | 

If you read my blog or if you know me personally, you know I'm a big fan of Unclebob. The reason I admire him is simple: he is a major contributor to the developer community. He writes books and articles, speaks at conferences and contributes to Open Source Software. It inspires me to see that he still have a glowing passion for software development, even though it has been his labor for 35 years. It's the same passion I have right now, but it has only been my labor for 8 years. When I'm turning 40, 50 and 60 I still hope I have this passion in me.

The cool thing about Unclebob is that he does not only talk the talk, but he also walk the walk. A couple of days ago he published a video where he is doing a Prime Factors Kata in Ruby. In this video you'll see mastery of programming. Watch it and enjoy!

I hope I someday can become a master software craftsman like Unclebob. Right now I'm still on my journey.

Read more about coding Katas on Unclebob’s blog.

Monday, November 23, 2009 8:56:47 PM (W. Europe Standard Time, UTC+01:00) 
  Permalink  |  Comments [2]  |  View blog reactions  | 

About three weeks ago, I asked my readers and some people in the Norwegian developer community about what books they have in their bookshelf. The response was good, and I ended up with many good book recommendations.

Today I placed a new order on Amazon, and spent 200$ to upgrade my bookshelf. If you read further, you’ll see which books I ordered.

Software Craftsmanship: The New Imperative
Pete McBreen

“This book is the foundation of the Craftsmanship movement that seem to get momentum these days (and that is a good thing). “Software craftsmanship” sounds nice and has a positive ring to it, so it does not seem to be hard to endorse. But for Pete McBreen software craftsmanship is more than just taking your job serious. It’s a way to organize teams, a way to run projects, a way to run the whole industry, a way to organize learning, and a new way to look at developers. I really like many of his ideas, and I hope people like the Craftsmanship movement not just because it sounds nice, but because they know what this book is about. Read it and see what you think of “Software engineering” when you’re done.” – Tore Vestues

Working Effectively with Legacy Code
Michael C. Feathers

“Don’t be scared away just because the title has the word “legacy” in it. This book is not about VB6 or Fortran. Not at all! It’s probably the best book I’ve read about writing automated tests. It is about how to work with code that is not tested (which is Feathers definition of legacy code). And it is about testing in general. If you want to write tests for code that is not previously tested (or written in a way that makes it testable), this book is for you.” – Tore Vestues

Test Driven Development: By Example
Kent Beck
Kent Beck is the man behind design patterns and TDD. Do I need to say more? If you don’t know his work, have a look at his presentation from RailsConf 08.

Extreme Programming Explained: Embrace Change
Kenth Beck

“Extreme programming is beautiful. Not only because it uses the well known practices of TDD, CI, Pair programming and so on. Xp is beautiful because it understands that practices do not stand on its own. You need a mindset. The mindset is expressed through the Xp Values, and throughout the entire book. Xp is close to a philosophy. Read the book and I’m sure you will see software development in a slightly different way.” – Tore Vestues

Agile Software Development
Alistair Cockburn
Twitter sphere is amazing. I got this recommendation from my online friend Liam.

Here is a review from Amazon:

“Every fifteen years or so, a great book pops up that describes what projects are really like. There was Brooks, then DeMarco and Lister, and now there’s Cockburn.

Why is there such a gap between these great books? Possibly because the message they contain isn’t the easy-to-digest dictate: “run your project this way and everything will be fine.” Instead these books all focus on the fundamentals of projects: people and the way they work together. These books treat people as people, and not replaceable parts in a process. The books accept people’s foibles and inconsistencies, and work out how to work with them, rather than how to try to stamp them out. The books ask: how can we help these funky people work better together to produce great software?

Agile Software Development has some great answers, which makes it a significant book. It deals with the issue that programming is essentially communicating. It looks at the success factors of individuals, and how to help align the project with these. It discusses practical ways to reduce the latency of communication (do you know how much each extra minute taken finding things out costs on a 12 person project? How do you line your walls with information radiators?) The book mines the metaphor of development as a cooperative team game, and looks at development organizations as a community, where good citizenship pays.” – Dave Thomas

I want to thank all of you how responded to my post, and my twittering. If you wondering; the total cost of the books was 160$, and 40$ in shipment L

Thursday, May 28, 2009 11:50:18 AM (W. Europe Standard Time, UTC+01:00) 
  Permalink  |  Comments [6]  |  View blog reactions  | 

Every now and then I get the question about what books I recommend on the topic of programming and software development. As I try to practice the DRY (Don‘t repeat yourself) principle while writing code, I‘ll also intend to do it in real life. And by answering this question in form of a blog post, I‘ll be able to redirect future questioners here.

IMG_5895 

I’ve assembled a list of books that I’ve read or that’s in my books-to-read queue.

The list

The list is sorted by my favorite books.

Clean Code
Robert C. Martin, also known as Uncle Bob
I finished reading this book a week ago and I have only one thing to say, it’s a masterpiece. If you are a professional programmer, you should read this book. I learned many, many neat tricks reading this book. Uncle Bob have 40 years of experience as a programmer, and he worked very hard not to become a business wonk, and this made him sharp like a knife. Read this book, it will give you a clear perspective on how to write quality code. Expect to read lots of code samples, and work hard to grasp the content. I’m going to convince every programmer I work with to read this book!

The Pragmatic Programmer
Andy Hunt and Dave Thomas
Hunt and Thomas are great storytellers and you’ll be blown away with their wisdom – it seems like they have been programmers forever! I like this book because it‘s hands-on and lots of the advice you get by reading it, you can put into practice in your daily job. The book tells you everything you need to know in order to become a good programmer.

They also push hard that programming is not only science, but a craft, and you need to practice it a lot in order to become a master - hence the slogan “From journeyman to master”. The book will provide you with tons of practical tips and the first one is “Care about your craft”. If I ever get responsible for a team of developers - hey, who the heck would put me in charge? :p, I’ll give this book to every one of them and then send them home and ask them not to come back before they have completed the book!

Design Patterns: Elements of Reusable Obect-Oriented Software
Eric Gamma, Richard Helm. Raplh Johnson, John M. Vlissides AKA. The Gang of Four
The first book ever to write about design patterns, it was released back in 1994 and it documented 23 patterns. I have to admit that I had to read this book several times to grasp most of the ideas, but it was worthwhile.

This book is not for beginners, but for developers with experience from OO (Object Oriented) languages and design. You probably find people argue that this book is not applicable today because the patterns were discovered in the time of C++, which don‘t contain modern language features like Generics and Events like we have in C# today. I disagree with these people because the core underlying principles are just plain old Object Orientation, but I can understand the argument. The samples in this book might not be as relevant for C# as they are for C++, and if you apply some of these patterns in a modern language, you obviously need to think about the features you have available in the language, and use them. There is a reason that we have the event language feature in C# today – so it’s easier to implement the observer pattern! If you learn and understand the observer, you‘ll also learn that loosely coupled code is harder to read and debug. The book is a good reference and contains the most general patterns you need to know about, but remember that even though you use a language with built-in language feature for some of these patterns, you should know about the pros and cons in order to make good design decisions! This is a good educational book.

Domain-Driven Design: Tackling Complexity in the Heart of Software
Eric Evans
I think this one is about to become one of the most important books out there on the topic of OO design and modeling. It‘s been a while since Evans published this book, but it seems to get more and more attention nowadays, and more and more people I talk to practice DDD (Domain Driven Design). I think the most important thing Evans teaches us is what he calls the ubiquitous language. The books also teach good modeling practices, and documents lots of useful patterns. This book made me revisit Object Orientation. You should read it, if you are experienced with OO design and programming.

Head First: Design Patterns
Elisabeth Freeman, Eric Freeman, Bert Bates, Kathy Sierra
This is the design patterns ABC-book. The authors have a great talent in communicating complex ideas in a way that‘s easy for the readers to understand. The book contains some of the same patterns as the GoF-book and the code samples are mostly in Java as well. Highly recommended for beginners on the topic of design patterns!

Windows Presentation Foundation Unleashed
Adam Nathan
The only book I‘ve read about Windows Presentation Foundation, and It gives a solid introduction to the technology. I admit that I haven’t read the book from chapter to chapter, but use it frequently as a reference when I need to learn new neat features about WPF. The code samples in the book even have color highlighting! This book should be in every WPF/Silverlight developer’s bookshelf.

The best Software Writing
Joel Spolsky
Mr. Spolsky has assembled a very entertaining book of essays on the topic of software engineering. The essays I remember are Paul Graham’s “Great Hackers” and Eric Lippert’s “How many Microsoft Employees Does It Take to Change a Lightbulb?”.

Agile Software Development, Principles, Patterns, and Practices
Robert C. Martin
I’m hooked on Uncle Bob, he is the Master Chief of programmers, and an awesome writer. This is a book I’ll read very soon.

Patterns of Enterprise Application Architecture
Martin Fowler
This book is yet another book that’s on my books-to-read queue. Fowler is a notorious craftsman in the art of software engineering, and I’m looking forward to take a snapshot of his brain!

Code Complete: A Practical Handbook of Software Construction
Steve McConnel
Have not had the chance to read this book yet, but I will sometimes soon. The word on the street says that this book is even better than Pragmatic Programmer – now we have to see about that!

Applying Domain-Driven Design and Patterns: With Examples in C# and .NET
Jimmy Nilsson
I haven’t had the opportunity to read this book yet, but people that have read it says it’s a more hands-on and practical book than Events book.

 

This is my list, for now, but I’m continuously seeking more knowledge in order to become a master in the craftsmanship of software development. While assembling the list I just realized that I don’t have a book about Test Driven Development – I should do something about that.

It would be interesting to hear what you and other fellow developers are reading, and what you have in your bookshelf – so therefore I‘ll start yet another meme and I invite you and the following people to answer:

  • Jonas Follesø – Silverlight guru, vivid speaker, long time partner in crime and friend!
  • Tore Vestues – wise guy and friend. I think of him as one of the most skilled craftsmen I personally know (It seems like Tore already had a book list, I’ve updated the link)
  • Anders Norås – Admirable and skilled software craftsman
  • Einar Ingebrigtsen – The Norwegian Scott Hanselman!
  • Mark Nijhof – Seriously skilled software craftsman and a community hero
  • Håvard Stranden – Fellow member of NNUG in Trondheim, active blogger and speaker
  • Børge Hansen – Active blogger and architect working for Microsoft Norway
  • Sondre Bjellås – Friend, thinker, mr. Robotics and the Norwegian Geek of the Year 2008
  • Fredik Kalseth – Highly active blogger about .NET, design patterns, testing etc. and a skilled software craftsman
  • Lars Wilhelmsen – Highly active in the Microsoft community and the new master chief of the Norwegian .NET User Group. Lars has now responded to this post. Click the link to watch his bookshelf 
  • Joar Øyen – Friend, MVP and master chief of NNUG Trondheim
  • Pål Fossmo – Friend, MVP, good speaker and a skilled software craftsman. Pål has responded to this post 
  • Kjetil Klaussen – Friend, good speaker and a skilled software craftsman
  • Johannes Brodwall – Norwegian agile guru!
Tuesday, May 05, 2009 7:58:33 PM (W. Europe Standard Time, UTC+01:00) 
  Permalink  |  Comments [13]  |  View blog reactions  | 

A colleague of mine showed me this YouTube video a week ago, and I thought was so much fun that I had to share it with you. Please take 4 minutes to watch the video - it’s worth it. You’ll see the comedian Louis C.K. talks about how ungrateful we are, even though we live in this amazing world with all this fancy technology that makes our lives easier to live.

Louis made some darn good points, and he made me think about how many unhappy fellow engineers I’ve spoken to lately – many. This made me thing about how it would be to work in the early days in the IT-industry, where the tools were much more primitive. In this age of the industry we are capable to create it-systems to automate most of our daily routines, but back then the computers were mostly used in the field of science. Nowadays even grandma can pay her bills using a web browser without leaving her home to visit the bank. This enables her to spend more time doing whatever she think is important, like watching her grandkids. This made me think about a quote I read in The Pragmatic Programmer.

“Civilization advances by extending the number of important operations we can perform without thinking.” - Alfred North Whitehead

So let’s do something fun; let’s have a look at how it was like to be a programmer 50+ years ago, and try to imagine how much work it would take to get the computers to “work” for us back then compared to nowadays .

Programming today and 50+ years ago

Today there are many high level general purpose programming languages. Programming nowadays is more like having a conversation with the computer, and we can express ourselves in a language similar to English.

If you use a statically typed language like C# or Java, you need to compile the code, which will output assembler code (machine code) that can execute on a computer. C# and Java are a special case, because the assembler code runs inside a virtual machine, which means that the assembler code is more high level than regular X86 assembler code. Anyway, this abstracts us away from the nitty gritty details of machine languages, which is hard to program, understand, read and maintain.

So let’s do something fun, let’s implement the Fibbonaci algorithm in C# and in X86 assembler code (machine level code).

C#

   1: class Program
   2: {
   3:     static void Main(string[] args)
   4:     {
   5:         Console.WriteLine("23rd fibonacci number: {0}", Fibonacci(23));
   6:         Console.ReadKey();
   7:     }
   8:  
   9:     static int Fibonacci(int n)
  10:     {
  11:         if (n == 0 || n == 1)
  12:             return n;
  13:         else
  14:             return Fibonacci(n - 1) + Fibonacci(n - 2);
  15:     }
  16: }

Assembler

   1: .model tiny
   2: .code
   3: org    100h
   4: rt:
   5: mov    ax,cs
   6: mov    ds,ax
   7: mov    es,ax
   8: cld
   9: push    23
  10: call    fib
  11: call    print_eax
  12: ret
  13:     push    bp
  14: mov    bp,sp
  15: mov    di,offset fib_array+2
  16: mov    cx,[bp+4]
  17: loop:
  18: mov    ax,[di-1]
  19: add    ax,[di-2]
  20: inc    di
  21: mov    [di],ax
  22: loop    fib_loop
  23: mov    bx,[bp+4]
  24: mov    ax,word ptr [bx+fib_array]
  25: mov    [bp+4],ax
  26: pop    bp
  27: ret
  28: t_eax:
  29: mov    bp,sp
  30: mov    di,offset outbyte
  31: mov    ax,[bp+2]
  32: mov    bx,10
  33: xor    cx,cx
  34: p:    xor    dx,dx
  35: div    bx
  36: add    dl,48
  37: push    dx
  38: inc    cx
  39: test    ax,ax
  40: jnz    divlp
  41: e:    pop    ax
  42: stosb
  43: loop    store
  44: mov    byte ptr [di],'$'
  45: mov    dx, offset outtxt
  46: mov    ah,9
  47: int     21h
  48: ret 2
  49:  
  50: xt  db  "23rd Fibonacci number is "
  51: xt_l = $-outtxt+1
  52: yte    db  "00000000"
  53: array db 1,1
  54:  
  55: end _start

Pasted from: http://cubbi.com/fibonacci/asm.html. Ps: I’m not sure if this code even works.

And yes, I realize that the x86 instruction set is younger than 50 years, but I thought it would be a good example, and it’s still assembler code, which is low level enough! When the C# get’s executed it’s probably going to end up looking something like the assembler code above, and that’s the main trick of compilers - they translate high level languages into low level machine code and instruction sets.

This it’s a nothing more than amazing! In the modern language I used the concepts of recursion, functions, strong typing, classes etc. Now compare it with the Assembler code, which I by the way almost seems like a foreign language to me. This modern language really enabled me to do more with less.

So if you think that the modern languages today are crappy, or they should have been different in any way, you should try to think about what if we had to implement business applications in assembler? Compilers are one of the most technical challenging problems we face in our career as programmers. I think we owe the creators of modern languages a really big thank you!

And if you are in a situation where you maintain crappy legacy code implemented in C#, VB 6, JavaScript etc. Imagine if that code was implemented in assembler - it would be much worse that you can even imagine, and it probably would end up being your worst nightmare. The only one you can blame for bad code in modern languages is yourself and your fellow engineers.

It’s not only the languages that have evolved, but also the frameworks. Today we have tons of commercial and open source frameworks, which also is a key enabler when developing high quality software. The frameworks I can come up with at the top of my head are;.NET, Java, Apache, Hibernate, Ant, CruiseControl.net, Silverlight, Mono, Moonlight, Struts, Ruby on Rails, SPRING etc. And let’s not forget the tooling; Visual Studio .NET, Eclipse, IntelliJ, TextMate, TextMate, SharpDevelop etc. And the funny part is that since we are getting better and better tools, the development speed of these languages, frameworks and tools seems to go even faster.

Nobody is happy?

So even though you are not happy with what you are doing in your daily job as a programmer, imagine how it would be if you had to maintain assembler code, how it would be to write ORM mapping by hand or if you had to use Notepad as you development environment – now it doesn’t seems so awful, does it?

But don’t fool yourself to think that’s something wrong with the languages, frameworks and the tools; a fool with a tool is still a fool! Even though it’s possible to do amazing things, programming is still something that takes hard work and lots of practice if you want to become a master. If you are serious about becoming a programmer, you should know that you have to face at least 10 years of practice to really master it. Programming is really, really hard - period. When it becomes your profession, it’s not only about creating cool stuff, it’s about creating cool stuff with high quality, and it’s the last part that’s hard. I’ve been programming professionally for 8 years, and I still feel like a young journeyman when I read books by Robert C. Martin, Eric Evans, Andy Hunt, Dave Thomas, Craig Larman, Martin Fowler etc. I realize I have still a long way to go before I can call myself a master.

So even though we can do all these amazing things, you still need to learn how to master the craftsmanship of software development, and if you are serious about it, expect to practice for a long time. You can expect much from this industry, but it will also expect much from you! So if you want to become a happy developer, you need to become a decent software craftsman, and expect plenty of work to achieve that!

Monday, March 23, 2009 10:31:26 PM (W. Europe Standard Time, UTC+01:00) 
  Permalink  |  Comments [11]  |  View blog reactions  |