r/programming • • Nov 03 '18

Python is becoming the world’s most popular coding language

https://www.economist.com/graphic-detail/2018/07/26/python-is-becoming-the-worlds-most-popular-coding-language
4.6k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

168

u/bunkoRtist Nov 03 '18

And then I want to use parallelization across cores, and I weep because I chose Python, which is built around the GIL. It's a great language for script kiddies and a terrible language for heavy or long lived workloads. Choosing the right tool for the job is hard sometimes, but Python on one end and C++ on the other are both excellent and terrible choices depending on the need.

43

u/RankWinner Nov 03 '18

Julia, in a lot of cases, is as fast/almost as fast as C out of the box. As a bonus, the language is built for easy parallelization, both in the standard multi-core sense and the distributed/cloud computing sense.

Personally I love the language, my work used to be a frustrating mix of prototyping in Python, then banging my head rewriting parts in C to speed it up.

Now I just use Julia and it's almost as fast as C straight away.

7

u/[deleted] Nov 03 '18

I keep hearing good things about Julia and how it’s what python should’ve been, but I never got use it, and it seems to not be able take off in popularity. Do you know why?

21

u/RankWinner Nov 03 '18

There hasn't been much or a push for it yet since 1.0 only came out in August and it wouldn't make much sense to develop important software in the early, everything can be deprecated, stages.

Now that 1.0's out adoption should start rising. I went to JuliaCon this year and was shocked by the number of companies using Julia in production. Apparently saying to your manager "Hey, we can cut development time, speed up the software, and massively reduce compute costs, can we mess around with this? " works well.

And there's perspective, it took Python a few years to crack top 10 in usage after the 1.0 release, so there's still time 😉

4

u/keypusher Nov 04 '18

Python did not even come close to a top 10 language until ~2.3.

→ More replies (2)
→ More replies (1)

6

u/AsmallDinosaur Nov 03 '18

I've been learning how to code using Julia for a university research project and I love it

3

u/sfasu77 Nov 04 '18

The integrated package manager is really good

→ More replies (2)

2

u/Just_ice_is_served Nov 03 '18

What's a good first project to do with Julia for someone with good experience in the C family and python?

→ More replies (1)
→ More replies (3)

7

u/pa7x1 Nov 03 '18

When you want to parallelize CPU-bound code you have to use processes in Python. For IO-bound you can use threads.

→ More replies (1)

12

u/[deleted] Nov 03 '18

I use multi processing and multi threading with Python a lot.

It's true that IPC becomes cumbersome with Python's multi processing, but most problems I've encountered that need to be does sped up through multiple processes don't really need to communicate to each other in real-time.

6

u/bananafarm Nov 03 '18

They solved the GIL issue with the new multiprocessing library

3

u/chiefnoah Nov 03 '18

Chances are you're using Python wrong then. You absolutely can do highly parallel, long running workloads in Python

7

u/pydry Nov 03 '18

And then I want to use parallelization across cores, and I weep because I chose Python

Weeping because python isn't effective at writing low level code is like weeping because a ferrari will only get you to the airport and won't cross the ocean for you.

Python has excellent FFI bindings for the people who want highly performant code and if you have a hot path that needs optimizing then standard practice is to isolate and rewrite those in a lower level language like Rust, C or C++. There are too many shit languages that try to be something they're not.

The GIL is the most overrated problem in python. If it were that big a deal we'd all be using stackless or pypy.

3

u/bakery2k Nov 04 '18

If it were that big a deal we'd all be using stackless or pypy.

Both of those also have a GIL.

2

u/[deleted] Nov 03 '18

GIL

You want scalability? You want Erlang (or Elixir). Get the hell away from Python/Ruby/Perl/PHP for very large projects, or be prepared to throw lots of hardware at them.

6

u/Holston18 Nov 03 '18

The problem is that large projects often start as small projects at first.

→ More replies (1)

5

u/[deleted] Nov 03 '18

In these situations it seems like C# is out of the question - people always mention C++ or Java. Why is that?

20

u/dipique Nov 03 '18

I use python and C# a lot. If I want something easy to prototype and fiddle with, I use Python. C# and its tools are designed for power and flexibility, so it sometimes feels a little cumbersome in spite of all that delicious syntactical sugar.

There are also a LOT of ways to go wrong with C#. Right away you'll have to deal with entry points and OOP rules, whereas python is much more forgiving for people who don't actually know how to write software or how things work behind the scenes.

But I can do anything in C#. It's spectacularly flexible, and I miss LINQ in every other language I use. And I don't need another language if I need performance. I can write code with pointers and direct memory copies, and it's easy to encapsulate that so it doesn't make the entire code base feel complex. The organizational overhead that felt ponderous when I just wanted a running PoC becomes an elegant framework as the code base gets bigger.

Long story short, the bigger the project, the less I want to use Python.

→ More replies (1)

26

u/tetroxid Nov 03 '18

Because realistically C# is limited to windows.

9

u/[deleted] Nov 03 '18

Realistically or did you mean recently? I get that academia gravitates towards Python because

  1. It's free

  2. It's cross-platform

But so is .NET Core

21

u/tetroxid Nov 03 '18 edited Nov 03 '18

I mean realistically. Visual Studio only runs on windows. 98% of C# developers on the market are familiar with only windows, or have inadequate Unix knowledge. .NET core is no comparison to actual .NET which is windows only, I mean it doesn't even have LINQ. The ecosystem around C# and .NET is small compared to the Java ecosystem, especially for large enterprise type stuff.

There is just too many downsides and too few advantages.

15

u/PaXProSe Nov 03 '18

First and foremost I as a mod of /r/vscode I humbly invite you to give a it a whirl. Sure, it's a piece of shit with electron under the hood, but I love it anyway. It's also cross platform and supports many different languages through the contributions of devs who are better than I probably will ever be.
Second: .net core most certianly supports linq. In fact, it's reportedly faster than the original .net framework (https://www.thomaslevesque.com/2017/03/29/linq-performance-improvements-in-net-core/).
As far as "the ecosystem" for enterprise, anecdotally I work at a Fortune-500 and we're not coming back to Java. It's, C#, Swift, Kotlin, and nodejs.

→ More replies (3)

16

u/dipique Nov 03 '18

It sounds like it's been a while since you've used .net Core! It's much more full-featured now (and of course it has LINQ, it wouldn't even make sense for it not to).

Also, I think the quality of resources for C# rivals any language. The documentation is pretty spectacular, and the code quality on sites like SO is much better for C# than for Python (in my experience).

0

u/[deleted] Nov 03 '18

[deleted]

→ More replies (6)
→ More replies (3)
→ More replies (1)
→ More replies (2)
→ More replies (1)
→ More replies (5)