4 ms·
Would you intentionally introduce language features that break functionality for people who don't follow style guidelines? I certainly hope not. The real probl
by nbouscal 13y ago
Would you intentionally introduce language features that break functionality for people who don't follow style guidelines? I certainly hope not.
The real problem with your argument is that the poorly-styled code of people who haven't learned better yet is in production. This isn't a theoretical exercise. This is a tool used in industry, and "teaching people to style their code better" is not a valid excuse for costing industrial users of the language money.
Further, Python markets itself as a beginner-friendly language. Your attitude is the exact opposite of beginner-friendly.
- amirouche 13y agobeginner-friendly doesn't mean stupid-friendly. And I am in favor of "teaching people to style their code better" in the language even if in this case, it's not about style but the meaning of midnight. semantic != style. Also, language must also help/structure/offer rails for thinking, create et cetera. Industry must bend before truth, not bend truth over itself...
- nbouscal 13y agoWe have mostly the same principles but have come to different conclusions. The semantics of midnight are indeed what is important here, but midnight does not qualify as a zero. Zero implies identity for some addition, and there is no addition for which midnight is the identity. This is because midnight does not even support addition: you have to use timedeltas if you want to add times. Timedelta 0, then, is the proper zero, and should semantically be falsy in languages where zeros are falsy. Midnight, on the other hand, should not be. (The entire notion of falsiness is terrible and should crawl off somewhere and die, but that's beside the point.)
- amirouche 13y agoAgreed, midnight is not False.
- TheZenPsycho 13y ago>Would you intentionally introduce language features that break functionality for people who don't follow style guidelines? Uhm maybe I'm confused but isn't that the whole design philosophy behind python? It makes bad indentation a syntax error!
- aninhumer 13y ago>It makes bad indentation a syntax error! No, its syntax for determining block structure is indentation. The designers didn't say "Hey lets complain about bad indentation" they said "Hey, people should be indenting their code properly anyway, so why not make that the syntax?" Also, they didn't introduce it to an existing project, it was there from the beginning (AFAIK).