Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 It seems like the overall Python syntax would be error prone
#11
(Apr-01-2020, 08:18 PM)bowlofred Wrote: The interpreter requires only that the spacing is consistent. But for readability by others, there are standards that should be followed unless there is a good reason to deviate. 4 spaces per level is suggested. https://www.python.org/dev/peps/pep-0008/#indentation

I used a code editor some time ago that had an indentation default of 4 spaces and tab settings to make that easy. I found that my code was getting indented so much that a lot of lines wouldn't fit on one line. I ended up changing it to 2 spaces.

Is there any problem if I use 2 rather than 4 for my code?
Quote
#12
(Apr-22-2020, 01:30 PM)CynthiaMoore Wrote: Is there any problem if I use 2 rather than 4 for my code?
it will be difficult to distinguish different levels.
(Apr-22-2020, 01:30 PM)CynthiaMoore Wrote: I found that my code was getting indented so much that a lot of lines wouldn't fit on one line
that may be indicative of poor code structure. Probably it's possible to refactor the code to more flat code
CynthiaMoore likes this post
Quote

Top Page

Forum Jump:


Users browsing this thread: 1 Guest(s)