On Saturday, September 28, 2013 3:59:34 PM UTC+2, 黄祥 wrote: > > thank you so much for your detail explaination. i'm sorry, my fault for > indentation, because to make it simple and straight to the point, i take > the code from the conditional, then remove the indentation (tab). > it works well now. > > it's not a matter on "you must do it" but a matter of "you should do it": indentation keeps the code more readable and it will be easier for you to spot bugs. Once the code works you can either decide to squash everything in the minimum number of lines possible or to keep it fully indented: it's just a matter of personal taste. I prefer reading 1k line of nicely-indented code than 200 of obscure 400-line long code that does the exact same thing. Remember that as soon as the "development process" is finished, you'll need to read the code more often than writing a brand new large section (squash bugs, improve performances, add features, etc). Nice indenting (and possibly lots of comments) makes code more "typo" resilient and helps also other people looking at your code to understand what it does.
-- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.