Thursday 1 October 2009

Window Live Writer Source code formatters

This is a review of three source code formatters plug-ins for Windows Live Writer. All three plug-in do a similar job and produce very similar output.

 

WLW Source Code Formatter (2432 downloads)

This formatter comes with support for a large number of languages and has lots of nice additional features like code highlighting and being able to choose the box size. What is more the author makes the Source code available as well.

The big negative of this plug-in is the HTML code it produces. It embeds the full inline style into every line of code which produces a very verbose code which would be very difficult to edit by hand.

  1: SQLSMALLINT ValueType,ParameterType,DecimalDigits = 0;
  2: SQLUINTEGER ColumnSize = 0;
  3: SQLINTEGER     BufferLength = 0;
  4: SQL_TIMESTAMP_STRUCT d;
  5: 
  6: r = SQLBindParameter(hstmt,i+1,SQL_PARAM_INPUT,ValueType,ParameterType,ColumnSize,
  7:   DecimalDigits, &(ParameterValue[i]),BufferLength,&(StrLen[i]));
  8: 


Code Snippet (12102 downloads)



Code Snippet has a much simpler interface with a few basic options. It does have an options dialog box where the css styles can be altered which is a useful feature. Similar to the first formatter the HTML is very verbose.





   1: SQLSMALLINT ValueType,ParameterType,DecimalDigits = 0;



   2: SQLUINTEGER ColumnSize = 0;



   3: SQLINTEGER     BufferLength = 0;



   4: SQL_TIMESTAMP_STRUCT d;



   5:  



   6: r = SQLBindParameter(hstmt,i+1,SQL_PARAM_INPUT,ValueType,ParameterType,ColumnSize,



   7:   DecimalDigits, &(ParameterValue[i]),BufferLength,&(StrLen[i]));




Insert Code (19250 downloads)



Insert Code is the simplest of the formatters with a very limited set of languages it supports. It supports C# which will probably do for C++ support in most case, but its not great. Its options are limited to line numbers and alternate line colors which the other formatters support as well. The one positive that this formatter has is that it produces nicer HTML. It defines the styles it needs and then refers to them in the code lines.



 




   1:  SQLSMALLINT ValueType,ParameterType,DecimalDigits = 0;


   2:  SQLUINTEGER ColumnSize = 0;


   3:  SQLINTEGER     BufferLength = 0;


   4:  SQL_TIMESTAMP_STRUCT d;


   5:   


   6:  r = SQLBindParameter(hstmt,i+1,SQL_PARAM_INPUT,ValueType,ParameterType,ColumnSize,


   7:    DecimalDigits, &(ParameterValue[i]),BufferLength,&(StrLen[i]));




Conclusion



The clear winner for me is the WLW Source Code Formatter for its impressive features the others do not have and its ease of use. The runner up is Code Snippet



Interestingly I rated these in reverse order of the number of downloads they got. I doubt this is a coincidence as the better snap-ins were released later on. No doubt the authors saw the older ones and implemented the same features and then added some of their own. As Insert Code is the oldest it had a lot of downloads already at the time the others were released. This will have placed it at the front of the queue  in plug-in list, a position it has since kept as the others will find it impossible to overtake despite being better quality. Its a common problem with list such as these that are ranked on simple popularity.

No comments:

Post a Comment