I'm glad that caveat is there, because "Python is simple" is one of the biggest misconceptions about the language. It's actually a very complex language hiding behind pleasant syntax.
It's heavily used by non-programmers not because it's simple but because it's easy, which isn't the same thing [0]. More specifically, Python makes easy things very easy, at the expense of making difficult things even more difficult.
I'm not sure emphasis on very is justified. C++ is a very complex language. Python is just... complex, like every real world language is.
Can you elaborate on this?
I burned myself with Micropython. Sometimes the syntax was wrong but the worst was that reading an input did not gave the desired result. You had to run it twice.
What are some actual simple modern languages then?
>"Python is the new BASIC because *Python is the language that non-programmers always seem to use*"
>"If even a *Python-hater like me* defaults to using Python, then I think it's pretty clear that Python has taken over the world, just as BASIC once did."
1) As a Python fan, I consider this hate speech.
2) I have yet to encounter a software development kit like Visual Basic that makes it easy to write executable files with a GUI.
Lazarus with FreePascal is pretty close with its drag and drop way of creating GUIs and it generates executables.
You know, I am not actually much of free speech absolutist, but this is the kind of statement that makes me more sympathetic to them. When they sometimes express the worry that the category of "hate speech" is going to be stretched to cover any sort of dislike or disagreement, I think this is the kind of thing they have in mind.
I use python, I don’t love it. Don’t really hate it either. You use it because it solves a problem or has a library that makes solving problems easy.
It’s ok for people to have different opinions about what languages they like.
There is a video where someone asked for people to submit python scripts to control his Christmas lights. It was fun but slightly annoying because over half the programs wouldn’t run ( missing libraries/ tab space indenting mis match). He said we would but he tried to install one of the packages on the fly. It installed, he got the same missing package error on rerun. Sort of matched my experience using python trying to get others peoples code to run.
Format strings being the first supporting reason for not liking a language is so funny to me.
- garbage-collected
- opinionated design meant for easy adoption by inexperienced coders
- static type system that is primitive to the point of being stifling
- dearth of abstract, generic language constructs
- lots of boilerplate, especially around error handling
- heavy reliance on code generation
I started on Atari basic in the 80s and having a REPL, even though I didn't know to call it that, was revelatory. Writing a line of code or a little for loop and drawing lines on the screen was a very tight learning experience.
Python approaches that with its REPL and notebooks but doesn't quite match the pedagogical ergonomics I enjoyed 35 years ago with that basic cartridge.
For beginners, python also has some confusing foot guns too, like understanding which objects pass by value and which by reference. It's all part of learning, but when a beginner is still trying to get a handle on variables and functions, it can confound the fundamentals.
Passing by reference means this is possible:
def change_param(ab):
ab = 768
x = 12
print(x)
change_param(x)
print(x)
Expected output in reference parameters, 12 followed by 768.Otherwise it is always a value, even if the value happens to be a reference to an heap allocated object.
Python has no mechanism to change the contents of the x variable used as parameter on call site.
Isn't that true for almost every "mainstream" language?
I think Nim is close, but every attempt to wrap PyTorch dies a miserable death somewhere along the line.
It has tools for checking static types (and the language community strongly encourages their use). Pattern matching was added in version 3.10.
I had quite a bit of success digging QBasic with our son (10yo back then), using this great tutorial which I translated to our language: http://tedfelix.com/qbasic/
Eventually, though, the son dropped his QBasic explorations (I consider it "my fault", since I got burdened with other stuff and couldn't help him as much as I wanted to). And - he dropped it in order to first take up Scratch and then dig straight into - duh! - Python. There ya go. I do think he will need some time to get closures etc intuitively right; in this regard, QBasic was, IMO, indeed, easier to grasp.
I was happy to find a great children-friendly IDE for Python, though - Mu: https://codewith.mu/
Not as "immersive" as the excellent (!) QBasic IDE and its blue screen, but still great. No bloat. F5 for launching the program, etc - and our son started to notice and carefully analyze the interpreter's error messages from first try all by himself. So, all in all, really happy with Mu.
Python doesn't really target non-programmers (IIRC the Steering Council is composed entirely of professional developers, who steer the language towards fulfilling their own needs).
Therefore I expect Python's reign as a language for non-programmers will be ended by a language that targets that audience specifically.
But what might such a language look like? For example, I imagine it will unashamedly dynamically-typed, or maybe have a simple (Go-like?) static type system - rather than the complexity of Python's Mypy/Pytype/Pyright/Pyre.
Maybe the "non-programmer friendly" language could add some kind of FFI to use libraries from another language, but then someone who wants to use it needs to understand caveats of two languages, not just one.
And mypy/pyright etc is not that bad imo - Python is fully dynamically typed, mypy just tries to help when it "knows" something is wrong, but user may ignore it. But I don't know, I've used python for so long that I may be blind to it's caveats.
non-programmers using the language will almost certainly not use type hints.
I suspect most Python code out there does not.
"A good way to discourage me from testing out your software is to require a gigabyte (or more) download (and no, providing an installer that obscures the massive download is not a solution).
The chief offender of inexplicably enormous downloads is, unfortunately, anything related to compiling software for Windows. Want to use the free edition of Microsoft Visual C? That will be at least 3 GB. How about a more modern language like C#? That's 5 GB. Even non-Visual Studio C/C++ compilers tend to be hundreds of megabytes."
The Microsoft practice of burying relatively small executables and libraries inside mega- and now giga- sized downloads dates back to at least the early 90s.
It's common that I'd prefer Ruby but pick Python because it can be expected to run out of the box pretty much anywhere as long as you're conservative with syntax and dependencies (and have automated compat tests).
Its only real interpreted competitors there are Bash, POSIX shell, and Perl, I think.
In particular, if you're based on Debian, the system Python likely lacks several pieces by default that the Python team considers standard: `venv` (https://software.codidact.com/posts/291789) and `tkinter` (https://software.codidact.com/posts/291791) standard libraries, and Pip (not part of the standard library, but has privileged status - https://software.codidact.com/posts/291787). You'll also run into problems (especially with Python 3.11 onward - https://software.codidact.com/posts/291839) trying to install third-party libraries without making a separate environment first (which you should do anyway).
Unsurprisingly, Python is the language I have the most experience with by far, followed by Bash and PowerShell if you count those. All because they're actually accessible from the getgo on the system.
Pyrhon 2 or Python 3 ? /s
"Future-proof programming languages, part 3
March 3, 2023
SDK size (measured on x86_64 Alpine Linux), as a proxy for simplicity
Just looking at SDK size, Rust is an outlier. Even compared to a similarly complex language like C++, the Rust SDK is absolutely huge.
Even after allowing for a build tool, custom linker, and standard library, the Rust SDK is disappointingly heavy.
The other languages show some interesting results: JavaScript and C# appear to be the most bloated, closely followed by SBCL (a Common Lisp implementation).
If I'm just looking for a simple and fast language, that would leave C, Go, and Zig.
C is almost certainly future-proof for another decade or two and the SDK is reasonably sized.
I don't like Python."
Anyway
# JIT-based build
dotnet publish -o {folder} -r linux-musl-arm64 -p:PublishSingleFile=true -p:PublishTrimmed=true
# Native binary build
dotnet publish -o {folder} -r linux-musl-arm64 -p:PublishAot=true
Can build on the RPI too: https://learn.microsoft.com/en-us/dotnet/core/install/linux-...I guess it's too challenging to browse the docs...
- the easy on-ramp (often reads like English, indentation is something beginners can innately pick up)
- batteries included: with the rise in the internet+ the shift to packages, it's really about having enough places you can find workable solutions, and Python's dominance helps here
- integration with other languages has been a key part of Python since the beginning, so you are rarely held back
It does largely fulfill that but there's more! Python is used for a lot of serious stuff in a way that BASIC never really was. ChatGPT is written in Python, the most popular language used by scientists is Python, the CERN accelerator is controlled by Python and so on.
It often seems to function as a bit of a user interface to control more serious code written in C, C++, CUDA or whatever.
But to be fair basically everything can be installed easily and is everywhere these days. Python isn’t everywhere and has to be installed on a Mac or a pc and doesn’t come with it. You could say the same of node or go or anything else that can be installed with a few clicks.
1) Turn computer on
2) Wait 2 seconds
3) Start programming
Python is not BASIC.
2) open your preferred CLI/shell, type "python"
3) start programming