personal comments edit

I don’t really participate on StackOverflow. Don’t get me wrong, I’ve asked a couple of questions and I’ve answered a couple, too, but by and large, I don’t go there.

At first I thought it was because of the Fastest Gun in the West problem. I like to take my time and give nice, thorough, sometimes lengthy, but always complete answers. I like that because it serves as a better reference for the future - it doesn’t just answer the question for that one person, it answers the question with context for the future person asking. And that’s still something I take issue with because, contrary to the current top answer on that problem, I don’t believe people read through every answer to the question. I don’t believe there’s a “long game.” I don’t believe the asker of the question comes back to their questions to review any new, more complete answers and switch what they mark as the “official answer.” I don’t believe people come in and upvote more complete/correct answers. We already know people don’t up-or-down-vote questions.

But I got thinking… and while the Fastest Gun thing does irritate me, that’s not really the reason I don’t often visit StackOverflow. The real reasons, I think, are:

1. A high percentage of the questions could be answered with a trivial effort on Google.

I can’t tell you how many questions I see fly past that are so simple, so “RTFM,” that anyone worth their salt couldn’t have just hit Google, typed the question in there, and got the actual documentation - with samples - to answer the question. So many questions could be answered with a “Let Me Google That For You” (or, if you prefer, the Bing equivalent) link that… I don’t even want to think about it. Cats and dogs living together - mass hysteria.

The reason this bugs me is that it really throws off the signal-to-noise ratio of questions on the site. It also, in my opinion, just serves to inflate the reputation of the Fastest Gun answerers - sit and search for trivial questions all day, answer, get points. The latter issue of reputation is sort of a self-solving issue since I’m not too concerned with reputation or answering trivial questions, but the signal-to-noise thing really is annoying.

2. People can not figure out how to ask a question.

There’s a whole FAQ on this even. It’s not that hard, but it kills me that people just can’t figure it out. Titles of questions like “Problem with ASP.NET” or “Migrating to MVC3.” Really? Both of those sound amazingly totally unlike questions. Even if you phrased the titles as questions (“How do I fix a problem with ASP.NET?”) they’re still too broad, so you have to go in and read them to figure them out. Once you’re in there, it’s one of three things:

  • A “plz send me the codez” question that somehow never gets moderated away, regardless of flagging, etc.
  • Something so broad that you should send them an Amazon gift card so they can buy some books and read up.
  • Very specific to a problem in their system, and while they describe the error that’s happening they don’t provide any context, code, stack trace, or additional data that would possibly be needed to assist them.

I’m not sure how to solve it.

I sort of thought StackOverflow (and the whole StackExchange thing) was supposed to be sort of self-moderating, but I feel like maybe they err on the side of less actual moderation just so they can build content. That’s great from a business model perspective because more content generally equates to more visitors. On the other hand, quantity is not the same as quality, and these two issues so drastically reduce the quality of what’s there that it’s hard for me to value the site as a resource. I can’t be alone here. This makes me wonder if I’m even the target audience for StackOverflow. Maybe I’m not. I guess I’ll just keep checking in to see if it gets better.

General Ramblings comments edit

Hypothetical situation:

A coworker approaches you and asks you to help them out with something. It’s a simple task like copying a file or changing a setting. This isn’t the first time they’ve asked you to help them do this, and they say they can’t do it themselves because of something they’ve known about for a while but haven’t gotten around to addressing - their machine is malfunctioning, their account should have permissions on something but it doesn’t, that sort of thing.

Do you help?

Honestly, in situations like this, I’m torn.

The first time or two, sure, I’ll help out, but after a couple of “please help with this quick little task” requests, I balk. It’s not that I don’t want to be unhelpful or *gasp* not a team player, but that I’d rather treat the cause instead of the symptom. if the reason the person can’t take care of things is something known that they need addressed, I’d much rather help them through the process of getting the root issue resolved so they can take care of the small things on their own. Even if the issue is education (“You know how to do this but I don’t, so can you just do it for me?”) I’d rather train the person than just keep fielding little help requests.

Of course, there are always exceptions (e.g., when there’s a huge deadline that solving the root issue would jeopardize, etc.) but by-and-large, I’d rather things just be fixed.

vs comments edit

Dear Visual Studio Extension Developers:

(This includes folks who create products that have “value-add” features that install into Visual Studio, extensions done through classic or new mechanisms, and/or anyone who has something that otherwise “bolts on” to VS to enhance the development experience.)

I have a lot of different products, add-ins, and extensions installed in Visual Studio. Most of them behave reasonably, but I’ve had some recent bad luck with a couple that have caused… frustration. This is to ask you to help me.

Help me enjoy your product. Help me not be frustrated. Help me be that guy who blogs about how double-plus-awesome you are. In order to do that, I have some ideas for you:

  • Don’t require administrative privileges to run. I don’t develop as an administrator. You shouldn’t either. Even if you do, for whatever reason, your QA process should test the extension as a non-admin. I don’t want to get all energized to use the stuff just to fire up VS and get an inexplicable exception message that I have to trace back to your extension.
  • Remember the state in which I left your extension. If you have some sort of window or menu bar addition, make sure if I close the window, move it, dock it, or otherwise use the standard window/menu customization options that I won’t totally lose that customization when I close VS and restart it later.
  • Test your upgrade path. If I install your extension, change some settings, and then later upgrade, I don’t want to lose my settings. Also, if your product is offered as a standalone installer and through the VS Extension Gallery, make sure the two mechanisms understand each other so I don’t manually install the latest version just to be prompted to “upgrade” by the VS Extension Gallery.
  • Don’t write files to my source tree. In my ideal world, I don’t want you writing anything to my source tree because in most cases are those files are going to be per-user settings (right?) which I don’t want to accidentally check into my repository. I also don’t want to have to chase everyone down that’s using your extension and make sure they don’t check them into their branches/clones/etc.
  • If you absolutely must write files to the source tree, use a file extension I’m already ignoring. Most source code control projects for .NET have *.suo and *.user ignored. Feel free to use those extensions so for your per-solution or per-project files so it’s seamless.
  • Don’t add a top-level menu to Visual Studio. You don’t need to show up at the same level as File, Edit, View, etc. I have no less than 19 of these top-level menus right now, counting the stock items. If I size the VS window less than 1200 pixels wide, the menu starts wrapping. That’s ridiculous, especially when some of these just open up settings menus. There’s a “Tools” menu. Use it. There is a standard VS options dialog. Hook into it. Putting yourself right at the top is like trying to install a desktop shortcut every time. (I figured out how to use the Start menu since Windows 95 came out. I don’t need a desktop icon.) Note: The exception to this is if your plugin actually does have a huge ton of things that are menu-driven. Chances are, though, your plugin doesn’t fall into this territory. You might think it does, but it probably doesn’t.
  • Have options to enable/disable sets of functionality. If your plugin does more than one logical “thing” (e.g., it does syntax highlighting and enhances the Solution Explorer) you need to offer me options to enable or disable the individual features. You may have five things that your plugin does but only four of them are things I’m interested in, while the last one is just annoying. Let me disable that annoying one. Don’t force me to choose between uninstalling your plugin or putting up with annoying behavior.

DevExpressis actually a good example of what to do in pretty much every case here. The CodeRush/Refactor set of VS extensions are fantastic. They do add a top-level menu to VS, but since there is a ton of functionality (tool windows, etc.) you’d want to get through menus and it’d be cumbersome nested under the Tools menu, it’s justified. They cover every other item I listed here like a champ and are, in fact, double-plus-awesome.

Anyway, thanks, VS Extension Developers, for hearing me out.

Sincerely, Me

I’m sensitive to smells.

I think I get it from my mom, who is also sensitive to smells, though she really likesstrong perfumes and scents whereas I really can’t stand anything of volume. I can’t really walk down the soap aisle at the store and I’m not a big fan of scented laundry soap or fabric softener. In most cases, I’d rather things just not have a smell.

There are exceptions, of course. I like the smell of chocolate. I like the smell of coffee. I also like the smell of pipe tobacco that you get when you walk past the smoke shop, but I don’t want to be in the middle of a bunch of pipe smokers.

Anyway, this is all coming to mind because the entire first floor at work smells like god damn hot ham sandwich and it’s making me sort of ill.

My cubicle neighbors are probably irritated with me and my smell issue since it basically means if you cook last night’s stank-ass fish dinner and bring it back to your desk, you’ll probably be getting a polite knock on the wall of your cube with my smiling face ready to have a polite discussion about maybe please could you keep the cooked food in the break area thanks.

I think smelly food falls into that same respect-for-your-neighbors arena as nail clipping. If you need to clip your nails, go ahead and take that into the appropriate place (restroom) so you’re not bugging other people with it.

I recently moved my cube not too far from the original location so I could get a nice view of the outside world rather than being stuck in a dark windowless tank all day. It’s a nice location, reasonably quiet, with a view of the parking lot which is really not so bad if I do say so myself. Unfortunately, what I did find is that the air vent over my head is, through some dark magic, connected to the vent over the break area, so whenever someone’s got something luscious a-cookin’, it ends up blowing out the vent in the ceiling right into my face.

I’m not entirely sure what to do about that. I have done some experimentation to see if this really is the case, and, yes, it does appear to be so. If it starts stinkin’, I can jog over to the break area and, sure enough, there’s the microwave going.

While I am figuring out how to somehow alleviate the issue at the source, I have “rigged up” a sort of counter-stink defense involving a small desk fan and “Clean Linen” scented air freshener. Step 1: Turn on fan. Step 2: Spray into the fan. Step 3: Sigh in relief.

The fan-and-spray anti-stink
setup.

Thank goodness for laptops, right? “Ack! They released the mustard gas! Grab your laptop and hide out in a conference room until it dissipates!”

Work’s not the only place with some dicey smells. Babies bring with them a whole new set of unpleasant aromas, most of which involve poop or vomit, and sometimes both. I am partial to neither, and that makes for a challenge. I’m not sure who figured out what baby formula is supposed to smell like, but that guy needs to be fired. Baby formula, even fresh in the bottle, smells like ass. Come on, you couldn’t stick some vanilla scent in there or something? Oh, and the Auntie Anne’s pretzel stand at the mall always smells so sickeningly sweet it catches my breath.

OK, the ham sandwich appears to be dying down. I can probably take this mask off and get back to work.

dotnet, gists, aspnet comments edit

We have a custom VirtualPathProvider that serves some static files (*.js, *.css) from embedded resources in assemblies. It is similar in function to the WebResource.axd that ships with ASP.NET, but instead of having some crazy URL, you just access the file directly and the VPP finds it in embedded resources and serves it just like it was on the disk. It makes for a nice deployment experience and easy upgrade.

The problem I’ve run into a bunch, particularly with routing showing up, is that even with a wildcard map to ASP.NET, my static files end up with a 404 error code because routing is catching them, sending the requests to the MVC handler, and no route is found. Fail.

So, as a note to myself (and anyone else who’s doing something similar), here’s what I’ve found you need to do to get your VPP serving up static files.

First, you need to get the desired static file types mapped to ASP.NET. In an integrated pipeline, that means adding the StaticFileHandler in your web.config (or doing some other machinations, based on your setup, but the web.config method makes it easy and controlled from the web app rather than the IIS console). A snippet of web.config looks like this:

<?xml version="1.0"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="AspNetStaticFileHandler-GIF" path="*.gif" verb="GET,HEAD" type="System.Web.StaticFileHandler"/>
      <add name="AspNetStaticFileHandler-JPG" path="*.jpg" verb="GET,HEAD" type="System.Web.StaticFileHandler"/>
      <add name="AspNetStaticFileHandler-CSS" path="*.css" verb="GET,HEAD" type="System.Web.StaticFileHandler"/>
      <add name="AspNetStaticFileHandler-JS" path="*.js" verb="GET,HEAD" type="System.Web.StaticFileHandler"/>
    </handlers>
  </system.webServer>
</configuration>

Obviously you’ll have a whole bunch of other stuff in your web.config, but this is the relevant bit here. Make sure the static file handlers are the last handler entries in your web.config.

UPDATE/IMPORTANT: In the original post for this article I set a wildcard mapping to AspNetStaticFileHandler. That actually messes other things up. For example, it starts serving web form .aspx files as text files directly. Not good. Instead, map the static file handler directly ONLY to the static file types you plan on serving.

Now the problem is that ASP.NET routing is going to pick up every incoming request for those file types and you’ll end up with a 404 when the request doesn’t match any route. This is the problem that is so hard to debug - your VirtualPathProvider.FileExists method will be properly called to determine whether the file can be served up… but then you get a 404 without ever getting your VirtualPathProvider.GetFile method to try and serve the thing up. WTF?! The answer is to ignore routes to the static files.

In Global.asax, in your RegisterRoutes method, set it up so static file extensions get ignored. This is based on Phil Haack’s blog entry about ignoring requests for a certain file extension:

routes.IgnoreRoute("{*staticfile}", new { staticfile = @".*\.(css|js|gif|jpg)(/.*)?" });

Now when you make a request for your static file, it will properly be served up by your VirtualPathProvider and won’t have to be in the filesystem.