Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
issue with syntax
#11
(Feb-22-2018, 06:51 AM)buran Wrote:
(Feb-22-2018, 06:47 AM)volcano Wrote: Its very hard to use indentation... Is there any alternative to this ?
Well, it's subjective. We think it's very intuitive and results in clean and readable code. There is no alternative.

The only issue with indentation is if the file is big ..it becomes messy ... its very hard to find which is parent and child unless you are using a nice editor with folding options or some sort of viewer.

Thanks for your time.
Reply
#12
Indentation should be used with every language. Its not required to run in other languages, but it surely makes it more readable. You should in theory be indenting like this with other languages plus the braces. Python is the same but requires the indentation and can omit the semicolons at the end.

Indentation is not messy but more organized. Being a beginner you should not have long files anyways. It should be split into different modules and classes. If your scrolling over 1k lines in the beginning, chances are you need to organize your code better, not worry about alternatives to indentation. If you share a file of yours (in code tags), im sure i could be more specific.
Recommended Tutorials:
Reply
#13
(Feb-22-2018, 04:13 PM)volcano Wrote: its very hard to find which is parent and child unless you are using a nice editor with folding options or some sort of viewer.
Actually this is way more correct statment when using braces, without requirement for indentation/coherent file structure
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Convert Python 2 to 3 syntax issue OscarBoots 11 5,571 May-21-2019, 05:30 AM
Last Post: heiner55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020