- Ifs, loops, etc., and more generally, blocks should be expressions that return the value of the last sentence.
- Closures are limited, not because they internally are, but because when you do x = 2, you immediately create a new reference x, not changing the one from an outer scope. This is a tradeoff; it doesn't happen in JavaScript, but on the other side, Python doesn't have dangerous automatic globals and it doesn't require you to define your variables. Still, I would like to have some kind of "outer scope" resolution operator.
- I would like to have C-like assignment operators and ++ --
- Modules should have been regular namespaces, working just like classes and functions.
- Regular expressions from the re module aren't as good as Perl's. They lack the experimental features.
- The re module needs simplification. You can fix it easily though.
Everything else looks great to me. It's overall my favourite language.
This thread went bonkers fast. Are the things that >>5 really the only problems with Python?
My powerlevel isn't high enough to really understand any of the problems listed, so I'll just continue using Python and learning C at the side.
Name:
Anonymous2007-02-03 23:29
>>16
Make sure you learn memory management well. Any application where performance is important will require a language that allows directly manipulation of how things are stored and accessed in memory.
Name:
Anonymous2007-02-04 0:45
>>13 >>15 >>14
all the same person, can you believe this guy? hes fuckin nuts
Name:
Anonymous2007-02-04 3:28
>>1
why dont you go back and script some php?
tard.
Name:
Anonymous2007-02-04 13:13
>>16
Personally, I don't like self, __, or things like len() either.
At least Python has real-time datatype change and is based on functional programming history. Being based on functional programming, the features of the language will also be based on actual features which took actually took place in Lisp. So here's this giant one-line lambda.
Name:
Anonymous2007-02-05 0:45
* poor performance
* Idiot creator
* Maintained by people who are similar to those who maintain PHP
* Wrong mix of features
* Bad operator overloading in the stdlib
More interesting problems were posted in >>5, such as the way scopes are handled in closures or functional and declarative programming features, and what does >>24 have to say? Wah wah wah stupid map bad team lag wah wah wah.
Python is not perfect, but saying stupid things outweight the "few" good things, you're just trolling. And IHBT. Dammit.
Name:
Anonymous2007-02-05 10:25
>>26
"forced" is only one word.
the "indenting" part isn't bad, just the "forced" part.
Name:
Anonymous2007-02-05 10:35
>>33
makes arguments a bit like a primary school child.
Name:
Anonymous2007-02-05 15:09
>>35 >>5 was mine too. I just adapt to the poster I'm replying to.
Name:
Anonymous2007-02-06 0:28
>>34
That's like saying that forced semicolons at the end of lines is bad, or forced braces.
God dammit C++ sucks because it forces you to use [] for arrays and doesn't allow you to use %% in the sense that you cannot say howdy%1% = 1; instead you have to say howdy[1] = 1;
FUCK ALL LANGUAGES EXCEPT PYTHON AND WEEABOOESE
Name:
Anonymous2007-02-06 9:11
That's like saying that forced semicolons at the end of lines is bad, or forced braces.
so true!
Name:
Anonymous2007-02-06 10:27
>>38
The best programming language
is natural language
it's not forced anything
>>39
programming languages aren't natural by definition, numbnuts. and in natural languages you still have formal rules to make written text unambiguous, but a fucking peon like you probably couldn't even think that far, you just go about yapping your nonsense with line breaks like you thought it was a haiku
>>40
so the difference between forced indentation and forced statement separators (semicolons) is what, exactly? are you idiots maybe upset because you suddenly can't use your own obnoxious indentation "style"?
Name:
Anonymous2007-02-06 13:56
I have over 65,535 years programming experience writing XBOX-SIZED programs that you couldn't even begin to comprehend with 100% of your brains. I wrote the first ANSI C compiler when I was -12 years old, using ANSI C.
You should just accept everything I say, I don't HAVE to give any reasons for my arguments because I am GUIDO ROSS.
Name:
Anonymous2007-02-06 13:56
so the difference between forced indentation and forced statement separators (semicolons) is what, exactly?
No do/while loops and a hamstrung lambda.
I rarely use lambda, but I miss do/while...
Name:
Anonymous2007-02-06 14:07
>>40
You seem to like C, but I can't help but notice that you did not declare the value of FALSE. That would result in some pretty bad errors...
tl;dr version: #define FALSE 0
Name:
Anonymous2007-02-06 14:12
>>43
who cares for multiline lambdas if you can just use def, and are you sure the lack of do while is because of the off-side rule?
Name:
Anonymous2007-02-06 14:20
<code>
for (AppleJuice juice : aj) {
Person moot = new Person();
while (juice.content != 0) {
moot.drink(new Glass(juice.getJuice(
(new MesureMent(15)).setMesure("cl"))));
}
}
</code>
>>48
one word: trying-to-be-clever-but-failing-miserably
Name:
Anonymous2007-02-06 17:11
>>49
forced-indenting is not clever either, it fails, enjoy your:
if ...:
if ...:
if ...: # fucked up indentation, welcome to Hell.
Name:
Anonymous2007-02-06 17:50
>>50
how about you shut your fucking yap hole before I stab you in the eye. here's a clue: YOUR LITTLE BONEHEADED EXCUSE FOR A POST MAKES NO SENSE
Name:
Anonymous2007-02-06 17:53
who cares for multiline lambdas if you can just use def
I like pointless functions about as much as I like pointless classes. Leave boilerplate to C++, kthx.
and are you sure the lack of do while is because of the off-side rule?
How would you implement do/while in python?
Of course, to be fair, do/while is a bit of a hack in braced languages as well.
Name:
Anonymous2007-02-06 18:03
>>43
Forced indentation did not prevent making do..while or repeat..until loops. It's just that Guido thought it unnecessary, or rather, he was being a dick so he challenged people to enumerate places where it'd be clearly better than while in the standard library, then he'd add it.
As for lambda, you can have multiline lambdas BTW:
l = (lambda x, y:
x + y) #Multiline lambda
The real problem is multi-statement lambdas, which you don't have. The best you can do is implement something like C's comma operator, e.g.
def last(*p):
return p[-1]
>>45
Tru.dat, the only problem with def is it's not an expression like JavaScript's function; you have to forcefully name it into a temporary variable (which you may reuse). For that purpose, I use underscore:
>>50
No, you're the fail, and your post did not make sense. Forced indentation is harder to fail than braces, unless you are not used to indenting your code, in which case you suck.
Name:
Anonymous2007-02-06 18:40
he was being a dick so he challenged people to enumerate places where it'd be clearly better than while in the standard library
thing is, you can do the same with a regular loop, adding a conditional break at the end; it just looks less pretty
As for lambda, you can have multiline lambdas BTW
I think what was meant was more complex statements inside a lambda, but, in that case, you should use a nested function, and lambdas are just syntactic sugar anyway
I like pointless functions about as much as I like pointless classes.
I'm sensing you're someone who has no clue
all in all, the best tards like >>50 can come up with is minor quibbling about the syntax, because it requires no brainwork
Name:
Anonymous2007-02-06 18:42
I think what was meant was more complex statements inside a lambda, but, in that case, you should use a nested function, and lambdas are just syntactic sugar anyway
oops, didn't read the rest of >>53 before replying
Name:
Anonymous2007-02-06 20:04
I'm sensing you're someone who has no clue
I like to think I do, but I'm always happy to learn something different. So, tell me how I'm wrong, chum.
see here
Thanks for the link. However, unless I've missed something (I must have):
do:
<setup code>
while <condition>:
<loop body>
Is little different from:
<setup code>
while <condition>:
<loop body>
So, that's just increasing the code, not the reverse. It doesn't solve the problem. Perhaps if you could demonstrate how it'll help with something like:
do {
print(x);
print(x%1);
print(x%2);
x++;
} while(x >= 5);
Since do/while loops always execute at least once, with python you'd currently get:
print(x)
print(x%1)
print(x%2)
x += x
while x >= 5:
print(x)
print(x%1)
print(x%2)
x += x
How would the proposed addition help? I'd be much obliged.
do:
print(x)
print(x%1)
print(x%2)
x += x
while x >= 5:
pass
oh, gee, would you look at this
I like to think I do, but I'm always happy to learn something different. So, tell me how I'm wrong, chum.
no, I think sucking cocks is alright for you after all
Name:
Anonymous2007-02-07 3:33
or:
while True:
print(x)
print(x%1)
print(x%2)
x += x
if x >= 5: break
Name:
Anonymous2007-02-07 3:39
>>60
That is... ugly. I'm glad to see people are thinking twice on the mailing lists.
no, I think, etc
No explanation? Just an insult? Grow up.
>>54 thing is, you can do the same with a regular loop, adding a conditional break at the end; it just looks less pretty
Sure, Guido challenged people to find enough places where do..while would make things look better.
While I think Python has a very elegant design that successfully straddles the fine line between the minimalism of Lisp and the rococo complexities of Perl, it's certainly not perfect. There are various design features that I consider ugly, or at least suboptimal in some way. This essay will examine the most significant problems in Python as I perceive them, assisted by suggestions from the comp.lang.python crowd.
The purpose of this discussion isn't to bash Python, or to second-guess GvR; most of these problems are rather difficult to solve and don't have any obviously correct solution, even if one disregarded backward compatibility. Instead, the goal is simply to demonstrate awareness of Python's flaws, and to ask if they're fixable. One test of whether someone is a good programmer is to ask them to assess the tools they use -- languages, libraries, and operating systems. Someone who cannot perceive flaws or express an opinion about the low and high points of a design is either not accustomed to thinking analytically about the systems they encounter or is blindly partisan in the service of their chosen favorites. Computing, at least in the exploratory fields where I hang out, is more of an art than a science, and inability to critique a design is a serious liability.
Name:
Anonymous2007-02-07 8:13
>>69
Truth. That's why I, despite being the biggest Python fag fanboy, was quick to take this thread seriously in >>5. I want this fixed just exactly because I like Python so much.
Also, 70GET
Name:
Anonymous2007-02-07 10:24
oh yeah, I almost forgot, there is a hidden feature that you can use curly braces as block delimiters in python too! you do it like this:
def fun(): #{
print 'Hello World'
...
#}
>>75
If that's all that's bad about Python, Python is a great language.
Name:
Anonymous2007-02-07 15:28
>>76
That's more than anything for me to dump this piece of a crappy language. I want to be in control, you aren't by writing in Python, you'll suffer from it and enjoy your IDE modifying your algorithm because it used tabs by mistake instead of spaces.
>>> from __future__ import braces
File "<stdin>", line 1
SyntaxError: not a chance
ROFLMAO
Name:
Anonymous2007-02-07 15:30
>>77
that's total bullshit and you know it. if you're not using proper identing in any other language, you suck MAJOR cock anyways
wait, no, judging how much braindead code is out there, it's actually very likely that you're an incompetent fucktard
Name:
Anonymous2007-02-07 15:33
>>79
you haven't read my code, I only give the legal rights to the company I work for, that's what the law allows me to do. And I can bend rules whenever I want, if I need to indent differently to be able to format something better, I can do it while you can't, duckfart.
Name:
Anonymous2007-02-07 15:37
>>79 is a prime example of why so many people hate the python community. I too dislike the community, although I think the language is decent.
It's a language, you damned zealot. Get a life and cool down.
Name:
Anonymous2007-02-07 15:40
>>80 >>81
You're both right, languages are tools. If they don't provide you with an efficient solution, change and try something else, Ruby for example.
Name:
Anonymous2007-02-07 15:43
>>80
let me guess, you're some low rank code monkey working for peanuts, know the whopping amount of about two or three languages, one of which is BASIC or somesuch
Also, lack of unicode, and the regex are half-baked.
Name:
Anonymous2007-02-07 16:02
>>85
I don't see myself telling you to stop posting your pretentious, insular crap in every other thread, so what gives you the right to order me around?
Name:
Anonymous2007-02-07 16:04
>>79 >>80
A bit less name calling please, lets concentrate on tearing python to bits :)
Name:
Anonymous2007-02-07 16:07
>>87
shut up please, you're unwelcomed here, this is not the "I'm new to computars help me programmating pliz"
Name:
Anonymous2007-02-07 16:10
>>88
what is the net amount of meaningful criticisms during this thread so far? zero? a link about shortcomings most of which have been fixed 3 versions ago? some quibbling about dubious features like do while, and the stupid old indentation shtick?
>>96
so n00bs can go on with their crusade against python?
Name:
Anonymous2007-02-07 17:17
>>33
and C++ with Boost and the STL outperforms Python with more features and more stuff to play with, what was your point again?
>>37
yes, but my C++ program won't break if I put too much spaces before or after a line or a statement, the flow of my applications can't be broken because I want to cut and paste functions when I refactor...
Name:
Anonymous2007-02-07 17:28
>>98
yeah, because c++ is literally flawless and modern IDEs are so primitive they don't take care of tabs for you.
you know what you can do with your c++ supremacy? I'll let you guess
Name:
Anonymous2007-02-07 17:39
100GET in a long fucking thread?
Name:
Anonymous2007-02-07 17:42
101DALMATIONS
Name:
Anonymous2007-02-07 17:42
>>100
yay, more tedious trolling for all, and I mean both pro and anti python
Name:
Anonymous2007-02-07 17:44
>>98
you must be a genius! a lower level language outperforms a higher level language? words fail me.
Name:
Anonymous2007-02-07 17:45
This thread is teh awesome. If anyone EVER tries to start another Python thread, we can just go:
kinda geeky, but iirc english isn't his first language as he's dutch, and the stuff that's written to the mailinglists is very assuring that a lot of tremendously intelligent people have been working and still are to make python a good language
Name:
Anonymous2007-02-07 18:36
>>80
Ooooh you don't give your very precious code to anyone! You're the man! Truly a master programmer! We should listen to you!
Name:
Anonymous2007-02-07 18:42
and C++ with Boost and the STL outperforms Python with more features and more stuff to play with, what was your point again?
C++ doing that is not only clumsy, incredibly verbose, error-prone and absolutely retarded, but it's also worse than having a monkey dance in your intestine. The fact you can hack it to do something that barely resembles what a high-level language should do doesn't make C++ a high-level language.
P.S.: Python has dynamic typing, closures, list comprehensions, generators, eval, etc., and since Python is written in C, C does all that! OMG!
yes, but my C++ program won't break if I put too much spaces before or after a line or a statement
After? Nobody cares for after. And if you put too much space before a line where it shouldn't go, then it should very well fail, because you suck at indenting.
Name:
Anonymous2007-02-07 18:47
>>106
+1 Interesting
Okay, so you may agree or disagree with GvR. You may think he's an indentation fag, or he has become an hero because he forces morons to indent properly. You may think his disdain for functional programming is stupid. You may think he's too Pythonic for his own good, or he's too Pythonic and that's his own good. So you may like or dislike or love or hate his work. But regardless of that, you have to admit he rocks.
Name:
Anonymous2007-02-07 20:09
Is there some way to do "if defined x" in Python that doesn't involve exceptions?
Name:
Anonymous2007-02-08 0:28
One word, the forced indentation of code. Thread over.
Name:
Anonymous2007-02-08 2:26
>>110
there isn't a better way for a reason: if your code requires so, it's not very good. anyway, you can do if 'name' in dir() or in locals() or globals().
>>111
Same troll as in the first posts, and WHBT constantly.
Name:
Anonymous2007-02-08 22:59
there isn't a better way for a reason: if your code requires so, it's not very good.
I realise that, but it's pretty darn hard to avoid it altogether when dealing with Zope3. Components are no fun. :(
Name:
Anonymous2007-02-09 1:32
One word, the forced indentation of code. Thread over.
>>106
I just watched the whole vid and near the end in the questions section, Guido says there'll probably be syntax so that you can assign to a variable in an outer scope. At this point, I instantly came all over my keyboard, mouse, table, and chair. It's as if I had been wanking for a year holding up all this time, then suddenly released a load of George Zimmer proportions.
>>127
hello, I'll be proving how you fail, using this categorical syllogism:
* > null
you == null
nerd > you
Name:
Anonymous2007-02-10 17:34
>>126
assign variable to outer scope? what a bunch of crap, just rename your stupid variables if their names clash, of course if you only use "a, b, c, d" you'll have a problem, shesh...
>>129
Uh... you kinda fail at realizing what this allows you to. I'm talking about closures. It's not that names clash, it's that I want to use outer scopes variables, and right now in Python you cannot assign them to new values because that would create a new inner variable.
>>142 >>143
Absolutely in no way thirded. Please try to improve your definition of "dead", lest thou wishes to confuse thy peers.
Name:
Anonymous2007-02-12 16:46
>>144
don't make me laugh, you're not one of my "peers", you could be my slave in another dimension but all you are able to do is click "Next > Next > Next" on template wizards for C++ projects, you're nothing.
Name:
Anonymous2007-02-12 16:47
>>144
One word, the forced indentation of code. Thread over.
Name:
Anonymous2007-02-13 3:55
>>134
Python is not that old, but it already does that. You can read outer scope objects and modify mutable ones. The problem is if you assign their symbols like i = 1 (not just modify them like i.mutablemethod() or i[index] = stuff), it will create a new symbol in the local scope, because symbol creation is automatic, and this was a tradeoff between this and what JavaScript and Perl do (automatic globals - pure shit). Currently, if you really need to assign to a symbol like that, you can, but you have to wrap it into a list. This will introduce a way to assign to a symbol in an outer scope.
>>136
Lisp has shitty syntax, Python's syntax is fine except for a few things. However, I think Lisp has superior features. The reason why I do Python is that I think the better syntax is worth the loss of features given what's left of Lisp is still good and flexible enough.
>>149
lisp isnt the best, but thats only because you cannot put languages on a linear scale.
if you could then yeah.
Name:
Anonymous2007-02-14 16:54
>>150
Lisp syntax is so easy and natural that anybody can see that your fake Lisp program is not valid, that's why I love Lisp.
Name:
Anonymous2007-02-14 16:55
>>151
thanks for the computar lesson, I write C++, Lisp and Lua on a daily basis for my job and I needed you to remind me that functional languages are different...
Name:
Anonymous2007-02-15 7:29
>>153
um "shitty syntax for you, best for me, you're a noob, I use Lisp."
you said it was the best... I was practically agreeing with you.
>>161
'perceived', dipshit. and the comic specifically mentions 'hacking together'.
you're a fucking retard.
Name:
Anonymous2007-02-16 15:42
>>162
yeah, and Windows is generally "perceived" as a good operating system and Bush as a good president. Don't use that fucking word if you don't know what it means. As for the "fucking retard" expression, YHBT, now go back to high-school where you belong.
>>166
Python is just "ok" for some small projects, you have to switch to C++ if you want efficiency and more flexible objects with the template system, sorry.
Name:
Anonymous2007-02-17 9:54
>>166
"Yes". As long as you understand:
1. The right tool goes for the right job. Python is the right tool for some jobs, and it's not the right tool for some others.
2. Nothing is perfect. Python has caveats, Ruby has caveats, Lisp has caveats, etc. The fact we criticize some misfeatures of Python doesn't make it suck.
>>170
variable number of arguments in haskell requires lots of fucking about with the type system, thread over.
Name:
Anonymous2007-02-17 12:40
>>171
One word. Variable number of arguments. Thread over.
Also, solution looking for a problem -- if you need varargs, you are probably doing something wrong (or implementing some sprintf-like thing).
Name:
Anonymous2007-02-17 12:44
>>172
>> Also, solution looking for a problem -- if you need varargs, you are probably doing something wrong (or implementing some sprintf-like thing).
so uh... your point is?
Name:
Anonymous2007-02-17 12:47
>>173
Generally you don't need varargs, and thus >>171's point (assuming he made one) is Robert Bopkins.
Name:
Anonymous2007-02-17 14:03
variable length argument lists; yeah Haskell doesn't like them much because of its currying behaviour. However you can just pass a list, you pussy.
Name:
Anonymous2007-02-17 14:07
THIS IS SPARTA WE ARE GOING TO DINE IN HELL
Name:
Anonymous2007-02-17 14:56
>>174
Generally you need variable number of arguments to simplify interfaces intelligently, by using default values for the rarest options.
Name:
Anonymous2007-02-17 16:00
>>177
Nah, you don't actually *NEED* to have functions with variable number of argumets. It makes sense to have, and it's nice, but Haskell has never cared about either of those.
Name:
Anonymous2007-02-17 16:38
>>178
Haskell is kind of the retarded kid of functional languages, the one that tries too hard but is useless and boring.
>>186
Ducks are Touring complete. They move across a (theoretically) infinite river in either direction. They have memory. In each step, they can catch fish, take a dump, or quack.
Name:
Anonymous2007-06-22 9:14 ID:1JNfRxL/
Epic bump of epic proportions. Here you can observe the origins of the `Forced Indentation' meme which I invented in its natural habitat.
>>37
because brackets for array access and semicolons for statement terminators actually make sense and are unambiguous, whereas with whitespace it's hard to see something that isn't there.
>>214 #1) you can't even use IRC well; #2) you can't tab-complete; #3) you can't google - this implies yer too busy jerking off and sucking soda or video-gaming. Die well, kid
Name:
Anonymous2008-12-12 19:03
>>214
That's [spoiler][m]/prog/[/m][/spoiler], not [spoiler]/prog/[/spoiler].
Name:
Anonymous2008-12-12 19:16
/prog/ has to be the only board on 4chan that was actually worse in early 2007.