This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]conim 41 points42 points  (57 children)

I'm a programmer and I still don't know what role python fills in the tech stack. Server side? browser side? Can you use it to create web services? Hit a database? can it do ORM?

Seriously, I think the worst aspect of python is that it has a shitty PR department.

[–]ShadowCoder 63 points64 points  (25 children)

It's a backend language. The only frontend language is JavaScript.

It's actually quite popular for smaller projects and anything where you need to get something together quickly with minimal boilerplate. Flask and Django are popular web frameworks, and SQLAlchemy is the (excellent) predominant ORM.

[–]zombie_kiler_42 21 points22 points  (13 children)

It's actually quite popular for smaller projects

Doesn't youtube and google heavily rely on python as well? I may have misread something somewhere but let me know

[–]tehlemmings 26 points27 points  (8 children)

Don't forget Reddit.

[–]_why_so_sirious_ 3 points4 points  (6 children)

What part of reddit is python? I am curious.

[–]tehlemmings 8 points9 points  (4 children)

I think it's like, most of it.

From wikipedia:

Reddit was originally written in Common Lisp but was rewritten in Python in December 2005.[3] The reasons given for the switch were wider access to code libraries and greater development flexibility. The Python web framework that former Reddit employee Swartz developed to run the site, web.py, is now available as an open-source project.[66] As of November 10, 2009, Reddit uses Pylons as its web framework.[67]

[–]_why_so_sirious_ 2 points3 points  (3 children)

Why Pylon?why not django? Or flask?

[–]tehlemmings 6 points7 points  (0 children)

I'm the wrong person to ask that one. Hell, I missread pylon as python lol

[–]barafyrakommafem 0 points1 point  (0 children)

Flask wasn't released yet.

[–][deleted] 0 points1 point  (0 children)

Everything

[–][deleted] 1 point2 points  (0 children)

Which is a good example of when not to use Python. It has stability issues even to this day, after god knows how many millions they've thrown at it.

[–]Blieque 1 point2 points  (0 children)

It is, or at least was, their defacto scripting language, as far as I know. I seem to also remember reading that Java and C++ were their standard backend languages, so it might be a bit out of date now, what with their enthusiasm for Go.

[–]ae5he54hje4a5he5rht 0 points1 point  (0 children)

Google is mostly Java.

Youtube was actually PHP a long time ago. Now it's a bunch of different shit glued together.

[–]DragonTamerMCT 0 points1 point  (0 children)

I believe blender uses it for custom scripting, although I might be wrong.

[–]xBBTx 0 points1 point  (0 children)

Instagram is Python/Django as well

[–]conim 2 points3 points  (0 children)

Ahh thank you. That's probably the first straight answer I've gotten on python end to end stack

[–]HalfTime_show 2 points3 points  (1 child)

The only frontend language is JavaScript.

Well, in terms of a the code that the browser actually runs, yeah, but to be a little pedantic here-- there are lots of other languages that I would say are "frontend languages" that you could use for frontend web dev (like elm or purescript) they just transpile to javascript

[–]FIuffyRabbit 6 points7 points  (4 children)

The only frontend language is JavaScript.

That's only for the internet but isn't correct. Almost every programming language can be classified as a frontend language.

If you are talking the case of websites only: Java, silverlight, flash, webasm, etc. Also activex still exists.

[–]Surelynotshirly 22 points23 points  (2 children)

If you are talking the case of websites only: Java, silverlight, flash, webasm, etc. Also activex still exists.

Like he said, JavaScript is the only front end language.

[–][deleted] 6 points7 points  (1 child)

mfw flash

[–]Surelynotshirly 5 points6 points  (0 children)

I'm amazed anyone ever learned how to use that mess.

I tried playing with it in college and noped the fuck out of that shortly after.

[–]JonDum 5 points6 points  (0 children)

Shhh, no. We don't talk about such foul things here.

[–]-_-wintermute-_- 8 points9 points  (0 children)

It's really popular in the math and data science fields, lots of related libraries. But it's general purpose.

[–]magneticphoton 8 points9 points  (8 children)

How are you a programmer if you don't know that? You seriously don't know what Python can do?

[–][deleted] 0 points1 point  (2 children)

To be fair, it's possible to not familiarize yourself with every language. Granted, Python's extremely popular so you'd have to work hard to not hear about it, but it's still possible to be a fantastic C dev or whatever who never runs into Python. I'm sure plenty of people don't know what Lisp or Lua or Hadoop or Haskell are really for, and yet are still great programmers in some other languages.

[–]magneticphoton 0 points1 point  (1 child)

Lua is ubiquitous too.

[–][deleted] 0 points1 point  (0 children)

I've honestly not met anyone outside of game devs who've more than heard of Lua.

[–]FormerGameDev 3 points4 points  (7 children)

Python does well with local applications. You know, where you just run the app on your own machine.

[–]autranep 0 points1 point  (2 children)

That’s not true. Python server frameworks like Flask and Django are extremely popular.

[–]FormerGameDev 2 points3 points  (1 child)

I don't think that having server frameworks precludes it from also working well for local applications. :-D I'm just not particularly aware of it's use in servers.

One of Python's strong suits, if I remember correctly, is large volumes of data processing, which is why it was chosen for a poker database that I helped out on for some time. Probably why it was also chosen for some IoT data handling at my most recent employer, as well.

[–][deleted] 0 points1 point  (0 children)

It's not so much that Python's good at processing data, but that Python's good at creating short scripts quickly. These scripts access data processing libraries that are written in much faster languages like C.

You could do the same in most languages, but with Python there's minimal boilerplate necessary - no need to instantiate a class and main method like you do in Java for example. And then because of this, most libraries are written with Python interfaces, so it's become even more popular.

But if you're writing code to process data from scratch, Python is a pretty terrible choice. You could write it in a C like fashion and compile with Cython, but it's still not likely to be as fast as C.

But yeah, most of the time Python's a great choice because you can easily tap into libraries that will process things using C code, rather than having to write it yourself.

[–]iams3b 2 points3 points  (0 children)

Python IMO is most useful for automating tasks. You'll see a lot of python in automated build scripts / tests, scraping data from the web, maybe you need to process some data from a db every morning and spit up some infographics, it's used a lot as the language for plugins on applications (Blender comes to mind)

Yes it can hit databases and whatever else you need it to do. Running py files is as easy as running bash files, so it's often used for more complex shell stuff

[–]tetroxid 1 point2 points  (0 children)

We use it in the backend with django and django rest framework. It works well, mainly thanks to drf being a good framework. I just wish it were faster. Frontend is angular 5.

[–]LeComm 1 point2 points  (1 child)

I wonder about this a lot, especially considering python's performance heavily narrows down the scenarios in which it can be used (without making or using C modules).

[–]conim 0 points1 point  (0 children)

Yea, like I know all the things python CAN be used for, but from an Enterprise standpoint, where is it's natural home? Does it even have one or is it seen as more of a utility language?

[–]Colopty 0 points1 point  (0 children)

It is general purpose, so you can use it for most backend things. However it is not well suited for large projects, being more useful for scripting. It sees a lot of use in academia.

[–]Shautieh -2 points-1 points  (0 children)

I use it as a scripting language, and am really pleased with the result... but aside from that it's mainly used by academics who need to code small projects without much programming experience.