Javascript, AJAX, Controls and Libraries, Oh My.

While looking around the net today for a specific control, it's amazing the number of javascript do-everything libraries that are out there. From mochikit and scriptaculous, to Yahoo.UI and Google's offering, to various ajax libraries like Microsoft's AJAX.NET, AJAX.NET Pro (the non-MS offering), and many many others, the number of choices is amazing. It seems they all have thier shortcomings, but that doesn't stop the devs on these projects to continue their broad scope.

What I came across that was a bit unusual was a framework that relies on a compiler that runs at serve time. Called Jitsu, it's yet another UI, animation, data binder, and AJAX library. The site looks pretty stale (circa 2006), but the approach was interesting because it was different.

Posted on 10/26/2008 4:26:00 PM by Jason Nadal

Permalink | Comments |

Categories: development | javaScript

Tags: , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Javascript, Booleans, and Implicit/Explicit Casting Performance

Ahh the variant. It provides so much ease in writing code, and yet can cause so many headaches. In Javascript, I learned today what joys and pains of assumption of datatypes through boolean expressions can provide. Take the following simple statement:

var x=true;
var y=false;
if (x || y)
  alert('true');

In this case, x is ORed with y, resulting in an obvious true. But we're assuming boolean values. What happens when one has the possibility of not being boolean?

So the creators of javascript saw in their wisdom to add strong-ish typed declarations. You can declare a boolean explicitly, like so:

var isInAGoodState = new Boolean(true);

So all is happy and we can use good booleans. However, there's also an implicit declaration that's much better in terms of performance:

var isInAGoodState = !!(sourceValue);

Essentially saying not-not-sourceValue, using a double negative, results in a true statement. The amazing thing here is just the scale of the performance gain. From a source example, "Overall, the performance gain for using implicit conversion averaged out to 53% across browsers after 10 tests"

Posted on 10/23/2008 7:16:00 PM by Jason Nadal

Permalink | Comments |

Categories: development | javaScript

Tags: ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Resharper tip: Go to Inheritor

My latest most-used resharper tip these days has been: Go to Inheritor. This is fantastic when tracing through code for debugging, and winding up at an interface. Go to Inheritor (Alt+End if you use the VS shortcuts) will jump to a list of classes that implement that interface.

Alternatively, Alt+Home will take you back up from the implementation back up to the Interface.

Posted on 10/22/2008 8:39:00 PM by Jason Nadal

Permalink | Comments |

Categories: development

Tags: ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Scrum for TFS

I found something rather interesting by chance today. Conchango Scrum Template for TFS. It looks to be pretty immature, but it's nice to see that even a product as large in scale as TFS can support scrum.

Personally, I find that Rally is sufficient for most tasks, lacking only a properly functional visual studio plugin (there's one available, but seems to disappear quite often; perhaps that's just my machine).

Posted on 10/21/2008 8:53:00 AM by Jason Nadal

Permalink | Comments |

Categories: development | scrum

Tags: ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Silverlight 2!

Don't know how I missed this, but Silverlight 2.0 has been released!

Get it here: Link

Posted on 10/20/2008 8:55:00 AM by Jason Nadal

Permalink | Comments |

Categories: development

Tags: ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

VisualSVN

After working with SourceSafe for a few years, working with SourceGear's Vault for a couple, and TFS briefly, VisualSVN was recommended to me.

This engine was extremely easy to set up,  and even easier to update for patches. This was the main contention I had with Vault. The visual studio plugin is $49, but "It Just Works", and in my opinion is worth the expense. This is especially true considering the server itself is free.

Posted on 10/20/2008 8:22:00 AM by Jason Nadal

Permalink | Comments |

Categories: development

Tags: ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Automating tests -- some pointers

Admittedly, I'm very early in the process of getting a full suite of automated continuous tests going against an app I'm working on writing. Currently it's only involving NAnt running NUnit tests on checkin.

Jeremy Miller gives some great pointers in this post on how to extend that. Inversion of Control (IoC) is a fundamental basis for testing interaction, as well as behavior tests through WATiN testing.

Posted on 10/18/2008 8:15:00 AM by Jason Nadal

Permalink | Comments |

Categories: development | unitTesting

Tags: , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Diminishing Returns -- Marathon Coding

Contrary to this blog's title, marathon coding, or Restless C#ding as I call it, does not always yield the most fruitful results. During a critical point in development, it's sometimes more helpful to force yourself to walk away from a problem occuring on the tail end of a session that is dragging late into the non-work day.

Code quality will doubtlessly improve, and your mind will have a much simpler time trying to analyze and solve problems. I'd read articles about the uninterrupted time (I really wish I had saved the article) needed to concentrate to get into the so-called "Zone", a career- and industry-agnostic state of mind (characterized by a higher concentration of alpha activity in brain patterns) under which the mind is more focused and more apt to achieve that with which it has been tasked. 

What is a harder thing to quantify is the morale toll that taking a step away from a task will have. At least for myself, I enjoy the gratification of seeing newly working parts of an app after a long session of difficult concentration, logic, and code. Denying that pleasure for the sake of quality can be a hard pill to swallow. On the flip side, there are health benefits as well, as the body is much more productive having regular rest cycles.

Posted on 10/15/2008 9:55:00 PM by Jason Nadal

Permalink | Comments |

Categories: development | management

Tags: ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Unit Testing for Larger Scenarios

After adding many unit tests, today I found myself cheating a bit. I'm attempting to retrofit tests to classes and methods that are responsible for way too much. So picture class A which is not written through TDD methodology. The new functionality in class B is being written through TDD. What I was able to do was to write good (-ish)  tests for class B, but for class A, I found myself writing way too much setup code.

I'm curious how the process will work out, but I wound up writing somewhat long unit tests to meet the point of the test. The tests are reliant on actions A, B, and C occurring before the actual thing that was being tested. So I wrote some helper methods, but I worry about one thing breaking taking down the tests like a house of cards.

This seems like a no-brainer for more of a BDD style of testing, but only more investigation will tell. One bright note is that code coverage went way up, since tests touched a large number of deeper library methods.

Posted on 10/14/2008 9:23:00 PM by Jason Nadal

Permalink | Comments |

Categories: development | unitTesting

Tags: , , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Debugging and End-of-Day Syndrome

What is it about that last thing you want to get done before leaving that just refuses to make sense & work? You come in the next morning and it winds up taking 10 minutes.

That was the case for me today while trying to reconcile LINQ and a Unit Test. For some reason the code works perfectly in the web app, yet refuses to work (or even give an exception) when seated properly in a test fixture. Hopefully I'll update this post tomorrow stating it was something obvious.

Update: Sure enough, it was. I realized that data contexts were being cached in HttpContext, which won't work in libraries where unit tests are being run (they're not part of a web app after all!). A little Thread Local Storage, and my woes are no more.

Posted on 10/13/2008 7:44:00 PM by Jason Nadal

Permalink | Comments |

Categories: development | unitTesting

Tags:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5