What makes Python so comfy?

What makes Python so comfy?

Is there any major criticism of Python except for the speed thing (i.e. I used it for something you shouldn't use it and it fucked up)?

Other urls found in this thread:

github.com/lhartikk/ArnoldC/wiki/ArnoldC
twitter.com/SFWRedditGifs

Its a C++ based toy language.

Its not quick and dirty

>>>>>>>>>>>>>>>>>>>>>>>>>>whitespace

>What makes Python so comfy?
its syntax is executable pseudocode (i.e. minimal ceremony)
versatile standard library and a MASSIVE ecosystem of third-party libraries
lack of type annotations makes prototyping pretty fast

>Is there any major criticism of Python except for the speed thing?
duck typing is counterproductive for medium to large scale codebases - it confounds valuable tools like IntelliSense and makes testing much more laborious than necessary
no thread-level parallelism

Why do you think that?

int
main (){
for (int i=0; i

>comfy?
xD
he said comfy xD

>no thread-level parallelism
Python as a language does support this, just not the CPython implementation. Look at StacklessPython for an example of a specifically GIL-less implementation designed mainly to enable parallel threading.

I occasionally want static typing

Horrendous typing

What's wrong with strong dynamic typing?

I absolutely hate the fact that tabs are syntactic characters in Python. Otherwise it's great when performance doesn't matter.

why would you use tabs in your code?

>duck typing is counterproductive for medium to large scale codebases - it confounds valuable tools like IntelliSense and makes testing much more laborious than necessary
Duck typing can cause issues, sure, but it is still a language used for medium to large scale codebases of any complexity. The cost of running into issues is, from my personal experience, minimal compared to the cost of time not using the language

>not using
10 I = 1
20 IF I

>Is there any major criticism of Python except for the speed thing (i.e. I used it for something you shouldn't use it and it fucked up)?

- There is no sane standard and the way CPython - the standard implementation is implemented screws with building good interpreters.
- Startup times are not that good in comparinson - there are compilers that are faster.
- While PHP standard libs are often mocked Python std libs often aren't golden as well, e.g. if it comes to naming conventions.
- Both tabs and spaces are allowed.
- If you embed CPython, you can only make one instance of the interpreter and there is no sane way to disable using dangerous APIs.

>[print(x) for x in range(10)]
Why does this neat and very useful shortcut for loop have to open with brackets, it's so ugly and stands out because nothing else does

Because that's not a shortcut for a for loop, that's a list comprehension where you are trying to create and populate a list with the results of calling print(x) for x in the range 0->9.

The printing if this does not generate a syntax error is just a side effect of what this syntax is supposed to be used for. I know it is in python 2.7 but not if it is in 3.0 and up. You "should' never use comprehensions for their side effects.

Side effects were a mistake

I don't know any programming languages. What's this called?

ugly as fuck.
*barfs*

for i in range (1, 101):
if i % 3 == 0 and i % 5 == 0:
print('FizzBuzz\n')
elif i % 3 == 0:
print('Fizz\n')
elif i % 5 == 0:
print('Buzz\n')

This is going to be posted every time fizzbuzz appears on /dpt/, and yes it's valid as a one-liner too

there is no standart version, there are literally shitloafs of different python versions

python is shit and only casuals use it.

But you don't have to duck type in python.
You can always just use isinstance/issubclass to enforce certain types.
But if you do want to duck type, it still does it way better than other languages since you can make ABCs with custom subclass/instance checks so that you can do duck typing but still use isinstance/issubclass.

>I had to learn shit in school that was unnecessarily difficult and verbose
>I don't like that new programming languages make syntax simpler and cleaner
>everyone should have to do it the hard way, LIKE I DID!

you sound bitter as fuckkkkk.

lmao get that weak shit out of here

say"Fizz"x!($_%3)."Buzz"x!($_%5)||$_ for 1..100

I don't see Jesus standing proudly next to your code, so you can't really say much

Whenever Sup Forums says something is shit, it is usualy good.

So I'm guessing Python is pretty good

Larry is Jesus' best friend tho

say"Fizz"x!($_%3)."Buzz"x!($_%5)||$_ for1..100*

>Because that's not a shortcut for a for loop
except it is, there's no way to accomplish that with a loop under the hood

"Whitespace as meaningful syntax" is a cancerous idea.

Python is awesome but the typing is shit and it shits it's pants if yu mix tabs and spaces (ie use a different editor to edit the file). I can't imagine making a large application with it thougn

for x in range(1, 101): print "Fizz" * (not(x%3)) + "Buzz" * (not(x%5)) or x

>ie use a different editor to edit the file
So configure your editor correctly? That's a PEBKAC

Not gonna lie, he's pretty compelling

BASIC. Pretty much nobody uses it anymore.

> no multi line lambda
> slow as fuck
> bad multithreading facilities
> indentation level significance
> generally hard to read and understand
It's harmful and you really should not use it.

He's talking about the brackets.

print x for x in range(10)

If you wanted an array. You could do

array = [x for x in range(10)]

What else should I use then, senpai?

#include
#define F(x,y) printf("%s",i%x?"":#y"zz")
int main(int i){for(--i;i++^100;puts(""))F(3,Fi)|F(5,Bu)||printf("%i",i);return 0;}

>not C

The biggest criticism is the clusterfuck that is Python 2.x VS 3.x and how it was handled.

Complete amateur clownshow to the extreme.

For that reason alone nobody should be using Python for fears of Python 4.x also making 3.x totally incompatible.

Ruby
AWK
Go
Scheme/Racket
Common Lisp
Java
Literally anything else, like ArnoldC github.com/lhartikk/ArnoldC/wiki/ArnoldC

If you are a hipster and want to impress hackernews: Go. (node.js lost a lot of favor because it became too mainstream)
If you want a job, good performance and generally a good time because there are limitless high quality resources and libraries, Java or C#, if you want a bad time and even more performance C++.
If you want to program an iOS app learn Swift.

>Thread(target=foo).start()
>It doesn't actually run on a new thread

Thanks GIL!

>Java
:^)

I'll bite
> no multi line lambda
True, although it tends to become an organizational clusterfuck.
> slow as fuck
It's only as slow as you make it. Most builtin stuff is implemented in C for speed, so as long as you don't reimplement stuff needlessly it's fine. On top of that, you can write your own modules in C, and there's also Cython.
> bad multithreading facilities
In CPython sure.
> indentation level significance
Still haven't seen a convincing argument as to why this is a bad thing. Your code better be indented properly anyway, so I'd take this over having to track down where I forgot a bracket somewhere.
> generally hard to read and understand
What the fuck are you on? It's far easier to understand than any other language of similar flexibility.

Yup, 3.X came out in 2008, but you still can find some modules that work only on 2.x and have not been updated since. Some modules are pretty much unique and you cannot replace them. Just what you need when you want to learn programming and everybody reccomends python.