5 ms·
You know, if Python 3 had been backwards compatible everyone would've been using it 10 years ago and you wouldn't need to waste time creating stuff like this. A
by itamarst 9y ago
You know, if Python 3 had been backwards compatible everyone would've been using it 10 years ago and you wouldn't need to waste time creating stuff like this. And more to the point, we wouldn't all have had to waste tends of thousands of hours of programmer time porting to Python 3.
- halfnibble 9y agoI'd have been using Python 3 ten years ago if they put something semantically useful in like a switch/case statement.
- raymondh 9y agoFWIW, I worked on a switch/case for Python about ten years ago and abandoned the effort because it reached a dead-end. Without the ability to mark variables as constants, a switch-case can't implement an efficient jump table. And without a jump table, a switch/case statement is merely syntactic sugar for an if/elif/elif chain.
- tonyedgecombe 9y agoI'd be happy with the syntactic sugar.
- sametmax 9y agoI don't see how it saves you that much of typing.
- halfnibble 9y agoIt's not about typing. It's about code legibility. With a series of if/elif's you have to mentally evaluate each condition to verify what's happening. If the use case really is switch/case, then a switch/case statement would allow the programmer to mentally evaluate only one condition and quickly glance at a list of possibilities.
- blickentwapft 9y agoIf/elif
- sametmax 9y agoMost of the things that makes Python 3 great would have broken compat. See my other comment. You could have broken down those changes into small pieces, with deprecation. But then, you would have spent the last 10 years changing your code every 2 years. I don't think that's better. Look at the JS community. They break things every 6 months. The result ? Oh they are moving fast. But most projects I met in JS are disposable ones. They will not evolve. They will not be maintained. They will be trashed and rewritten. So yes, the transition has issues, and it could have done it better. But it's far from as bad as most people say it is. People just like to be have everything without paying any cost, but it doesn't work. They want a modern language, but that never changes. They want something stable but that stays up to date. They want to write code and never touch it again, but then complain they can't use their shinny new toy. And seriously, I always hear about those too many huge hours spent to port code 2 to 3. That is so much bullshit. I do that regularly with my clients, and that's far, far away from the reality. Unless you have some very exotic code, it's a few minutes per files. Something you do anyway cause you redactor and clear your code. The team of numpy, twisted and dropbox did suffer from the port. But come on, most people are not them. And THEY didn't complain. People that don't have the problem usually complain the most. They are just scared of the movie they played in their head. They all think they are a special snowflake.
- blickentwapft 9y agoDamn you'd think it was rocket science. For goodness sake it was EASY to upgrade. People just wanted to whine and whine until eventually they had to try it and find it wasn't that hard. Now everyone uses python 3 and has stopped griping, which wasn't warranted in the first place.