[Ironruby-core] "Native" Zlib Implementation Patch

John Lam (IRONRUBY) jflam at microsoft.com
Tue Apr 22 20:08:12 EDT 2008


Michael Letterle:

> "Native" Zlib Implementation Patch

Thanks for sending this in!

FYI - a few quick pointers about your contribution. No need to take any action since I've fixed most of them on my machine already.

1. Bangs

Please do your best to incorporate the bangs in your contributions. The bangs indicate a non-nullable reference type. I find that it's best if you create a VS macro to insert them - I bind this macro to the CTRL-! key:

Sub InsertBang()
    DTE.ActiveDocument.Selection.Text = "/*!*/"
End Sub

This helps to reinforce in your mind (and in the mind of the code reviewer) whether a given reference type is non-nullable or not. This will also greatly help us out when we start running spec# for real across our codebase to look for violations of this contract.

Generally you'll find that any time you get a CodeContext from us it's guaranteed to not be null, which means that you don't have to do a null check. The converse is also true - if you have a nullable reference type, you'll need to validate it with one of the helpers in our Microsoft.Scripting.ContractUtils class.

2. General formatting issues

Please do try and stick with .NET naming conventions if possible when porting code from Java etc. I realize that it does take time to do this, and thanks, but it's either you do it or I have to :) Not a big deal since I can just do a CTRL-K CTRL-F on your code, but it would rock if you could format along the same lines as the rest of the code.

3. Testing / coverage

If possible please let us know how many specs from the spec suite your code passes etc. That would help us determine how much to look into the codebase itself.

Thanks,
-John



More information about the Ironruby-core mailing list