r/Python • • May 26 '14

Python 3 is killing Python

https://medium.com/@deliciousrobots/5d2ad703365d/
0 Upvotes

147 comments sorted by

View all comments

8

u/jm_ May 26 '14

It's not like there are alternatives. Don't even mention Golang - it's a piece of dried up crap with arbitrary limitations (error handling from the 90ties, no ability to implement datastructures with native api, no operator overloading). Might as well use Pascal ...

It seems to me that just few bratty library developers (shamed by their users into fixing their shit to support Python 3) are the main detractors.

Now start downvoting ... cause we all love Armin and his unconstructive bitching.

7

u/greyscalehat May 26 '14

Are you honestly saying there are not alternatives to python?

Also just because you don't like Go doesn't mean that 'it's a piece of dried up crap'. I am writing Go at work and loving it, but I am doing my side project in python. They are different tools, one of which is made for writing extremely reliable fast servers and one is really fun to write.

13

u/KagatoLNX May 26 '14

As an aside: I'm not sure why Golang is getting the hate here. Sounds like you've never needed to write systems software. Golang is great for that. It's not shorter; but not much longer, either. It does a number of things very, very right. I suspect just nothing that you have ever needed to do, though.

Complaining Go doesn't have operator overloading is like complaining Python doesn't have type annotations--it isn't written for a use case where they're particularly useful.

5

u/djimbob May 26 '14 edited May 26 '14

go isn't a drop-in replacement for python, but its a well designed, easy-to-read statically typed language with good well-written libraries. It serves a different purpose. (Granted obviously python has many more libraries having a 10+ year head start).

Go misses some nice features (e.g., generics, operator overloading), but granted go was publicly released ~3 years ago -- give it time (python 2.0 didn't have bools, sets, new-style (object derived) classes, decorators, generators and iterators, with statement, nested scopes (beyond two nestings), automatic casting of 32-bit int to arbitrary sized int, etc). Once you get used to it, I really like the panic / recover and explicitness checking for errors. It's a different mindset, but actually works really nice.

Not sure what your "no ability to implement data-structures". Are you talking about how make only works on slice, map, chan? This isn't really a limitation, you can easily build on top of those structures; e.g., create a set out of map (go's equivalent to a dict) with values that are zero-byte struct. Yes, python has an underlying C API that you are encouraged to use as python2 would otherwise be unusably slow. As go doesn't have that huge speed difference it would be a bad idea to encourage writing things in a C API on top of go. Granted there still is the cgo if you need to call C library/function from within go, and IMO it is much easier to deal with than python C API (by nature of go being statically typed).

2

u/alcalde May 26 '14

Might as well use Pascal ...

Oh now you've done it... now you're going to hear it from the Delphi developers....

It seems to me that just few bratty library developers (shamed by their users into fixing their shit to support Python 3) are the main detractors.

That's not the most diplomatic way of putting it, but it's fairly accurate. One Python library maintainer once said "Why should we ever port to 3 when Python 2's going to be supported FOREVER?" It's just inertia at this point.

2

u/flying-sheep May 26 '14

armin has better points as this guy when he’ bitching. i still don’t agree at all with both, though. see here for my rebuttal.

and the only thing that completely turned me off of golang is the missing generics (your second point). i can’t even implement a tree, wtf.

1

u/ggtsu_00 May 26 '14

I keep hearing so many complaints about generics in go, but interface{} types serve that need pretty well for most cases.

For a tree you could have:

type Node struct {
    Left *Node
    Right *Node
    Data interface{}
}

4

u/flying-sheep May 26 '14

Type safety.

0

u/ggtsu_00 May 26 '14 edited May 26 '14

What is unsafe about it? You you still need to have type assertions before you can actually use interface{} object as an actual data type and the type assertions give you the type safety. It is not any less safe than a python equivalent if that is where you are coming from.

8

u/Categoria May 27 '14

Why have static types in a language where you need runtime checks to replace all but the simplest uses for a type system. Even java learned this lesson.

0

u/ggtsu_00 May 27 '14

That is also why handling unstructured Json objects with in languages like Java is a huge pain.

2

u/Categoria May 27 '14

Java is more verbose than necessary. For example in Scala there's https://github.com/mandubian/play-json-zipper this for example. But how is it more painful than Go? Json is a very simple type to represent, after all. Whatever Go has can be emulated by pre generics java. After all, their type systems would be equivalent modulo structural typing.

1

u/ggtsu_00 May 26 '14

There is also ruby which is the most obvious replacement competitor.