• Nick Doyle (8/22/2013)


    I don't agree that it encourages sloppy coding. You need to know how a language works and be a decent coder to not be sloppy. I don't see how providing more user-friendly functions contributes to sloppy coding. It makes non-sloppy coders' lives easier.

    This is much easier/quicker than coalesce or:

    ISNULL(FirstName + ' ', '') + ISNULL(MiddleName + ' ', '') + ISNULL(LastName + ' ', '') + CONVERT(VARCHAR(3), Age)

    I'm definitely happy I no longer have to explicitly convert int to string. 😀

    +1

    In this case CONCAT also is faster than ISNULL(FirstName + ' ', '') + ISNULL(MiddleName + ' ', '') + ISNULL(LastName + ' ', '') + ISNULL(CONVERT(VARCHAR(3), Age),'')

    Because you call ONE function and 4 parameters vs 4 functions with 8 parameters and ONE CAST.