Tech Blog

Jay's Technical blog

101000

31 July 2008
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

Well, this is the geek way to say this... today is the day... at approximately 8:10am est on July 31st, my official age is the equivalent of 1010 or $28 or written in another format : 0x28 (or in VB &h28).

That’s also 50 in octal (which really sucks! I think base 10 looks better than that don’t you think)...

[yep, I’m a geek... you can figure it out... to find that not only am I a geek... but an old one... I wrote all this the night before because tomorrow, I’m afraid that I will be cursed by the early onset of dementia and will have forgotten the whole thing as well as my birthday<grin />]

-----------

PS. I miss you mom.. I wish you were still here on this planet...


Core Addin Challenge: 1 week with CodeRush/Refactor Pro

28 July 2008
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

[UPDATE 8/5: Rory noticed a couple spelling errors in people's names and also noted that I should give Koen HanHoefkens credit for his excellent CR_RESOLVE plugin]

I have survived my first week with CodeRush/Refactor Pro (CR/RP). I have discovered a few things about my development habits:

  • I don’t memorize all that many shortcut keystrokes... I tend to look for the "one keystroke to rule them all." Interestingly enough I avoid mouse usage as well
  • With the competing produce (R#) I use about 7 features:
    • Improved Intellisense
    • Rename Refactoring (which is also available in VS)
    • Extract Method (also available in VS)
    • Code Analysis
    • Auto-create add using/import
    • File Templates
    • Find Usages

I’m also discovering some things about CR/RP

  • I’m discovering that I need to tweak CR/RP’s default settings to avoid some of the "annoyances" (CR/RP can take over at times when you don’t want it to)
  • I think If I can get over the hump I am going to find that I’m MORE productive with this thing (although it has been touch and go at times)
  • One of my machines seems to run faster than R# and the other not so much (there are different things turned on/off on these machines right now)
  • RP provides more refactorings than any other product I have seen!! They even have refactorings for ASP.NET .ASPX files (the html part!!!)

So the "one keystroke to rule them all" for CR/RP is CTL + ~ . Oh yeah, you also need to install the community DXCore addin called -- Refactor_Resolve (which was written by Koen HanHoefkens and you can get from here.. but I would recommend that you get it out of the zip file found here. BTW, thank you Rory Becker for this info). Once you have installed that and get it turned on then Refactor! will give you an option to add usings/imports for your unresolved references.

Oh yeah that community project has a number of nice things you may want to install... like the highlighted line focus.

As I mentioned before you also need to turn on Code Analysis and cut down the size of the little bar at the bottom of the code files, by setting it to 1 file and 0 pixels (it will still show up, but it won’t be as intrusive... your scroll bar will work again). One more thing I believe this feature is a new one (and maybe even a beta one)... it’s not as good as R#'s but from what I understand with their plans it is going to get a lot better (they are going to add over 100 items it can check for and find...)

Additional things I did was I turned off the Smart Brackets and Smart Parentheses and the some of the Smart Paste features features (the auto create properties ones are what I killed... I may kill a few more of the Smart Paste features to get things tweaked out a little better for me).

Summary
All in all things are getting better... Today was a breakthrough day for me (Thank you Rory Becker and Mark Miller)! I think I turned the corner on my experience. I’m think I’m as productive with CR/RP now as I was with R#. I’m only missing 2 things... both of which are livable right now: Find Usages (which I can use the Find References mechanism), and R# File Templates (but CR’s templates are WAY better... so I need to learn a few more of those... I have a number committed to memory already). Just 23 more days to go... but I suspect I'm going to be very comfy before that happens.


DLRScript 0.55 released for Silverlight2 Beta2

24 July 2008
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

[UPDATE: I forgot to add the link to the project - http://www.codeplex.com/dlrscript/]

It took a bit of time for this release. In the end I had to take everything a step back (as well as there are probably a few "mid thoughts" in here as the release of SL2 Beta 2 caught me a bit by surprise... actually the changes to the DLR caught me more by surprise).

The step back is that we no longer get script code lines when there are issues. I’ll try to bring this feature back, but right now if it breaks, you’ll know it via an alert with a .NET error.

Future direction
I need some feedback on this. I’ve been thinking about scrapping any attempt at jscript compatibility and am thinking more about ecma3 support (DLRJScript has an ecma3 mode). The benefit there is that I could start focusing on building a better set of client-side APIs instead of a more compatible one. That said, I’m not sure how qualified I am at coming up with a "better" set of client-side APIs.

I do want some feedback though. Let me know what you think: jkimble-at-gmail.com.


MS MVC Thoughts

24 July 2008
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

[NOTE: I haven’t quite had much of a chance to look at the new Preview 4, so take this as someone nearly informed. I haven’t read about anything in the Preview 4 that changes what I’m going to say. Also, remember that I am the admin/editor of the blog site which is Alt Alt.NET... so testability/mockabilty doesn’t really resonate with me.]

I know it’s shocking that I would have something to weigh in on MS MVC, but I do. For those who don’t know. I took some issue with Ayende’s "leaky abstraction" back in my CodeBetter days (they had to love having me around). BTW, I understood and agreed in some respects, but in others I was less than agreeable. I still think Web Forms are viable and usable, but in some cases the paradigm breaks down, so the need for another paradigm is both welcome and interesting (and before anyone brings up Castle, PixelDragon, or CodeStory MVC frameworks, I have looked at them as well and found them --in general--way too complex to get started with which is not to say that a couple templates could help you guys out...).

Why I’m interested?
Ok, the reason I’m interested is summed up in one word: RIAs. I could have summed that up in 2 words: Ajax, and Silverlight2. The other thing is that I have used the MVCContrib’s Restful feature to build REST services (way cool).

The Good
I really like the simplicity. I mean MVC isn’t simple, but the MVC framework makes it easy to keep your layers separate... you still have to think about what you are doing, but on the whole it’s pretty easy to use. The MVC paradigm allows for a truer coding experience (the engine doesn’t pretend to be a Windows application in any way although you can still use things like session and the forms authentication engine in ASP.NET).

The MVCContrib library is indispensable. It’s an open source library that is a community project that adds additional features to the MS MVC architecture. For instance there are a number of alternative view engines; I haven’t investigated all them yet (and for the most part I am sticking with the ASPX engine... although my later comments may lead you otherwise).

The Not So Good
Before I say this I want you to realize I have written a grand total of 2 apps with this. App1 used the Restful plugin and really shouldn’t count, so I have written exactly 1 app (so definitely take this with a grain of salt).

Complaint number 1 is that I felt like I was writing old ASP code. I used the inline code method for writing output into my HTML. I probably could have written in the codebehind and had a clean web template with code separation (something I’m a believer in, but it was my first app)... probably more my fault than the engines, but there is a lot of sample code out there already that lead you down this path.

Complaint number 2 really is valid. The whole idea of MVC is that I should be able to swap out the view engine. Or better yet, be able to respond to a request and supply a view that is more suited for the client. Someone pointed out to me that one of the big features of ASP.NET 1.0 was that it would supposedly do this... I would really love for MVC to make it easy to determine that "this is a mobile browser" supply the mobile template (if one exists). Or better yet, this client is requesting that I send XML... evidently it’s some kind of Rich Client. Specific methods can be triggered to deliver a specific type, it would just be nice if the framework would detect that the client "accepts" (that’s a ServerVariable pushed in the header) only "Application/Json" so the MVC app should use a JSON result or convert the result I got to JSON and push it directly down to the client.

This would make the MVC part of this more useful to me (remember all the stuff I said up front... and Yes, I know I can do this myself and have... it just would be nice if I could get the controller framework to make it easy for me to configure and then do this for me)


Core Addin Challenge : Hello CodeRush/Refactor Pro

22 July 2008
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

[Disclaimer: Before I start this series I want you all to know that I love Resharper! It has made me a better developer, and if you pay attention you will see why I think that. At the same time I love Dev Express. As a company they are constantly giving back to the community. While I’m not a fan of Mark Miller’s humor, their addin framework is about the best you will find IMO... and Scott Hanselman (ScottHa from here on) loves CodeRush/Refactor. I love ScottHa; he has shown me all kinds of cools utility that I couldn’t live without... he is angelic... I went looking for a halo for his picture... nahh been done <grin />. Anyway, this article series I hope will do a good job of comparing and contrasting the 2 VS2008 IDE adds in their current forms (which CR is at 3.0.8 and R# is at 4.0)... and this is really from my personal perspective on what I use]

I’ve been using R# for quite awhile and honestly I have felt that it made me a better developer. I know I’m not a TDD guy, but there are so many goodies in it that I just simply loved it. BUT, my license ran out. I was in a debate about what I was going to do.

As it turns out (late) last year, I was given a license to CodeRush/Refactor Pro. I had been intrigued by their lengthy list of Refactoring and how they were doing ASP.NET refactorings. Well, about that time the betas of R# started happpening and personally I was going through the collapse of my business (and the amount of development I was doing dwindled, so honestly I did the bad thing and forgot to blog about it.

Like I said my R# ran out, but I remembered that I had CR/RFP, so I decided to re-install it and look around (and really look around), so for the next 30 days I will be exclusively using CR/RFP and will be looking to see how it compares to the features of R# that I actually use (you might use other things), and will of course be blogging about it.

The number 1 feature of R# that I use is it’s code analysis I love being able to look at my C# code and at a glance am able to tell if there are issues with the code at a glance. I have actually learned things from the suggestions it gives me... so I can’t live without that.

Guess what, I remembered reading a veiled reference to CR’s Code Analysis on Dave Hayden’s blog. It’s off by default, so if you are playing with CR... here’s how to turn it on. Bring up the DevExpress menu’s options, turn on Expert mode (I think you need that), and type "Code Issues" in the Search Text box. Check the enabled check box when the Code Issues options appears and Viola! You now have analysis on your code.

My initial knee jerk reaction is that the Code Analysis is almost as good as R# (almost), but then sometimes R# recommends things that I’m not really interested in doing (I know you can tweak it’s suggestions).

On the other hand, CR doesn’t seem to bog down the environment for me!

So take your pick... CR has come a long way from when I last used it. It used to have some annoying "features" that seemed to have been tuned. (their auto-complete used to annoy me/get in my way... I would say that it neither gets in my way nor annoys me)