[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
Python is the best programming language in the world.
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: 129
Thread images: 7
File: pythonlogo.jpg (46 KB, 680x459) Image search: [Google]
pythonlogo.jpg
46 KB, 680x459
Prove me wrong, /g/.
>>
I happen to agree.
>>
>>54497197
I can't prove you wrong
>god tier for mathematical/scientifical research
>god tier for data analysis including images and neural networks surrounding images
>god tier for webdev because Django is the comfiest fucking thing ever, and Flask is decent
>god tier for menial tasks too like web scraping
I used C, C++, Java for 15 years, but goddamn is Python a smooth motherfucker
>>
>itertools
>>
>>54497197
>Using a script language
Absolutely disgusting.
>>
god tier for high level
c++ best for low level tho
>>
>>54497197
> God is the greatest in the world. Prove me wrong
>>
File: 1442509372310.jpg (52 KB, 400x600) Image search: [Google]
1442509372310.jpg
52 KB, 400x600
>>54497239
>>god tier for mathematical/scientifical research
>>god tier for data analysis including images and neural networks surrounding images
I wish pykids would die out.
>>
>>54497307
>he doesn't know
Those pics showing PHD students leading image-based neural network technology using Python's numpy, scipy and pillow, as well as top companies like Google pushing it like mad, were not all a meme
>>
javascript

learn once, write anywhere
>>
>>54497340
>Neural network technology
Why is this the only thing pyfags have? And they're not even that good at it.
It is a meme, just like the academic lispfags that never really got anything done but were supposed to be the new holy grail of scientific/academic computing were a meme. Python will always be a beginner language that a programmer should at one point grow out of.

Rock on, pykids, you're gonna grow out of it soon(I hope), but keep shitposting to a minimum please.
>>
>>54497412
lmao you are the one shitposting and memeing
>>
>>54497197
>Prove me wrong
I can't
>>
UI libraries don't add anything new, graphical libraries seem to be under utilized, Perl is better for system admin scripts in my opinion, python needs extra security precautions. Not good for high performance tasks. not easibly portable, Still python is one hell of a swiss army knife because of the community.
>>
>>54497197

it's the best programming language for non-programmers
>>
>>54497340
i understand that the front-facing libraries and their interfaces are written in python but all those things are written in C
>>
>>54497797
Neither numpy, scipy, or pillow are useful for front-facing libraries. And if you mean CPython is written in C, so are interpreters, compilers and VMs for many other languages
>>
>>54497197
__magic_method__
>>
>>54497822
what i mean is that "Python" libraries such as numby aren't written in python -- they are written in C commonly. scipy uses fortran and some others as well
>>
Use a switch statement.

OH WAIT
>>
>>54497847
Yes, people who make the bigger libraries can extend python with those libraries.

The people who use them for research, however, are using Python
>>
>>54497239
>>54497209
>>54497298

This was a test. You all passed. Well done.
>>
>>54497239
That doesn't make python good, it makes it easy to use.
It is objectively worse in every performance aspect than almost any other language.
>>
>>54497866
def function(stuff):
return {
'a': 1,
'b': 2,
}.get(stuff, 9)
# if stuff not found print 9
>>
>>54497881
are you realizing you're arguing against yourself yet or not?
>>
Why do some people use Python 2 and some people use Python 3? What's the difference?
>>
>implying there is a "best" language

It's my goto language for most tasks, but if you think I'm going to program my μC in Python you're dreaming.

>>54497866
As much as I enjoy python, I do miss switch statements.
>>
>>54497909
Considering I was arguing for python library users and not python library developers, I'm not arguing against myself.

The alternative is that you are trying to imply that there are fewer languages out there because many are written in others
>>
>>54497902
>instantiate a dictionary to do branching logic
kek
and people make fun of java programmers
>>
>>54497953
>Python is the best programming language in the world
>has its shortcomings made up for it by other programming languages as modules
theres your argument since you couldn't read between the lines
>>
>>54497937
>It's my goto language
really? mine is BASIC.
>>
>>54497197
I think you spelled wrong "Assembly x86"
>>
>>54497990
>additional libraries are shortcomings
loving every laugh, fyi most languages have foreign interfaces and dynamic library languages are still used by industry professionals
>>
>>54497896
>performance is the only metric of value

>>54497927
http://semver.org/

Some major changes were made between versions making them somewhat incompatible. The only reason to not use 3 is if some module you desperately need hasn't been upgraded to be compatible with 3 yet.
>>
>>54498002
you probably don't even remember the times when PC games were written in assembly
>>
>>54497197

Oh, you mean "Ruby light"?

Yeah, it's kinda neat.

>inb4 "muh scientifc algorithms" that are used by 0.001% of all users
>>
>>54498022
>ruby
nice meme
>>
>>54498011
>additional libraries are shortcomings
i shulda figured since u couldnt read between lines that u would make some shit u[p
>>
>>54498026

>I can't into meta programming
>>
>>54498028
Yes you implied numpy, scipy, etc are th result of a language's shortcomings. Considering, you can extend the language to make it flexible, you are only promoting python, which may be your intention. Otherwise, come up with a better argument please
>>
>>54498017
Any example of open source game written in assembly? Sounds interesting
>>
Make a private class variable that is impossible for me to access.

Oh wait
>>
>>54498100
But anon I trust you, why shouldn't I let you access anything if you want to?
>>
>>54498100
>he fell for the encapsulation meme
lmao
>>
>>54498100

Why?

If you can access the code something went already wrong..

It's enough to up put a "do not cross" sign and expect other programmers know what they are doing.
>>
>>54497197
For what ? I mean its best program lang for what purpose ? I bet there is plenty of which Python is really good at, probably the best really, but just stating its the best overall for all purposes its just stupid, friendo ;^)
>>
>>54498115
>>54498120
Let me just touch your organs m8 just trust me I won't do anything bad.

*breaks brain*
>>
>>54498100
I use python professionally and I've never had a moment where I thought "shit this guy shouldn't access this". I've written games in C and SDL as well, and you can access anything you see in its source code.

Why is private stuff good again?
>>
python programmer program cocks LOL GAY!
>>
>>54498182
>professional
>Why is private stuff good again?
how many scrum teams are on your project again?
>>
Why learn any language besides Javascript ?
You can do everything in JS
>>
>>54498248
Fuck if I know fampai, it's a pretty big company
>>
Is there any reason to learn programming anymore I can just hire some Indian for $.50 an hour to do the shit for me
>>
>>54498172
Cant break whats already broken
>>
>>54497902
That's not a switch case.

>>54498013
I can use a handcart to move furniture across town or I can put it in a truck.
One requires nothing, the other means I have to know all the traffic laws and have a heavy vehicle license.

Does that mean the handcart is the best option?
>>
>>54498322
someone might be able to change a small detail later without breaking it if you dont hire an indian
>>
>Python doesn't even have consts
LMAO

Inb4 "professional" Python devs saying why do you need consts just don't edit it :^)

Inb4 some hacky property bullshit
>>
>>54498434
If you don't change it, how will it change?
>>
I got so far in life without learning python. Actually learning it killed the magic.

>shitty scoping rules
>shitty threads
>shitty lambda expressions
>no TCO
>whitespace has syntactic meaning
>the disaster of a transition from 2 to 3 that has somehow left a huge amount of vocal idiots still using and swearing by 2
>>
What are some good plugins for python in vim?
>>
>>54498348
>Does that mean the handcart is the best option?
It means you're shit at analogies son
>>
>>54498348
This is a terrible comparison.

Owning a truck yourself is faster, but you have to be licensed, you have to own a truck, you have to insure the truck, you have to maintain the truck, you have to fuel the truck. This costs time and money.

Or I can just toss some guy some cash and not have to worry about any of that. Sure it may arrive a day later than if i had my own truck, but my life was made easier. I can also do other things while some other schmuck is driving the furniture for me.

It's still a flawed analogy, but in the end, if all I'm trying to do is crunch some raw data to create some human readable charts, is performance really the metric I give a shit about?
>>
>global interpreter lock
>>
File: 1462901916945.jpg (27 KB, 457x358) Image search: [Google]
1462901916945.jpg
27 KB, 457x358
>>54498618
>stock photos
>>
>>54498618
Multi-threading is terrible anyway. Cooperative scheduling with co-routines is where's it's at (call it "green threads" or however you want).
If you need more performance:
1) Don't use CPython
2) Don't use CPython
3) Spawn multiple processes and have them communicate
>>
>>54498683
>greenlets
kek, enjoy your single-core speed limit
>processes
expensive as fuck to spawn on demand
>>
>>54498683
>don't use CPython
So use PyPy? What good python implementations are there?
>>
>>54498795
>PyPy
Not compatible with a few packages either. CPython is the best
>>
I just got into Python anyone have a good IDE to use with it. It really seems to rely on indentation much more than other languages.
>>
>>54498904
Pycharm
>>
>>54498328
underrated
>>
>>54497197
I love Python but it's weakness is where C/C++ take over and vice versa.
>>
When you program in python what you're actually doing is programming a programming language to program a programming language to program a computer. This can be called progprogprogramming, and just as three lefts make a right, three progs make an amateur linguistic twiddler.
>>
>>54497197
Arguments against python being the best language in the world:
It's slow
It has quirks
No/whacky dynamic memory allocation
Easily replaceable, unlikely to be used that much 20 years from now
Seems to leave little legacy code, so if a better alternative shows up, python will disappear quickly (Compare with perl)

However:
It's easy to learn
It's fast to type
It's widespread
It has plenty of nice libraries for plenty of different things
It's multi-paradigm

Of course all languages have different applications. In its own category python is probably one of the best languages that you could learn. And given that most programming should be done (cycles are cheap, programmers expensive) in high-level languages python is probably one of the best languages to learn all categories as well.
>>
>>54498904
Vim with Jedi
>>
>>54497412
Python was like my 5th programming language and I still use it all the time for simple programs and scripts. There are plenty of applications where it really is a good tool for the job.

There is no single programming language that is suited to every task. If language X has some useful libraries and features that would make your project easier, then use that instead of being autistic. Language evangelists are so annoying, and most of them have never done any real-world programming outside of their mom's basement.
>>
>>54497197
then tell me: how do I install matplotlib, if installing through pip and homebrew doesn't work, also downloading and using the .whl-wheel doesn't work. Is matplotlib not compatible with OSX 10.11 El capitan?
>>
Crystal will rule the world one day. Learn ruby.
>>
>>54497239
django is shit
>>
>>54497197

no brackets around code blocks. that shit is totally messed up.
>>
Golang desu.
>>
>>54502189
indent block are really comfy after you write for longer time

its not lack of brackets that make syntax bad.

Look at js, functions with callback sometimes has 16+ brackets
>>
>>54498434
Literally why do you need them though.

You gave an actual reason and then said 'lol I bet you'll say this :^)'
>>
>>54498434
python list and dictionaries are mutable, rest are immutable
>>
F# desu
>>
>>54498002
I'm pretty sure you mean SPARC assembly, X86 is as shitty as assembly languages get.
>>
>>54497197
>Py_Initialize();
Done.

Also:
>metaclasses

Also, see
>>54497846
>>
>>54498795
>What good python implementations are there?
There aren't. That's the joke.
>>
>>54502949
I was honestly hoping he'd try to post some python 2 interpreter so I could have a laugh
>>
>>54497999
pun
>>
>>54497197
defsystem "foo"
:version (:read-file-form "variables" :at (3 2))
:components
((:file "package")
(:file "variables" :depends-on ("package"))
(:module "mod"
:depends-on ("package")
:serial t
:components ((:file "utils")
(:file "reader")
(:file "cooker")
(:static-file "data.raw"))
:output-files (compile-op (o c) (list "data.cooked"))
:perform (compile-op :after (o c)
(cook-data
:in (component-pathname (find-component c "data.raw"))
:out (first (output-files o c)))))
(:file "foo" :depends-on ("mod"))))

(defmethod action-description
((o compile-op) (c (eql (find-component "foo" "mod"))))
"cooking data")


QED slacker
>>
>>54498100
>what is a debugger
>>
>>54502168
says whom has not used django
>>
>>54498516
>vocal idiots still using and swearing by 2
/g/tards will swear by a lot of shit.

There aren't any sane people who swear by Python 2, it's just because of legacy code or libraries that are in 2 and not supported in 3 so you stick with what you have.
>>
>>54503890
I respect that. What I can't stand seeing is people getting newcomers to learn 2.
>>
>>54498100
name a language where a private variable is IMPOSSIBLE to access

>>54502949
but pypy is gud
>>
>>54503940
I don't believe you can in Ada. I could be wrong.
>>
>>54503940
>>54503940
>name a language where a private variable is IMPOSSIBLE to access
In the language itself? Python

def foo():
x = 10
return 5

# Try to access x. Protip: you can't
>>
>>54498013
For programmers that aren't shit yes, it's the only metric, since all others are in their direct control. Anything else you bring up like "ease of use" is just proof you're a shit programmer.
>>
>>54498052
>Yes you implied numpy, scipy, etc are th result of a language's shortcomings.
No he didn't you moron, any language has libraries. He said you're justifying how great Python is through C libraries, which makes no sense.
>>
>>54504041
>I have no idea what a private variable is
>>
>>54504107
You use it in Python you dolt. You've heard of an API? The standard library of many languages were not fully implemented through the language itself most of the time. It makes no difference if it's another library, you are programming in Python
>>
>>54497239
It's god tier for incompetent programmers.
>>
>>54504131
>I'm retarded.
def foo():
x = 10
class Foo:
def setx(self, value):
nonlocal x
x = value
def getx(self):
return x
return Foo()

x = foo()
assert x.getx() == 10
x.setx(20)
assert x.getx() == 20
>>
>>54504376
This is pretty neat. Out of curiosity, in case you've experienced it, is it still possible for Django to manipulate things like models like this, correctly? As in, detect that it needs to be migrated?
>>
>>54504041
> confusing scoping rules with class properties
>>
>>54504798
>doesn't understand the lambda calculus
>doesn't know that OOP is mathematically just functions
>failed the CS track and shitposts daily about how CS is useless
Off yourself.
>>
Every CS major I have ever seen start you off with Java. It's fucking bullshit. I major is Cyber Security and I had to take two programming classes plus a cryptography class that required coding in Java (Dropped that shit fast). I didn't even know what coding was coming into college so I struggled with it. Bad experience with it overall.

>dropped programming I four times before finally passing it.
>all the teachers who taught it were assholes, dicks, or both
>students around me were completely douchebags whenever I asked them for help
>made me hate programming
>spent 6 years in denial before finally accepting that I need coding in my field just this year

I got by those classes by just looking up code and using debug mode to learn how the code worked. I did write my own code, but that was off of looking at code I did in class with the teacher. lol The way it is taught is a joke and the language they choose is pretty questionable IMO.

Im going to be learning Python and JS this summer. Looking forward to it. Giving coding a second chance.
>>
>>54505536
>TL;DR I'm bad at programming
>>
>>54504376
>putting a class inside of a function

lol why? not that best design senpai
>>
>>54505583
Classes are just objects like strings, dummy. Would you put a string inside a function?

def foo():
return str()

def foo():
x = 10
foo = type('foo', (), {})
def setter(value):
nonlocal x
x = value
foo.set = setter
foo.get = lambda: x
return foo

x = foo()
assert x.get() == 10
x.set(20)
assert x.get() == 20
>>
>>54504041
you can access private variables in python. they call it a "consenting adults" language for a reason.

the idea is don't fuck it up, but feel free to tinker if you're not retarded.
>>
>>54497197
Sandboxing a python application's dependencies from other python applications' dependencies

pls don't say virtualenvs
>>
>>54505690
We're learning classes in my python class this week. Could you explain them like I was 5?

Specifically about what they do, why to use them?

I've read a couple different explanations but I'm having a hard time grasping them
>>
>>54505536
Mine used to start with Ada
>>
>>54505791
Variables aren't attributes, anon.
>>
File: XoYsoBm.png (953 KB, 1560x2048) Image search: [Google]
XoYsoBm.png
953 KB, 1560x2048
>>54497197
Tabs/Spacing reliant
Retarded minimalist control and scoping mechanisms that leave it's clarity and readability out the fucking window in large coding projects.

"Correct syntax"
if(cond){
/*10-20 lines of code*/
}else if(cond){
/*10-20 lines of code*/
}else{
/*10-20 lines of code*/
}

Vs.

"Shit Syntax"
if cond:
#10-20 lines of code
elif cond:
#10-20 lines of code
else:
#10-20 lines of code


Which one will bitch and moan about some invisible white space characters you most likely will never see, even if code is perfect? Which will lose its shit between DOS/UNIX cross platform development when the respective environment starts messing with encoding, carriages, etc fucking up formatting?
>>
File: image.jpg (187 KB, 1334x750) Image search: [Google]
image.jpg
187 KB, 1334x750
>>
>dynamic typing
:^)
>>
>>54506459
>overriding class references with variables

This can't possibly go wrong!
>>
>>54502805
>mutability
>>
>>54504041
def foo():
vals = {'x':10}
def inner():
vals['x'] = 100
return vals['x'] + 10
return inner()
>>
>>54506426
Is this factual?
>>
>>54506633
if it ever was it's not anymore
>>
>>54506633
No, Java was never slower than C#.
Also, while >>54506710 only showed us Python numbers and Java still mobs the floor with it in comparison, you aren't supposed to use simple number tests to benchmark language implementations, since they are rather trivial to optimize for in a JIT cumpiler.
>>
>>54506146
are you fucking blind
>>
>>54497197
pros: math and ML libraries, almost lisp-like
cons: shit syntax, slow, full of newbies who only know python and write fucking everything in it, poorly
>>
>>54504041
>private is impossible to access ...
yes it is ... it's private ...
>>
>>54504376
thx for knowing how to get an private !
>>54504041
Thread replies: 129
Thread images: 7

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.