﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Martin R-L commented on Find the design flaw</title><description>@Patrik,
  
  
What I do in order to use the ease of tuples and other complex generic types, *and* get readable code, is to at least give them a friendly name by utilizing the using statement of C#.
  
  
An example is given on my blog: 
[http://goo.gl/ksCm](http://goo.gl/ksCm)  
  
In a specific context, you can also give the type friendly method names (like e.g. Ruby's alias methods) by using extension methods that are just simple pass-throughs. 
</description><link>http://ayende.com/4514/find-the-design-flaw#comment16</link><guid>http://ayende.com/4514/find-the-design-flaw#comment16</guid><pubDate>Thu, 17 Jun 2010 06:27:46 GMT</pubDate></item><item><title>Dmitriy Nagirnyak commented on Find the design flaw</title><description>When using 'yield' the resulting items will be returned 'lazily' (delayed execution).
  
This might not be what the method is intended to do. I think the intention is to have the results ready after the call.
  
  
It also might have potential issue when the underlying data store is closed and the enumeration gets executed.
  
  
Cheers,
  
Dmitriy,
</description><link>http://ayende.com/4514/find-the-design-flaw#comment15</link><guid>http://ayende.com/4514/find-the-design-flaw#comment15</guid><pubDate>Sun, 23 May 2010 23:56:58 GMT</pubDate></item><item><title>Andrew commented on Find the design flaw</title><description>Yeah now that I've thought it through, I'm unsure why I even said that. I read something like this on someone's blog recently and haven't had time to process it.
</description><link>http://ayende.com/4514/find-the-design-flaw#comment14</link><guid>http://ayende.com/4514/find-the-design-flaw#comment14</guid><pubDate>Sat, 22 May 2010 10:19:13 GMT</pubDate></item><item><title>Ayende Rahien commented on Find the design flaw</title><description>Andrew,
  
I disagree with that quite strongly
</description><link>http://ayende.com/4514/find-the-design-flaw#comment13</link><guid>http://ayende.com/4514/find-the-design-flaw#comment13</guid><pubDate>Sat, 22 May 2010 10:03:46 GMT</pubDate></item><item><title>Andrew commented on Find the design flaw</title><description>Is it not also bad practice to publicly expose IEnumerable for methods like this ?
</description><link>http://ayende.com/4514/find-the-design-flaw#comment12</link><guid>http://ayende.com/4514/find-the-design-flaw#comment12</guid><pubDate>Sat, 22 May 2010 09:56:26 GMT</pubDate></item><item><title>Ayende Rahien commented on Find the design flaw</title><description>Patrik,
  
This is mostly for internal API needs, it just doesn't make sense to create a type here, it wouldn't add enough meaning
</description><link>http://ayende.com/4514/find-the-design-flaw#comment11</link><guid>http://ayende.com/4514/find-the-design-flaw#comment11</guid><pubDate>Sat, 22 May 2010 09:54:44 GMT</pubDate></item><item><title>Ayende Rahien commented on Find the design flaw</title><description>James,
  
Yes, the collection may not be continuous
</description><link>http://ayende.com/4514/find-the-design-flaw#comment10</link><guid>http://ayende.com/4514/find-the-design-flaw#comment10</guid><pubDate>Sat, 22 May 2010 09:54:03 GMT</pubDate></item><item><title>James Newton-King commented on Find the design flaw</title><description>Is the collection between the startId and endId not continuous? A limit would make sense then.
</description><link>http://ayende.com/4514/find-the-design-flaw#comment9</link><guid>http://ayende.com/4514/find-the-design-flaw#comment9</guid><pubDate>Sat, 22 May 2010 09:42:25 GMT</pubDate></item><item><title>Patrik commented on Find the design flaw</title><description>This might be personal preference but I _really_ don't like methods exposing tuple types. Create a type (possibly a struct) that has carries some semantics instead of the tuple.
  
  
Note that this in C#, this would obviously not be my thoughts if the language was F#, Haskell, Erlang or any other functional language.
</description><link>http://ayende.com/4514/find-the-design-flaw#comment8</link><guid>http://ayende.com/4514/find-the-design-flaw#comment8</guid><pubDate>Sat, 22 May 2010 09:38:38 GMT</pubDate></item><item><title>Ayende Rahien commented on Find the design flaw</title><description>Chojrak,
  
It isn't key value. It is a tuple, it isn't a set of int to json doc, it is a int &amp; json doc. 
  
</description><link>http://ayende.com/4514/find-the-design-flaw#comment7</link><guid>http://ayende.com/4514/find-the-design-flaw#comment7</guid><pubDate>Sat, 22 May 2010 08:58:16 GMT</pubDate></item><item><title>Chojrak commented on Find the design flaw</title><description>Oh no, damned HTML. Again:
  
I'd change it to IEnumerable&lt;Dictionary&lt;int,JsonDocument&gt;&gt; I think key-value dependencies are better handled using Dictionary. Any ideas?
</description><link>http://ayende.com/4514/find-the-design-flaw#comment6</link><guid>http://ayende.com/4514/find-the-design-flaw#comment6</guid><pubDate>Sat, 22 May 2010 08:56:49 GMT</pubDate></item><item><title>Chojrak commented on Find the design flaw</title><description>I'd change it to IEnumerable
&lt;dictionary&lt;int,jsondocument&gt;
&gt;, I think key-value dependencies are better handled using Dictionary. Any ideas?
&gt;</description><link>http://ayende.com/4514/find-the-design-flaw#comment5</link><guid>http://ayende.com/4514/find-the-design-flaw#comment5</guid><pubDate>Sat, 22 May 2010 08:55:25 GMT</pubDate></item><item><title>Ayende Rahien commented on Find the design flaw</title><description>James,
  
startId: 1
  
endId: 100000
  
limit: 100
</description><link>http://ayende.com/4514/find-the-design-flaw#comment4</link><guid>http://ayende.com/4514/find-the-design-flaw#comment4</guid><pubDate>Sat, 22 May 2010 08:41:12 GMT</pubDate></item><item><title>Ayende Rahien commented on Find the design flaw</title><description>Ashic,
  
Yep!
</description><link>http://ayende.com/4514/find-the-design-flaw#comment3</link><guid>http://ayende.com/4514/find-the-design-flaw#comment3</guid><pubDate>Sat, 22 May 2010 08:40:52 GMT</pubDate></item><item><title>James Newton-King commented on Find the design flaw</title><description>An endId and limit seem at odds with one another.
</description><link>http://ayende.com/4514/find-the-design-flaw#comment2</link><guid>http://ayende.com/4514/find-the-design-flaw#comment2</guid><pubDate>Sat, 22 May 2010 07:44:08 GMT</pubDate></item><item><title>ashic commented on Find the design flaw</title><description>It's returning an IEnumerable using yield. The caller would take out the ones they need. There's no sense in passing parameters like limit as it would the the callers' responsibility to get only the number they need. IEnumerable won't trigger data access until and unless the data is required and so the limit parameter doesn't have any use.
</description><link>http://ayende.com/4514/find-the-design-flaw#comment1</link><guid>http://ayende.com/4514/find-the-design-flaw#comment1</guid><pubDate>Sat, 22 May 2010 07:34:22 GMT</pubDate></item></channel></rss>