Why do I use ScriptSharp for Silverlight 1.0 Web Development?
Since the day I deep into
Script#
Nikhil Kothari project, nearly all my personals and professionals Silverlight 1.0 projects are base on Script#
Here are some reasons that make sense for me about this decision.
1. Type and error checking at compilation time. ScriptSharp is a C# to Javascript Compiler. Script# takes an MSBuild file as input (only C# files are supported) and transform them into Javascript files. I have nothing against Javascript but I waste too much time on debugging annoying coding error that a compiler should throw up to me instantly... Wasting time is just unacceptable...
2. Script# Base Class Library. Script# come with it's own BCL. (Careful, nothing in Script# language is related to .Net. Script# is an implementation of a subpart of C# language specification) Script# BCL (Base Class Library) contains many advanced feature about DOM, Dhtml, AJAX, Regex, Collections, and sure all Silverlight 1.0 stuff...
3. Same Deployment model than before: Browser still only use Javascript file. All C# stuff can be deleted. So the web site can be deploy on any webserver without having to care about .Net (You will be able to deploy your website on Apache or any other web server.
4. Transparency, As Ayende say in one of his blog post : I firmly believe that if you have to ever think about the tool then the tool is not doing it's job. Script# comes with Visual Studio Project Template. After the project is created, just forget that you are using a Javascript compiler. The only thing that you will have to care is the BCL as it's have nothing in common with the .Net BCL.
5. Customizable Build process: Script# come with its MSBuildTask so to create a Script# custom project you just need to tweak some MSBuild stuff in the csproj file. As I want to respect Project Development Tree wellknown best practices I want to include Script# tool in the repository and use this one instead of the one into program files. Script# just evolve quickly. Includinng Script# tool into the repository is safe for long time project. On the other way, respecting this principle, all team members, including Blend Designers do not need to install anything about Script#. It's just what I call 'Checkout & Play' Principle.
6. Object Oriented, Polymorphism, Inheritance, Namespaces, Properties, Events, Anonymous method and closure are all finely supported. The 2 frist sentence words "Object Oriented" should convince you to run download Script# and test it
.
7. Project Architecture. You can divide your project into multiple projects. Script# will output one Javascript file per project. Just use the 'add reference' context menu option in Solution explorer if you want to add a reference to another existing project.
8. Javascript interaction. Script# uses a very practical Attribute base mechanism to bind a C# class to the real Javascript one. At the end Script# do not generate the C# binded class but only its usages. About this point, personnaly I have never been blocked into Script# impass and you always have a solution to ly use pure Javascript files.
9. Tools, Tools, Tools :
a. Use can use Reflector to browse all available Script# BCL and additional libraries.

10. You can use Resharper. Resharper is just my favorite coding tool behind tone of other ones. If you don't know it just have a look to this jedi codding video
11. Developers, Acceptation, learning curve. C# resources are more easy to find than Javascript one. C# is generally more appreciated than Javascript. C# learning curve is better than Javascript (think that Script# abstract you all the plumbing of how to create a class in Javascript that support polymorphism. I don't want to go into any debate but around me people are more motivated on Script# project than on Javascript one. As Dick Latim say(I can't point to it directly so Click on the 5th TOC Item 'Video' at the end. The content is in French), motivation is one of the most important success factor on a project.
12. Documentation: Thank to Nikhil Kothari for all the Docs available. So useful?
Here you can have a look to this French website fully build using Script#.

Hope this help.
Many Thanks to Nikhilk again!
Ce post vous a plu ? Ajoutez le dans vos favoris pour ne pas perdre de temps à le retrouver le jour où vous en aurez besoin :