A simple question

ExitToShell
Unregistered
 
Post: #1
As I plan to learn by my own for the rest of this summer(read: No projects available around my skill level that I know of), are there any decent set of ideal rules for the indenting & general format of code for others working with you to see? The last time I showed a friend he thought my format was atrocious Rasp.

Any advice would be appreciated Smile
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #2
There are so many different ways of doing it, and everyone seems to be attached to their own. Google around a bit and you'll find a few (the GNU coding standards come to mind) and you can check indent and similar programs. Other than that it pretty much comes down to personal style... TMTOWTDI Smile

Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Quote this message in a reply
Member
Posts: 168
Joined: 2004.10
Post: #3
As a rule I indent my code every time there is a seperate loop, if statement, function, or just a set of commands that go together. How you Indent is up to you, I like using tabs.
Code:
program {
    declare stuff
    declare more stuff

    function() {
        do stuff in function
    }

    get input()
    if (input == this) then
        do this
        and this
        and this
    else
        do this
        function()
    end
    print("I like waffles")

}
Basically seperating the different workngs of the program. But everyone has there individual style, like where they put the curly brackets.
Quote this message in a reply
Member
Posts: 63
Joined: 2005.04
Post: #4
I think that is the greatest program I've ever seen LOL
Quote this message in a reply
Moderator
Posts: 529
Joined: 2003.03
Post: #5
That's it, Steven! From now on all unusual acronyms have to be linked to the definition! KWIM?!

"Yes, well, that's the sort of blinkered, Philistine pig-ignorance I've come to expect from you non-creative garbage."
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Simple file class question KiroNeem 1 2,040 May 20, 2006 03:38 PM
Last Post: backslash