Showing posts with label book. Show all posts
Showing posts with label book. Show all posts

Tuesday, December 8, 2009

Another book, another kata

This unit testing book by Andrew Hunt and David Thomas is better than the last one, but I made the mistake? to start reading The art of unit testing in parallel (when I've finished that book, a review will be posted as well). So, nothing bad about the pragmatic book, but nothing good either. It covers NUnit (already with "That") and only strives mock-frameworks. There are a plenty of tips how to write good unit tests, among them mnemonics like "Right BICEP", "A TRIP" and "CORRECT". There is even a Pragmatic unit testing summary in checkbox-format. As if I'll go through all the rules after writing a test *lol*
All in all, a good book - but I'm looking forward to "the art".

Staying by Dave Thomas, I've done his sixth kata "anagrams" a few times and I always learned a new shortcut, trick or whatever. I rarely use the mouse anymore and I've downloaded ReSharper (because we're using NUnit instead of MSTest now) and took benefit from the smooth integration of the refactorings. DevXpress had to go unfortunately.

Here, I've found a nice introductory-video in the principles of coding katas, if you're interested.

Here is a video about the randori-variation.

Uncle Bob takes this approach a step further and declares coding kata as an art. See him performing the prime factor kata to music! here.

Monday, November 16, 2009

Test-Driving

The plan is to do a 2-week-bootcamp right before christmas to learn / get experience with test driven development (TDD). I already tried to practice it and I must say that it's hard. Though writing tests before you implement feels natural (I somewhere read "developing without testing is like driving a car without fastening your seatbelt"), it is so much contradictory to what I'm used to develop (test last development; if tests at all). Because of that I looked for some help in books.

From the first one I only read two chapters online: Test Driven: Practical TDD and Acceptance TDD for Java Developers by Lasse Koskela. You can find the chapters here. As I'm a .NET-developer, a Java-book is not worth purchasing, I think. However, I mention this book because these two chapters are really good. The first one is about beginning TDD. This is the usual stuff about red, green, refactor by example. The second chapter is the one that enlightend me. It talks about how to integrate the testing in the development-process (eXtreme Programming, that is) with acceptance TDD. The following picture is from Lasse's book and opened my eyes. Never before was the test-integration so clear to me. This is the only way how a developer will write good tests: write an acceptance test and make it green via several unit test driven development-cycles.
The other chapters sound interesting - maybe I'll find this book in a library.

Test-Driven Development in Microsoft .NET by James W. Newkirk and Alexei A. Vorontsov is the other book I recently read. I got this book from my good friend Uwe (*winkeWinke*). This book has a foreword by Kent Beck - so this has to be good, I thought. But actually: it isn't :( The first three chapters are OK - the standard-introduction section. Then, the book tries to write a whole example-application with TDD. I must admit, this is courageous - but it fails. I don't think that someone will work through all this code in order to understand how to test a database, a web-service, a web-client, etc. At the end, all tests are more or less the same. I think it is more helpful to learn TDD with your own little project than with this book. By the way, the technology used (ADO.NET instead of Entitiy Framework, ASP.NET Web Service instead of WCF, ASP.NET instead of Silverlight!?) is old...

Tuesday, November 3, 2009

2 agile books and one IOException

I just finished 2 books about agile development: User Stories Applied by Mike Cohn and Scrum and XP from the trenches by Henrik Kniberg.



Mike Cohn covers all about user stories. As we're just beginning Scrum with a new project, we will be doing a story writing workshop with some business people. So, User Stories Applied is probably the right book for that.
After not much blabla and good tips, page 49 describes what to do in such a workshop. He suggests to find the top epic stories and break each down. Page 182pp shows the place of a workshop within the path to begin programming:

1) Perform user role modeling
2) Trawl for high-level user stories <-- Start workshop
3) Prioritize stories
4) Refine high- and medium-priority stories
5) Organize stories into groups
6) Create a paper prototype <-- great if we'll reach that in the workshop
7) Refine the prototype
8) Start programming

I think the hardest thing is to gather the top 25 epics. This will be difficult with people discussing each and every detail don't focusing at the higher level. But as this will be the first workshop, we can still learn if things go astray :)

Here's a passage I liked (about 'why user stories'):
"Humans used to have such a marvelous oral tradition; myths and history were passed orally from one generation to the next. Until an Athenian ruler started writing down Homer's The Iliad so that it would not be forgotten, stories like Homer's were told, not read. Our memories must have been a lot better back then and must have started to fade sometime in the 1970s because by then we could no longer remember even short statements like "The system shall prompt the user for a login name and password." So, we started writing them down." (cf. IEEE 830)

So, good book, nice to read and great for looking up user-story-things.



The second book I finished is Scrum and XP from the trenches which is a war story on doing scrum. Lots of hands-ons and lessons-learned stuff. Some parts are interesting like how to handle multiple scrum teams but the most part I heard or read already. If you're new to scrum and agile methods, this is amusing to read (like how to negotiate with the PO). If not, you can scroll over it (as I read it as a free eBook).

And now for the IOException. I made some debug-sessions lately and now and then I came across an IOException just reading "the file exists" when calling GetTempFileName. I loaded old, already released code and even with this *cough* high-quality-code the exception will be thrown. Luckily I found this blog-post dealing with the same problem. Just delete some temp-files (approx. 100,000) and everything works fine now :)

Monday, July 6, 2009

Clean Code


I just read the german edition of Clean Code from Robert C. Martin. The introduction made me love this book immediately by a simple drawing. There are two things I’ll take along from this book:

1) For each function f let f.LinesCount < 20

2) Comments are evil

These two rules need some clarifications of course. In fact, the demand to keep functions below 20 lines is a result of another rule: Don’t mess with abstraction-levels. If you see a function with more than 20 lines, this should be a good indication for a mix of different levels of abstraction.

The second rule points in the opposite direction of what I’ve learned at university: one tutor said to me that there should be more lines of comment than lines of code, so that another person could easily understand what you wanted to say. Today with C# and Java, this isn’t true anymore. The code itself became the comment. No more cyptic function-calls or Hungarian notation but intuitive named functions and variables telling what they’re doing.

Although I’m still feeling awkward without any function-header-comment, I slowly try to reduce unnecessary comments like this:

‘ iterate through all alarms
For Each a In m_colAlarms

And transform it into this

For Each alarm In _alarms

The difference is not big but the sum of all changes generates a nice picture.

So, the first dozen chapters are truly inspirational. After that, the book takes a look on bigger examples how to refactor whole classes. This is done step-by-step and after some steps, it’s getting boring. My advice: just read the first 12 chapters and start coding!

Thursday, April 9, 2009

Public Property Get IntValue() As Long


I'm reading Framework Design Guidelines from Microsoft at the moment. Great book, similar to Code complete, but one layer above. All brilliant people of Microsoft have contributed to these guidelines, among them are Anders Hejlsberg (Mr. C#), Paul Vick (Mr. VB.NET) and Phil Haack (Mr. ASP.NET MVC). Anyway, as I'm reading it, I get a different look on our sourcecode. For example, I stumbled over:

Public Property Get IntValue() As Long

Great, isn't it? The more you think about it, the more abstruse it gets. I'll better stop it, I almost feel dizzy ;)

Thursday, March 26, 2009

Pack:=1 and ASP.NET: The beginning

Uff, just fighted for two days of getting that byte-array into a structure. There were always strange values starting from a specific property. After a few hours, I found out that there was a off by 1 byte error: if I shift every byte back one byte, I will reach the right result. Code tells more than 1000 words:


Structure Test
Dim a As Byte
Dim b As Int16
Dim c as Byte
End Structure

Dim handle As GCHandle = GCHandle.Alloc(byteArray, _
GCHandleType.Pinned)
Dim t As New Test
t = CType(Marshal.PtrToStructure(_
handle.AddrOfPinnedObject(), _
GetType(Test)), Test)


This will give you false values for b and c. This is why: "The default behaviour in the framework is for values in the structure to be aligned at 4-byte boundaries, so values start at FieldOffset 0,4,8,12 ..." (see forum). To avoid this, use as a structure-attribute and everything's fine now :)

Another bad book read: Programmieren mit ASP.NET AJAX. The first chapter is good - everything else just confusing. No good examples. Maybe I didn't get the point - I haven't done anything in ASP.NET yet. I'm watching now and the first 6 videos were fine :)

Ah, I forgot to mention the free first chapter of Professional ASP.NET MVC 1.0 from Rob Conery, Scott Hanselman, Phil Haack and Scott "ScottGu" Guthrie - famous bloggers writing a book. I'm curious to read it :)

Friday, March 20, 2009

Mix09 and "The Guide"

Right now, Mix09 is on air. This is a Microsoft developer conference focusing on web development. I bet, you want to see some videos from here.

I recently finished The Application Architecture Guide 2.0. Now I can design every system from a mobile app up to a RIA :)

Friday, February 20, 2009

SOA again, 2 new blogs to read

On wednesday, I had to return SOA und Webservices in der Praxis of Herbert Burbiel to the bib. Unfortunately, there was a reservation on this book. Anyway, I wouldn't have the time to test this promising ASP.NET-world. I'm really astonished how easy it is to write a webservice or -client with .NET - not a great difference to a normal windows forms application. So, the book is great; however, it uses examples of .NET and Java and makes every step (write a client, write a service, make a db-connection) twice, if not thrice (Java, C# and VB.NET). Actually that showed me that the .NET-way is the right one for me ;)

On my journeys in the web, I recently found two great blogs about WPF (Windows Forms - someone needs that anymore?), or better say two great minds writing about WPF: John Gossman and Josh Smith. See Karl Shifflett (not John Gossman...) talking about MVVM here - I love that guy :) (more to come about MVVM soon!).

Monday, February 16, 2009

Linq in Action, Toolbar

Last week I finished Linq in Action. It's a great primer on Linq: it covers Linq to Objects, Linq to SQL, Linq to XML and a bit of Linq to DataSet - i.e. everything ;) I read it from the start to the end and I assume this book isn't supposed to be read like this, because in the three main chapters (to Objects, SQL, XML) some basic queries are described again and again. Well, just turn that over :)

I really liked the chapter about Linq2Sql. It's so easy to use a database-access with Linq. Just make a connection and raise your queries. If you're working with small databases, take that. Although the Entity Framework has the favour of Microsoft, I hope, Linq2Sql will survive to make life easy.

In the book there are a lot of good examples going beyond the ordinary book-examples. For instance, there are performance-considerations in which cases Linq is significantly slower than "old style" for each and how to overcome the performance loss.

I read it in German - don't do that if you're tetchy in things of misspellings like me. If you're getting a paycheck for every found mistake like for a Knuth book, you will get rich :/

One thing I missed are ExpressionTrees. They are mentioned only in a small paragraph :(

And now a big discovery which I haven't seen in all the years I work with Win XP: "Symbolleisten". I accidently dragged my CVS-folder-link from my desktop to the top of the screen and released it. I never ever did that before. Now I have on the right of my desktop a toolbar for the CVS-DotNet-folder and on the left a CVS-ActiveX-folder. Fast access to the components :)

Friday, December 5, 2008

Book review "SOA?" and Ranorex

I recently finished (actually "flew over") the SOA-book: too academic and packed with stuff I don't bother. So don't waste your time with that book.

Today, I installed Ranorex: a GUI automation testing tool which can generate C#-code (yes! no scripting-bullshit like AutoIt or Workspace Macro Pro). With that, you can easily record test cases and elaborate them enhancing the generated code. One day and I managed to make a setup-test for the VENTIlogic: start WEINMANNsupport, select automatic port-search, create a new patient with !!!random!!! name, start the import, after import start WEINMANNadjust, connect to the device via automatic port-search, load "Werkseinstellungen" and change some parameters. Did I already mentioned the best? You can validate the results - great!

Wednesday, November 26, 2008

Book review "Essential Software Architecture"

Tomorrow I will finish Essential Software Architecture. Ian Gorton uses a real web-project all over the book and it fits surprisingly good in all chapters supporting the content by fabulous examples. Maybe the chapters were constructed around the project because the book itself has a way too much web-related content in my opinion. At the end of the book (actually 1/3 of it), there are chapters presenting one emerging new technology each. Of course MDA and SOA are on board. But what is really interesting is Aspect Oriented Architecture (AOP). My next book will handle SOA - maybe the one after SOA will be about AOP, we'll see :)

Wednesday, November 19, 2008

Book review "Effektive Software-Architekturen"

Once more, yesterday I finished a book. This time the afore mentioned "Effektive Software-Architekturen". Here, views are good explained - finally I got the difference between views and viewpoints :) This book has also lots of checklists and good advices which makes it a bit shallow. Next book I'm reading is Ian Gorton: Essential Software Architecture.

Here are a few links I want to check out: Buschmann et al 96: A system of patterns, Bass et al: Software architecture in practice, pacman03.pdf.

Tuesday, November 11, 2008

Book review "Handbuch der Software-Architektur"

I finished yesterday a book about software architecture: "Handbuch der Software-Architektur". It tries to cover all themes of architecture especially with a good comparison to a "real" building-architect. Unfortunately, it becomes very abstract and far away of reality to the end of the book. It's more like a study-book than a real hands-on one. So, don't read it ;)

Now I'm reading "Effektive Software-Architekturen". The introduction is very amusing with a comparison between the "Wasserfallmodell", "V-Modell" and agile methods (hier unbedingt lesen).