Skip to content

Philosophical Geek

Code and musings by Ben Watson

  • Home
  • About Me
  • Writing High-Performance .NET Code
  • Software
  • Music
  • Resume

What’s wrong with this code? – 1 – Answer

The main thing wrong with the code is that object.ReferenceEquals(a,b) will ALWAYS return true because it’s comapring structs, which are value types. Value types are passed by value, not reference, so every instance is different.

 

This entry was posted in Code and tagged .net, Code, programming, quiz on May 3, 2006 by Ben.

Post navigation

← Pausing a Thread Safely The First Thing in an XML file needs to be… →

Writing High-Performance .NET Code

If you are a .NET programmer, you need a copy of my latest book, the best and most essential resource on .NET performance. Learn to diagnose, debug, and control your own code and the underlying CLR to obtain the fastest performance possible. Soon in a 2nd edition!

Visit site

Recent Posts

  • 4 Lessons from a Life in Music: The Wisdom of John Williams
  • The Best Thing That Ever Happened To Me Was That John Williams Did Not Return My Letter
  • Announcing: Microsoft.IO.RecyclableMemoryStream 1.3.0
  • How to Write and Publish a Technical Book and Not Lose Your Sanity
  • Sample Chapter of Writing High-Performance .NET Code, 2nd Edition
  • .NET Rocks covers .NET Performance!
  • Writing High-Performance .NET Code on the No Dogma podcast
  • Announcing Writing High-Performance .NET Code, 2nd Edition!
  • Don’t Make This Dumb Locking Mistake
  • Free Kindle version of Writing High-Performance .NET Code when you buy the print version
  • Get Your Thread Synchronization Right the First Time
  • Announcing Microsoft.IO.RecycableMemoryStream
  • 2014 Year In Review
  • Buy EPUB and PDF of Writing High-Performance .NET Code and Save 25%
  • Digging Into .NET Loop Performance, Bounds-checking, Iteration, and Unrolling

Categories

  • .NET
  • A Better Future
  • Bing
  • Books
  • Code
  • CodeProject
  • Humor
  • Interviewing
  • lego
  • Link/News
  • Live Search
  • microsoft
  • Music, Film, Theater
  • Performance
  • Personal
  • Photos
  • Software Development
  • Thoughts On Tech and More
  • Tips
  • Uncategorized
  • WPF
May 2006
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  
« Apr   Jun »

Blog Policy

This blog represents my own opinions and not those of my employer. This is my own personal work only. All comments are moderated. Comments containing abusive language, profanity, or are wildly off-topic will not be approved.

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Proudly powered by WordPress