I have a couple of small tools which work well. One is basically a 200 loc script that coverts files.
The moment you need multiple files, the project is probably big enough where you really need a strong type system.
Java and C# fit extremely well for this. Both have caught up in terms of ease of use. The latest .net let's you run a C# file individually like a bash script.
The gift and curse of python is that it's really easy to do a lot. So you can be sloppy , just tossing stuff in, up until issues start to arise. Next thing you know you have a giant code base no one has any chance of understanding.
Still, it's a great first language. You can make small tools within a month. C isn't nearly as forgiving.
If you love the Python syntax, Nim is here.
If C and Python are the only options I would strongly vote for C being the first. It will weed out those who are unfit.
Myself I use many languages including Python but I started programming by entering machine codes in hex. Obviously I do not do it now but I think it did benefit me in general.
Python can help a bartender write a small application to track her stock for example. In fact with a bit of computer vision this can work very well.
I originally just wanted to make small games, I was hacking together sloppy JavaScript. I don't like gate keeping.
The future is probably even a higher level language than Python. Maybe an embedded llm that sorta decides what to do at runtime.
>" I don't like gate keeping."
I hate it too. Cheers.
>"higher level language than Python"
I do not see Python as a high level language. Sure it is not assembly but that's about it in my opinion.
Python is high level insofar as it's very far from the metal, and insofar as you can define quite sophisticated abstractions. Would I use Python to write a compiler or sophisticated graph algorithms? Probably not if I had any choice in the matter. But it has proven to be a great language for experimenters in numerical analysis, data science, machine learning, etc. who don't care (and don't want to care) about how the machine works.
And you also have a bunch of low-level embedded engineers barely making 60K or so.
I don't really care about how a computer works, like most of us probably don't care how a car works. We just know it gets us to where we need to be.
Python, can get you a working rest API in 10 loc. Try that in C.
The original sin of Python ( arguably JavaScript as well) is these languages were never meant to scale to large code bases. VS Code and other IDEs use various tricks to help, but it gets weird.
What industry? I know low level stuff but do not get hung up in it. I run my own company and develop enterprise grade products for clients. I make well above 60k
In my experience it's much easier to write Python or JavaScript at a professional level vs C or another more difficult language.
I think it's calmed down, but for a while Ruby was hot and you had 300k TC jobs demanding it.
The highest paying job I've had so far had us using Python. Fintech loves Python. Maybe one day I'll get a job at Jane Street.
Python's not fun in a larger code base though...
Edit: I'm actually a bit intrigued as to what you consider professional programming. As far as I'm concerned if I write code and I get a paycheck that's professional.
Sure, python is an ok glue / script to call bunch of specialized libs doing some calculations and display the results. This has nothing to do with professional programming. And I agree that data scientists do not and should not give a flying fuck about how machine works.
>"Please do not give us other FP users a bad name :)"
I can't decipher his attempt on humor but just in case: FU ;)
- runtime optionally type checked interfaces
- make depending on system python an antipattern
- a reasonable package manager with lockfiles and transitive dependency versions
- package org namespaces
- steps towards hermetic builds with less linking against system libraries and dependencies
- cleanup and slimming down of the standard library. Removal of cruft. Less "batteries included" so people lean more on packages and enforcing good practices with packages.
Python is too flexible. It produces sloppy code.
And in no world are Python builds and dependencies solved. It's a major headache.
For that matter, one of those dependencies, `pyparsing`, is around 10k lines installed (and the repository is much larger with tests etc.). That's with it not having any dependencies of its own.
There is no real barrier anywhere around the 1k loc mark. The problems large projects run into have more subtle causes.
Look, is correct to understand that the BEST way, the BEST refactoring of all, is to change to a language + libraries that fix core issues (similar how you can't outrun a bad diet you can't outrun bad semantics)
BUT, also change it means lose a lot of nice things.
For example I move from python to F# and then Rust, for what I say that is now the best overall decision at all, BUT I miss dearly Django (and instant run and REPL)
IF I could get Django (that means transitively use python) and get better type system and perf from it, I could consider it and surely use it, like "python get as swift or go but with rust algebraic types, whatever it means to get here and yet is Django and python. ok?
Is unreasonable? but sincerely, it will nice if the best ideas get retrofitted in other languages because, well, I wish everyone get as more nice things as possible instead of keep with suboptimal options (that is what I say: breaking languages is not something that must be forbidden forever)
Is unreasonable? (I say again) could be, but I think is a good thing to explore. Maybe is not that much, and if at the end things get better, great!
> They do not enforce it. It's not about "can do". It's about defaults and enforcing stricter standards.
How exactly do you want to "enforce" an "optional" runtime type check for an interface, that is different from opting in by calling `isinstance`?
For that matter, `TypeError` exists and is raised non-optionally by all sorts of things.
> And in no world are Python builds and dependencies solved. It's a major headache.
For your specific set of dependencies, perhaps. Lots of people are using Python just fine. A large majority of what I'm interested in using would install fully (including transitive dependencies) from pre-built wheels on my system; and of those wheels, a large majority contain only Python code that doesn't actually require a build step. (Numpy is the odd one out here.)
In fact, of the top 10 largest packages in my system's `dist-packages` (all stuff that came provided with my Linux distro; I respect PEP 668 and don't let Python native packaging tools touch that environment), at least 9 have wheels on PyPI, and 4 of them have `none-any` wheels. (And of course, tons of the smaller ones are pure Python - there's simply no room for a compiled binary there.)
---
For posterity -
make depending on system python an antipattern
uv is virtual env, uv managed python executable first,
opt in to system python packages only a reasonable package manager with lockfiles and transitive dependency versions
uv.lock, check. I think base pip also has transitive dependencies, though, and has since 2020? steps towards hermetic builds with less linking against system libraries and dependencies
I know there's build isolation for dependencies in uv, I'm not sure it solves the problem you haveWhat is it you mean by package org namespaces?
> What is it you mean by package org namespaces?
eg. `google/protobuf`. An organization would parent all of its packages under its namespace.
> uv is virtual env, uv managed python executable first, opt in to system python packages only
A project should blow up if you attempt to use system python. It should not work.
`python main.py` should handle all of this for you.
An ideal Python would work like Rust's cargo. And there would be only one way to use it.
You keep seeing this come up because it's still a systemic issue with the ecosystem. Python needs to enforce this top down.
If you're talking about what you write in the code to import it, nothing prevents anyone from doing this. They just don't, because PyPI is a free-for-all by design.
If you're talking about names used on PyPI, see https://peps.python.org/pep-0752/.
But this is not a language feature.
> A project should blow up if you attempt to use system python. It should not work.
Why?
> `python main.py` should handle all of this for you.
How could it, given the issues you've identified?
> You keep seeing this come up because it's still a systemic issue with the ecosystem. Python needs to enforce this top down.
A very large fraction of Python users (whom you'll likely never hear from because they have their own ways of sharing code amongst themselves) actively don't want that kind of enforcement.
A project should blow up if you attempt to use system python. It should not work.
Disagree here - an environment is an environment. Yes, the system python environment is kind of shit, but it does provide one - if a package cares about where exactly it gets dependencies, other than "here's a directory with packages", it's doing something wrong. I'm not sure how you'd enforce that, as nice as it sounds from the point of view of getting system python to go away. `python main.py` should handle all of this for you.
Have you seen https://docs.astral.sh/uv/guides/scripts/ ?Just to be clear - I agree with you. My impression of the python packaging ecosystem has been that it's kind of shit, various tries have been made at fixing it with various tools, all of them have had issues with one workflow or another. But things are now trending in a much more positive direction.
Pip has attempted to resolve and install transitive dependencies since even before 2020. That's just when they introduced a new, backtracking resolver (which can be slow because it is thorough and simple-minded about its backtracking).
"hermetic builds" sounds to me like it's referring to packages that don't depend on system binaries being present, by the magic trick of separately providing them (even if redundant). That's... just a wheel.
But also: currently, Python 4 is out of the question, and even if it were in play, "we should take this opportunity to integrate package management into the language" would be completely out of the question. That's just not how Python's politics work internally. There is generally pretty broad agreement anyway that the reasons packaging problems are hard to solve in Python (in the places where they actually are) are: 1) people don't agree on the design for a solution; 2) all that code in other programming languages that people want to interface with from Python (which, to be clear, is not something they're trying to get rid of); 3) backwards compatibility concerns. Making a clean break is not going to help with the first two and is directly opposed to the third.
The tragedy of Python 3 is that they made the community go through a billion dollar migration but didn't tackle any of the hard stuff. And the reason they didn't was the Perl 6 debacle. So it's all Larry Wall's fault.
Python could do with more major version upgrades, but small scoped upgrades that only change tiny, manageable pieces. Forcing a good package manager on all Python developers would be a good candidate for this.
No, just no. If anything, Python needs more batteries built-in.