fallenrogue.com

Microsoft and jquery

written on: Monday September 29 2008 at 11:23 AM there are currently 2 comments
I’ve been a critic of Microsoft. I develop on their platform and use their products every day. Lately I thought that their working with open source for their MVC product line, while a step in the right direction was still largely serving platitudes to the vocal minority alpha geeks. It wasn’t really open, it wasn’t really community owned. That’s not saying anything about the product itself, which is quite good, it just wasn’t what I was hoping for. I was hoping for a vendor fork of Castle. Something that didn’t re-invent the wheel that the community had spent time creating but rather built upon their great work and rewarded it with support and endorsement.

So, you’ll imagine my utter shock and surprise when it was announced that the very popular and hugely successful javascript library jquery will be packaged and shipped with full Visual Studio support (intellisense, etc) in the next version. But wait! It doesn’t stop there! They are shipping the library as is (no vendor fork) and under the existing MIT license.

I don’t think I can stress just how big this is for Open Source and Microsoft. Getting OSS adoption in some enterprises with ELAs with Microsoft can be a real challenge. Seeing MS proactively embrace this project under its license goes a long way to solidifying credibility. It also is a huge vote of confidence to the community for their hard work. The reward being, Enterprise recognition while retaining community ownership. Microsoft, I have been hard on you with good reason but today I applaud you and this decision.

Lambda and Scope in C#

written on: Tuesday July 08 2008 at 04:34 PM there are currently 3 comments

Ok, so I’ve read a few articles out there that are trying to explain scope and lambdas. The one above is the latest in an attempt to make it easy to grok this concept in the new C# spec. (new is a relative term) Let me make this very clear and simple.

public static void Main(string[] args)
{
    List<Action> closures = new List<Action>();
    for (int i = 0; i < 10; i++)
    {
        closures.Add(() => Console.WriteLine(i));
    }
}

Results:

Windows Server 2003 Enterprise Edition

now, run this Console app and you’re going to get a list of 10s. Here’s where people’s faces turn white and start cursing lambdas. The problem though is that it’s not lambda’s fault at all. In fact, lambda is doing exactly what it is suppose to do. I’ve read online where people debate if lambda’s are lexical at all, because they don’t seem, in this case, to be retaining the correct scope of the variable passed in. Well, this is not true. The issue is the way that for loops execute in C#. You see, according to the C# 3.0 spec the variable “i” in our for loop defines it scope outside of the containing block that it is iterating over. That is the issue. The lambda is going to capture it is in the parent scope and while, traditionally that variable “i” would have fallen out of scope after the for block it is actually retained in memory (because it’s still being referenced by the lambda!) until the lambda is gone.

SO! what do we REALLY want here? Well, if the answer is to print numbers from 0 to 9 then you have to establish a variable to hold the value in the currently executing scope of the lambda. Like so…
public static void Main(string[] args)
{
    List<Action> closures = new List<Action>();
    for (int i = 0; i < 10; i++)
    {
        int j = i;
        closures.Add(() => Console.WriteLine(j));
    }
    foreach (var a in closures) a.Invoke();
}

Results:

Windows Server 2003 Enterprise Edition

And there you have it. You’ve now correctly established a variable in the same scope as the lambda thus ensuring it is not modified after you exit that scope. If that's difficult to grok, think back to our garbage collector. It will flag an item for deletion when it falls out of scope and no objects are currently pointing to it in memory. j will be retained in memory because although its execution scope has exited, the lambda is retaining a reference to... even beyond its scope! How cool is that?!

Because some of you may be wondering… why 10’s? Well, again: Scope. the incrementor in our for loop increments AFTER the for block is complete. It is, in essence, a closure itself. If I defined a for loop in C# it might look like this:
static void LeonFor(int start, int end, Action<int> toDo)
{
    int i = start;
    while (i<end)
    {
        toDo.Invoke(i);
        i++;
    }
}

You see how the scope is defined? The final increment on i will never be seen during the invocation of the block. Thus: 10.

I hope that helps clarify a bit. This is a common barrier to grokking this topic. Remember, it’s not lambda’s that are “acting goofy”. It’s the assumptions we made before they existed. This issue is about Scope and not a “funky new language feature”. And scope is certainly easy to understand, right? :)

Check out the latest Deep Fried Bytes!

written on: Monday July 07 2008 at 10:51 AM there are currently 0 comments
Yours truly is on the latest episode of the great Deep Fried Bytes podcast! We’re talking about doing .net development on a Mac. The pros, the cons, the ins and outs! Please check it out and also give us a digg!

Digg here and then listen!

Wanna hear me complain in person? Work for Telligent!

written on: Monday June 23 2008 at 03:08 PM there are currently 0 comments
So, for those of you out there who can’t seem to get enough of me there is an opening on our team for a SharePoint developer. The position is out of Dallas but, for the right candidate, that may be up for negotiation! If you want to sling some SharePoint code, making a difference in the enterprise (read: making it suck a whole lot less!), and get your geek on with some of the sharpest tacks in the .net drawer then email me [fallenrogue at gmail]

Just in case you don’t know, I work for Telligent Systems and we build the best community software platform on the planet, Community Server .

SharePoint Development is an Adventure!

written on: Wednesday June 18 2008 at 06:00 PM there are currently 4 comments
There is an amazing amount of pain that developers in the .net space are experiencing with SharePoint development. SharePoint has become much more than a place to store documents or work with others on a file. Many enterprises are using it in unique and orignal ways and that value has been brought to the service by a growing community of developers outside of Microsoft.

I’ve been asked many times why I bother with SharePoint. While out drinking with Alan Stevens in Cleveland he could barely hold back his contempt for the platform and my participation in it. He turns to me and screams “You’re doing WHAT?! SharePoint sucks! It sucks so hard! Why the fuck would you even do that!?” He then went back to his drink. I’m sure the beer brought the rage that had been lying dormant. I get these types of reactions often.

Joe Wirtley asked me (in a much more civil manner than Alan. :) ), nearly 6 months ago, “Leon, why SharePoint? You love open source, standards, your favorite language is Ruby. You’re an avid supporter of testing. SharePoint development seems to be the opposite of all of those things.” Joe’s observation and ability to articulate the confusion of my peers is exactly why I’m taking a few moments to blog about my choices. Those who read this blog know that I have a language fetish and hop often. Folks who found me for my Rails articles have probably long since moved on to other rock stars in that community. I had little or nothing to contribute or say about Rails anymore so I haven’t. Many kind people have asked about future articles on Rails but the truth of the matter is that there is a buzzing community around Rails doing just that. The area is covered and I feel good about moving on. I love Rails. I love Ruby and I’ll continue to use it as appropriate but if there’s one thing that I’ve realized in this business its not to put all of your eggs into one technology basket. Besides, it’s not my nature to stay tied down to tech or platform.

So, why this post? There is a lot of pissing and moaning on the internet these days about SharePoint as a bad development platform. Really? Well, it’s not developer centric, I’ll give you that. There are many challenges that go into developing for SharePoint when you compare it to non-platform specific development. Unfortunately, many of these developers who are in pain are making a comparison of SharePoint development to other forms of asp.net development. This is made worse by those, like myself, who are constantly saying that SharePoint development is, at its core, asp.net development. A statement that is true only in the sense that WSS 3.0 is built on asp.net. The comparison is not 1 to 1 and when the developer, perhaps an expert in asp.net, tries SharePoint and sees the poor tooling, documentation or worse finds one of the many bugs in the Object Model they throw their hands in the air and walk away from the table.

But that’s not enough to make a man angry. That’s not enough to make him go onto a blog and yell at the masses for days. It’s certainly not enough to make a fat man in a plaid hat re-think his life while having drinks in Cleveland. No, the difference is that SharePoint is a platform that is usually endorsed by the enterprise. Meaning, the developer is thrust into the environment and expected to perform at the same level that they have in the past with asp.net; after all, the Microsoft rep assured the management team that the learning curve would be low considering the platform is “just asp.net”. Yeah. And there’s not difference between merb and rails either or Django and Pylons. Now they’re angry and they should be.

So that’s where I come in. I’m in SharePoint everyday. I did it while consulting and I’m helping to bring Community Server into SharePoint (a union that gets stronger and stronger every day) and I do it everyday. The path was long and difficult and I had to pave my own road for most of it. Starting today, I’m going to share my experiences with you. I’m going to share my point of view, as a developer working in SharePoint. ‘cause right now I feel like the guy who still loves his Dreamcast and says it was fantastic while everyone looked at me cross eyed.

I’m not saying it’s not difficult. I’m not saying there is a small learning curve. I’m not saying the barrier to entry is low. I am saying that it is a rich and rewarding platform that has more to offer than most are giving it credit for. I, personally, have said some unkind things about SharePoint development out of anger and frustration. I’ve since learned that it’s just as easy to file a bug report and move on. Count me as one guy who does it. I’m frustrated, sure, but nothing worth having isn’t without some effort. Details will follow soon but for now... lighten up a bit and enjoy life. ;)

How I got started programming

written on: Wednesday June 11 2008 at 10:56 AM there are currently 2 comments
Well, this is going round and round and round the inter-tubes and since Jim Holmes called me out I will certainly give my response. So here it is, in all it’s pith…


How old were you when you started programming?

21-ish. Started building lame-ass websites for my friends in college in the late 90s for funzies.

How did you get started in programming?

Dad sent me a laptop, I built a web page. That turned into a web site. Then I got Flash 4 from my student discount and started building flash web sites for people. I was doing data entry one day when my boss saw my website and asked if I would develop something for him at 10x the bill rate. That’s how I started.

What was your first language?

HTML and Javascript

What was the first real program you wrote?

A Blog Engine before it was called a blog.

What languages have you used since you started programming?

As many as I can get interested in: HTML, XHTML, CSS, Javascript, Flash (actionscript), C, C++, C#, VB, VBScript, VB.NET, XML, Ruby, Ruby on Rails, Python, Smalltalk (Dolphin), DOS, Powershell, Bash, XAML. etc, etc, etc…


What was your first professional programming gig?

NYC – Flash interfaces for banking reports.

If you knew then what you know now, would you have started programming?

Sure. I mean, if I didn’t like it I just would stop doing it and do something else. Not doing something you like for a living is retarded. If you’re doing that and you’re reading this, stop now. Move on. Do something with your short life, people. I program cause I enjoy it not only for the money.

If there is one thing you learned along the way that you would tell new developers, what would it be?

Think.

What’s the most fun you’ve ever had … programming?

Rich and I built a impossible CRM system in 3 weeks that was scoped at 6 months. We worked non-stop and had a great time. It wasn’t the system that was fun, it was working with Rich.

So, there you have it folks. Mystery revealed! ;)

Calling all SharePoint developers!

written on: Sunday May 18 2008 at 10:52 PM there are currently 0 comments
Or would be developers or folks who tinker, in fact, if you’ve touched SharePoint from a development/design/admin capacity then Glenn Block and the P&P folks at Microsoft want to hear all about your dev concerns in a survey that will result in some much needed and long overdue guidance regarding SharePoint development and customization.

The survey is here and you can read more about Glenn’s project at this blog here

Meet up this week!

written on: Monday May 12 2008 at 09:56 AM there are currently 2 comments
Hey all, just wanted to let you know I’m going to be jabbering live in the Cincinnati and Cleveland areas this week.

First stop, there is a new Architecture specific special interest group starting up in Cincinnati Tuesday the 13th at 6:00. It’s being started by Mike Wood who is head of the Cin .net user group, a fantastic community of passionate technologists. Come check it out, chances are that I will talk specifically about software arch and not hardware cause that’s my thing. I’ll let everyone else go on about hardware and infrastructure. Details here.

And on Saturday the 17, I’m going to be talk about SharePoint in Cleveland. It’s a 100-200 intro to SharePoint for designers, devs and sysadms so if you want to grok a little SP, see what it can do for you please stop by the talk. If you then want to talk about Ruby, Rails, Python or Django, hit me at the bar afterwards because I’ve got some convos I need to have!

Cleveland Day of .NET


Truth is folks, I’m large and have been accused of “looking scary” from a far but I asure you, nothing could be further from the truth! Please if you see a 300 lbs. man in a funny plaid colored bukkit hat answering to either Leon, FallenRogue or Rogue, say hi and let’s chat nerd style. Hope to see you guys soon!

Oh! and it's not this week but I'm also speaking at the Dayton .net user group at the end of this month in case you can't make it to Cleveland. details for that event are here

Wanna work for Telligent?

written on: Thursday May 08 2008 at 07:37 PM there are currently 0 comments
The company that I’m currently slinging code for Telligent Systems is currently looking for a SharePoint developer in the Dallas area to join the CommunityServer product team. Yup, that’s right, you work with the best of the best in the .net space building one of the most badass apps on the planet.

So, if you’re looking for a high profile, highly visible SharePoint project to get your hands dirty on check out the job posting here.

Tell your friends. :)
Now back to our regularly scheduled blog articles…

history blog meme

written on: Tuesday April 22 2008 at 10:27 PM there are currently 0 comments
Joe and Jay are doing it… me too!
fallenrogue$ history 1000 | awk ‘{a[$2]++}END{for(i in a){print a[i] ” ” i}}’ | sort -rn | head
135 git
128 rake
30 svn
26 ls
22 rapt
21 cd
19 gem
18 python
11 mate
9 script/plugin

The lighter side...

Leon Gersing's Facebook profile

Twitter Updates

    The conversations...

    In Microsoft and jquery

    Leon: For the record, I love prototype! It's a great ...
    Chris Poteet: Word yo. So when is CS going off of Prototype?

    In Lambda and Scope in C#

    Jacques: Thanks for the very clear explanation & good ex...
    Leon: totally. R# 4.0's support of the new C# 3.0 spe...
    Matt Hinze: I like the quick fix in Resharper that alerts m...

    In SharePoint Development is an Adventure!

    Leon: Well, the project that I was working on fell th...
    JDP: "Details will follow soon but for now..." Really?
    Leon: @Chris: hehe :) There is that little side effec...
    Chris: When they ask: "Why SharePoint?" You can also ...

    In How I got started programming

    Joe Wirtley: +1 to "Think". Concise summary of many recent ...
    Michael Eaton: "Think." Word. :-)

    In Meet up this week!

    Leon: Good! :)
    Joe Wirtley: Like I'm going to talk about hardware or infras...

    The most recent comments...

    Leon: For the record, I love prototype! It's a great library that extends javascript to look and behave...
    Chris Poteet: Word yo. So when is CS going off of Prototype?
    red: Glad that 2.0 upgrade is free.
    judy: Great site. I will bookmark for my sons to view as well!!!o
    name: Hi!,
    name: Hi!,
    name: Good day!,
    Jacques: Thanks for the very clear explanation & good example!
    Leon: Well, the project that I was working on fell through, which is why I didn't announce it. So yeah,...
    JDP: "Details will follow soon but for now..." Really?
     

    The other stuff...

    ©2000-2008 fallenrogue.com | Some Rights reserved.