• bc_ (2/25/2010)


    is there an advantage to using a fixed width font? or is it personal preference?

    Fixed-width fonts allow to adjust and beautify a piece of code easily.

    Simple example (Courier New):

    [font="Courier New"]CREATE TABLE #TEST_TABLE

    ( Id INT NOT NULL IDENTITY,

    Customer_Id INT NOT NULL,

    Customer_Name VARCHAR(100) NOT NULL,

    Invoice_Id INT NULL,

    Invoice_Total MONEY NULL,

    Invoice_Tax MONEY NULL,

    Discount_Percent NUMERIC(5,2) NULL

    )[/font]

    With Arial Black, this code will look like:

    [font="Arial Black"]CREATE TABLE #TEST_TABLE

    ( Id INT NOT NULL IDENTITY,

    Customer_Id INT NOT NULL,

    Customer_Name VARCHAR(100) NOT NULL,

    Invoice_Id INT NULL,

    Invoice_Total MONEY NULL,

    Invoice_Tax MONEY NULL,

    Discount_Percent NUMERIC(5,2) NULL

    )[/font]

    Alignment is not as good as before, and (it's more important) another developer will see a total mess when he/she opens the code in his/her SSMS. I think the developer will not be happy 🙂

    Delphi, Clarion, Visual Studio, Query Analyzer, SSMS, PL/SQL Developer - all of these use fixed-width fonts by default...