Browse by Tags

All Tags » Stack Overflow (RSS)

Just how spiky is your traffic?

No, this isn't the post about dynamic languages I promise. That will come soon. This is just a quick interlude. This afternoon, while answering a question on Stack Overflow 1 about the difference between using an array and a Dictionary<string,...
Posted by skeet | 9 comment(s)
Filed under: , ,

Revisiting randomness

Almost every Stack Overflow question which includes the words "random" and "repeated" has the same basic answer. It's one of the most common "gotchas" in .NET, Java, and no doubt other platforms: creating a new random...

OMG Ponies!!! (Aka Humanity: Epic Fail)

(Meta note: I tried to fix the layout for this, I really did. But my CSS skills are even worse than Tony's. If anyone wants to send me a complete sample of how I should have laid this out, I'll fix it up. Otherwise, this is as good as you're...

Iterating atomically

The IEnumerable<T> and IEnumerator<T> interfaces in .NET are interesting. They crop up an awful lot, but hardly anyone ever calls them directly - you almost always use a foreach loop to iterate over the collection. That hides all the calls...

API design: choosing between non-ideal options

So, UnconstrainedMelody is coming on quite nicely. It now has quite a few useful options for flags enums, "normal enums" and delegates. However, there are two conflicting limitations which leave a couple of options. (Other related answers on...
Posted by skeet | 10 comment(s)
Filed under: , ,

Generic constraints for enums and delegates

As most readers probably know, C# prohibits generic type constraints from referring to System.Object, System.Enum, System.Array, System.Delegate and System.ValueType. In other words, this method declaration is illegal: public static T[]GetValues<T>...
Posted by skeet | 54 comment(s)

Recent activities

It's been a little while since I've blogged, and quite a lot has been going on. In fact, there are a few things I'd have blogged about already if it weren't for "things" getting in the way. Rather than writing a whole series...

Faking COM to fool the C# compiler

C# 4 has some great features to make programming against COM components bearable fun and exciting. In particular: PIA linking allows you to embed just the relevant bits of the Primary Interop Assembly into your own assembly, so the PIA isn't actually...
Posted by skeet | 1 comment(s)

Reasons for voting on questions and answers

I've recently been involved in a few discussions around voting on Stack Overflow , and I think my own "policy" around it may be different to that of others. I thought it would be worth sharing why I personally vote items up or down, and...
Posted by skeet | 23 comment(s)
Filed under:

Go on, ask me anything

This afternoon, I found a comment which had been trapped in the spam bin for this blog. It was from Andrew Rimmer, in reply to my "micro-celebrity" post , pointing me at http://askjonskeet.com The world has officially become extremely silly...
Posted by skeet | 29 comment(s)

Answering technical questions helpfully

I'm unsure of whether this should be a blog post or an article , so I'll probably make it both. I've probably written most of it before in Stack Overflow answers, but as I couldn't find anything when I was looking earlier (to answer a...
Posted by skeet | 18 comment(s)
Filed under: ,

Benchmarking: designing an API with unusual goals

In a couple of recent posts I've written about a benchmarking framework and the results it produced for using for vs foreach in loops . I'm pleased with what I've done so far, but I don't think I've gone far enough yet. In particular...
Posted by skeet | 8 comment(s)

Programming is hard

One of the answers to my "controversial opinions" question on Stack Overflow claims that " programming is so easy a five year old can do it. " I'm sure there are some aspects of programming which a five year old can do. Other parts...
Posted by skeet | 22 comment(s)
Filed under: ,

Quick rant: why isn't there an Exception(string, params object[]) constructor?

This Stack Overflow question has reminded me of something I often wish existed in common exception constructors - an overload taking a format string and values. For instance, it would be really nice to be able to write: throw new IOException( "Expected...
Posted by skeet | 26 comment(s)

Stack Overflow reputation and being a micro-celebrity

I've considered writing a bit about this before, but not done so for fear of looking like a jerk. I still think I may well end up looking like a jerk, but this is all stuff I'm interested in and I'll enjoy writing about it, so on we go. Much...
Posted by skeet | 44 comment(s)
Filed under: ,

Stack Overflow Reputation Tool now online

Update: Now that the "recent activity" page is working, the feed that the tool was using has been removed. However, the new page offers pretty much everything that the tool did, and a lot more besides. I've updated the tool to just redirect...
Posted by skeet | 7 comment(s)
Filed under:

New addiction: Stack Overflow

This may be old news to many readers, but there's a relatively new development Q&A site called Stack Overflow . I'm not generally a fan of web forums as opposed to newsgroups, but Stack Overflow just works . In particular, the post/answer...
Posted by skeet | 3 comment(s)
Filed under: ,