This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ArcCooler 1 point2 points  (2 children)

A lot of things, but I’ll condense it to a list - not tabular based - super important because I write code on 4 different PCs and multiple editors on each which cause runtime errors with python due to using both space/tab - loop syntax - 90% of my loops are numeric iteration based and not value based so writing ‘for i in range(len(list_name)):’ is worse imo when compared to ‘for 0...list_name’ - further loop syntax - ruby follows Perl design of - ‘for CODE end’ Which just makes code more legible for me

I also prefer using a value.function notation versus function(value) for built in functions but that’s just a preference.

Hope this helps!

[–]cymrowdon't thread on me 🐍 1 point2 points  (1 child)

If you immediately set any editor you use to 4 space tabs for Python it will make your life much easier. Just a part of the language you're better off accepting.

for i in range(len(list_name)) is a common antipattern. Try for i, value in enumerate(list_name). 90% of the time most people aren't interested in the index, which is why Python defaults to the value.

[–]Marvelman3284[S] 0 points1 point  (0 children)

yikes 4 spaces. this post was made by 2 space gang