November 24, 2003

Code formatting blues

I just installed MTCodeBeautifier by Sean Voisen, which leverages the Beautifier code written by Mike Jewell and which required the MTMacro plugin by Brad Choate. I also installed Brad Choate’s MT-Textile plugin, which helped me with eliminated literals from appearing in my code segments. Finally, because I’m a complete geek, I installed John Gruber’s SmartyPants plugin which converts regular quotes to smart quotes (among other things).

To get C# code formatter properly, I had to hack the beautifier.pl and download a HFile_csharp.pm from the Twiki project Web site.

Here is a sample formatted for C#. It didn’t originally look right in Mozilla Firebird (my default browser), but that’s because of a dumb mistake I made with a malformed comment. Argh!

/*
 * EnumVideoModes
 */
public class EnumVideoModes 
{
     public EnumVideoModes() 
     {
          s = "Hello";
      }
}

An anonymous-language block:

    int i = 10;
    String message = "hello, World";
Posted by Nick Codignotto at November 24, 2003 09:58 PM
Posted to General
Comments
Post a comment









Remember personal info?






Valid XHTML 1.0!   Valid CSS!