Wow – some real talk about Rails and Microsoft

I am listening to Hanselminutes #65.

Some very interesting perspectives on Rails and Microsoft. Its great to hear this type of sentiment come though a channel like Hanselminutes. Scott is someone who I would consider typically a pro-MS type who is open to new things. Hopefully the less open people will understand what Martin and David tried to convey.

http://hanselminutes.com/default.aspx?showID=82

ASP.NET on Mono with Postgresql

Until bug 81490 was closed, Mono wasn’t capable of the ever popular “YOU DID IT WITHOUT ANY CODE” demo using Postgresql. For the unfamiliar, this is when someone demos Visual Studio’s ASP.NET designer and drags a table from the expanded database connection and drops it to the ASP.NET designer. The tool creates a connection string in the application configuration file, an SqlDataSource which uses the connection and a GridView which uses the SqlDataSource.

This code worked with Mono only if you were using SqlClient data provider. This means you were talking to Microsoft SQL Server. Most Mono users are on Linux. They want to talk to Postgresql or MySQL. Npgsql has an ADO.NET 2.0 provider model compatible library unreleased in source repository.

I’m of the opinion that declarative code such as ASP.NET or XAML or even HTML is still code. Lines of code is even moer useless a measurement here as it is in C, C++ or C#. Number of XML Nodes or number of XML Elements may be better counts of complexity in these declarative languages.

What I wanted to point out, is that it is now possible to use GridView talking to Postgresql with Mono without any code behind in C# or VB.NET.

Default.aspx:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml” >
<head runat=”server”>
<title>Npgsql with SqlDataSource Example Page</title>
</head>
<body>
<form id=”form1″ runat=”server”>

<asp:SqlDataSource ID=”SqlDataSource1″ runat=”server” ConnectionString=”<%$ ConnectionStrings:NpgsqlConnectionString %>” ProviderName=”<%$ ConnectionStrings:NpgsqlConnectionString.ProviderName %>”
SelectCommand=’select firstname,lastname,age from people’></asp:SqlDataSource>

<asp:GridView ID=”GridView1″ runat=”server” DataSourceID=”SqlDataSource1″Â >
</asp:GridView>

</form>
</body>
</html>

Web.config:

<?xml version=”1.0″?>
<configuration>
<connectionStrings>
<add name=”NpgsqlConnectionString” connectionString=”server=localhost;user id=test;password=test;database=test” providerName=”Npgsql” />
</connectionStrings>
<system.data>
<DbProviderFactories>
<add name=”Npgsql Data Provider” invariant=”Npgsql” support=”FF” description=”.Net Framework Data Provider for Postgresql Server” type=”Npgsql.NpgsqlFactory, Npgsql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7″ />
</DbProviderFactories>
</system.data>
</configuration>

Of course this assumes you have a Postgresql database named test with a table named people with columns firstname, lastname, age.

Bugzilla sucks less, Mono still rocks

A couple of years ago I filed a Mono bug and it was fixed the next day.

I had the same experience a last week.

I filed the bug on April 29th at 23:18 and by April 30th at 7:07 am the bug was fixed in SVN and the case closed! I even filed the bug under the wrong topic and didn’t have very good helpful information in my bug report.

The patch solved the problem and now you can use SqlDataProvider with something other than SqlClient data source. Tests with Npgsql work great. My bugzilla experience this time around was smoother than I remember from two years ago.

Thanks mono team. 8hr turn around time is AMAZING!

ALT.NET: It is not us vs. them…

It is not us vs. them.

One of the reasons I stopped doing any promoting, evangelizing(MS’s term for promoting), or really even any discussing about Linux was because I was sick and tired of the us vs. them attitude of so many.

Ayende is right and I’m sorry if I made it sound like an us vs. them. The point I was trying to make when I said “using Castle Windsor before Enterprise Library’s ObjectBuilder” is that we don’t have to wait for Microsoft’s version of something to mature before we find a good solution to a problem we are having. I’m guessing this is the same thing that Kar was saying when he wrote “NHibernate before the Entity Framework”.

If you are using Enterprise Library’s Object Builder today and it is working for you, I did not mean to suggest that you are not “with us” and that you are “against us”. If you are somehow using Entity Framework in production and it is working for you, again, I think that is great. The point I heard from Kar and what I was trying to expand on is that there is more to the .NET development experience than Visual Studio with no plugins and only the Base Class Library.

I’m of the opinion that if you are using any IoC container that you are probably already what I would consider ALT.NET. It doesn’t matter if you use Windsor, Structure Map or Enterprise Library offerings. You are out there doing something that MS really didn’t provide you tools to do easily in the BCL. I doesn’t matter if it is IoC or MVC in your WebForms or WinForms applications or any other thing that is a well known “better practice”. I view ALT.NET as not letting what is available from MS today or what is coming tomorrow stop you from doing the right thing today.

.NET is MS’s baby in the development world. Anything outside of what MS provides is what I would consider ALT.NET and even some of the things that MS does provide I would consider ALT.NET. F#, IronPython, CardSpace even are MS techologies, but they aren’t very widely used. If you are using them, I’d consider you ALT.NET.

I agree with Ayende when he says:

We as an industry has enough problems with the “We Are A Microsoft Shop, Do Not Write Non Microsoft Certified Code!” apprach, we don’t need it in the other direction.

I view ALT.NET as a label for those who aren’t afraid to use a technology outside of what is provided and supported by Microsoft. It is an attitude I would think many developers would have. Can you imagine getting all of your Java support and code from only Sun? I cannot. Why are so many .NET shops MS only in their attitudes?

Honestly, I don’t think it is a problem entirely with “we are MS only” as much as it is an awareness problem. I think many development organizations simply don’t know about many of the alternatives that are out there. It is interesting because most know that they can go buy a tools suite from Telerik or DeveloperExpress or Data Dynamics and they are told that these will help the quality and power of their product. Awareness here is raised by advertising. But how many development organizations know that using an additional framework like Castle or Spring.NET or even Enterprise Library can help with the underlying design and architecture of the software system which they develop? If I had to venture a guess, I would guess MUCH LESS. Enterprise Library may be an exception there because it does get talked about and promoted by MS.

Am I complaining? I guess only a little. I feel NHibernate was in a similar unknown state just a few months ago. After some articles and much talk on DotNetRocks and seeing it presented at conferences and code camps, now you can’t turn your head in a Starbucks without hearing a developer talking about NHibernate or some other ORM. My current complaint is that some of these other frameworks need the same treatment. Of course I shouldn’t complain. I should do something about it.

Expanding on ALT.NET

Dave Laribee started it.

Kar points out some attributes of the ALT.NET developer.

I’d expand and say ALT.NET also means some other things.

  • An ALT.NET developer has written in Boo, IronPython, F# or some other out of the mainstream language.
  • An ALT.NET developer has used Mono on Windows or elsewhere (Linux, OSX, Solaris, etc).
  • An ALT.NET developer uses a Mocking framework.
  • An ALT.NET developer would be using Castle Windsor before Enterprise Library’s ObjectBuilder.
  • An ALT.NET developer has written code to talk to a database other than MSSQL.

What are you doing right now to become more ALT.NET?

Kar posses the question. I never feel like I do nearly enough. My Mocking Framework usage skills are weak. I don’t contribute to Castle nor Mono as much as I wish I did. What I’m doing right now is creating a DisplayShelf component for MonoRail. I was inspired to do this by CodeMash and I finally had the itch when I took photos of my newborn daughter.

TFS woes

A few months back, or maybe a year+ ago right after Visual Studio 2005 was released, Dianne had mentioned to me that she didn’t like that her team wanted her to use Team Foundation Server. I didn’t know much of TFS at that time. I shrugged and said Subversion and Trac work great for me. In fact my team was afraid of Trac and they opted to buy OnTime for bug tracking and live without integrated SCM. Working with the technology of 1997 was better than that of 1987

An ongoing blog discussion made me think of Dianne and her woes.

It started here:
http://ayende.com/Blog/archive/2007/04/29/CodePlex-TFS-and-Subversion.aspx

It escalated here:
http://ayende.com/Blog/archive/2007/04/29/TFS-Zero-Friction-and-living-in-an-imperfect-world.aspx

Roy kept responding:
http://weblogs.asp.net/rosherove/archive/2007/04/29/what-source-control-tool-do-you-use-and-more-on-tfs-vs-open-source-tools.aspx

So did Oren:
http://ayende.com/Blog/archive/2007/04/29/TFS-Vs.-Open-Source-tools.aspx

It seems to have digressed into an Open-Source vs. Closed-Source discussion at this point. Honestly, I can’t see any of Roy’s points. They all seem to be excuses. I tend to agree with Oren on every point. Of course, I am biased toward the open-source world as well.

I’m the Daddy

Many Dad’s have told me how special becoming a Dad is, but its kind of like mastering perl. You must experience it yourself to truly understand what those who are telling you are talking about.

On April 17th, 2007 at 3:14pm Lillian Grace Wren completed a journey down a long dark tunnel toward big bright lights. She weighed in a 7lb, 5oz (3317 grams). Mom and Baby are doing very well and are healthy. Janice never even swore at me or got mad at me the whole delivery time. I encouraged her by saying things like “You can do it Doug, err, Janice” and other paraphrases from the most inspirational movie of all time Iron Eagle.

wrenfam.com

Camel Humping

Ask and I shall receive.

I linked to Scott Cate’s Resharper praise on Friday. Today I’m greeted with a pleasant surprise. Someone else must have been reading Scott Cate’s blog because that crazy guy over at Developer Express seems to have implemented the feature. Happy day!

Oh No! I may have to get Resharper just for this one feature

Oh No! I may have to get Resharper just for this one feature.

http://weblogs.asp.net/scottcate/archive/2007/04/13/resharper-don-t-develop-with-out-it.aspx

Are you listening Developer Express? I tend to prefer CodeRush/Refactor!Pro to Resharper. I’m just choosy like that (my mom didn’t choose Jiff).

I’m talking about the CamelHumps feature that gets used in the Find search boxes, specifically for GoTo File or GoTo Type. This feature is basically like its identical feature from IDEA. I first saw it demoed at CodeMash and I started to druel a little bit. I’m not sure but maybe SonicFileFinder could be improved to support this feature. I’m also not sure that CodeRush doesn’t support it already and I just don’t know it.

According to this I can get ALMOST the same feature using sonic file finder by typing just a few more keystrokes M*S*T for MySearchText instead of just MST. But these features are pure cake and * is an expensive keystroke. I want my pure cake to be moist and smooth. I don’t want to have to type these wildcards.

GAH! According to this, SonicFileFinder already supports what I am asking for. Why has this not worked for me? I swear that I have tried it.

*GASP* I am a fool. I’ve been confusing CodeRush’s Quick Nav feature with SonicFileFinder. SonicFileFinder is VERY nice.

I’m not afraid to admit I’m foolish, so I’m posting this anyway.

Mono SVN repositories moved

Mono finally closed their main SVN for anonymous access and added a new host for anonymous access. I have a bunch of different mono projects checked out in my /opt/mono/src directory and honestly I like to follow trunk for a number of them. I don’t want to recheckout all of them again so I came up with this little shell script/oneliner.


for i in `grep myrealbox */.svn/entries | awk -F/ '{print
$1}' | uniq` ; do pushd $i ; FROM=`svn info | grep URL | cut -d' ' -f 2 ` ; TO=`echo $FROM | sed -e 's/svn:\/\/svn.myrealbox.com/http:\/\/anonsvn.mono-project.com/'` ;svn switch --relocate $FROM $TO ; popd ; done

I hope this helps you.