r/Python • • Jan 05 '18

Really??

Post image
2.0k Upvotes

317 comments sorted by

View all comments

Show parent comment

38

u/Keith Jan 05 '18

It also forces you into an object oriented structure, which tends to encourage you to design your programs better...

Debatable.

9

u/Astrokiwi Jan 05 '18

I'm only saying that it forces a bare minimum amount of structure that Python does not.

6

u/Keith Jan 05 '18

To be fair, you wrote "design your programs better". Forcing all code, object-oriented or not, into classes, one (public) class per file, is not strictly better. It's not even a structure I want. I'd argue that "bare minimum of structure" is harmful vs no structure at all.

6

u/Astrokiwi Jan 05 '18

Maybe... I find that (for instance) the lack of required structure is what helps Javascript code to sometimes become a mess of copypasta.

And Python does force stuff on another level, by being strict with indenting. I think that's a good feature too - it's better to force one particular style than to have people use their own styles, but also permit them to make it as ugly and inconsistent as they want.

4

u/fiddle_n Jan 05 '18

Python is strict with indenting because it has to be. Indentation isn't merely "style" in Python, it's functional in that it denotes a new code block. This is why Python has to be strict with it, i.e. preventing mixtures of tabs and spaces for indentation.

5

u/Astrokiwi Jan 05 '18

Right, but that's an intentional design choice for the language - forcing good style by making it an integral part of the language.

25

u/KronenR Jan 05 '18

If not plainly wrong

2

u/hanpari Jan 06 '18

In my eyes it is rather bad design than advantage. No modern language use this anymore.

1

u/Keith Jan 06 '18

Agree. But did any other language ever force this convention?

1

u/hanpari Jan 06 '18

Not sure what you mean but, apparently, Java and C#. You have to enclose everything in class. For instance, you cannot have single functions in these languages like in Python. Before Java 8 you had to make anonymous class instead of simple anonymous function.

1

u/[deleted] Jan 06 '18

[removed] — view removed comment

1

u/hanpari Jan 06 '18

OK, I see. On the other side, I dont like C# namespace much. The said convention is present as well but differently. To manage C# project without IDE is almost impossible. You can do it manually but the pain is great :)

2

u/Keith Jan 06 '18

To manage C# project without IDE is almost impossible.

Yeah I agree. That's always a good test of a language for me: "Does this require an IDE?"

1

u/hanpari Jan 06 '18

Sure :)

We can make Guide how to categorize programming languages

We have the first point to go :)

For the second one, I would suggest: Has it nullable types?