Tuesday, November 14, 2006

Before you start your quest to become a Jedi programmer, remember these small things :
  • Most language have end of line delimiter, like C, C++, C#, java, PHP and many other C like languages, use ";" ( semicolon ) to mark end of line then telling the compiler to treat subsequent strings as new statement. Even the masters can forget this from time to time, but it's a good habit to make sure you hit semicolon after typing a complete statement.
  • Matching bracket, wheter it's curly bracket "{}", or any other brackets "( )", "[]" always make sure that they come as pair... No bracket should live alone :)... hints : everytime you need to type a bracket, type as pair, then move back your cursor to type in and fill in the space between the two...
  • Some languages has it's own quirks, and sometimes not too obvious for uninitiated ones, like Python, it uses "tab" to specify blocks of statements... so if in most other languages you put tabs for readability and make your codes aesthetically beautiful, then in Python, you could actually get error if you don't tidy up your codes...
  • Make comments... put comments, any comments on any functions, or any parts of the codes that you deem important... may not be meaningful at the time you write the code, but it will be after sometime and you need to review your own code... Well, don't bother about other people, just do it for your own sake, that will be enough...
Another thing is, if you code doesn't generate error the first time you run it, then must be something wrong with it :) could be the error suppression is working or simply because you only type in an example from the book as is... come on, be more adventurous, add more code, try those built in functions, use those weird syntaxes... the more you try, the more you gain...

No comments: