You searched for the word(s): userid:2127
Page 1 of 40 (391 items) 1 2 3 4 5 Next > ... Last »
  • Extension methods, explicitly implemented interfaces and collection initializers

    This post is the answer to yesterday's brainteaser . As a reminder, I was asking what purpose this code might have: public   static   class Extensions  {      public   static   void Add<T>( this ICollection<T> source, T item)      {          source.Add(item);      }  } There are plenty of answers, varying from completely incorrect (sorry!) to pretty much
    Posted to Jon Skeet: Coding Blog (Weblog) by skeet on Tue, Apr 8 2014
    Filed under: C#, Evil Code, C# 6
  • Quick brainteaser

    Just a really quick one today... What's the point of this code? Does it have any point at all? public   static   class Extensions {     public   static   void Add<T>( this ICollection<T> source, T item)     {         source.Add(item);     } } Bonus marks if you can work out what made me think about it. I suggest you ROT-13 answers to avoid spoilers for other readers.
    Posted to Jon Skeet: Coding Blog (Weblog) by skeet on Mon, Apr 7 2014
    Filed under: C#, Evil Code
  • C# 6: First reactions

    It's been a scandalously long time since I've blogged about C#, and now that the first C# 6 preview bits are available, that feels like exactly the right thing to set the keys clacking again. Don't expect anything massively insightful from me just yet; I'd heard Mads and Dustin (individually) talk about some new features of C# 6 at conferences, but this is the first opportunity I've had to play with the bits. There are more features to come, and I suspect that the ones we've
    Posted to Jon Skeet: Coding Blog (Weblog) by skeet on Fri, Apr 4 2014
    Filed under: C# 6
  • How many 32-bit types might we want?

    I was recently directed to an article on "tiny types" - an approach to static typing which introduces distinct types for the sake of code clarity, rather than to add particular behaviour to each type. As I understand it, they're like type aliases with no conversions between the various types. (Unlike plain aliases, an object is genuinely an instance of the relevant tiny type - it doesn't have "alias erasure" as a language-based solution could easily do.) I like the idea
    Posted to Jon Skeet: Coding Blog (Weblog) by skeet on Fri, Jan 31 2014
    Filed under: General, Wacky Ideas
  • Diagnosing issues with reversible data transformations

    I see a lot of problems which look somewhat different at first glance, but all have the same cause: Text is losing "special characters" when I transfer it from one computer to another Decryption ends up with garbage Compressed data can't be decompressed I can transfer text but not binary data These are all cases of transforming and (usually) transferring data, and then performing the reverse transformation. Often there are multiple transformations involved, and they need to be carefully
    Posted to Jon Skeet: Coding Blog (Weblog) by skeet on Mon, Jan 20 2014
    Filed under: General, Stack Overflow
  • A tale of two puzzles

    As I begin to write this, I'm in a small cubicle in Philadelphia airport, on my way back from CodeMash - a wonderful conference (yet again) which I feel privileged to have attended. Personal top highlights definitely include Dustin Campbell's talk on C# 6 (I'm practically dribbling with anticipation - bits please!) and playing Settlers of Catan on an enormous board. Kevin Pilch-Bisson's talk on scriptcs was fabulous too, not least because he demonstrated its NuGet support using Noda
    Posted to Jon Skeet: Coding Blog (Weblog) by skeet on Tue, Jan 14 2014
    Filed under: C#
  • Career and skills advice

    It feels a little odd even to write this post, but I receive quite a few emails asking me for advice on how to get better at programming, how to get through interviews, whether it's better to be a generalist or a specialist etc. I want to make it very clear right from the start, I am not a career guidance expert . I have very little evidence that this is good advice, and it may well not be good advice for you even if it's good advice in general. Oh, and don't expect anything shockingly
    Posted to Jon Skeet: Coding Blog (Weblog) by skeet on Sat, Sep 21 2013
    Filed under: General
  • Casting vs "as" - embracing exceptions

    (I've ended up commenting on this issue on Stack Overflow quite a few times, so I figured it would be worth writing a blog post to refer to in the future.) There are lots of ways of converting values from one type to another – either changing the compile-time type but actually keeping the value the same, or actually changing the value (for example converting int to double). This post will not go into all of those - it would be enormous - just two of them, in one specific situation. The situation
    Posted to Jon Skeet: Coding Blog (Weblog) by skeet on Thu, Sep 19 2013
    Filed under: C#, Design
  • Array covariance: not just ugly, but slow too

    It seems to be quite a long time since I've written a genuine "code" blog post. Time to fix that. This material may well be covered elsewhere – it's certainly not terrifically original, and I've been meaning to post about it for a long time. In particular, I remember mentioning it at CodeMash in 2012. Anyway, the time has now come. Refresher on array covariance Just as a bit of background before we delve into the performance aspect, let me remind you what array covariance is
    Posted to Jon Skeet: Coding Blog (Weblog) by skeet on Sat, Jun 22 2013
    Filed under: C#, Wacky Ideas, Benchmarking, Design
  • But what does it all mean?

    This year before NDC, I wrote an article for the conference edition of "The Developer" magazine . Follow that link to find the article in all its illustrated glory (along with many other fine articles, of course) – or read on for just the text. Back when I used to post on newsgroups I would frequently be in the middle of a debate of the details of some behaviour or terminology, when one poster would say: “You’re just quibbling over semantics” as if this excused any and all previous inaccuracies
    Posted to Jon Skeet: Coding Blog (Weblog) by skeet on Fri, Jun 21 2013
    Filed under: General
Page 1 of 40 (391 items) 1 2 3 4 5 Next > ... Last »