People say that Python has a higher speed of development, probably are experts in Python language only. For me development in C/C++ is faster. Whenever I work with Python I have to fight against the interpreter. Indentation error, how annoying! Or it runs through 200 lines of code, and then crashes!
@@konstantinrebrov675 i really like python for GUIs and parser. Also quite nice to automate basic office stuff and administration tasks without expensive software.
If you account for bugs dynamically typed languages have a pretty big time cost as project complexity increases. But for trivial code that calculation is different.
@@MrHaggyy You can automate anything with C++ as well hack I am now doing things in Rist because the syntax of rust is short like python. The only downside to Rust is like C when compiling it's slow but once Running blazing fast.
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.
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.
Tbh python's not perfect, but it's definitely the first right step towards simple and easy programming (which is the direction we should strive for) I usually compare programming languages with other inventions such as cars; having a choker as well as a manual transmission with a clutch may give you more control over the car, however, the tradeoff is added complexity as well as more strain on the human, which isn't ideal for something that's supposed to "drive itself". I mean, do you really want to start your car with a manual hand crank? The same principle can be applied to programming languages The goal here is to "automate" a programming language in such a way that it's efficient as well as fast while also being simple to use, humans shouldn't be concerned about declaring datatypes or memory management
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).
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.
Can you explain a bit more about 'virtual machine' and 'on the fly' part? I read about the difference between compiled and interpreted languages multiple times but still get confused.
@@arnobchowdhury9641 compiled: translated from one language to another. This most of the time means translated from high level language (e.g. C, C++, Swift) to a low level language (e.g. assembly, bytecode, or machine code). When the target is machine code, this can run natively on the CPU, meaning the CPU understands the language and can execute each instruction. When the target language is for example bytecode, this means the CPU doesn’t understand that language. To run this you use a “virtual machine” or an “interpreter”. This is a program that understands what action to perform for each instruction in the bytecode. Therefore it’s an abstract CPU, hence the name “virtual”.
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.
A method is function encapsulated and abstracted away in a class(see pillars of object oriented programming). Almost every mainstream language have "methods"
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!
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.
Exactly. The statement "You have to actually create a virtual environment to run your python code" is simply wrong and shows misunderstanding of the "virtual environment" term. In fact, virtual environment only allows to manage isolated python environment without spoiling globally installed python with libraries you need to install. The speed the code runs is the same when run using virtual environment and when using globally installed one.
@@smibssmibs this statement is false python works differently in different virtual environments provided the virtual environments are actually different think carefully about this issue before you answer
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.
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!
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.
Due its broad use in the academic and scientific field. Julia is the logical replacement (or at least it should) for Python. Another obstacle is the Apple users' obsession with.
@@janikwindisch6643 Because is somehow easy to code and therefore gained popularity in the aforementioned fields, resulting in numerous libraries that are highly dependent on as a result. The catch, is that python is slow, not multithreaded, needs other C/C++ libs in order to make use of GPU acceleration and so on.
Wouldn’t it be better to create a faster Python interpreter? The libraries are treasure of Python and are the efforts of a large community for 2x years. It is like something too large to be replaced.
@@MrCk0212 That's the point. The huge dependency of libraries. There's already a lot of crap on top of crap to increase performance (bytecode, etc), but I think is a catch 22. Anyway, a substantial amount of main Python libs are already barebones C, so it would be feasible to interface them with Julia.
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.
UA-cam 'codebasics' perfectly put it, that python is slow if you are using the wrong module and wrong approach. Essentially if you are using the right module for the task then it won't be slow.
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!😉
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!
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 💙
Well, i dont understand why ppl declaring python as having good syntax and easy readable. i personally find it harder to read than any other bracket based lang
The virtual environment isn’t a performance penalty. It’s solely the interpretation of an instruction to its actual byte code and then running that byte code, which has overhead. And in Python more so than Java or C# byte code (especially .Net Core 5). And in C++ you can use “auto” to make the computer choice the type as well. Frankly, I don’t see a reason to develop in Python (and I did a lot of Python from 2000-2010). Back then I liked it because of its “there’s only one way to do something” principle. That was great because it confirmed coding styles. When that was thrown overboard, it lost the only great thing it had going for it.
Honestly I don't like Python myself but still use it because of all the great libraries and support available for it. It's just better for some use-cases. I prefer C# and other C like languages, Maybe it's because I started my programming journey with C++ and those habits and preferences stayed with me, and I believe it's the case for many people who hate on python
don't EVER EVER EVER give away gift-cards or coupons or free stuff, your comments WILL BE FULL OF SCAMS tricking users into thinking they have won. YOU HAVE BEEN WARNED.
You don't need to declare types in Rust or C++ and they are as fast or faster than C(auto i = 3;). The key to speed is optimisation. You would think a Python class is equal to a C++ struct but intact it is a std:: unordered_map , and strings in hot paths are always stupid. Python compilers usually do not comply with Python rules so that they can optimise this. Python is slow due to non zero cost abstractions.
4 reasons why people use python: 1. Easy to learn 2. Requires less debugging 3. Used in big tech companies (eg. Google , UA-cam) 4. You can build (almost) anything eg. websites, apps, games
You are measuring the execution time of the programs, but forgetting the time of development, optimization and maintenance of the program. Programmers' time is more important than program execution time
Kalle is pissing a lot of c gods now 😂😂 , good video btw I used to be a full stack web dev but now i am a system/kernel dev i know c,c++ currently learning rust.
@@jeffreydijkstra3391 I don't work yet I am still in high school but started with a simple kernel that prints hello world when booted from grub and this is when a initially started learning c 6 months later I started to work on my own bootloader and all and I contributed a little bit to serenity os too.
Also I meant don't have a job or something but I do freelance and the thing with kernel programming it's really fun but u can't make good money of your projects
i was a pythonist. tried to learn rust and found out i knew nothing about low-level. so now i'm learning C so that later i can learn rust. imagine not getting seg faults and stuff like that.
I always find dynamically typed languages to be more annoying to deal with since it really takes away the structure of your code. It's like "Ok, this method gets 2 parameters... What are these parameters exactly? What am I supposed to do with them? How may I treat them?" And in the end you just use the type declaration function baked into python to state, what type of object you're dealing with. Also, all of your casual mistakes are just accepted and interpreted. There are a ton of memes with PHP and such where you add two totally different "types" of objects together and get a thrid completly random type as a result. Have you ever declared a variable INSIDE a foreach loop and then mistakenly assigned it OUTSIDE of it? This would obv. cause an error in a compiler, but PHP lets you run it without problems but the results are just completly fked. And then you're sitting there like: "WTH just happened". I always see the Compiler as a friend that says "There is a type mismatch here", "This one is not defined - what is that?" and most of the time, this really points out your honest mistakes.
Writing native python extensions through the C API is a real bear but it's not bad once you get it working, and yeah it does allow you to do a lot of stuff in python that would be tedious in C and not necessarily need the performance and just handing off tasks to C functions. Best of both worlds, there. I found their tutorials pretty out of date though and had to do a lot of digging around their docs to figure out how to actually do things in the modern way.
I am watching your channel to learn more about computer technology. But, why do I need this python, I should study 😆😆😆 Congratulations, you have 500 subscribers! 🔥🔥🔥🔥🔥 You have progress friend! 🌠🌠🌠
If you are working with data, almost always bottleneck will be the database, and speed of the language doesn't matter, you might have some memory problems if it isn't coded well but speed of the language hardly matters.
There are mistakes in the video: 1. Virtual environments in Python make it slower. WRONG Virtual environments in Python are just a way to separate different Python versions and libraries used in the project. There is no need to create them, other than encapsulation of project dependencies and their versions. It makes Python run at the same speed as always, because when creating a virtual environment, your Python interpreter executable is copied to the virtual environment directory. 2. In your languages pyramid, on the top, you put OO languages like Python and Visual languages (WTF are those btw? could you elaborate?) where you put JS (which is also OO language). What about Functional Programming languages like Haskell or Elixir? and languages like Golang? All those are higher abstraction than C, yet you only put OO languages (where btw C++ also belongs and you put it along with C). 3. Assumption that dividing 10 by 3 will give an error in C. Numeric types in C are semi-compatible, so as long as you assign the result of this operation to float, it will be completely fine. 4. "Interpreter interprets code and understands what needs to be done". And compilers don't? 5. Claims that you don't tell python what type you are using are wrong. 7:29 you have `number = 10**7 + 1`. You actually use integer literals, so you do tell Python to use ints. Well, not really* because Python doesn't actually have variables, only pointers (that's why it's so easy to change the type of "variable" in Python). 6. Associating language being compiled or interpreted with its type system. Those things are distinct. TypeScript for example, while being compiled, still has quite a dynamic type system. "Typescript is just JavaScript", you say? What about Golang? It can infer the variable type based on the assigned value. Don't mix up those two properties of language. 7. Python is not fully interpreted. It is precompiled (you can find compiled .pyc files in __pycache__ directory in your project).
As someone else mentioned before, you _might_ be coming off kinda harsh there with the way you replied. But since you seem to know your stuff, do you suppose C++ will ever get the amazing support/libraries as is there for Python? Or will there be a different language that has lower abstraction levels like C and also the resources of Python? I’ve heard mention of Julia as a successor to C++.
Imagine being so grumpy and hater you take the time to type that all of that down just to pin point little technical specificities in a video intended for beginners.
@@TheIsraelMendoza I am not hating, I am against misinformation. It doesn't matter that the video is for beginners. There is difference between simplifing stuff for beginners and misinformation.
@@thedrunknmunky6571 just in my opinion, C++ has a lot of good libraries, the problem is, there is no general repository of them (like Python has PyPI). Also IMO C++ progress is being slowed by the fact ISO comittee keeps every version backwards compatible back to 80s and 90s. When it comes to low level langauge like C, look at Rust, it starts to take of even in embedded (although C is still leading that industry). From what I've heard, Julia is more like Python, but faster.
@@neeronb I am defending Python since I like this language and I hate when people spread misinformation about it (mostly first point of my list). While you are right, that some of it might be hard to understand for beginners, I stand my point that simplification for beginners is not the same as misinformation and mistakes. It just can't be. I know that programming is now being spread for everyone to learn, but it is still science. It has basis in engineering, maths and physics. People need to be aware of that. The cancerous amount of programmers scared of learning some basic assembler or even pointers in C is growing. Let me compare it to cars. You don't need to know how engine is built and how it works, to drive a car, but you need to know stuff like changing oil, pumping tires and what type of gas you put in it...
Is Lenovo legion 5 pro good for android and web development purposes? Processor and memory features - • 11th generation, core i7 • 16GB RAM, 1TB SSD • 6GB graphic/ NVIDIA GeForce RTX 3060 Or I should go for MacBook Air or Pro m1 With 16GB unified memory and 1TB SSD...?
Python itself is not slow, it cannot even be measured in slow or fast. It's a lang spec. The ref impl. called CPython has the runtime characteristics that you described. PyPy is another one with different characteristics. But yes, natively compiled Go or C will always be faster, no matter what. But the difference becomes less of an issue with JITs.
People that think Python is “slow” clearly don’t understand how Python works. If you’re reading this, please think of why Python is commonly used for AI. It’s used for AI because Python is used as an intermediary between the programmer and the underlying C libraries the code is written in. It’s unfortunate that many programmers don’t even understand this. Python is “slower” only dependent on what you’re using it for and what you’re using it with. If you’re creating algorithms in Python then it’s slower. If you’re calling libraries that are written in C then Python is “faster”.
Python is just slow and I do understand how Python works ;-) Native C/C++ compiled applications are simply faster. Relaxed syntax vs type safety in C++.
yeah we get that. but then node id just better. javascript is easy to learn and more flexible to type so it’s just better objectively. you can ship data to C libs faster nbd it’s just better
At 4:26 : Javascript is a visual language? If you search up for this, you find nothing because its just wrong. Javascript has also oop concepts. You comparing a programming paradigm with a nonsense word in this context. And overall the explanation about the difference between python and c is not good. You missing an important point, which is the biggest difference: Runtime. At the point where you was talking about virtual environment (which is also not correct in terms to runtime), i think you meant a Runtime. Im missing the point that the python code is interpreted in an interpreter at runtime and convert the interpretation to system calls. The explanation about type hinting has nothing to do with a native language or interpreted one. If you look at c or c++, you have also the keyword 'auto' which allows you to enable type interfering. In my opinion the video is missing some important points and mixed concepts which are not related to the topic and i think, you are not complete sure about the difference between the languages which you showed us.
Myeah, don't agree that Python is intepreted language. I mean of course it is, but not for 100%, it still has come compilation. 1. Compile to intermediate lang (byte code) e.g. files with ending *.pyc 2. Interpret the written code line by line That's how it works with python btw That's one of the reason why Python has strong type system (to compare with JS, who doesn't)
I would say that speed of scripts is often overrated. In real life, If you want to speed up your work with programming it doesn't matter if your script runs 5 or 10 sec, even difference of 5 minutes and 1 minute is offten to miss, or even a higher. And it's pretty hard to write a code that runs more than 10-15 minutes.
at 06:50 you argue that python is an interpreted language because 10/3 == 3.333 this is not correct. a typed language is not the same as an intepreted language. Python is both loosly typed and interpreted, yes, but you are mixing the 2 in your argument.
I'd argue speed often is everything, it's just that the relevant speed includes development, not just run-time.
@@ToolwatchBoutique getting python in the finished product will be an uphill challenge though, don't think anyone has got it through approvals?
People say that Python has a higher speed of development, probably are experts in Python language only. For me development in C/C++ is faster. Whenever I work with Python I have to fight against the interpreter.
Indentation error, how annoying! Or it runs through 200 lines of code, and then crashes!
@@konstantinrebrov675 i really like python for GUIs and parser. Also quite nice to automate basic office stuff and administration tasks without expensive software.
If you account for bugs dynamically typed languages have a pretty big time cost as project complexity increases.
But for trivial code that calculation is different.
@@MrHaggyy You can automate anything with C++ as well hack I am now doing things in Rist because the syntax of rust is short like python. The only downside to Rust is like C when compiling it's slow but once Running blazing fast.
This guy is even good at drawing
Maybe he hasn’t drawn it and he is just acting
Get on your knees and tell my mommy you love me.
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.
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.
You can simply use // to have integer division in Python.
What python makes up in time is its "one language does it all" approach
you can do pretty much everything with java or c++ too. The thing about python is the "pseudocode that runs"
Tbh python's not perfect, but it's definitely the first right step towards simple and easy programming (which is the direction we should strive for) I usually compare programming languages with other inventions such as cars; having a choker as well as a manual transmission with a clutch may give you more control over the car, however, the tradeoff is added complexity as well as more strain on the human, which isn't ideal for something that's supposed to "drive itself". I mean, do you really want to start your car with a manual hand crank? The same principle can be applied to programming languages
The goal here is to "automate" a programming language in such a way that it's efficient as well as fast while also being simple to use, humans shouldn't be concerned about declaring datatypes or memory management
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).
why are u mad
People usually ignore the fact that if your program needs a speed boost, you can compile that potion of it...
If you want to fasten your Python code you can use annotations. So it definitely takes some optimization and cost to be a dynamically typed language
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.
Can you explain a bit more about 'virtual machine' and 'on the fly' part? I read about the difference between compiled and interpreted languages multiple times but still get confused.
@@arnobchowdhury9641 compiled: translated from one language to another. This most of the time means translated from high level language (e.g. C, C++, Swift) to a low level language (e.g. assembly, bytecode, or machine code).
When the target is machine code, this can run natively on the CPU, meaning the CPU understands the language and can execute each instruction. When the target language is for example bytecode, this means the CPU doesn’t understand that language. To run this you use a “virtual machine” or an “interpreter”. This is a program that understands what action to perform for each instruction in the bytecode. Therefore it’s an abstract CPU, hence the name “virtual”.
@@WouterStudioHD This is why a mentor is important. Thanks a lot. I understand now. You explained it very well.
@@arnobchowdhury9641 Thanks for the compliment, you’re most welcome.
What is bytecode, will you explain me differences between machine code and byte code
The hidden amazon giftcards were very fun! The last one was difficult. Was to slow unfortunately but do more plz!
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.
A method is function encapsulated and abstracted away in a class(see pillars of object oriented programming). Almost every mainstream language have "methods"
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!
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.
Agreed. It just provides a seperate workspace/env. to work on.
Exactly. The statement "You have to actually create a virtual environment to run your python code" is simply wrong and shows misunderstanding of the "virtual environment" term.
In fact, virtual environment only allows to manage isolated python environment without spoiling globally installed python with libraries you need to install. The speed the code runs is the same when run using virtual environment and when using globally installed one.
@@smibssmibs this statement is false python works differently in different virtual environments provided the virtual environments are actually different think carefully about this issue before you answer
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.
You redeemed any giftcard
@@klvp_techie nope lol
Where is the second one?
@@josepauljenson8789 8:50 Just change play speed to 0.25x so you can see it(and of course pause the video if needed) :)
@@josepauljenson8789 when he is drawing the pic, make the speed to 0.25x , you can see when he takeoff his left hand.
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!
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.
Due its broad use in the academic and scientific field. Julia is the logical replacement (or at least it should) for Python. Another obstacle is the Apple users' obsession with.
I don't understand anything, but I want to get into coding. Could you please elaborate?
@@janikwindisch6643 Because is somehow easy to code and therefore gained popularity in the aforementioned fields, resulting in numerous libraries that are highly dependent on as a result. The catch, is that python is slow, not multithreaded, needs other C/C++ libs in order to make use of GPU acceleration and so on.
Wouldn’t it be better to create a faster Python interpreter? The libraries are treasure of Python and are the efforts of a large community for 2x years. It is like something too large to be replaced.
@@MrCk0212 That's the point. The huge dependency of libraries. There's already a lot of crap on top of crap to increase performance (bytecode, etc), but I think is a catch 22. Anyway, a substantial amount of main Python libs are already barebones C, so it would be feasible to interface them with Julia.
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.
UA-cam 'codebasics' perfectly put it, that python is slow if you are using the wrong module and wrong approach. Essentially if you are using the right module for the task then it won't be slow.
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!😉
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!
Python now is to what BASIC was for home computing in 80s.
Python is easy to learn, but HARD to master
Your channel is really addicting
Not only speed IS important but SCALABILITY also is fundamental. And Python lacks both.
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 💙
Well, i dont understand why ppl declaring python as having good syntax and easy readable. i personally find it harder to read than any other bracket based lang
Agree. Only having indentation and return statements to determine where funcions start and end makes it harder to read IMO.
Well the trick is if you just learn cpp you don't have to worry about it being strict. Just know what you're doing and you get a faster end product
Appreciate the insight mate about python. Need to start my python learning journey soon.
The virtual environment isn’t a performance penalty. It’s solely the interpretation of an instruction to its actual byte code and then running that byte code, which has overhead. And in Python more so than Java or C# byte code (especially .Net Core 5).
And in C++ you can use “auto” to make the computer choice the type as well.
Frankly, I don’t see a reason to develop in Python (and I did a lot of Python from 2000-2010). Back then I liked it because of its “there’s only one way to do something” principle. That was great because it confirmed coding styles. When that was thrown overboard, it lost the only great thing it had going for it.
Honestly I don't like Python myself but still use it because of all the great libraries and support available for it. It's just better for some use-cases.
I prefer C# and other C like languages, Maybe it's because I started my programming journey with C++ and those habits and preferences stayed with me, and I believe it's the case for many people who hate on python
I like all your videos, you are so kind and your videos are really proffesionals. Good luck Halle
The sum function is called from c or c ++ language if it is in python pure the speed drops to thousands slower than c, c ++, c# or java.
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.
I love how you are a good teacher
don't EVER EVER EVER give away gift-cards or coupons or free stuff, your comments WILL BE FULL OF SCAMS tricking users into thinking they have won. YOU HAVE BEEN WARNED.
PHP 8 & Javascript are also interpreted language, yet they are fast. Specially if you use deno runtime with js.
Js uses just in time compilation ,hence it's fast python is actually faster than PHP.
@@repotranstech Maybe you are talking about previous version of PHP. PHP 8 also use JIT compiler, latest python 3 still slow.
You don't need to declare types in Rust or C++ and they are as fast or faster than C(auto i = 3;). The key to speed is optimisation. You would think a Python class is equal to a C++ struct but intact it is a std:: unordered_map , and strings in hot paths are always stupid. Python compilers usually do not comply with Python rules so that they can optimise this. Python is slow due to non zero cost abstractions.
Great video, your explanations cleared a few things up
4 reasons why people use python:
1. Easy to learn
2. Requires less debugging
3. Used in big tech companies (eg. Google , UA-cam)
4. You can build (almost) anything eg. websites, apps, games
Dude uses vim without themes on windows and still looks cool. That's some chad move
You are measuring the execution time of the programs, but forgetting the time of development, optimization and maintenance of the program. Programmers' time is more important than program execution time
Hiding the codes is a great idea! but I'm beginning to think the 2nd amazon code isn't really there :/ - Damn! found it
It’s on the left page of the drawing, just for a split second though. Dont bother, someone already redeemed both
Hey like your videos am learning a lot from you thanks
I found a Reedm code in the phone screen, but it Used, oh my luck.
I chose Python over c because I live above sea level
8:45 Nice drawing
Kalle is pissing a lot of c gods now 😂😂 , good video btw I used to be a full stack web dev but now i am a system/kernel dev i know c,c++ currently learning rust.
Can i ask where you work, and what you kinda kernels you are making? I’m really interested by it😄
@@jeffreydijkstra3391 I don't work yet I am still in high school but started with a simple kernel that prints hello world when booted from grub and this is when a initially started learning c 6 months later I started to work on my own bootloader and all and I contributed a little bit to serenity os too.
Also I meant don't have a job or something but I do freelance and the thing with kernel programming it's really fun but u can't make good money of your projects
i was a pythonist. tried to learn rust and found out i knew nothing about low-level. so now i'm learning C so that later i can learn rust.
imagine not getting seg faults and stuff like that.
@@jeffreydijkstra3391 you don't have to make a kernel to be kernel dev. if you change the linux kernel, you're kernel dev.
More knowledge you are giving me than my college professor .
Thank you very much bro ❤️❤️❤️❤️❤️
I always find dynamically typed languages to be more annoying to deal with since it really takes away the structure of your code. It's like "Ok, this method gets 2 parameters... What are these parameters exactly? What am I supposed to do with them? How may I treat them?" And in the end you just use the type declaration function baked into python to state, what type of object you're dealing with. Also, all of your casual mistakes are just accepted and interpreted. There are a ton of memes with PHP and such where you add two totally different "types" of objects together and get a thrid completly random type as a result. Have you ever declared a variable INSIDE a foreach loop and then mistakenly assigned it OUTSIDE of it? This would obv. cause an error in a compiler, but PHP lets you run it without problems but the results are just completly fked. And then you're sitting there like: "WTH just happened". I always see the Compiler as a friend that says "There is a type mismatch here", "This one is not defined - what is that?" and most of the time, this really points out your honest mistakes.
And then this video comes when I'm feeling down with my progress in python because I'm currently learn java in college. Thanks Kalle 😁
You can make it - keep pushing harder
Great information, thank you!
Was that a Subaru? Good cars
hey have you tried nim? its compiled, almost entirely python-like and also a lot faster?
basically python but statically typed
I am a java dev but start to use Python more and more
"Speed of development"
Can you do a tutorial on how you film your videos. I like the way you do them
I appreciate the educational content
Writing native python extensions through the C API is a real bear but it's not bad once you get it working, and yeah it does allow you to do a lot of stuff in python that would be tedious in C and not necessarily need the performance and just handing off tasks to C functions. Best of both worlds, there. I found their tutorials pretty out of date though and had to do a lot of digging around their docs to figure out how to actually do things in the modern way.
I am watching your channel to learn more about computer technology. But, why do I need this python,
I should study 😆😆😆
Congratulations, you have 500 subscribers! 🔥🔥🔥🔥🔥
You have progress friend! 🌠🌠🌠
U good??
@@cedric6941 lmao
R u on something?
I'm not a coder, that's why relax! Take care yourself! 😉
is python best for software development?
Every Friday u get us happy 😊
Just use assembly like a chad
If you are working with data, almost always bottleneck will be the database, and speed of the language doesn't matter, you might have some memory problems if it isn't coded well but speed of the language hardly matters.
This one is easy to answer, because python is easy and yet very powerful.
was a cool idea with the amazon codes, found both :D but they were already used
Out of curiosity…where were they?
@@theonlybonsu one was at 5:36 on the phone display and one was at 8:50 on the left page of the drawing (just a few frames) :)
I love the Amazon Easter eggs 😂😂 though, plz next time don't tell us... Anyways I'm clicking that notification bell right now 🤣🤣🤣
Please, tell me what’s the background music?
Can you make a video about the Go programming language?
There are mistakes in the video:
1. Virtual environments in Python make it slower. WRONG
Virtual environments in Python are just a way to separate different Python versions and libraries used in the project. There is no need to create them, other than encapsulation of project dependencies and their versions. It makes Python run at the same speed as always, because when creating a virtual environment, your Python interpreter executable is copied to the virtual environment directory.
2. In your languages pyramid, on the top, you put OO languages like Python and Visual languages (WTF are those btw? could you elaborate?) where you put JS (which is also OO language). What about Functional Programming languages like Haskell or Elixir? and languages like Golang? All those are higher abstraction than C, yet you only put OO languages (where btw C++ also belongs and you put it along with C).
3. Assumption that dividing 10 by 3 will give an error in C. Numeric types in C are semi-compatible, so as long as you assign the result of this operation to float, it will be completely fine.
4. "Interpreter interprets code and understands what needs to be done". And compilers don't?
5. Claims that you don't tell python what type you are using are wrong. 7:29 you have `number = 10**7 + 1`. You actually use integer literals, so you do tell Python to use ints. Well, not really* because Python doesn't actually have variables, only pointers (that's why it's so easy to change the type of "variable" in Python).
6. Associating language being compiled or interpreted with its type system. Those things are distinct. TypeScript for example, while being compiled, still has quite a dynamic type system. "Typescript is just JavaScript", you say? What about Golang? It can infer the variable type based on the assigned value. Don't mix up those two properties of language.
7. Python is not fully interpreted. It is precompiled (you can find compiled .pyc files in __pycache__ directory in your project).
As someone else mentioned before, you _might_ be coming off kinda harsh there with the way you replied. But since you seem to know your stuff, do you suppose C++ will ever get the amazing support/libraries as is there for Python? Or will there be a different language that has lower abstraction levels like C and also the resources of Python? I’ve heard mention of Julia as a successor to C++.
Imagine being so grumpy and hater you take the time to type that all of that down just to pin point little technical specificities in a video intended for beginners.
@@TheIsraelMendoza I am not hating, I am against misinformation. It doesn't matter that the video is for beginners. There is difference between simplifing stuff for beginners and misinformation.
@@thedrunknmunky6571 just in my opinion, C++ has a lot of good libraries, the problem is, there is no general repository of them (like Python has PyPI). Also IMO C++ progress is being slowed by the fact ISO comittee keeps every version backwards compatible back to 80s and 90s. When it comes to low level langauge like C, look at Rust, it starts to take of even in embedded (although C is still leading that industry). From what I've heard, Julia is more like Python, but faster.
@@neeronb I am defending Python since I like this language and I hate when people spread misinformation about it (mostly first point of my list). While you are right, that some of it might be hard to understand for beginners, I stand my point that simplification for beginners is not the same as misinformation and mistakes. It just can't be. I know that programming is now being spread for everyone to learn, but it is still science. It has basis in engineering, maths and physics. People need to be aware of that. The cancerous amount of programmers scared of learning some basic assembler or even pointers in C is growing. Let me compare it to cars. You don't need to know how engine is built and how it works, to drive a car, but you need to know stuff like changing oil, pumping tires and what type of gas you put in it...
Is Lenovo legion 5 pro good for android and web development purposes?
Processor and memory features -
• 11th generation, core i7
• 16GB RAM, 1TB SSD
• 6GB graphic/ NVIDIA GeForce RTX 3060
Or I should go for MacBook Air or Pro m1
With 16GB unified memory and 1TB SSD...?
Bro what!!! Go get ur lenovo bro forget that macbook😂😂
kalle, do you use vim as your everyday text editor now?? or do you still use VS Code sometimes??
Python itself is not slow, it cannot even be measured in slow or fast. It's a lang spec. The ref impl. called CPython has the runtime characteristics that you described. PyPy is another one with different characteristics. But yes, natively compiled Go or C will always be faster, no matter what. But the difference becomes less of an issue with JITs.
People that think Python is “slow” clearly don’t understand how Python works.
If you’re reading this, please think of why Python is commonly used for AI. It’s used for AI because Python is used as an intermediary between the programmer and the underlying C libraries the code is written in.
It’s unfortunate that many programmers don’t even understand this.
Python is “slower” only dependent on what you’re using it for and what you’re using it with.
If you’re creating algorithms in Python then it’s slower. If you’re calling libraries that are written in C then Python is “faster”.
Python is just slow and I do understand how Python works ;-) Native C/C++ compiled applications are simply faster.
Relaxed syntax vs type safety in C++.
Hell, even Java is faster than Python. But as you said, it is a very readable glue language with lots of libraries.
Not faster, only slightly slower.
yeah we get that. but then node id just better. javascript is easy to learn and more flexible to type so it’s just better objectively. you can ship data to C libs faster nbd it’s just better
Thank you. Very interesting video.
Thx for the content 🔥🔥
Love from Bangladesh
Nicely done, will you please explain 'Go' in same context?
At 4:26 : Javascript is a visual language?
If you search up for this, you find nothing because its just wrong. Javascript has also oop concepts. You comparing a programming paradigm with a nonsense word in this context.
And overall the explanation about the difference between python and c is not good. You missing an important point, which is the biggest difference: Runtime. At the point where you was talking about virtual environment (which is also not correct in terms to runtime), i think you meant a Runtime. Im missing the point that the python code is interpreted in an interpreter at runtime and convert the interpretation to system calls. The explanation about type hinting has nothing to do with a native language or interpreted one. If you look at c or c++, you have also the keyword 'auto' which allows you to enable type interfering. In my opinion the video is missing some important points and mixed concepts which are not related to the topic and i think, you are not complete sure about the difference between the languages which you showed us.
I can only give you like
i can count numbers on my fingers faster than python
Simple, they don’t know better
Your channel inspire me to use more linux and do more programming 😂🤦🏽♂️
anybody knows what distro Kalle is using at around 1:36?
- how is python more flexible than C
- what is a beginner friendly language
- is C high level language
Is Multi-level as it is both High and Low level. You can make Full fictioning apps with C as well bootloaders and kernels.
I wonder what would happen to the TIOBE index if they took out all of those in Uni
Which colour scheme do you use for vs code please..
Very interesting video, I suggest you keep making videos of this type (like why lanuage, master langauge) :D
Such a precise explanation!
Is there any tool, that converts your python or JS code to machine language.
Tie your hair a bit loose. You could damage or even permanently lose your hair if it's too tight.
Kalle: "Even though Python is quite slow".
Programmers across the world: "How dare you!"
*python programmers
What is the problem in creating a language like python that is easy to understand, that can be as fast as C? why this haven't been done yet?
It's not slow, all depends, saying that Python is slow is also saying that all interpreted languages are slow, which they are not.
Myeah, don't agree that Python is intepreted language. I mean of course it is, but not for 100%, it still has come compilation.
1. Compile to intermediate lang (byte code) e.g. files with ending *.pyc
2. Interpret the written code line by line
That's how it works with python
btw That's one of the reason why Python has strong type system (to compare with JS, who doesn't)
C runs Python. It is the original. It's like asking Mickey Mouse to help you out of a dangerous situation when Chuck Norris is available.
This is why Microsoft Word takes 5+ seconds to load up on modern machines
Honestly, sometimes I don't like this "relaxed" syntax and dynamic typeing (dynamic typeing is especially bad when consuming js APIs).
I don't have knowledge of coding can I star learning for my career plz replay
You almost tricked me into believing that you understand what you are talking about :)
I would say that speed of scripts is often overrated. In real life, If you want to speed up your work with programming it doesn't matter if your script runs 5 or 10 sec, even difference of 5 minutes and 1 minute is offten to miss, or even a higher. And it's pretty hard to write a code that runs more than 10-15 minutes.
at 06:50 you argue that python is an interpreted language because 10/3 == 3.333
this is not correct.
a typed language is not the same as an intepreted language. Python is both loosly typed and interpreted, yes, but you are mixing the 2 in your argument.
Because it is non verbose programming language. And it's easy to use in terms of immeasurable amount of libraries for all problem fields.
I’ve been trying to learn programming. I’m struggling so much :////
YES THAT"S RIGHT !!! PYTHON IS THE BEST