Python 3 is a piece of shit (23)

1 Name: Anonymous : 2009-02-21 04:58 ID:6aK.THdJ (File: 2 kb, 480x300, 2vs3.png) [Del]

2 kb, 480x300

http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=python3

So not only is Python 3 needlessly incompatible and requires a bunch of annoying code changes, it's also slower and uses more memory. (Unless you happen to do a lot of Mandelbrot set calculations.)

What the fuck, GWEEDO.

2 Name: Anonymous : 2009-02-21 15:52 ID:q8FVGaEc [Del]

Yes, Python is a piece of shit.

3 Name: Anonymous : 2009-02-27 13:56 ID:06Bzii.8 [Del]

I just started programming a week ago and I started on python 3.
What do you guys reckon I should learn if not Python 3? Isn't python 2 gonna be obsolete so there's no point in learning it? Should I learn a different language entirely?

4 Name: Anonymous : 2009-02-27 19:29 ID:gDR.oqOH [Del]

Python 2 is not /that/ different from Python 3 and it will be supported way into the future.

Either way, if you have any talent in programming then switching between the two shouldn't pose a problem at all.

5 Name: Anonymous : 2009-02-27 21:39 ID:Heaven [Del]

I don't get why people hate on Python so much. Maybe it's because they don't understand the basic configuration options of their text editor, such as auto-indent (or worse, are using an editor highly insufficient for any actual programming tasks). Maybe it's because Python already implements a whole slew of basic features, so the only code left for most simple programs is "glue". Maybe the interactive repl and full builtin module documentation is just too helpful, and they'd rather spend several megabytes in bandwidth searching the web instead. Maybe they just spent way too much money on a new 8-core processor and are upset that the GIL is interfering with making their programs OMG OPTIMIZED. (In which case, they're also not competent enough to figure out how to use anything besides CPython, which is the only implementation that imposes this particular restriction.)

Or maybe it's because they're irrational pricks who just hate everything.

Admittedly I think the Python community has made some weird choices, especially with some of the changes in Python 3, but it really isn't a bad language. It's not for everything, but for most applications, it's a decent language.

6 Name: Anonymous : 2009-02-27 23:07 ID:Heaven [Del]

>>5
poor support for functional programming.

7 Name: Anonymous : 2009-02-28 11:30 ID:Heaven [Del]

>>6
So should we all start hating C because it has poor support for OOP? Or Ruby, because it isn't good for logic programming? SQL because it lacks procedural constructs?

And besides, Python 3 has more functional programming constructs. Things like any() and all(), functools.partial(), the (a if b else c) construct, print being a function, etc. Now it's more of a Lisp-functional than a Haskell-functional as the procedural constructs intermingle with the functional ones and lazy evaluation isn't always guaranteed, but that also means there's no IO monad so you can print everywhere.

I think Haskell's a ton of fun for playing with, but in terms of getting any actual work done, Python wins by a long shot.

8 Name: Anonymous : 2009-02-28 14:38 ID:Heaven [Del]

>>7
it's better to not support functional programming at all than to do it in the half-assed way python does. guido has said that he hates functional programming. he's just afraid that if he removes the half-assed support for functional programming the 5 people who actually use python will stop using it.
and who said anything about haskell? try factor if you want a language with great support for functional programming that's good for getting actual work done.

9 Name: Anonymous : 2009-03-01 06:26 ID:Heaven [Del]

>>8
you are either severely confused or trolling.

10 Name: Anonymous : 2009-03-01 18:04 ID:Heaven [Del]

>>8

>the 5 people who actually use python will stop using it

Made me lol

11 Name: Anonymous : 2009-03-12 13:34 ID:kpp9L61. [Del]

Этот тред состоит из: УНЫЛОСТЬ и ФАГГОТОРИЯ.

12 Name: Anonymous : 2009-03-24 20:36 ID:66gG4CEl [Del]

>>8

Make that six people. Though I've got my eye on Genie. It's fucking fast.

13 Name: Anonymous : 2009-03-24 22:01 ID:BJ71/dDD (File: 2 kb, 480x300, chartvs.png) [Del]

2 kb, 480x300

14 Name: Anonymous : 2009-03-24 23:20 ID:7ujVclEG [Del]

>>12
Make that five people, I used to use python but I've switched to C# lately

15 Name: Anonymous : 2009-03-25 18:12 ID:66gG4CEl [Del]

>>14

I tried C#, was a bit too verbose for my tastes. IronPython is pretty zippy, though. And having access to all the CLR goodness was a blast.

However, when all is said and done, I prefer C-compiled programs over bytecode or interpreted. Thus, Genie.

16 Name: Anonymous : 2009-03-26 14:24 ID:AjsAgKCU [Del]

>>15
Was that C# 3.0 or 2.0? They're both quite verbose, but 3.0 less so.

17 Name: Anonymous : 2009-03-26 21:01 ID:Heaven [Del]

>>15-16
c# is only a tiny bit more verbose than python.
unless of course you ignore the whitespace and not the braces.

18 Name: Anonymous : 2009-04-06 12:12 ID:wZZi.tot [Del]

>>17
I wouldn't say a tiny bit more:

  • 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].
  • Lots of little things such as params keyword instead of splat, lack of str[1:-1], etc. all add up.
  • C# has no free functions. They're all (possibly static) methods of a class, and classes themselves can't be ‘imported’. The .NET class library is also excessively verbose in places.
  • The lack of duck typing necessitates declaring and implementing interfaces.

Most of its verbosity comes from its historical lack of type inference and its lack of higher-kinded polymorphism. The C heritage adds the minority of it, I'd say.

Also, Markdown seems to require that the asterisks used to form lists don't have any whitespace in front of them. How intuitive.

19 Name: Anonymous : 2009-04-06 14:07 ID:uTPj79y6 [Del]

>>18
Well, that's because this isn't Markdown, it's some weirdass hack of Wakabamark with a bunch of extra shit jammed into it.

Try D, it's a lot like C#, only less stupid. I've found it to be a quite comfortable language for mid/high-level programming, and although it's statically typed, it also has some degree of inferencing, which if you combine with templates, you get a lot of the benefits of duck-typing without many of its problems (like runtime errors about wrong types).

import std.stdio;
int main(char[][] args)
{
// more type inferencing for 'n' and 'arg'
// also note use of 'length'
foreach (n, arg; args[1 .. length])
writefln(n,
// inline array declaration
" (", ["RED", "ORG", "YEL", "GRN",
"BLU", "BLK", "WHT"][n % length],
") ", arg);
return 0;
}

20 Name: Anonymous : 2009-04-06 14:18 ID:X/zbIPI7 [Del]

>>19
IAWTC. Used to be all over Python, now I'm mostly a D hacker.
(I really, really wish there was a dmd version for PowerPC, though.)

21 Name: Anonymous : 2009-04-06 23:26 ID:d3cZcExp [Del]

> * 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.

> * Lots of little things such as params keyword instead of splat, lack of str[1:-1], etc. all add up.

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

> * C# has no free functions. They're all (possibly static) methods of a class, and classes themselves can't be ‘imported’. The .NET class library is also excessively verbose in places.

just wrapping everything in a single class makes it pretty much the same as having free functions. but doing things like is generally considered to be a bad idea, for good reason.

> The lack of duck typing necessitates declaring and implementing interfaces.

fuck typing is just bugs waiting to happen.

> Try D, it's a lot like C#, only less stupid.

does d have generators? lambda expressions? linq?

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.

23 Name: Anonymous : 2009-04-08 19:01 ID:z4yuT5vm [Del]

> 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?

if it were an absolute position, the name of the method should be slice, not substring.
the only reason there's any confusion about this is that javascript called their slice method substring.

Name: Link:
Spam trap (leave blank):
File: