Delphi coding style

Found the following article: http://dn.codegear.com/article/10280
will keep this as a reference for future.

Related posts

5 Responses to “Delphi coding style”

  1. ziolko says:

    hmm formating of this if condition got scrambled, but it’s really hard to understand when you see it

  2. ziolko says:

    I’ve seen many discussions about coding style, of course I have my own style but whenever I join new company I have to use their style.
    It never was a problem for me until recently, I just can’t get used to it. here’s little sample:

    if ( (not FUsePrinter)
    or ( (FUsePrinter)
    and (dlgPrint.Execute)
    )
    ) then
    begin

    also they put blank line before any keyword (for, while, begin, if, case…)
    moreover they use:

    if … then
    begin

    end
    else
    begin

    end;

    everytime even with single line between begin/end.

    I gouess I’ll pass this article to my manager:)

  3. ciuly says:

    seems you’re not used to forums, eh? 🙂 you can use BBCode for text formatting 😉 like the "code" code.
    like this:
    [code:1:1329c576dc]
    if ( (not FUsePrinter)
    or ( (FUsePrinter)
    and (dlgPrint.Execute)
    )
    ) then
    begin
    [/code:1:1329c576dc]
    also they put blank line before any keyword (for, while, begin, if, case…)
    moreover they use:
    [code:1:1329c576dc]
    if … then
    begin

    end
    else
    begin

    end;
    [/code:1:1329c576dc]

    and yes, there are a lot of styles out there which are just plain … let’s say ugly 😀

  4. ziolko says:

    heh yeah that’s true I’m not used to forums:)

    as far as I’m concerned coding style may be ugly as long as I can easily read without wondering what going on:)
    putting blank lines is another stupidty, I wrote some procedure which was 8 or 9 lines but after aplying their rules it doesn’t fit on screen.
    Nightmare!

Leave a Reply

This blog is kept spam free by WP-SpamFree.