[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
What makes Python so comfy? Is there any major criticism of
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 48
Thread images: 6
File: python_sh-600x600.png (106 KB, 600x600) Image search: [Google]
python_sh-600x600.png
106 KB, 600x600
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)?
>>
>>54668165
Its a C++ based toy language.
>>
File: larry-wall-quick-and-dirty.jpg (56 KB, 450x561) Image search: [Google]
larry-wall-quick-and-dirty.jpg
56 KB, 450x561
>>54668165
Its not quick and dirty
>>
>>54668165
>>>>>>>>>>>>>>>>>>>>>>>>>>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
>>
>>54668206
Why do you think that?

>>54668274
int
main (){
for (int i=0; i<100; i++){
if (i%3==0 && i%5==0){
puts("FizzBuzz\n");
} else if (i%3 == 0){
puts("Fizz\n");
} else if (i%5 == 0){
puts("Buzz\n");
} else {
printf("%d\n", i);
}
}
}

is supposed to be better?
>>
>>54668165
>comfy?
xD
he said comfy xD
>>
File: rack'd.jpg (59 KB, 453x604) Image search: [Google]
rack'd.jpg
59 KB, 453x604
>>54668323
>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.
>>
>>54668165
I occasionally want static typing
>>
>>54668165
Horrendous typing
>>
>>54668404
What's wrong with strong dynamic typing?
>>
>>54668165
I absolutely hate the fact that tabs are syntactic characters in Python. Otherwise it's great when performance doesn't matter.
>>
>>54668449
why would you use tabs in your code?
>>
>>54668323
>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
>>
>>54668339
>not using
10 I = 1
20 IF I <= 100 GOTO 40
30 GOTO 160
40 IF I MOD 3 = 0 GOTO 80
50 IF I MOD 5 = 0 GOTO 110
60 PRINT I
70 GOTO 140
80 IF I MOD 5 = 0 GOTO 130
90 PRINT "FIZZ"
100 GOTO 140
110 PRINT "BUZZ"
120 GOTO 140
130 PRINT "FIZZBUZZ"
140 I = I + 1
150 _DELAY 0.2
160 GOTO 20
>>
>>54668165
>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
>>
>>54669254
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.
>>
>>54669254
Side effects were a mistake
>>
>>54668806
I don't know any programming languages. What's this called?
>>
>>54668339

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')
>>
File: fizzbuzz of the christ.png (402 KB, 1024x768) Image search: [Google]
fizzbuzz of the christ.png
402 KB, 1024x768
>>54670106
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
>>
>>54668165
python is shit and only casuals use it.
>>
>>54668323
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.
>>
>>54670161
>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.
>>
>>54668339
>>54668806
>>54670106
>>54670136
lmao get that weak shit out of here

 say"Fizz"x!($_%3)."Buzz"x!($_%5)||$_ for 1..100 
>>
>>54670776
I don't see Jesus standing proudly next to your code, so you can't really say much
>>
Whenever /g/ says something is shit, it is usualy good.

So I'm guessing Python is pretty good
>>
File: friday_01_01.jpg (16 KB, 239x320) Image search: [Google]
friday_01_01.jpg
16 KB, 239x320
>>54670785
Larry is Jesus' best friend tho

say"Fizz"x!($_%3)."Buzz"x!($_%5)||$_ for1..100
*
>>
>>54669414
>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
>>
>>54670890
>ie use a different editor to edit the file
So configure your editor correctly? That's a PEBKAC
>>
>>54670827
Not gonna lie, he's pretty compelling
>>
>>54670013
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.
>>
>>54670836
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)]
>>
>>54671251
What else should I use then, senpai?
>>
>>54668806
#include <stdio.h>
#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
>>
>>54668165
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.
>>
>>54671413
Ruby
AWK
Go
Scheme/Racket
Common Lisp
Java
Literally anything else, like ArnoldC https://github.com/lhartikk/ArnoldC/wiki/ArnoldC
>>
>>54671413
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.
>>
File: 1462299535008.jpg (11 KB, 235x215) Image search: [Google]
1462299535008.jpg
11 KB, 235x215
>Thread(target=foo).start()
>It doesn't actually run on a new thread

Thanks GIL!
>>
>>54671632
>Java
:^)
>>
>>54671251
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.
>>
>>54671545

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.
Thread replies: 48
Thread images: 6

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.