Reviews

Responding to Effectus commentary

Jose was kind enough to post a review of my sample Effectus application. This post is a reply to that. The first thing that Jose didn’t like was the fact that I didn’t put an abstraction layer in front of NHibernate’s usage in my application. There are several reasons for that, the first, and simplest, is that I was trying to explain how to use NHibernate, and for that, I wanted to deal with the lowest common denominator, not show off a particular wrapper implementation. Showing NHibernate usage directly means that even if you are using another library with...

posted @ Friday, January 08, 2010 12:00 PM | Feedback (10)

Git commits as code review?

I just had to go through a code base where I had a bunch of of comments. Instead of going with the usual route of just noting the changes that I think should be done, I decided to do something else. I fixed each individual change, and commit them individually. This is how it looks like, each commit is usually less than a single screen of changes (diff mode). I wonder if it is something that I can apply more generally.

posted @ Thursday, October 15, 2009 6:40 AM | Feedback (13)

Reviewing NerdDinner: The Select N+1 pitfall

During my review of NerdDinner, I came across the following piece of code: And I knew that there is a Select N+1 problem here. This is quite similar to the problem that I described here. RSVPs is a lazily loaded collection. As such, calling Any() on it will result in a database query. Now the question was whatever or not it is used somewhere in a loop. ReSharper will help us figure that one out: The first usage location is here: And this certainly doesn’t look...

posted @ Thursday, July 30, 2009 11:55 PM | Feedback (17)

Reviewing NerdDinner

Scott Hanselman has asked me to see if I can port NerdDinner to NHibernate, now that Linq for NHibernate has made RTM. I thought that I might as well take the time to look at the code and do a code review. I would like to say a few things before actually even starting to look at the code. I am not going to review the code as a sample application, I am going to review it as if it was a standard production project. I am assuming that (remember, haven’t seen the code yet) there...

posted @ Thursday, July 30, 2009 11:19 PM | Feedback (60)

Review: C# in Depth

C# in Depth has a very different focus from most “Learn language X” books. Starting from the premise that you are already am familiar with the basic language syntax (for 1.0, or maybe you are a Java or C++ programmer), it focus entirely on the new additions to the language and platform. Its stated goal is to take C# 1.0 developers and give them all the changes that happened to the language in the C# 2.0 and 3.0 versions. And it most certainly deserves the “in Depth” part of the name. I consider myself a fairly...

posted @ Tuesday, May 12, 2009 1:10 PM | Feedback (9)

Ode to ReSharper

I am using R# 4.5, and I have to say, for  a release that is supposedly all about perf, they managed to squeeze in some really nice new smarts: Figuring out all the implementations that use or do not use parameters. Killing off BDD :-)

posted @ Wednesday, April 22, 2009 8:34 PM | Feedback (7)

Reviewing NChord: A codebase that makes me twitch

I was referred to NChord by one of the comments, and it looked very interesting on the surface, so I downloaded the code and took a peek. It is not typically my style to criticize code openly, especially after a very brief glance, but I thought that it  might be a good idea to point some of the things that made me decide that the codebase isn't worth the time to pursue in details. Single Responsibility Principle doesn't apply to the file level What you see here are no less than 11(!) files that are all parts...

posted @ Tuesday, April 07, 2009 4:41 AM | Feedback (16)

First Steps with Post Sharp

PostSharp is an AOP framework that works using byte code weaving. That is, it re-writes your IL to add behaviors to it. From my point of view, it is like having the cake (interception, byte code weaving) and eating it (I haven't even looked at the PostSharp source code, just used the binary release). My initial spike with it went very well. Here it is: [Serializable] public class Logger : OnFieldAccessAspect { public override void OnGetValue(FieldAccessEventArgs eventArgs) { Console.WriteLine(eventArgs.InstanceTag); Console.WriteLine("get value"); ...

posted @ Thursday, October 09, 2008 7:52 PM | Feedback (10)

Reading Eralng: CouchDB Streams

A question to my dear readers, do you find this series valuable? Do you consider it interesting? It is a significant departure from my usual set of topics. In my recent post I wondered about the concept of summary streams, and how they related to the way CouchDB works. I couldn't figure out what they were doing. As it turn out, there is a good documentation for them in this post. There were two things that mislead me. The first was the notion of summary. I think that this is a misnomer, because this is the only place in CouchDB where...

posted @ Monday, October 06, 2008 1:37 AM | Feedback (7)

Erlang Reading: CouchDB - Digging Down to Disk

Jan has corrected a misconception that I had here, where I assumed that PUT was create and POST was update. Apparently this is not quite correct. A PUT request will update/create a new document with a user supplied name, while a POST request will create a new document with a server generated name. That narrows down my search for "create new document" code path again. Here is the method in couch_httpd_db that handles a POST request on a document. It parse the form, get the revision of the document, and then it calls to open_doc_revs, which we haven't explored so far. I...

posted @ Saturday, October 04, 2008 2:32 PM | Feedback (0)

Reading Erlang: CouchDB - From REST to Disk in a few function calls

As you can probably figure out from the title, the purpose of this post is to track how CouchDB is saving a document on the disk. We have already tracked how much of CouchDB works, including some fascinating pieces such as btree:lookup and btree:query_modify. Now it is time to dig ourselves from the trenches and have a slightly higher level view of what is going on. We start with the recently refactored couch_httpd_db module. The fun starts with handle_request. It took me a few seconds to realize what is going on here. Again, some of the problem is that I am not...

posted @ Saturday, October 04, 2008 3:01 AM | Feedback (2)

More CouchDB reading: btree:query_modify

Okay! After diving into CouchDB source code and doing an in depth review of the btree:lookup, I am ready for the real challenge, figuring out how CouchDB writes to the btree. This is the really interesting part, from my point of view. The heart of this functionality is the query_modify method. This method allow us to perform a batch of operations on the tree in one go. Following my own ideal that all remote APIs (and this is talking to disk, hence, remote) should support batching, I really like the idea. The first part is dedicated to...

posted @ Wednesday, September 24, 2008 12:50 PM | Feedback (1)

More CouchDB reading: btree:lookup

I want to dive deep into the way CouchDB's file format, which is interesting, because it maintain ACID guarantees and the code is small enough to make it possible to read. The file starts with a header, with the following structure: "gmk\0"db_header:    writer_version    update_seq    summary_stream_state,    fulldocinfo_by_id_btree_state    docinfo_by_seq_btree_state    local_docs_btree_state    purge_seq    purged_docs// zero padding to 2048md5 (including zero padding) At the moment, I am not sure what some of the fields are (all the state and the purged_docs), and there is indication that this header can get larger than 2Kb. I'll ignore it for now and go study the way CouchDB...

posted @ Wednesday, September 24, 2008 11:23 AM | Feedback (2)

Reading Erlang: Inspecting CouchDB

I like the ideas that Erlang promotes, but I find myself in a big problem trying to actually read Erlang. That is, I can read sample code, more or less, but real code? Not so much. I won't even touch on writing the code. One of the problems is the lack of IDE support. I tried both ErlIDE and Erlybird, none of them gave me so much as syntax highlighting. They should, according to this post, but I couldn't get it to work. I ended up with Emacs, which is a tool that I just don't understand. It supports syntax...

posted @ Wednesday, September 24, 2008 1:07 AM | Feedback (13)

Review: Hibernate Search in Action

I just finished reading Hibernate Search in Action, and I loved it. I should point out that I was the porter of Hibernate Search to NHibernate Search, so I had some previous expertise in the topic. In addition to that, I approached this book at an angle completely orthogonal to the expected audience. Unlike most "in Action" books, I did not intend to make immediate use of the code and approaches suggested in the book. Instead, I looked to the book as a way to deepen my understanding of the tool and how it works. I am impressed,...

posted @ Tuesday, September 02, 2008 3:53 AM | Feedback (11)

Code Reviews are not just about the code

Usually when I am doing a code review, I ask not just access to the code, but to the source control repository as well. There are quite a lot that you can learn from the source control of a project. Here is something that is both good and bad. It is bad because we have no checkin comments. It is good because we can see that we have very frequent checkins.   Another thing that you want to check is the bug tracking system. Is there such a thing (including email thread or a post it notes...

posted @ Thursday, July 31, 2008 10:32 PM | Feedback (6)

Code Critique: Transactional File

Update: To clarify, the only purpose of this code is to give atomic writes, it either complete successfully or it is rolled back. Okay, this looks like it is too simple to work, thoughts? /// <summary> /// Allow to overwrite a file in a transactional manner. /// That is, either we completely succeed or completely fail in writing to the file. /// Read will correct previous failed transaction if a previous write has failed. /// Assumptions: /// * You want to always rewrite the file, rathar than edit it. /// * The underlying file system has at least...

posted @ Sunday, July 27, 2008 10:09 PM | Feedback (18)

Review: Umbrella project

The Umbrella project from nVentive. I had the chance of sitting with Francois Tanguay in DevTeach and he showed me a bit about it. I was impressed. Umbrella is the ultimate utility library, using all the advantages C# 3.0 can give it. In fact, I think of it a bit like boost for C#. I tried to read the code, and it was hard. Because of the util nature of Umbrella, there isn't a lot of context around the code, so you have to parse the code to understand what it is doing. Luckily, there are a lot...

posted @ Wednesday, June 04, 2008 7:37 PM | Feedback (13)

Reviewing Mass Transit

A while ago I took a look at NServiceBus and its Distributor, after catching this post talking about Mass Transit, I decided that I really need to take an additional look at this project. Mass Transit is very similar in purpose to NServiceBus, and it uses a very similar approach. However, it has a radically different style. A lot of the concepts are shared between both projects. As usual, I am going to post here my thoughts as I read through the code. Opening the project is a bit overwhelming, although not as much as with NServiceBus....

posted @ Wednesday, June 04, 2008 5:47 AM | Feedback (13)

Article Review: N Degrees of Separation

Following Frans Bouma's recommendation, I just read N Degrees of Separation: Multi-Dimensional Separation of Concerns. I came away decidedly unimpressed. First things first, the article is boring. And SoC is a subject that is near & dear to my heart. More importantly, I don't like the way they are approaching the solution, even if I agree with their overall premise. The idea that they present is that we should have a way to split functionality not based on a single parameter, but on multiplies of them. To that I agree, most certainly. Except that the example that they gave...

posted @ Saturday, January 12, 2008 10:12 PM | Feedback (7)

FeedDemon? +1

I am moving from RssBandit, mainly because the new UI really annoys me now. It doesn't respond properly to scrolling, and other minor annoyances. The big thing is that it has start to consume way more CPU than it should. I installed Omea Reader for a while, and while I really like it, I keep getting the same old items in many feeds. I am not quite sure why. I also have problems with defining newspaper view vs. normal view, and it rememberring a post that I read three days ago and keep...

posted @ Friday, January 26, 2007 3:30 PM | Feedback (10)

SQL Refactor

So I got the beta of SQL Refactor, opened SQL Management Studio and liked what I saw: The first thing that I noticed, more important than anything else, is that it has a SQL Beautifier. This is the first I have seen this for T-SQL (there seems to be a lot for Oracle, though), and the first where the beautifier is integrated directly into SQL Management studio. Why is this important? Well, check this out (from Northwind): ...

posted @ Saturday, October 07, 2006 1:40 AM | Feedback (0)