Live data from Hacker News

Is Python the Future of Programming?

m.slashdot.org

41–50 of 77 posts

Re: Is Python the Future of Programming?

#41
post #30
post #17

Python is stupidly simple and that's the reason I use it for 99% of my work (netsec/forensics). I introduced my ex to it for her dissertation in astro-physics. It took her under a week to mainly self-learn and start writing scripts with numpy and matplotlib, and it was her first language. The code wasn't good by professional standards, but it did the job. I cannot think of any programming/scripting language which can…

NO, Python is not simple at all, especially nowadays with all the asyncio stuff and tons of new features in 3.4+. One can't even follow what's happening with the language. I don't understand where this nonsense is coming from. Probably ignorance? You might not know too much about it to understand how huge and complex Python is.

asyncio is a feature, not a requirement. Most people will never need to use it or the threading library will meet their use case.

Every language will get more complex as you dig into it, but most people don't need to go beyond the surface.

Re: Is Python the Future of Programming?

#42
post #20

I have never got serious about python until very recently(I mean about one week), the more I dive into it the more I am convinced yes python is the future in the sense it does the below: replacing BASIC(i.e. good for beginners) replacing Java in colleges for intro to programming replacing matlab(ipython jupyter) replacing R for ML and big data great for web scraping replacing Perl and probably shell scripts for CLI s…

I think the one area that Python won't fit in is low level languages such as C/C++. I can easily see Rust taking over that space.

Java is never going to go away, but let's hope Scala becomes more popular. Neither is C#.

I'm not really sure where Go fits into the picture.

Re: Is Python the Future of Programming?

#43
I'm not sure. I see so much money being poured into making scripting languages faster [0], and with the "End of Moores Law" in sight I feel like the industry is going to be leaning towards static languages [1].

Perhaps developments in gradual typing will allow for the benefits of quick and experimental development (scripting) that can later be calcified into a sturdy fully-typed program with higher performance (through optimized AOT compilation).

[0] https://instagram-engineering.com/dismissing-python-garbage-...

[1] https://youtu.be/Azt8Nc-mtKM?t=9m59s

Re: Is Python the Future of Programming?

#44
post #16
post #8

Earlier quoted context omitted.

Access modifiers are something that I only ever find to get in the way. I've recently moved to Java from Python for work. The underscore convention in python works fine for hiding stuff from the general public namespace, but its still there if you want to explore how some code or module works. Java really annoys me because I can't access implementation details when I'm trying something out in an interactive shell or…

The point of access modifiers is to get in the way. They're ways of allowing developers of one part of the source to control what the path of least resistance is for the users of that code. If you expose everything, someone will write code that depends against it and make it harder for you to improve or change it in the future. Tossing in roadblocks helps guide users to the better long-term path. It doesn't really ma…

> If you expose everything, someone will write code that depends against it and make it harder for you to improve or change it in the future. Tossing in roadblocks helps guide users to the better long-term path.

> It doesn't really matter for small teams

Doesn't even have to be your team. We encountered this by way of a major library, celery.

I forget all the details, but celery was importing something else (name started with a "k", I think), and that was importing an underscore-prefixed function from uuid. Somewhere between python versions 2.7.8 and 2.7.13, the implementation of uuid changed and that import failed.

Re: Is Python the Future of Programming?

#45

I've never been a heavy Python user myself, but I 'm working in Elxiir w/ a couple other people who are/were heavy Python users. They seem to much prefer Elixir/Erlang's concurrency model over Python's. Scanning the article, I don't see any mention of concurrency, and concurrency seems to be an increasingly valuable tool in a micro service world. Does anyone here have a preference for using Python to tackle concurren…

Very good question! Python have a couple of tools to handle concurrency and parallelism, but it's a mess.

For I/O bound programs, you can use threading (in stdlib). For CPU bound, you can use multiprocessing (also in stdlib). But these have huge overhead, (e.g starting a Python thread costs 32kb memory minimum.) and there are multiple solutions in the stdlib like ThreadPoolExecutor and ProcessPoolExecutor in concurrent.futures beside the threading and multiprocessing modules...

If you want to write async code, there is tornado with callbacks, tornado with the new async stuff, asyncio (tulip for Python2), the new async/await from 3.5 which is very immature. The async part of the ecosystem is like a totally separate whole new world, you can't really mix and match or pick parts from the other, however, there are brave folks like Andrew Godwin how tries to make Django async with not moderate success.

For web frameworks, there are a ton of servers which might fit you, but they are mostly very complex to set up or reason about like greenlets, pre-forked web servers and stuff.

I have 5 years experience with Python, using it every day and once I tried to write a custom SSH server and it took 1-2 weeks to grasp Tornado fully, then I tried the same with Go and WITH LEARNING THE LANGUAGE itself, it took me about 2 weekends and my server was up and running!

TL;DR: You can write concurrent code with Python but it's a mess and you will probably have a hard time.

Re: Is Python the Future of Programming?

#46
post #23
post #16

Earlier quoted context omitted.

The point of access modifiers is to get in the way. They're ways of allowing developers of one part of the source to control what the path of least resistance is for the users of that code. If you expose everything, someone will write code that depends against it and make it harder for you to improve or change it in the future. Tossing in roadblocks helps guide users to the better long-term path. It doesn't really ma…

`foo._a` accessible outside `Foo` but it makes code look gross and means you're doing something wrong. `foo.__a` accessible only inside `Foo` I think it works.

> `foo.__a` accessible only inside `Foo`

It's not all that inaccessible. Try:

    class C:
      def __init__(self):
        self.__private = 'Is it private?'
    
    c = C()
    c._C__private
Double underscore names aren't so much about access control (because access control isn't strongly enforced) as about limiting name collisions (by including the class name in the underlying field name).

Re: Is Python the Future of Programming?

#47
post #19
post #9

Python is one of the simplest language you can learn. It is really nicely designed and executed. If simplicity is the goal, Python has that in spades.

Lua is far simpler, and still easy to learn. Yet it's powerful enough to be used in "real" projects (e.g. Photoshop Lightroom).

Unqualified simplicity is useless metric. Brainfuck is about as simple as a language can be, and people can learn it in an afternoon.

Re: Is Python the Future of Programming?

#48
post #41
post #30

Earlier quoted context omitted.

NO, Python is not simple at all, especially nowadays with all the asyncio stuff and tons of new features in 3.4+. One can't even follow what's happening with the language. I don't understand where this nonsense is coming from. Probably ignorance? You might not know too much about it to understand how huge and complex Python is.

asyncio is a feature, not a requirement. Most people will never need to use it or the threading library will meet their use case. Every language will get more complex as you dig into it, but most people don't need to go beyond the surface.

The most basic things are hard to grasp also. I had a really hard time understanding what is the difference between unicode, str, bytes and how to encode what when I started with it 5 years ago: https://stackoverflow.com/questions/14839028/how-are-these-s...

Nowadays, teachers have to start with generators and yield even for beginners, because most of the things are generators in Python3, which is not a trivial concept to understand when you have no programming background.

Re: Is Python the Future of Programming?

#49
post #33

Python does have two growth vectors going for it right now: 1) Deep learning / data science works really well in Python 2) Lambda functions are really great in Python... maybe people will choose to write servers out of Lambda functions instead of writing high performance servers in Go - who knows? Those are big areas, but still a small percentage of all programming work falls into those two categories.

Sorry, but you don't have no clue what you're talking about. Python is an imperative language by nature, and lamdba is very uncomfortable to use for anything than a simple expression. You can use functional elements up to a certain degree, but it will be a pain if you try to force it to be a functional language; you simply can't go very far with it.

[deleted]

Re: Is Python the Future of Programming?

#50
post #35

Earlier quoted context omitted.

> Lambda functions are really great in Python Hah, if you had told anyone that five years ago they would have been very confused. "What are you talking about? Lambdas in Python are horribly neutered..." Back to what you actually meant, I think that lambda functions will get simpler to use in every language, and I think JS will extend a lead there even though I prefer Python as a language. I should get my "microservic…

I must be stuck in the past. What's great about lambda functions in Python?

I think the parent isn't talking about lambda functions, but about python code deployed on the AWS Lambda
Post reply on HN