Being Cellfish

Stuff I wished I've found in some blog (and sometimes did)

Browse by Tags

Tagged Content List
  • Blog Post: Logical task combinators

    When I had to use Erlang for the very first time it was a brand new language and I was in collage. Back then Erlang did not have a logical not function so we had to define our own in order to make our code readable. At least given the knowledge me and my lab partner had at the time. So the other week...
  • Blog Post: What is technical debt really about?

    When you think about the reasons for reducing technical debt; what do your think about? Read more here .
  • Blog Post: Asynchronous enumerations - summary

    So what did we end up to do after the discussion two months ago? Well we ended up using option #1 mostly because it simplified things to have all items available during processing. technically not needed, but it simplified things. My generic advice would be to use option #1 or #2 and to favor option...
  • Blog Post: Asynchronous enumerations - Part 5: MyEnumerationAsync

    For background, read the introduction . If you have no need for filtering using LINQ (or Rx) and you do not want to expose an IEnumerable you can create tour own " IEnumeratorAsync " that asynchronously fetches the next item. Again this is something I would advice against. First of all you are loosing...
  • Blog Post: Asynchronous enumerations - Part 4: IEnumerable<Task<IEnumerable<T>>>

    For background, read the introduction . This is really just a variant of option #2 using the fact that you use azure tables and know that you will get several items at a time. In my opinion you shouldn't even consider this option since it uses a feature of the underlying storage layer and compared...
  • Blog Post: Asynchronous enumerations - Part 3: IObservable<T>

    For background, read the introduction . In part 2 I briefly mentioned that if you have simple filtering needs then you might implement your own LINQ-like methods. Well if you have more advanced filtering needs there is already something out there to help you; Reactive Extensions (Rx) . The only thing...
  • Blog Post: Asynchronous enumerations - Part 2: IEnumerable<Task<T>>

    For background, read the introduction . This is essentially the opposite of option #1 . With this approach you are optimized for processing one item at a time. Or even process all items in parallel! So this is a very good option if you do not need all your data at once and you also have a large number...
  • Blog Post: Asynchronous enumerations - Part 1: Task<IEnumerable<T>>

    For background, read the introduction . If you need all data before you start processing it or if you expect just a few records each time, then this is probably your simplest way to get an "asynchronous enumeration". Technically the enumeration is not asynchronous since you retrieve all data asynchronously...
  • Blog Post: Asynchronous enumerations - Introduction

    A couple of weeks ago I had a discussion with a co-worker about what would be the proper way to asynchronously iterate over some data in azure tables. Exploring different options was very interesting and let us understand different pros and cons for each asynchronous strategy. So over the next few weeks...
  • Blog Post: "Mocks: the code smell"

    So I stole the title from this talk: I have seen Arlo argue for his tests with simulators and I've always felt I shared his view on mocks. Or at least I share what I think is his view; that they should be avoided and only used under special circumstances. Kind of like nuclear weapons... But that is...
  • Blog Post: Don't make it hard to trust your code

    I recently learned that an API I had been using for a project was lying to me. Maybe not intentionally but anyway. I think that a fundamental rule in software development is that you must trust that the methods you call at least try to do what they say they do. For example if a method is called " SavePerson...
  • Blog Post: Which collection interface do I use?

    ReSharper has a warning that I thought came from FxCop that is so important I wish it was an FxCop warning. It warns you if you try to enumerate an IEnumerable twice. This is important when you take a collection as an argument and you do not know how that collection is created. For example if the collection...
  • Blog Post: How would I test a WebAPI controller

    Kind of related to my previous post , this article on how to test ASP.Net WebAPI controllers made me think. As you can see from the article it is fairly easy to get your controller under test, but it does take some work to get everything setup properly. And I have never tested my WebAPI controllers like...
  • Blog Post: If it is hard to test, you did something wrong

    I've often been asked questions like how would you test this or been told that there cannot be unit test for some code because it is impossible to test. Well, my opinion is that if something is hard to test it is all your fault. You designed it, you implemented it and hence it is your fault it is hard...
  • Blog Post: Collection initializers not doing what you expect

    Let's assume that you have a class that have a collection property and that you want the default for that collection to be to actually have a value. That class might look like this: 1: class Foo 2: { 3: public Foo() 4: { 5: this .Numbers = new List< int > { 4711 }; 6: } 7: public...
  • Blog Post: Task-based Asynchronous Pattern - kick starter

    Regardless of if you are new to TAP (Task-based Asynchronous Pattern aka " async/await ") or have been doing it for a while this presentation from an MVP summit in February (2013) serves both as a good introduction explaining how it works as well as providing deeper knowledge and high-lighting a few...
  • Blog Post: How to know when the garbage collector is not helping you

    A while back I did an experiment where it turned out that allocating objects was better than pooling them. Since then I have encountered a few times where allocating actually turned out to be a bad thing. I've never seen this being a problem in a client application, but in servers allocating a lot of...
  • Blog Post: Using T4 to eliminate maintenance

    I like to abstract diagnostics (logging and performance counters) into a separate interface or abstract class. But it becomes tedious to manually keep the fake diagnostics (used to test that that proper diagnostics calls are made), dummy diagnostics (when I just need something to pass around), console...
  • Blog Post: Factory pattern improved

    My impression of most major west coast cities like Seattle, San Francisco, Los Angeles etc, is that people in general are very healthy. And Redmond where Microsoft have its HQ is even the bicycle capital of the north west (I guess anything can be the capital of anything if you just constrain geography...
  • Blog Post: Using HTML as your web service format

    In the past I've seen examples of clever use of style sheets to turn XML responses into browsable results that are human readable and more important; human navigable. But this was the first time I heard about using HTML straight up to create the content of a web service API. It is interesting that there...
  • Blog Post: Analysing code coverage

    I was recently asked to look at a project that had around 60% code coverage and was asked to give my recommendations on what area to focus on to increase the code coverage. There were a lot of unit tests and actually there was around 10% more unit test code than production code so I was a little surprised...
  • Blog Post: Implementing a good GetHashCode

    If you've ever implemented GetHashCode you probably did it the way suggested in MSDN which is using XOR. And if you use R# you might have seen that it generates a different GetHashCode using prime numbers. So what should you do? I think there are three properties you want to aim for when it comes to...
  • Blog Post: Implementing IDisposable

    The IDisposable is probably one of the most abused interfaces in .Net. Except from all the cases where you actually have an unmanaged resource you need to release I've seen it being used a lot of times (including by myself) just to guarantee some code is executed immediatly when a variable go out of...
  • Blog Post: Task-based Asynchronous Pattern - PauseToken and common problems

    I just wanted to make sure you did not miss this article describing a mechanism to pause asynchronous processing. Just like the article state that this came out of a problem encountered in the UI World I think this is something I would not expect to see a lot outside the UI world. But it could be used...
  • Blog Post: Reactive Extensions Reminder

    It's been a while since I last looked at Rx and I must confess that my first impression was that the amount of possibilities to do the same thing and all the extension methods was overwhelming at start. But like with any new framework you learn you'll settle for a few to solve your most common problems...
Page 1 of 4 (83 items) 1234