Console? good, GUI? good, game dev? use Godot engine with its similar language Gdscript, but what else? Ive been seeing AI, Data Science stuff, but whats the point if ita slow?
define slow.
my life has been in C style languages but even i kniw python us a great general purpose language. are you going to use it for high frequency trading? no but most things dont need that speed.
yes its used a lot in ai but also for a ton of linuc scripting. i dont think anyone uses perl anymore.
so in what way was it slow when you used it? what micro seconds were you lookong for?
I started off with programming languages that compiled into binaries. I knew dos and bash well enough but wanted the convenience of scripting, just type in run, no compiling needed. I also wanted it to be cross-platform.
I chose Perl. TBH I loved it, but I kept hearing about all the cool things that would come as soon as Perl 6 was released, so I started waiting, and waiting, and waiting…
The XKCD comic, import antigravity, is literally what convinced me to try python finally. Haven’t really looked back, even 13 years later when Perl 6 was finally released
Python is slow enough to notice in fairly normal usage. Just doing lookups into a dict with thousands of entries, for example, will lead you to researching how to sort and index it.
Python’s great as an interface to C which gives it the illusion of performing well.
I wrote a console tictactoe game with primitive AI opponent using both Python and C++ and python takes more time in the background process before making a move than in C++.
Yeah, computationally intensive stuff is going to be slow when implemented in Python. You will find lots of data science libraries for Python that do computationally intensive stuff, but they’re then generally implemented in C/C++ or Rust, with only a thin API layer written in Python.
Things I do in Python don’t require speed
People who say “Python is slow” are generally wrong, yes, the language is slower then C in basically everything and it also almost always doesn’t matter.
The bottleneck in a console app is not your applications ability to process, it’s your ability to read and type, you will have the same experience in any language.
The same is true with GUI apps, python GUI apps are generally just bindings to toolkits written in other languages like pyqt is a python wrapper around a C++ toolkit.
In actual gamedev, something like Pygame is using SDL which is a C library.
YouTube is a python web app.
Yes, python is slow, and generally it doesn’t matter, if it’s slow then it’s usually a PEBCAK problem. Python is primarily used as an easy to write language that is gluing together more complicated things written in faster languages.
Like bash, but readable by humans!
By the time you finish your C script, compile it and run, Python developer will already have finished. Speed is relative.
Slow depends on the use case. If your main bottlenecks are in code that people have written highly optimized lower-level libraries for, it could be slower to roll your own implementation or use a less mature library in a different language. And in some cases it might not matter if you take 1 ms or 100 ms to do something.
It works the other way too, and you have to weigh the pros and cons of your specific case when you choose a language. What level of abstraction do you want to work at, how stable do you need the toolchain to be, how familiar you are with the language, what’s supported in the language, how easy is it to do what you want, what’s the norm in the domain you’re working in, etc.
Assuming this is a genuine question and not just trolling.
Python’s main feature, IMO, is that it’s easy to pick up. You don’t need to remember to put a semicolon after nearly every line, so you don’t need to remember which lines don’t need it. Basically you only need to remember to put a colon before an indented block.
Thanks to significant whitespace even bad code will be moderately legible.
Control flow and loops are basically written in plain English:for i in range(17):as opposed to e.g.for (int i=0; i<17; i++) {.
This all reduces the mental load and thus leaves you with more capacity to focus on the task you’re trying to solve.
It’s a great language to give to your mathematicians, data scientists and other people with rudimentary programming knowledge at best.As for the performance: interpreted languages are inherently slower than compiled ones. You don’t get a speed boost from first asking a separate program to translate the next line of code into a machine readable format before executing it. Just like you don’t get a speed boost from executing all your code in a virtual machine. Looking at you, Java.
But you don’t use python for the compute-heavy tasks. You use it for the plumbing in between and outsource the computation to a native library with python bindings, like NumPy, Pandas, PyTorch, etc. Horses for courses.Because it is easier to read large codebases of Python than large codebases of Bash.
In my experience, GUI was horrible because of the GIL. Python is nice because you can write and read it quickly, and packages like numpy allow you to use very natural syntax. Most of the numerical packages wrap C/C++/Fortran binaries which are very optimized. You just have to keep in mind not to do that kind of stuff directly in Python, write tight loops, etc.
pish posh
Python is a good first language to learn programming because the syntax is easy (eg. no semi-colons at the end of each line).
In particular you’ll be able to switch to Julia with ease.



