C# 3.0 - Hair extensions for wanna-be rubyists(realfiction.net)

submitted by fquednaufquednau(404) 4 years, 7 months ago

Get some of ruby's sexyness by using C# 3.0's extension methods.

2 comments |category: |Views: 10

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by yesthatmcgurkyesthatmcgurk(4063) 4 years, 7 months ago 0

My fav ruby extension, for that oh so sexy ruby hotness:
public static class AwRubySugarbaby{public static string to_s(this int i){return i.ToString();}}

Reply

posted by JudahGabrielJudahGabriel(783) 4 years, 7 months ago 0

Sarcasm?

So, i.to_s() is better than i.ToString()?

Seriously though, I do like extension methods so far. I just hope they don't get abused, such as:

public static void GetName(this object o)
{
o == null ? "null" : o.ToString();
}

string s = null;
s.GetName(); // Doesn't throw a NullReferenceException! Yikes...

Reply

information Login or create an account to comment on this story