Why People Use Python Even If It’s Slow

preview_player
Показать описание
Why Python Is Popular But Slow

"Clean Code Friday"

Follow me on:

--------------------------------------------------------------------------------------------------------
GEAR:
Рекомендации по теме
Комментарии
Автор

I'd argue speed often is everything, it's just that the relevant speed includes development, not just run-time.

AHR_James
Автор

to me the brilliance of python is that it can be used to glue together lots of libraries in c++ or rust to speed up development time of stuff that leverage those libraries while still benefiting from the speed of compiled languages.

cambamboozle
Автор

In c++ you can divide an int by a float too. all you need is a decimal point. Integer division is used by default for math between int and int, but oftentimes that is exactly what you want. Forcing float math onto everything is more annoying than helpful.

benebene
Автор

Most of the "arguments" used to explain the slowness of Python actually don't make any sense (or are deliberately oversimplified to take into account the audience's level of knowledge?). Python is slow for a couple of reasons. One is being interpreted, so the compiler (that doesn't exist) doesn't have that chance to optimize out the code and make It faster. It has nothing to do with "environment" or "dynamically typing". However, if you compile your C program with -O0 (no optimization), it still will run faster than Python. So it takes us to the second point. It's dynamically typed at runtime. It means that operations cannot be optimized for specific types, and all inferring needs to happen every time, during runtime. In languages like Julia (dynamic and JIT-compiled), however, the compiler is able to infer the types at compile time and use monomorphization to generate specific versions of each function for each type, which allows compile-time optimization and takes Julia to the level of C in performance. It means that Julia is still dynamic at the development stage (so you're free from annotating all the types), but its machine code is actually statically typed and optimized, just like C (at least for well-written and type-stable codes). Lastly, the argument "speed isn't everything" is also weak to explain the popularity of Python in ML and Scientific communities. The actual explanation for that is the marketing done by Google, just like Go. That initial marketing built an absurdly vast (and increasing) ecosystem to the point that absolutely everything today has a library for Python (commonly written in "real languages" like C++, Rust, Fortran, or Julia).

hellmrf
Автор

What python makes up in time is its "one language does it all" approach

Shaam_Ark
Автор

The hidden amazon giftcards were very fun! The last one was difficult. Was to slow unfortunately but do more plz!

SlimThuis
Автор

6:45 that's not what is meant by "interpreted". Interpreted means that it is not compiled to machine code, but executed on the fly by a virtual machine. C can also be interpreted, but that doesn't change the fact that you need to cast explicitly.

WouterStudioHD
Автор

In my experience as a physicist, the only advantage of python is that it has more "functions" (I think people call them methods in python) than c/c++. This save me a lot of time writing a whole new function for a simple task. However, I still prefer c/c++ because of speed.

longhoacaophuc
Автор

Man, I've been following you since you started your channel and reached 10, 000 subscribers, I'm your fan! It's great to see you with half a million! From Brazil, for you!

JoaoMiguel-mwrm
Автор

2:42 I believe that virtual environments have nothing to do with execution speed in Python. Python interpreter works the same way regardless of virtual environments.

nscarlos
Автор

Honestly my biggest issue with python is that I have to tailor my use case for it. I have found that using node and javascript is magnitudes faster for a lot of tasks. So I end up almost always doing python scripts for things that cant be easily done in node rather than relying on python because of this. Recently I had a document parsing application for example, that in python would take several minutes to complete but when I ported it over to node to work on a back-end I had already set up it took less than a minute.

timcates
Автор

I think speed isn't everything, but instead efficiency is everything. High efficiency code is not only faster but uses less memory. This is crucial for lots of use cases. It also prevents bloated software like Microsoft Teams and other electron apps taking over thankfully!

NewLondonMarshall
Автор

8:48 the most inner section of the right eye ball of that lady in the picture has the number 50 written with white letters. Is that the hidden gift card? 😎 P.s. Great video!😉

georgiostsobys
Автор

Hi, Kalle! I really appreciate your work and this channel! You motivated me to learn more python. I'm interested especially in ML and AI section.
Can you make some introduction or complete tutorials about this topics?
Let's say TensorFlow Introduction ... Something like that:))
I hope this comment will land in front of you 💙

robimegu
Автор

Total beginner to Python and programming here. I wrote a program using Python after 3 months of learning that completed a 30+ hour task at work in 2 minutes. The program is based on basic Python and Pandas. It took me like 2 weeks to complete it because I was flipping through textbooks and reading online a lot. I doubt I could say the same learning a low-level language. Yeah, maybe it would run in like 30 in seconds in a low-level language instead but at the end of the day who cares? Reducing something that takes 30 hours to 2 minutes as a total beginner is fantastic and it was fun to write.

BrownStain_Silver
Автор

5:35 Kalle is well aware of the fact that most people fast forward through the sponsoring section. :)
Edit: Another one at 8:50 at the top left corner.

haisongqi
Автор

Some people say that the advantage of Python is an interpreter language, rapid prototyping. There actually are interpreters for C/C++ too!
For example Ch Script, a C+, a dialect of C with some extra added features, including the ability to write shell commands directly within the source code, can be used as a replacement for both Python and Bash.
And there is also Cling, a C++ interpreter recognizing the latest and greatest C++ features, good for testing code, and it even runs in Jupyter notebooks too!

konstantinrebrov
Автор

Thanks for the video! @9:19, it should be "number_ = np.sum(np.arange(number, dtype=np.int64))" instead of np.range as the video states.

lurwas
Автор

Hiding the codes is a great idea! but I'm beginning to think the 2nd amazon code isn't really there :/ - Damn! found it

AHR_James
Автор

I like all your videos, you are so kind and your videos are really proffesionals. Good luck Halle

navsys