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

Python is the best programming language for a variety of reasons:

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 57
Thread images: 4

File: swastika.png (31KB, 2000x1200px) Image search: [Google]
swastika.png
31KB, 2000x1200px
Python is the best programming language for a variety of reasons:
>Super fast to create useful code
>Any feature you could ever need is in a library
>Not wasteful, import as you need
>Asyncio
>Dict / list comprehensions
>Unpacking
>Format strings
>type declarations that allow automatic documentation generation

Basically if you're not using python then you're a nigger
>>
>>Super fast to create useful code
Partially agree, Python has structures for quickly achieving a goal but a lot of times such a solution isn't readable.
>>Any feature you could ever need is in a library
Ending up in a war in dependency hell, with some things running in Py2 or Py3, and Py3 not being backwards compatible with Py2. Fuck, even PHP doesn't do this.
>>Not wasteful, import as you need
Debatable, and [citation needed]
>>Asyncio
Not unique to Python.
>>Dict / list comprehensions
Not unique to Python. And unreadable in Python.
>>Unpacking
what
>>Format strings
Not unique to Python.
>>type declarations that allow automatic documentation generation
Not unique to Python.

Try harder next time.
>>
>>59681070
Almost all of this is not unique to Python.
>>>/global/rules/2

>>59681119
>>Unpacking
>what
Python has things called tuples. They look like this:
x, y = ("Dicks", 666)

Doing
print(x)
print(y)


will yield "Dicks" and 666 on separate lines. Basically you can assign each item in a tuple to a variable. That's called unpacking.
>>
>>59681242
>Unpacking
How fucking useful.

Python is a meme.
>>
>>59681257
t. NEET
>>
>>59681242
>tuples
Pick any modern non trash language and tuple is already available. C(ancer) doesn't count
>>
>>59681242
arrays?
>>
>>59681242
{
x=dicks
y=666
cout<<x<<endl;
cout<<y<<endl;
}
nuttin revolutionary
>>
>>59681321
idiot. You should not be using C++, stick to C with your illiteracy
>>59681316
arrays are not heterogeneous
>>
File: 1490902338216.png (126KB, 800x769px) Image search: [Google]
1490902338216.png
126KB, 800x769px
>>59681070
Should I learn python then?
>>
>>59681338
{
while(true)
cout<<fuck you ;
}
>>
>>59681397
:DDD
>>
>>59681257
>>59681303
>>59681303
holy fuck /g/ really doesnt program
if you cant understand why tuples are useful for quick programming i dont even know what the fuck youre doing
>>
>>59681441
When did I say tuples are not necessary? I said tuples are available in any non trash language
>>
>>59681463
>static lists of various types of data

I don't think most languages have this. Named tuples definitely not.
>>
>>59681070
Why the fuck is this image allowed?
>>
>>59681689
4chan is judenfrei. Please leave.
>>
>>59681070
C# does all of this better.

C# also has the named tuples you seem to have an erection for, plus many things that Python does not have.
>>
>>59681743
>C# has many things python doesnt

Name them or piss off. Im expecting a long list.
>>
>>59681743
But c# for not wangblows
>>
>>59681119
>He cant understand list comprehensions in python
>>
Where my Java niggas at
>>
>>59681070
- Global Interpreter Lock (GIL) is a significant barrier to concurrency. Due to signaling with a CPU-bound thread, it can cause a slowdown even on single processor. Reason for employing GIL in Python is to easy the integration of C/C++ libraries. Additionally, CPython interpreter code is not thread-safe, so the only way other threads can do useful work is if they are in some C/C++ routine, which must be thread-safe.
- Python (like most other scripting languages) does not require variables to be declared, as (let (x 123) ...) in Lisp or int x = 123 in C/C++. This means that Python can't even detect a trivial typo - it will produce a program, which will continue working for hours until it reaches the typo - THEN go boom and you lost all unsaved data. Local and global scopes are unintuitive. Having variables leak after a for-loop can definitely be confusing. Worse, binding of loop indices can be very confusing; e.g. "for a in list: result.append(lambda: fcn(a))" probably won't do what you think it would. Why nonlocal/global/auto-local scope nonsense?
- Python indulges messy horizontal code (> 80 chars per line), where in Lisp one would use "let" to break computaion into manageable pieces. Get used to things like self.convertId([(name, uidutil.getId(obj)) for name, obj in container.items() if IContainer.isInstance(obj)])
- Crippled support for functional programming. Python's lambda is limited to a single expression and doesn't allow conditionals. Python makes a distinction between expressions and statements, and does not automatically return the last expressions, thus crippling lambdas even more. Assignments are not expressions. Most useful high-order functions were deprecated in Python 3.0 and have to be imported from functools. No continuations or even tail call optimization: "I don't like reading code that was written by someone trying to use tail recursion." --Guido
>>
>>59682057
- Python has a faulty package system. Type time.sleep=4 instead of time.sleep(4) and you just destroyed the system-wide sleep function with a trivial typo. Now consider accidentally assigning some method to time.sleep, and you won't even get a runtime error - just very hard to trace behavior. And sleep is only one example, it's just as easy to override ANYTHING.
- Python's syntax, based on SETL language and mathematical Set Theory, is non-uniform, hard to understand and parse, compared to simpler languages, like Lisp, Smalltalk, Nial and Factor. Instead of usual "fold" and "map" functions, Python uses "set comprehension" syntax, which has overhelmingly large collection of underlying linguistic and notational conventions, each with it's own variable binding semantics. Using CLI and automatically generating Python code is hard due to the so called "off-side" indentation rule (aka Forced Indentation of Code), also taken from a math-intensive Haskell language. This, in effect, makes Python look like an overengineered toy for math geeks. Good luck discerning [f(z) for y in x for z in gen(y) if pred(z)] from [f(z) if pred(z) for z in gen(y) for y in x]
- Python hides logical connectives in a pile of other symbols: try seeing "and" in "if y > 0 or new_width > width and new_height > height or x < 0".
- Quite quirky: triple-quoted strings seem like a syntax-decision from a David Lynch movie, and double-underscores, like __init__, seem appropriate in C, but not in a language that provides list comprehensions. There are better ways to mark certain features as internal or special than just calling it __feature__. self everywhere can make you feel like OO was bolted on, even though it wasn't.
>>
File: 1488908757173.jpg (26KB, 275x295px) Image search: [Google]
1488908757173.jpg
26KB, 275x295px
>>59681119
>comprehensions
>unreadable
>>
>>59682069
- Python has too many confusing non-orthogonal features: references can't be used as hash keys; expressions in default arguments are calculated when the function is defined, not when it’s called. Why have both dictionaries and objects? Why have both types and duck-typing? Why is there ":" in the syntax if it almost always has a newline after it? The Python language reference devotes a whole sub-chapter to "Emulating container types", "Emulating callable Objects", "Emulating numeric types", "Emulating sequences" etc. -- only because arrays, sequences etc. are "special" in Python.
- Python's GC uses naive reference counting, which is slow and doesn't handle circular references, meaning you have to expect subtle memory leaks and can't easily use arbitrary graphs as your data. In effect Python complicates even simple tasks, like keeping directory tree with symlinks.
- Patterns and anti-patterns are signs of deficiencies inherent in the language. In Python, concatenating strings in a loop is considered an anti-pattern merely because the popular implementation is incapable of producing good code in such a case. The intractability or impossibility of static analysis in Python makes such optimizations difficult or impossible.
- Problems with arithmetic: no Numerical Tower (nor even rational/complex numbers), meaning 1/2 would produce 0, instead of 0.5, leading to subtle and dangerous errors.
- Poor UTF support and unicode string handling is somewhat awkward.
- No outstanding feature, that makes the language, like the brevity of APL or macros of Lisp. Python doesn’t really give us anything that wasn’t there long ago in Lisp and Smalltalk.
>>
>>59681070
>python2
>python3

That alone fucked the language forever. What a huge hassle. What a fucking joke.
>>
Pretty much every feature you just described also applies to F#. Try harder.
>>
>>59681689
Because we love that it triggers pussies like you
>>
>>59682088

>Why have both dictionaries and objects?
Objects are not just glorified hash tables and should not be treated as such.

>Why have both types and duck-typing?
Duck typing is still a type system, and you need to have a way to differentiate between objects that represent different things. 2 + "hello" should not be a valid operation, even though 2 is an object that responds to the + method.
>>
>>59682069
>Python's syntax, based on SETL language and mathematical Set Theory, is non-uniform, hard to understand
No it's not, it's set-builder-esque.
>try seeing "and" in "if y > 0 or new_width > width and new_height > height or x < 0".
Not difficult.
>>
>>59681987
Mono and .NET Core are both open-source and platform agnostic.
>>
>Any feature you could ever need is in a library
This is the same reasoning that has caused every basic webpage to be filled with 20 package and framework imports.
>>
>>59681689

Why would it be banned? Your personal feelings do not matter on this website. If you are actually offended by a fucking image on 4chan, we need to twist the knife in deeper.
>>
>>59681242
Those aren't tuples, that's just a borrowed feature from Perl.

($a $b $c $d) = (1, 2, 3, 4)
>>
>>59681689
Welcome to 4chan, the last bastion of free speech on the internet

I think you meant to go to reddit and ended up here by accident
>>
>>59682088
>Python's GC uses naive reference counting, which is slow and doesn't handle circular references, meaning you have to expect subtle memory leaks
Except that python's gc does detect circular references. There was a historic problem in rare cases where the user had implemented a __del__ destructor. However that's fixed in recent python versions
>1/2 would produce 0, instead of 0.5, leading to subtle and dangerous errors.
(A) This happens in quite a large number of languages when dividing integer by integer.
(B) This does not actually happen as of python 3, where automatic conversion to a float type occurs
>>
>>59681070
C, C++ and C# are all infinitely better than python and are the god trio of languages.

Using anything else is stupid.
>>
>>59682500
>conversion to a float type occurs
His language doesn't support fractions and has to convert to decimals!
>>
>>59682069
>Python has a faulty package system. Type time.sleep=4 instead of time.sleep(4)
Honestly? That's a fault of the language in the same way a user trying to dereference a null pointer in C is a fault of the language.
>>
>>59682568
A proper package system uses locks.
>>
File: 1485282447083.jpg (1MB, 2200x3111px) Image search: [Google]
1485282447083.jpg
1MB, 2200x3111px
>>59681689
Because it's
A E S T H E T I C
>>
>>59681689
This will answer all of your questions:
https://www.youtube.com/watch?v=icqPHsNumuU
>>
>>59682511
>c#

I was with you until that point

There's a god duo, C and C++. No trio. Fuck C# and fuck the jumbled mess that is windows development
>>
>>59682575
>create your own definition of 'proper'
>haha your language does not conform to my definition of 'proper'
>>
>>59682641
Who are you quoting, anon?
>>
>>59682637
>t. Never used C#
C# is everything Java should have been and is a delight to work in.
It's slow, and WPF is a god damn clusterfuck, but C# itself is delightful and quite robust.
>>
>>59682661
he's greentexting what the other people was assuming

are you new here
>>
>>59682914
Where did he say this?
>>
>>59682220
cof cof LISP
>>
>>59682960
lurk more.
>>
>>59683064
What does this mean?
>>
>>59681242
can this be used to return multiple values from a function? seems useful
>>
>>59684226
Yes, and variable swapping.
>>
>>59684226
yeah its pretty great

Return a, b, c
same as
return (a,b,c)
>>
>>59681340
No, learn Java (popular, easy to start with) and then C (embedded systems are built on this). Ignore OP, they're an idiot. Python is more niche.
>>
>>59681689
why the fuck is this faggot allowed?
Thread posts: 57
Thread images: 4


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.