Lean code means you are not writing code just because you are a programmer. You are writing only enough code to get the job done. Any extra code is just wasted time and money. If you find you are adding code to "use later". Stop. Later rarely comes and applications live long lives. That code you added for later only confuses later. Think of it this way. Every piece of paper on your desk must be handled. Every line of code must be dealt with.
I have read their book "Getting Real". I do not agree with everything. Yet, much of what they say does apply to web development and wouldn't apply to desktop or device applications. It seems a lot of the content, especially near the end, is just noise to fill a book.
How I Generate Lean Code
Document (for yourself) what you need to do and your understanding of what needs to be done. Be absolutely clear on your understanding. Better to get a yes/no now then a bug, or worst, a design issue, later that will cost you weeks, which always results in "hacked" code.
Generate a rough draft of a brief user-guide. Even if you are the only one who will read it. Do this with pencil and paper. Do not waste time with a word processor. You will waste more time "formatting" then writing content. If you cannot write it in words, how can you code it? It does not have to be pretty. Ugly is okay.
Generate any kind of documentation with pencil and paper as much as possible. (Hey, didn't I already say that.) It is much faster, it is clear, users can write on it, you can copy it, hang it on the wall, and so on. More importantly, you can erase it and start over with the user right there. Did I mention it is much faster.
Perform personal code reviews. One good method is to compare each file before checking into source control. I guarantee you will find bugs, items your forgot to do, and so on. This is a good time to clean up the code and generate any user or technical documentation and last minute testing.
For instance, I spent a day creating an Excel workbook to document a model I needed to create. I did this for myself. The model was already designed by specialists (on paper). I found, I should say Excel found, a circular reference. I reported this but was told that the model has been worked out carefully over the past month and the problem was my understanding. Two months later, fixing that "circular reference" costs us two weeks. We barely made the deadline. What could have been resolved in eight man-hours, costs us over sixty man-hours and lots of stress. Yet, because my code was "lean" the fix was only a few lines of code to a small table function.
Most programmers will code first. Most developers with document first. In general, every minute documenting early will save you ten minutes later. (Read "Code Complete".) Yet, do not forget to "get real". Your job is not to code, but to build solutions. Think of it this way, a writer's job is not to write but to create a document that someone will read. He doesn't add a chapter just because he or you might need it later. He continually has to make a decision on what to include or exclude to reach his reader. Better to take a few minutes to make a decision about code then spend a day coding, only to realize the code is not needed.
Generally, I do not write Test-Driven-Development (TTD) code. I find you end up writing a lot of code for no reason, instead of providing a solution. Before I get "flamed", I always write TTD on paper first. If I cannot work something out, I will create a "discard" project and write some code. If I find I have to dig deeper, I create a "wip" (Work-In-Progress) project, and if that fails, I will finally create an actual Test project. With that said, as Justin Ethier mentions, if I am writing libraries or core functions for an application, I always create a Test project.
Tidbit
For an application, I once created and embedded a RSS Pane control that downloaded company financial information from Google. My supervisor requested this feature to "wow" the managers before a demo. It did. Everyone absolutely loved it. While working with a company, users would get instant news alerts specifically for that company. It took me four hours to create and implement, which I did right before the demo. Yet, because this was a feature the users did not ask for, they constantly complained that I was wasting time implementing unnecessary features, especially features they did not ask for when I couldn't provide the features they requested. (Which was not my decision.) About two months later this control started throwing exceptions. It took me two days to troubleshoot and fix. This feature was a great success, but imagine the problems if it wasn't.