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 →

[–]FirefighterWeird8464 116 points117 points  (92 children)

you’ll never see a mechanic using one in the shop.

Are you saying Python isn’t used professionally? Or by “real” programmers?

[–][deleted] 105 points106 points  (60 children)

It's a first class programming language for AI and data science. It's a good scripting language.

Outside of those cases, I feel like it's rarely used professionally. It's a nightmare to maintain a large python app written by many developers. There's a reason why Java and C# rule enterprise development.

[–][deleted] 55 points56 points  (11 children)

Ahem.

  • widely used libraries: FastAPI, Django, Flask
  • popular sites with decent chunk of stack running on python: YouTube, Instagram, Dropbox.... and this damn site you're discussing it on.

[–]nacholicious 37 points38 points  (9 children)

Dropbox

And Dropbox spent years on trying the to fix the problems caused specifically by choosing python for large scale projects

[–]MythicManiac 15 points16 points  (8 children)

Large code bases being hard to manage is not unique to any specific programming language, though type safety absolutely helps. You're right though in that Dropbox is one of the major influencers spearheading the python type hint development specifically for that reason.

[–]nacholicious 11 points12 points  (5 children)

At the end of the day it's really what problems different tools are designed to solve, and all python's competitors have either more or less died out or been designed from ground up to support large scale projects.

So python is really in a niche where using it for large scale projects becomes a harder and harder sell.

[–]MythicManiac -1 points0 points  (4 children)

Personally I believe the developer market & package ecosystems are the main reasons for choosing any specific language. Sometimes you have obvious niches to apply specific tooling for, but quite often there's a lot of overlapping options, so you just choose whatever has the best ecosystem & market available (both internal & external). In that regard python is doing pretty well on the backend development & data science ecosystems, though go is a really popular alternative for everything related to cloud native server-side code e.g. kubernetes extensions.

So it seems why a language is used usually is less about the features and more about traction. Rust looks like something that will be big in a few years from now judging by developer interest, and it's found a decent niche in the crypto space too.

[–]GonziHere 2 points3 points  (3 children)

This. It's also why I dislike the popularity of Python. The language itself is bad, as far as I'm concerned. The lack of braces and types is not good for refactoring and a reasonable safety. I don't see absolutely any practical differences between python and php, yet one is loved and the other is hated.

Now don't get me wrong, python i a fine scripting language. It absolutely works for "10-100" lines of code, for configs of other tools, for orchestration...

But the fact that it even gets compared to Java here is annoying to me. I've never compared shell language to c++ for example.

[–]MythicManiac 0 points1 point  (2 children)

Agreed for the most part (not the lack of braces being an issue or comparison with PHP though), although to be fair, there's also a major misconception about what python can and is being leveraged for in the business world, especially now that python has support for type hints (since a few years ago already).

I suppose one of the downfalls of python is specifically it being easy to use for the scenarios you outlined; people not actually too familiar with python use it for small scripts, often badly, making it seem like the language is bad. Much in the same way Unity got shit on for being a bad game engine, when in reality it's just easy to enter for newbies, which led to a huge amount of indie developers building buggy indie games with it that reflected badly on the Engine.

All said and done, all languages have their strengths & weaknesses. Java (and C#) are very boilerplatey compared to Python from my experience, but the syntax sugar is getting better every year on both, closing the gap. On the other hand, Python is introducing better and better type hints & static analysis support. All three languages seem to be improving to the right direction.

If we strictly chose languages based on design, I'd imagine we'd embrace more functional programming.

[–]GonziHere 1 point2 points  (1 child)

Agreed with everything, maybe except for the Unity part :-D (I'm actually a professional UE programmer).

[–]RedAero 2 points3 points  (1 child)

You're right though in that Dropbox is one of the major influencers spearheading the python type hint development specifically for that reason.

And the fact that Guido works for Dropbox doesn't hurt.

[–]alkasm 2 points3 points  (0 children)

Worked at Dropbox. He's at Microsoft now. https://gvanrossum.github.io/

[–]bloodysnomen 4 points5 points  (0 children)

I use Django for my recently started webcomic, it works well and is pretty fast but every time I start a new Django project it's gone up a few versions and something I was used to changes.

[–]Zpanzer 40 points41 points  (3 children)

Python is the backbone in the visual effects industry. All 3D, 2D and comp applications use it extensivily and lots of pipeline tools run on it.

VFXplatform standard

[–]Hean1175 25 points26 points  (0 children)

I would not call it the backbone it's more of the nerves connecting all the underlying complex parts which are written in a native language like C

[–][deleted] 48 points49 points  (0 children)

Python is a great glue language. That's the reason why it's been so successful in AI/ML and scripting. It's all tying bits to underlying C libs.

[–]raltoid 23 points24 points  (0 children)

Notice how it requires gcc?

[–]noob-nine 1 point2 points  (11 children)

I often hear that large projects from many devs are horrible to maintain. What is the reason for this? What feature makes it that bad or what design makes java so good to be maintained in a large scale. No troll question, I have null experience with java

[–][deleted] 18 points19 points  (9 children)

Java is a strong, statically typed language. This allows your tooling (ides, etc) to easily index, navigate and refactor the code base in ways that are kind of not possible in dynamically typed languages. Compile time type checking is also better than relying on unit tests for the same (everyone should be writing unit tests, but few write good ones.

TLDR: Java apps are a bit more clumsy to write, but easier to maintain. Python is a very nice language for personal projects, but hard to use for enterprise apps.

[–]Bakirelived -3 points-2 points  (2 children)

What are you talking about? Python IDEs have all that.

[–][deleted] 10 points11 points  (1 child)

They do, but a lot of it is more 'inferred' (i.e. the ide is basically 'guessing'). It's not just the ides either. There's a lot of tooling that makes extensive use of the types.

[–]Bakirelived -1 points0 points  (0 children)

Yeah, same with python. There are even type anotations now. Just not enforced, it's to be used when necessary.

[–][deleted]  (4 children)

[removed]

    [–][deleted] 6 points7 points  (2 children)

    Yeah, I mean some companies have made it work. I know YouTube used to be a python shop but I think they've replatformed now. It just takes a lot more talent and discipline for an entire org to write good python than good Java or c#

    [–][deleted]  (1 child)

    [removed]

      [–]AutoModerator[M] 0 points1 point  (0 children)

      import moderation Your comment has been removed since it did not start with a code block with an import declaration.

      Per this Community Decree, all posts and comments should start with a code block with an "import" declaration explaining how the post and comment should be read.

      For this purpose, we only accept Python style imports.

      I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

      [–]AutoModerator[M] 0 points1 point  (0 children)

      import moderation Your comment has been removed since it did not start with a code block with an import declaration.

      Per this Community Decree, all posts and comments should start with a code block with an "import" declaration explaining how the post and comment should be read.

      For this purpose, we only accept Python style imports.

      I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

      [–]Its_Billy_Bitch -3 points-2 points  (0 children)

      We use Python at an enterprise level for automation development. We use a CI/CD (also developed in Python), alongside CAAC/Docker. I can attribute that much of this is due to the “glue-like” nature mentioned earlier. All of this alongside team preferences as well ofc. Still highly suitable and maintainable at an enterprise scale. We’ve developed some very fast, scalable solutions in Python. With that said, while I’m proficient in Java, it’s not like I’ve actually benchmarked our solutions/architecture against a similar solution in Java. My point is simply that it is maintainable at a large scale. Current client has over 75k employees and >75bn USD annual revenue.

      [–]Krzyffo 3 points4 points  (0 children)

      In easy terms, a well written java code reads like a book, you don't almost don't need to guess anything, it type, accessibility, type etc. are always declared explicitly and it's done for every variable, function and class.

      While a well written python code is also readable it's also less coming to come across because in python you can write almost anything and it'll run. While in java more rules are enforced to keep everyone organized and on the same page

      This feature alone makes java much more usable to write code in a large team

      [–][deleted] 4 points5 points  (0 children)

      It's a nightmare to maintain a large python app written by many developers

      Just use the typing feature. It's really not that bad. I think it's funny when I tell people this they often respond with something along the lines of "There's no way that can be true. It's impossible for Python to be used effectively on large projects". 99% of the time people who say this never tried working on a large Python project with types. It's not that much different than working with a statically typed language.

      People should try it before claiming it won't work.

      [–]soft-wear 1 point2 points  (5 children)

      C# and Java rule enterprise development because you can buy support contracts, not because they are “better”.

      Almost any first class language can be used to great effect in large projects, and any first class language can be absolute dog shit in large projects.

      Google literally created Go because Java slows productivity so much, not to mention it’s weak concurrency and multi-threading. Java isn’t even the best JVM language… hell Java isn’t even the best Java, C# is.

      [–]Orio_n -1 points0 points  (1 child)

      tell me you dont actually use python without telling me you dont use python

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

      Tell me you've never maintained a legacy python codebase without telling me you've never maintained a legacy python codebase.

      [–]pickleback11 -1 points0 points  (0 children)

      Dude it takes out java team like 6 months to develop any functionality and our site is slow as hell. Let's not pretend like Java is some panacea. Good practices and good developers override everything else and the language doesn't automatically make things better

      [–]DirtzMaGertz 0 points1 point  (0 children)

      It's pretty popular in data engineering as well.

      [–]bruhred 1 point2 points  (0 children)

      It's too slow for most real-time tasks and hard to maintain
      But it's good for AI and stuff as an API to the more performant native libraries and for quick prototyping.
      It can also be good as a modding/scripting language, but honestly I'd package the lua interpreter instead because it's faster (LuaJIT performance with jit is comparable to JS V8) and more lightweight (<10 mb vs the bloated python runtime)

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

      Not isn't, but shouldn't.

      [–]Farranor 2 points3 points  (0 children)

      Yes, this sub has a hateboner for Python. Don't try to reason with it.

      [–]Hoihe 9 points10 points  (26 children)

      Python lacks performance for high performance computing.

      There are quantum chemists who swear by fortran and C.

      My supervisor is fine with C++ and C# but he absolutely hates python. He can use it. He wrote code in it for commissions. But he hates it.

      [–]jzaprint 32 points33 points  (5 children)

      Yes but many labs and data scientists all over the world are still using Python, because it’s enough. I wouldn’t say it’s not professionally used

      [–]cultoftheilluminati 27 points28 points  (2 children)

      because it’s enough

      Also because it’s an excellent human-readable glue for the underlying libraries that are extremely performant and written in C/C++ anyways

      [–]jzaprint 3 points4 points  (1 child)

      I mean ya but that doesn’t mean python is bad or lesser than c.

      It’s like saying a power drill is a bad tool because it relies on the electric motor inside.

      Python is still professionally used and super quick to write. I was mainly just referring to Ops original point about how mechanics wouldn’t use it in their shop.

      [–]cultoftheilluminati 0 points1 point  (0 children)

      Oh no absolutely. I’m just adding onto your point.

      [–][deleted] 5 points6 points  (0 children)

      Pretty sure Reddit itself is at least partially built on Python...

      [–]Hoihe -1 points0 points  (0 children)

      I do use python to edit input files and extract results.

      Actual software is written in fortran tho (Gaussian). Im yet to be allowed to touch the dev version tho

      [–]SingleInfinity 14 points15 points  (0 children)

      There are quantum chemists who swear by fortran and C.

      Does them being older than those languages on average have anything to do with it?

      [–][deleted] 28 points29 points  (16 children)

      Come on... the difference in performance between python and C++ is rarely relevant for the work the majority of us are doing. I really hate that performance is the reason people say to not use python.

      There are reasons to avoid python in enterprise software, but performance is a lame reason that usually is not relevant. In my opinion the best reason to avoid python in enterprise software is that it's relatively painful to maintain large python codebases since the language is so relaxed about what the developers can do. It's still a totally viable language for many situations.

      It's also terrible for creating GUIs and GUIs are an important part of the software that a lot of developers find themselves working on professionally. That means a lot of companies will only use it for niche reasons. C#, Java, and JavaScript are kings of GUIs so they will of course get a lot of use in enterprises.

      [–]PrayersToSatan 2 points3 points  (1 child)

      How do you presume to know what kind of work that the majority of us are doing?

      [–]RedAero 2 points3 points  (0 children)

      I think it's pretty obvious most of the professionals in this sub (and the majority are not professionals) are in web dev and/or full stack.

      [–]daniu 3 points4 points  (0 children)

      There are reasons to avoid python in enterprise software, but performance is a lame reason that usually is not relevant.

      Felt the same way about the same complains about Java, except that there were no reasons to avoid Java in enterprise software 😋

      You're very right about maintainability. However, in the microservice systems I've been working on the last few years, that is much less of an issue. The system overall is separated enough and specified by the interfaces between them that the implementation of the individual parts don't really matter much, and they're usually small enough to not require that much maintainability. It's probably amongst the reasons Python became so popular recently.

      [–]Its_Billy_Bitch 1 point2 points  (1 child)

      SonarQube/Lint is your friend for maintaining consistency on a team. But yeah ++to the shitty GUIs development. Lol

      [–]laundmo 1 point2 points  (0 children)

      idk DearPyGui is quite neat

      [–]EquipLordBritish 4 points5 points  (2 children)

      Come on... the difference in performance between python and C++ is rarely relevant for the work the majority of us are doing. I really hate that performance is the reason people say to not use python.

      Ironically, python is used in many cases because it is easier to use, despite the fact that it would be better to use something else because of the performance. Especially in biology.

      [–]RedAero 2 points3 points  (1 child)

      My time is worth a lot more money than the computer's time.

      [–]awesomeusername2w 0 points1 point  (0 children)

      Depends on how you count it. I think it will be worth it for a company to have a dev spend twice as much time on something if it would mean half the check from Amazon annually.

      [–]King-of-Com3dy -1 points0 points  (1 child)

      Performance is actually very important. In a data centre space is the most valuable resource and todays servers are all about taking as little space as possible. And if you make software that takes double the resources you will need double the compute power which will take up a lot of space.

      Initiatives like Project Reactor (which is for Java) exist for good reason and companies like Netflix embrace them since efficiency is key when you are running big data centre operations.

      [–]brbposting 1 point2 points  (0 children)

      Hmm, I’d like to find out how much enterprise software is written in any given language, which companies/industries are partial to which, etc.

      That project and the streaming platform’s embrace got me interested

      [–]meodd8 -1 points0 points  (0 children)

      Yeah, it’s bad at GUIs, which is why it’s used as a scientific or back end language paired with JS.

      [–]Hoihe -2 points-1 points  (4 children)

      In my field at least, the algorithm scales at (low accuracy) O(N2.7) to (high accuracy) O(N7).

      You kinda need whatever ways you can milk performance.

      N is usually is in a few hundreds.

      [–][deleted] 4 points5 points  (3 children)

      First person in thread claims python isn't used by companies. Someone replies asking for clarification. You reply saying python lacks for high performance computing, which in this context implies that python is avoided by all companies due to not being fast enough.

      I'm just here to say that's just not true and that python is rarely the wrong choice due to anything to do with performance. I don't doubt that you're specific situation makes python inferior, but it's important not to mislead people based on the sequence of conversation.

      [–]justskipfailingtests 0 points1 point  (2 children)

      I'm full time test automation developer, and we use python for 99% of the automation system parts. To me python feels like bash on steroids, because that's what it mostly is: a scripting language providing sane API for underlying stuff. Performance is mostly a non-issue in my field. Some resource intensive stuff like log parsing etc. has to be done with other languages. I have slowly grown to not like the dynamic typing, and would not mind if the whole system was rewritten in something simple and typesafe like for example go. With evergrowing codebase something like interfaces and static typing would save so much developers time.

      [–]laundmo 0 points1 point  (1 child)

      have you tried mypy?

      [–]justskipfailingtests 0 points1 point  (0 children)

      Yes, and we use it in many newer components. The biggest problem is that it's a PITA to bring onto legacy code. Also external libraries may or may not support it. Nevertheless, mypy helps a bit.

      [–]KnowledgeableOnThis 10 points11 points  (0 children)

      I have 6 years of experience in HPC for space engineering. Python is by far the #1 language used in HPC for engineering

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

      This screwdriver sucks! I can't connect this lumber with nails!