Python 3 is a piece of shit (23)

22 Name: Anonymous : 2009-04-08 07:56 ID:Heaven [Del]

>>21
I wasn't necessarily saying that all of those things were bad things (I agree with you on duck typing). But I'd like to address the following cases:

> > * You're required to specify types for properties, return types of methods, and types of lambda expressions if assigned to a variable (i.e. var f = x => x + 1 is illegal).
> > * The syntax for an array literal is new int[] { 1,2,3,4 } instead of [1,2,3,4].
> these two are the same thing. type safety is a good thing.

It's possible to implement both of those in a type-safe manner without the programmer having to hold the compiler's hand. The problem is that C#'s type inference is too limited.

> that's just simpler, saner syntax. seriously, "splat"? "[1:-1]"? what is this, perl?

Do you think str.Substring(1, str.Length - 2) is any better, especially given that it's not even clear whether the second argument is a length or an absolute position? C# uses str.Substring(index, *length*)¹. JavaScript uses both (str.substr and str.substring) – go on, guess which is which. Python and many other languages' syntax make it obvious, with less wordiness.

¹ I suppose it could be named better to reflect this, but no great names come to mind.

Name: Link:
Spam trap (don't touch):
File: