I think I may have found my .Net stack to replace rails: Spark, MVC (Monorail or ASPNet), FluentNHibernate, NHibernate, and FluentMigrator. With these, I get similar productivity to rails, except the generators (yes, AspNet MVC has some templates and stuff).
See, I’ve got this pet project which I’ve destroyed and rebuilt several times. It started in Ruby on Rails; and I got about 90% function, but I kept stalling. Figuring I could overcome that in .Net – no, I haven’t really – I re-wrote yet again in .Net. Well more like started to re-write it. I used Prawn and prawnto for the pdf feature. So in going through the Spark sample code, I noticed one sample seems to generate PDF’s. Woohoo! I’m going to need that, and right there it is. Also, it looks really simple.
There are also samples showing internationalization, modularization, client rendering (aka ajax), IoC, integration with Monorail, and other things. All around really impressive and practical stuff. I’ll continue to play with Spark, but I’ve pretty much been convinced already. I’d recommend anyone check it out.
blog comments powered by
Spark looks like an excellent alternative view engine. It’s appeal is that the HTML dominates the view instead of <asp:controls>. Maybe its because I like rails, but it just feels more natural. Plus you still get the power & familiarity of .Net – in any form! It supports IronRuby & IronPython even!
So what happens when you take Spark, ASP.Net MVC, FluentMigrator, and FluentNHibernate.. will it blend? Sure, and here’s how.
- create and ASP.Net MVC web application.
- follow this guide to replace the default view engine
- use the same simplistic example migration and setup from my InstantApp
- Then just add a view and the code to list the users
You can grab the code from http://github.com/jcoffman/csinctools, where you’ll also find the code for InstantApp.
Controller method:

View:
Result:

By the way, the top image is from the book “The People of Sparks” which is the second in the City of Ember series. The first is better; never read the third.
blog comments powered by
I’ve thought Rob (twitter) does an excellent job with screencasts, and apparently I’m not alone. In fact, Rob has started with James Avery (twitter) a demo/training/video site called TekPub.com. Check it out. It’s built with Silverlight and ASP.Net MVC. No surprise there.. Rob recently co-authored an MVC book. Good luck to them both.
Oh yeah.. here’s a preview with a screencast on Git. Definitely check that out!
blog comments powered by
I’ve got a little itch to see about making FluentMigrator run on Mono. I ran the analysis tool, which say the FM assemblies look ok. However, System.Data.Sqlite.dll doesn’t seem to be good. I read that it should work on mono, and even if not there is Mono.Data.Sqlite.
I think it would just be cool to do this, but it would also let FM run on Linux and Mac with Mono. That would rock! People could write C# on Mac or Linux, and use FM. Now we’d probably need to add support for more databases, but I’d like to see that happen anyway.
So a secondary part of wanting this, is knowing that Mono can run on Android. I think Android is going to be big, and that its getting close to a huge growth phase. [I missed James Britt’s Android and JRuby talk last night.] While I’m happy to learn other languages, being able to use C# in new ways on a new device would be a whole lotta fun.
If anyone out there would like to help or offer guidance, you can reach me through the contact page. Or post to the FM google group.
blog comments powered by
My name is Josh and I have a problem. I am a keyboard shortcut addict. As such, I’ve found Resharper restrictive because it re-maps a lot of the shortcuts I use most often. Lots of devs like it so don’t take my word for it. I have been using CodeRush (express, pro) more and more. As I do, I’m finding it’s gives you some nice features without getting in the way of those nice shortcut keys.
![CropperCapture[20] CropperCapture[20]](http://computeristsolutions.com/blog/image.axd?picture=CropperCapture%5B20%5D_thumb.png)
What prompted this post is the handy little feature of cleaning up unnecessary using statements and namespacing. Since I like clean, crisp code, this really tickled my aesthetic senses. And earns a +1 for CodeRush.
blog comments powered by
I’ve done it, but don’t talk about it much. There is plenty of thought on the web from which to draw inspiration. In general, I recommend looking at NHibernate for ORM. There are times and cases when such an ORM cannot be used (usually a political decision). Then you’ll have to write your own DAL if you intend to access data.
There are good ways to do it, bad ways, and then there are ugly ways. Recently, I was looking at DAL code in a client’s project and found it somewhere between bad and ugly.
I’m sure the smart guys can pick this apart, but there are some simple reasons why this is not good. First, there are dozens or hundreds of methods just like this all over the code base. Many where the only major difference is the SQL loaded by the CommandLoader and maybe a couple of variable. Second, you are stuck managing state on your own for _every_ _single_ entity. Or how about that is taking an object parameter only to later cast it back to the strong type ConnectorField. Heard of boxing anyone?
Are you stuck with stuff like this, or would like to avoid problems like this. Lost of good ideas on the web. I recommend reading Davy Brion’s series on building your own dal. The good, the bad the ugly was a good movie. Just don’t let it creep into your code base.
blog comments powered by
I’ve recommended Evernote before, and I’ll do it again. If you take notes like I do and don’t always work on the same machine, then you will run into times when you don’t have the notes you took while at another location. Evernote solves this. Plus there’s a lot more functionality that I’m not even using. Today for the first time, I dragged and dropped an image onto an note. It embedded in the note, and I can log into the website and see the same note with the embedded image. It’s a simple thing which I really appreciate.
I also carry a composition notebook around a lot. It’s a lot cheaper than a moleskin, and nicer than a spiral notebook. I use this in meetings because I don’t bring a laptop to most meetings. These two simple things help me keep nicely organized in business.
Oh, and the evernote image was captured with cropper. Another helpful tool.
blog comments powered by
Just a quick announcement.. Desert Code Camp is on November 7th, which is really soon. Go check out the sessions to see if you want to attend or teach any. It’s reportedly a great event, especially for those local to PHX.
blog comments powered by
In this post, the venerable Martin Fowler expounds upon his definition of a technical debt in contrast to Uncle Bob’s definition. Not that they are completely different, but that Uncle Bob views an ignorant mess as not qualifying as a technical debt. Martin considers a mess also a debt, and I agree.

In fact most all development has a certain debt aspect in terms of the metaphor for required maintenance later on. The point of good design and clean code is to empower productivity and easier maintenance. Even a non-decision on design, such a mess, is still a decision. You still have to maintain what was done.
I’m certainly not the sage of good design & patterns like Uncle Bob or Martin Fowler. I do strongly advocate principles for clean code and easier maintenance. That’s why I advocate Test Driven Design and Object Oriented design patterns. It tends to make your code evolve in a direction that is clean and maintainable. It does make you more productive because you are getting feedback on your decisions much quicker than, say, Waterfall style development does.
A lot of what is said in the internets is subjective. What I mean by clean code may be slightly different than what people like Martin or Uncle Bob mean. (although I like to think I write some rather poetically readable, clean code) It’s still subjective. The practices you choose have a lot to do with how clean it will work out, so choosing the right practices – and values for that matter – is highly important. It makes a difference now and an even bigger difference later when you have to maintain your code. ..or that axe murderer psycho programmer who knows where you live has to maintain your code. That’s when you REALLY want to have clean code with low technical debt!
blog comments powered by
Are you really making your builds with Visual Studio? Please tell me you aren’t using VS in the command line to compile your application. You do realize there are better ways, don’t you?
Some suggestions:
- Use a command line tool such as MSBuild or nant for long running builds – VS takes a while to compile a long running build because of the visual feed back it provides. It does a fair job and all, but it’s not going to beat running msbuild or nant. MSBuild is the easier of the two to pick up because it knows how to use the solution file as the build script. With nant, you have to write your own. For both, you will need a separate script to do things like deploy files or run unit tests.
- Use TeamCity or CruiseControl.net to automate your build process – CruiseControl and TeamCity will help you automate your builds. CCNet requires build scripts; TC does not.
- Automatically pull updated source code – have your build process pull updated source code each time. This way you can take some of the pain out of the build process and find out if the build works.
- Run your automated builds on a separate machine or different folder – Meaning, don’t run your automated build in the same place you work on your code. This avoids the “works on my machine” problem.
- Use known tools – Sure you can make your own build server, but should you? Look for known tools which you can extend or configure to meet your needs. Building your own for your special circumstance will likely bite you later when that special circumstance changes; or you just outgrow it.
Building your application doesn’t have to be painful. It doesn’t have to result in moans and growns when you find things are missing. You can automate it with moderate or little effort, and then let it run often. You will get a better idea of how your work is going and find out more quickly. This is basically what Continuous Integration is about. It’s not hard, and you will see the benefit quickly.
blog comments powered by