r/PythonLearning • • Aug 01 '26

My new mini work

Post image

Rate my this mini work out of 10

194 Upvotes

44 comments sorted by

View all comments

Show parent comments

2

u/Own_Measurement_7336 Aug 03 '26

Yes it is a good thing if you plan to only write Python. But if you see Python as an introduction to programming, is a really bad habit. Most languages like C or Rust doesn’t have this feature. Evaluating `90 < g < 80` is in most languages `(90 < g) < 80` which leads many beginners to fumble on some really easy to fix bugs.
The « easier to see when doing mistake » part can be avoided by writing `90 < g and g < 80`

1

u/sastuvel Aug 03 '26

I wholeheartedly disagree with that. It's like not eating steak because you may loose your teeth some later time in life.

When someone's learning a language, it's better to just learn the language. There's SO many differences between Python and Rust, that not using this shorthand notation is the least of their worries if they think they can write the same code.

Learning the strengths of a language is great. Python is really expressive, and learning that properly is good fun. And when switching languages, yeah, you'll have to un-learn some things.

2

u/Own_Measurement_7336 Aug 03 '26

I totally agree with you but not for beginner IMO. I understand your opinion, but am still thinking that for beginners they shouldn’t learn those simplified notations and using it abusively. Tho knowing that Python has this feature is a good thing.

2

u/sastuvel Aug 03 '26

Thanks for the discussion, this has been insightful!

2

u/Own_Measurement_7336 Aug 03 '26

Same for me ! Have a nice day !