r/programming • u/technonotice • Dec 06 '08
Python Makes Me Nervous
http://teddziuba.com/2008/12/python-makes-me-nervous.html5
Dec 07 '08 edited Dec 07 '08
I agree here, and I hate agreeing with Ted.
I recently had to work on a soap proxy class generated by a crappy WSDL. All of the methods had signatures like this:
void Method(object arg1, object arg2, object arg3)I had to do a ton of work to determine what I should actually pass to the method, and it made my life unpleasant.
Working with a library on a duck typed language has this exact same problem. While static typing has its warts, this is one advantage it does have over duck typing.
-1
u/mr_chromatic Dec 08 '08
While static typing has its warts, this is one advantage it does have over duck typing.
It makes SOAP and WSDL slightly less intolerable?
2
0
u/jaysonbank Apr 09 '09 edited Apr 09 '09
You shouldn't need so many arguments, the whole point of OOP is you can split things up into separate methods and make other things default.
void Method(object arg1, object arg2, object arg3)Why are those args not properties? Why havn't these properties been set somewhere else line by line? Why doesn't the library choose some sensible default values?
Java is so full of bullshit it boggles the mind, I love the way he presents this little 'gem' in the article:
protected TServer(TProcessorFactory processorFactory, TServerTransport serverTransport)Wow! so easy! yes, all I need to do to use it is find a fucking processor factory (whatever the FUCK that is) and a fucking server transport (can't you just give me a default??)
You see, Java is so fucking verbose and hard to read, it actually needs static typing and all this contractual shit just to make it understandable. Better languages are just readable and do useful shit in fewer lines, as a result, you can easily check the definition to see what a method does.
5
Dec 07 '08
What is the difference between a single programmer in this mythical big team that needs bondage and discipline and a single programmer who uses all those hundreds and thousands of Python libraries and frameworks from everywhere everyday like I do?
O.K. people need to manage changes of interfaces and you tell me this isn't possible in Python because of duck-typing?
4
-1
u/mycall Dec 09 '08 edited Dec 09 '08
Custom work done quickly in a group without documentation is a bitch; removing the trust in parameters for understanding data contracts is the problem.
If you ask me, it sounds like someone doesn't know how to program. Overloading constructors is optional if that is such a big concern.
2
u/hoover Dec 07 '08 edited Dec 07 '08
If he's worried about vargs and kwargs, then don't use them. Sheesh.
1
u/Jessica_Henderson Dec 07 '08
That's true. But his complaint is with a separate library that he wishes to use. So in some cases, he'd really have no choice.
1
u/SuperGrade Dec 08 '08
The article is grossly misnamed - from his concerns it should have been labelled "Straying from Java makes me nervous".
Most of his issues aren't specific to Python. He uses checked exceptions as a "static checking" example, even though I have trouble even thinking of another language that has that unfortunate feature.
And going into the text editor/IDE in a language comparo. . . . . perhaps it should be called "straying from Java with my IDE and its specific settings making me nervous".
-2
u/moonwatcher222 Dec 07 '08
I think the title of the post should be "Python Doesn't Have the Security Blanket of Static Typing that I Rely on in Java"
8
3
0
Dec 08 '08
I can see Python 3K's new annotations easily expanding to fill the compile-time checking and IDE hinting role: http://www.python.org/dev/peps/pep-3107/
Speaking honestly though, I've had issues with duck typing when trying to read standard library code and such-like, and have found in my own coding that arguments to methods and functions tend to be of the same type anyway.
He has a good point about the constructor he encountered, but that's not Python's fault (although it doesn't help), that's a bad API - I've met a fair few classes with multiple constructors that take a bunch of reading to figure out. I tend to prefer static factory methods with descriptive names over a gazillion slightly different constructors.
I'm sure you could do the same in Python if it was really a problem.
-5
u/ubernostrum Dec 07 '08
Aw, the little failfucker discovered the fact that people who aren't him can get by just fine without the crutch of an IDE. Poor guy.
(lest you think I'm being unreasonably harsh, remember that this is the dude who, for a while, ran a blog whose text essentially consisted of the words "fuck" and "FAIL" and the phrase "Web 2.0" endlessly repeated after each other; apparently he's purchased a dictionary and expanded his vocabulary since then, but the average intelligence of what he writes hasn't benefited from such)
2
u/mycall Dec 09 '08 edited Dec 09 '08
So IDEs are 100% useless and programming shouldn't need to evolve beyond CLI+emacs/vi for the next 75 years?
-2
u/ubernostrum Dec 09 '08
So whenever you encounter someone whose opinion doesn't match yours, you make up something and pretend that's what they really said?
2
-2
u/Jessica_Henderson Dec 07 '08
Please, he's not a "failfucker". He's the founder of pressflip.com! Oh, wait. I've never heard of them before, either. Maybe you're right.
-2
u/caiomoritz Dec 06 '08
I think the title of the post should be "Lack of documentation in Python code makes me nervous".
2
8
u/brother-seamus Dec 07 '08
I hate to say this, but I think he's right on most of what he says, especially considering what he said early on: in a big group of developers, it tends to get complicated to memorize what some things are without checking it first.