As any other scripting language interpreter?
Some are better than others. Python is just old enough where ease of building from scratch was never a goal at first, everyone assumed everyone would be using official build and that would be good enough. But then the library dependency hell (which exists in nearly all mature languages) reared it’s head and an easy solution to it became bundling everything including interpreter. That means often rebuilding everything in all kinds of environments. Add to that a hot mess of localization support that still is not fully fixed even in the large backwards compatibility breaking update that was python3 and you have a cinderblock wall when it comes to building in anything not resembling typical dev environment.
It’s a cinderblock wall with construction crane hooks for portability. They are there in theory, but in practice you 1) have to know they are there 2) have a crane 3) have a road access for the crane 4) have a city/FAA/EPA permit to operate the crane in the area 5) hope that your crane has fixtures that fit the hooks 6) … and then yeah, it is portable.
Quite a while ago I was interested in Python.
Then the debacle between Python V2 and V3 happened. The change itself seemed logical, but the way it was handled was simply atrocious.
The whole langue seems to be slapped together patchwork. I mean, what sort of moron comes up with a construction like:
if name == “main”:
just to get a normal entrypoint for a program.
I also thoroughly dislike the absence of declaring variables before their use. If you mistype a variable name, then python just invents a new variable, and you won’t even know this unless you try to run that part of the code and it fails to work as expected.
Then I wrote a little loop to add items to a list…
It turns out you have to declare an empty list before you can add anything to it.
Then there is some horrible construct to reach “global” variables when they are hidden by local ones.
And please don’t even start about the horrible dependence on whitespace. I once tried to file a bug report for the meld merge project, where a line that should be in a for loop had lost some spaces, and it was executed after the loop instead of in the loop.
The whole python thing feels like a quickly thrown together bunch of idea’s without solid design behind it and all holes that are found get patched in some way. It is a sloppy language, that attracts sloppy people, and there are a lot of those, and that is probably why it became popular.
Things like that made me loose all interest in python very fast. I still dabble a bit in python every now and then. Not because I like the language, but only because it has become the de facto standard scripting language in a lot of programs I like such as KiCad, FreeCad, and Sigrok / Pulseview.
So I think it is more suitable to write some short scripts, because then the developer can remember exactly the name of the variable
Python is a tool. Sure, it has lots of ways to misuse and it can be argued that a good tool should be hard to use incorrectly. But literally every programming language has ways to be misused and choosing a language based on that is not a good idea.
Good programmer chooses language that best fits the job. Python is great for a lot of projects, bad choice for others. Same as C/C++ is great for a lot of stuff but is horrible for web development.
Specifically for KiCad python was a great choice for scripting.
Most things you listed I disagree with and some are just incorrect but we can discuss it in another topic if you’d like.
That will never be a case IMO, let’s take for example a much more simple and also physical tool, a hammer…
Hammer is an equivalent of a punch card programming. Old, primitive, works but needs skill and a lot of sweat to do the job.
Modern programming languages are more like heavy construction equipment. Still need safety precautions but you don’t do the physical work anymore, instead guide the machinery to do your bidding. And good heavy machinery has lots of built in safety mechanisms to prevent the inevitable poor schmo from losing his limbs.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.