jaredpar's WebLog

Code, rants and ramblings of a programmer.
Posts
  • jaredpar's WebLog

    Why are thread safe collections so hard?

    • 52 Comments
    Writing a collection which is mutable, thread safe and usable is an extremely difficult process. At least that’s what you’ve likely been told all through your schooling. But then you get out on the web and see a multitude of thread safe lists, maps and...
  • jaredpar's WebLog

    When to use Type Inference

    • 27 Comments
    Occasionally the debate will come as to when it's OK to use type inference in order to declare a variable.  There appear to be three groups in this debate. Whenever it's possible Only when it's absolutely clear what the type is Never, type inference...
  • jaredpar's WebLog

    Code is not self documenting

    • 17 Comments
    Nothing revolutionary about that statement.  Yet I keep reading the opposite on various comment threads and message boards so I thought it a good idea to explore it again. Code is not self documenting. The "code is self document" argument...
  • jaredpar's WebLog

    A more usable API for a mutable thread safe collection

    • 17 Comments
    In my last post we discussed the problems with designing a safer API for mutable thread safe collections that employ only an internal locking system. The result was an API that was more difficult to mess up, yet pretty much unusable. Lets take a look...
  • jaredpar's WebLog

    Vim Emulator Editor Extension Released

    • 17 Comments
    I just released version 0.5.0 of VsVim: a vim emulation editor extension for Visual Studio 2010 Beta1 written in F#. This is a hobby project I’ve been working on for awhile now. I expect to continue updating this release as time goes on as I use it on...
  • jaredpar's WebLog

    Don't mix using statements and lambda expressions

    • 15 Comments
    Title pretty much says it all but what good is a rule without any explanation. The main issue here is that at the core, using statements and lambda expressions both alter variable lifetimes. Unfortunately they alter the lifetime in different directions...
  • jaredpar's WebLog

    VsVim Update Released (Version 0.9.5)

    • 12 Comments
    I just released an update to VsVim for Visual Studio 2010.  This is available on the extension manager in Visual Studio or can be downloaded directly at the following link. Link: http://visualstudiogallery.msdn.microsoft.com/en-us/59ca71b3-a4a3-46ca...
  • jaredpar's WebLog

    The File System is unpredictable

    • 11 Comments
    One of the more frequent questions I answer on StackOverflow is a variation of the following.  I’m doing XXX with a file, how can I know if the file exists? The variations include verify no one else has the file open, if the file is in use, the file...
  • jaredpar's WebLog

    Marshaling Nested Data Structures Part 1

    • 11 Comments
    A frequent question that pops up on newsgroups such as microsoft.dotnet.framework.interop is how to Marshal nested structures (and arrays of nested structures) via P/Invoke. The documentation on the subject that I have found usually only covers structures...
  • jaredpar's WebLog

    Extension Methods without 3.5 Framework

    • 10 Comments
    For a time I've been avoiding extension methods. Not because I'm opposed to using them but because of the 3.5 Framework. A lot of the tools I own are designed to be very light weight tools that only require the user to have 2.0 installed on their machine...
  • jaredpar's WebLog

    Case Sensitive vs. Case Insensitive Languages

    • 10 Comments
    Just had a random thought while I was looking at some code today.  It’s yet another argument in the case sensitive vs. case insensitive language battle.  Do you really want this to be able to compile? class C1 { int M1; int m1; } Yes...
  • jaredpar's WebLog

    ImmutableStack in F#

    • 10 Comments
    When learning a new language I find it very instructive to re-code certain structures from my well used libraries into the new language.  It gives a great basis for comparison in terms of ease of implementation, expressiveness of the language and...
  • jaredpar's WebLog

    Enums vs. Adapters

    • 9 Comments
    I like Enums and use them frequently for options and behavior.  To an extent I use Enum's to control behavior.  For example enum Kind { Kind1, Kind2, Kind3 } class Example { private Kind m_kind; public int SomeAction() { switch...
  • jaredpar's WebLog

    Switching on Types

    • 9 Comments
    One action I find frustrating in C# is where a particular action needs to be taken based off of the type of a particular object. Ideally I would like to solve this with a switch statement but switch statements only support constant expressions in C# so...
  • jaredpar's WebLog

    Dvorak keyboard … is it really faster ???

    • 9 Comments
    Most people discover I’m a Dvorak user because they’re in my office, attempt to drive during a conversation and find they are typing gibberish. I take the keyboard, hit CTRL+LEFT_SHIFT and they’re on their way again. Well at least until they open up a...
  • jaredpar's WebLog

    Why is LINQ absent from debugger windows?

    • 9 Comments
    As the owner of the VB.Net portion of the overall debugging experience, I frequently hear the request from customers to add LINQ support into the Watch / Immediate and Locals window. Virtually every other type of expression is available in the debugger...
  • jaredpar's WebLog

    Building a WeakReference Hashtable

    • 9 Comments
    Recently I ran into a situation on a personal project where I needed a hashtable like structure for a set of WeakReference values.  When poking around for an existing implementation I saw found several versions which were very thin, type safe wrapper...
  • jaredpar's WebLog

    Closures in VB Part 2: Method Calls

    • 9 Comments
    For previous articles in this series, please see Part 1 - The basics This part of the series will focus on how method calls are handled in closures. As stated in the previous article, the purpose of closures is to allow all operations inside a lambda...
  • jaredpar's WebLog

    Who's selling your email address?

    • 9 Comments
    Ever wonder which companies that you shop with are selling off your address? I used to be very paranoid about giving my email address to companies that I shopped with for fear that they would sell it off and I would start to get a ton of spam. Like most...
  • jaredpar's WebLog

    VsVim 1.0 Released

    • 9 Comments
    I just released an update to VsVim for Visual Studio 2010.  This is available on the extension manager in Visual Studio or can be downloaded directly at the following link.  [1] Link: http://visualstudiogallery.msdn.microsoft.com/en-us/59ca71b3...
  • jaredpar's WebLog

    VsVim Update Released (Version 0.9.3)

    • 9 Comments
    I just released an update to VsVim for Visual Studio 2010.  This is available on the extension manager in Visual Studio or can be downloaded directly at the following link. Link: http://visualstudiogallery.msdn.microsoft.com/en-us/59ca71b3-a4a3-46ca...
  • jaredpar's WebLog

    Not all “true” are created equal

    • 8 Comments
      During a review of some low level bit manipulation logic a developer raised a question about the correctness of a piece of code which allowed any arbitrary byte to be seen as a bool.  No one could recall if true was defined as not 0 or simply...
  • jaredpar's WebLog

    Part of being a good programmer is learning not to trust yourself

    • 8 Comments
    ... and to actively guard against yourself. Over the years I've found that I can be my own worst enemy when I code. Part of the problem stems from paranoia Early in my college days, a professor of mine, Jim Greenlee, instilled in me the virtue of paranoid...
  • jaredpar's WebLog

    Why is LINQ absent from debugger windows (Part 2)?

    • 8 Comments
    Some readers may remember an article I published almost half a year ago about LINQ being absent from the debugger windows.  That post explored the initial design of the feature, it’s limitations and ultimately why it was absent but promised a future...
  • jaredpar's WebLog

    Dictionary<TKey,TValue>.TryGetValue and Anonymous Types

    • 7 Comments
    One of the methods I find to be the most useful in .Net is the method Dictionary<TKey,TValue>.TryGetValue .  This method is a nice compromise between performance, explicit return vs. exception, and a being verbal about the chance of failure...
Page 1 of 13 (321 items) 12345»