by exabrial · 7y ago · 0 comments
No it's not. Significant whitespace, underscores that mean things, lack of type system (but people treat variables as typed anyway), et all, make it quite a difficult language to understand. And we won't get into performance problems that it's cult following turns a blind eye to.
I will say Python has inspired a generation of languages that got away from the C-inspired syntax. We're moved to critically thinking about _why_ we write code the way we do, rather than simply accepting things because "that's the way it's done" and for that we owe Python a great debt.
I won't defend beauty, as that's extremely subjective. I happen to find the whitespace significantly more intelligible than nested braces and parens, but that's me. I know plenty of people who strongly prefer to have braces and parens, so no argument from me.
Everyone loves to bring up performance as a huge drawback to Python, but it never holds up as a fundamental problem. Yes, that means for specific problems, it's not suitable. But the same can be said about many languages. Fortran is a horrible language to try and build a web framework on top of. Lisp is a bad language to write an OS in. Programming languages are tools, choose the right one for the job.
If you need blazing fast processing of numerical data, choose the proper tool. If you want fast iterative development with a broad set of packages and an active community, Python is a suitable tool.
I do agree that the growth in new languages is amazing, and greatly welcome them to the the toolbox that is programing and software development.
Beg to differ. Lisp machines were huge, back in the day, and there are still hobbyist projects like https://github.com/froggey/Mezzano
There's a reason why most OSes are not written in Lisp, and it's not because the OS writers aren't smart enough to learn Lisp. It's not because they don't know it exists. It's because there are better languages to write an OS in.
This is different from someone working on an OS in, say, C. They just pick some C compiler and use it, without becoming a C researcher and implementor.
(They might bemoan some things happening in the development of the compiler they are using that affect their work, but not actually take that on.)
OSes aren't written in lisp because lisp isn't terribly popular, and subset of lisp programmers who are interested in OSes is pretty small--this is a much more interesting factor to look at than subset of OS programmers who are interested in lisp.
Given that it's been decades, I think it may be safe to say "If Lisp were a good language to write an OS in, we'd see more than hobbyist projects and the Lisp machine companies would still be offering them."
(The need for garbage collection caused a bit of a stumble for the Lisp machines on the market, if I recall correctly).
Of course there is issues, as there is with ANY language.
Stop these silly language wars...
Since then I've watched people use it as an application or systems programming language and I don't really get it.
To me it's a great Swiss army knife scripting language.
But yes, I think you're right. There are far more "elegant" programming languages. I never got the sense that that was Python's niche, though.
"Intuitive" is a word for "stuff I already know". Symplectic geometry is unintuitive until you learn it. Learn stuff.
Python has a type system. The types are on the objects, not the variablenames. If people threat variables as types then it's their misunderstanding.
That being said, simple static analysis definitely has its advantages, but it's not so useful that it needs to eat the world.
Unlike say, for example...?
Python 3 has introduced syntax to optionally declare types in the source (type annotations). This does not affect the runtime. Mypy is a program that does static analysis to tell you where your code is inconsistent with your type annotations, so:
a: int = "foo"
Will compile to bytecode and run fine, but if you run mypy it will warn you that you're not supposed to assign a string to a.I don't hate python just lazy windows ports.