﻿<?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>Ayende Rahien commented on Relying on hash code implementation is BAD – part II</title><description>James,
  
That is actually something that you _should_ be worried about in a mixed 32 &amp; 64 bits env.
  
Most distributed caches does the naive thing and use GetHashCode to get the hashcode for the key lookup.
  
Granted, there aren't that many mixed bits mode, but it is important to know
</description><link>http://ayende.com/3981/relying-on-hash-code-implementation-is-bad-part-ii#comment7</link><guid>http://ayende.com/3981/relying-on-hash-code-implementation-is-bad-part-ii#comment7</guid><pubDate>Tue, 28 Apr 2009 17:05:59 GMT</pubDate></item><item><title>James commented on Relying on hash code implementation is BAD – part II</title><description>String.GetHashCode() returns different values when running in a 32-bit or 64-bit image.
  
  
Now, if you serialized the value somewhere in a file format...
  
  
Yes, it happened. No comments please ;)
  
</description><link>http://ayende.com/3981/relying-on-hash-code-implementation-is-bad-part-ii#comment6</link><guid>http://ayende.com/3981/relying-on-hash-code-implementation-is-bad-part-ii#comment6</guid><pubDate>Tue, 28 Apr 2009 12:16:33 GMT</pubDate></item><item><title>Nik commented on Relying on hash code implementation is BAD – part II</title><description>Agreed, it doesn't read well that alerts["SELECT N+1"] means get the alert with the title "SELECT N+1" especially with the one below it "alerts["Too many database calls per session"]" which looks like your using the [] to set a message not select a title.
  
  
Though in my eyes, it's more of a case of bad titling. :P But then using more code like titles to reference a full alert would probably read just as cryptic. 
</description><link>http://ayende.com/3981/relying-on-hash-code-implementation-is-bad-part-ii#comment5</link><guid>http://ayende.com/3981/relying-on-hash-code-implementation-is-bad-part-ii#comment5</guid><pubDate>Tue, 28 Apr 2009 08:50:31 GMT</pubDate></item><item><title>Ayende Rahien commented on Relying on hash code implementation is BAD – part II</title><description>Bill,
  
My main concerns arereadability and sensability
</description><link>http://ayende.com/3981/relying-on-hash-code-implementation-is-bad-part-ii#comment4</link><guid>http://ayende.com/3981/relying-on-hash-code-implementation-is-bad-part-ii#comment4</guid><pubDate>Tue, 28 Apr 2009 04:31:25 GMT</pubDate></item><item><title>Bill Pierce commented on Relying on hash code implementation is BAD – part II</title><description>It is not obvious from your posts, excluding the readability of the code, what the non obvious side affects are of using GetHashCode in this way.  Can you enlighten me?
</description><link>http://ayende.com/3981/relying-on-hash-code-implementation-is-bad-part-ii#comment3</link><guid>http://ayende.com/3981/relying-on-hash-code-implementation-is-bad-part-ii#comment3</guid><pubDate>Mon, 27 Apr 2009 20:07:50 GMT</pubDate></item><item><title>Ayende Rahien commented on Relying on hash code implementation is BAD – part II</title><description>a,
  
Not really.
  
If you don't have that, you can't write hash table or dictionary.
  
</description><link>http://ayende.com/3981/relying-on-hash-code-implementation-is-bad-part-ii#comment2</link><guid>http://ayende.com/3981/relying-on-hash-code-implementation-is-bad-part-ii#comment2</guid><pubDate>Mon, 27 Apr 2009 15:19:18 GMT</pubDate></item><item><title>a commented on Relying on hash code implementation is BAD – part II</title><description>btw, this is not relying on a particular hash code but on the fact that gethc and equals are properly implemented, so that:
  
  
a.eq(b) =&gt; a.gethc() == b.gethc()
  
a.gethc() != b.gethc() =&gt; !a.eq(b)
  
  
and that eq and gethc are taking into account all relevant fields. however an "action" kind of object (without knowing exactly what your statementaction does) is probably not the right kind of hash code provider. gethc should only be implemented for value object imo. i also think it is a mistake in the framework design that every object has equals and gehashcode methods. that is clearly something that _not_ every object can and should support.
</description><link>http://ayende.com/3981/relying-on-hash-code-implementation-is-bad-part-ii#comment1</link><guid>http://ayende.com/3981/relying-on-hash-code-implementation-is-bad-part-ii#comment1</guid><pubDate>Mon, 27 Apr 2009 15:14:17 GMT</pubDate></item></channel></rss>