Тёмный

Why is Python SO slow!? 💀  

Coding with Lewis
Подписаться 596 тыс.
Просмотров 876 тыс.
50% 1

Опубликовано:

 

2 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 903   
@Martynyuu
@Martynyuu 6 месяцев назад
Oh, I thought because a Python has no legs
@Aman_Boy-dc2nn
@Aman_Boy-dc2nn 6 месяцев назад
😂
@kostya8764
@kostya8764 5 месяцев назад
html doesn't have legs too
@Jaimekk
@Jaimekk 5 месяцев назад
​@@kostya8764 The joke is that there's a snake called Python
@subtheman2136
@subtheman2136 5 месяцев назад
@@Jaimekkeveryone knows that😂
@Jaimekk
@Jaimekk 5 месяцев назад
@@subtheman2136 I don't think so, non-English speakers might not know
@jaredwilliams8621
@jaredwilliams8621 8 месяцев назад
As someone who has to debug code, I would consider dynamic types a con as well.
@BboyKeny
@BboyKeny 8 месяцев назад
I think this happens almost anytime you use a scripting language for non scripting things.
@MoveAlongPeasant
@MoveAlongPeasant 8 месяцев назад
That just makes you bad at your job. Point blank. Dynamic types aren’t hard. This is a skill issue.
@rkidy
@rkidy 8 месяцев назад
@@MoveAlongPeasantwhat a foolish comment. Static typing allows the compiler to check a massive amount of possible bugs at compile time rather at run time. If it was worse than dynamic typing why does almost every other major language use static typing. Why is typescript so beloved by developers. You sound like a clueless first year comp sci student.
@lobotomy-victim
@lobotomy-victim 8 месяцев назад
⁠not being able to write rust code as fast as python makes you bad at your job. Point blank. Using real languages isn’t hard. This is a skill issue
@samblanton967
@samblanton967 8 месяцев назад
@@lobotomy-victimtalking as if python isn’t a real language is a brain issue
@Gameplayer55055
@Gameplayer55055 6 месяцев назад
Remember, python is used for AI It's the special limitation to prevent creating skynet
@nathaaaaaa
@nathaaaaaa 5 месяцев назад
All of the AI that "Python" does is actually C, C++ and Fortran. Python is just a wrapper for the native functions through FFI
@torbilan6292
@torbilan6292 5 месяцев назад
@@nathaaaaaa yet we still use python for ai. good composition doesn't make stuff good as well. plus, c++ and fortran are just some wrappers for assembly.
@joyhoon
@joyhoon 5 месяцев назад
wrapper for assembly? wtf, don't you know what compilers do? If C++ is just a wrapper, It have to be one output for one source, but It is not!
@torbilan6292
@torbilan6292 5 месяцев назад
first of all, compilers ARE the wrapper itself. second, chil, mofo, calm the f down and read the context, then try to figure out why I would say that to the previous guy. if you can't that's ok, you tried. but remember, everything is a wrapper.
@toadragethe5th
@toadragethe5th 5 месяцев назад
​@torbilan6292 by that logic, all languages are wrappers for assembly
@Anonymous-u8r8j
@Anonymous-u8r8j 8 месяцев назад
Python developers explaining why their language being 1000x slower than every other one is a good thing:
@anderdrache8504
@anderdrache8504 8 месяцев назад
It's crazy because JS has dynamic typing as well and the rules are so much more loose and weird but it's speed is atleast sometimes within an order of magnitude of ahead of time compiled languages.
@kooskoos1234
@kooskoos1234 8 месяцев назад
Ikr
@senzmaki
@senzmaki 8 месяцев назад
​@@anderdrache8504JS runs the web there's infinitely more devs working on making JS efficient than Python
@fus3n
@fus3n 8 месяцев назад
​@anderdrache8504 because js uses JIT and Python doesnt, it has to interpret the bytecode it generates , "interpreted language" is very vague.
@anderdrache8504
@anderdrache8504 8 месяцев назад
@@fus3n I know but if JS can Python can too. Why doesn't it?
@techiza652
@techiza652 8 месяцев назад
Can't wait for when the Python JIT compiler is finally complete
@WakeUpDuringNights
@WakeUpDuringNights 8 месяцев назад
Is it in the development stage?
@jakubkucera1973
@jakubkucera1973 8 месяцев назад
It basically is though, just use pypy or anything similar
@maxrinehart4177
@maxrinehart4177 8 месяцев назад
Didn't they work on removing Gil as well?
@smanzoli
@smanzoli 8 месяцев назад
Numba is complete for years
@Ðogecoin
@Ðogecoin 7 месяцев назад
@@smanzoliyes
@12kenbutsuri
@12kenbutsuri 7 месяцев назад
You can always combine c/c++ and python. And its relatively easy.
@dirknash4113
@dirknash4113 4 месяца назад
Cython
@KavyanshKhaitan
@KavyanshKhaitan 4 месяца назад
@@dirknash4113 its called CPython... CPython: Built upon C JPython: Built upon Java
@Dinger_D
@Dinger_D 2 месяца назад
@@dirknash4113 hahahahaha
@traveller23e
@traveller23e 2 месяца назад
To be fair though, that's true of most languages so not really a reason to chose python.
@12kenbutsuri
@12kenbutsuri 2 месяца назад
​@@traveller23etrue lol
@planktonfun1
@planktonfun1 4 месяца назад
you can use python to convert python code to assembly and then run that assembly
@rataV7517
@rataV7517 Месяц назад
That sounds awesome
@abdulniyas1657
@abdulniyas1657 8 месяцев назад
I remember one twitter post by Francois chollet(author of keras) in which he says , “The complaints "Python is slow" or "Python is unsafe" seem misguided. The point of Python isn't to be fast or safe, it's to be flexible and hackable, and to interface well with everything else. It has become successful by serving as a frontend from which to call other libraries”
@traveller23e
@traveller23e 2 месяца назад
In other words: good for convenience scripts and similar tools, bad for enterprise systems or compilers.
@TheDragShot
@TheDragShot 20 дней назад
Exactly. The real problem is the way some people misuse Python and other scripting languages as if they were your average compiled language. They're not, as we call them scripting languages for a reason.
@pretzel4626
@pretzel4626 8 месяцев назад
It's important to clarify what the test is when comparing speeds. Python looks much worse on shorter tasks due to the overhead Python requires on startup. This can be mitigated somewhat when compiling python to .pyc files. At medium tasks, python looks much better. At massive tasks we see the gap widen again, and this can be somewhat mitigated by compiling with optimized bytecode into .pyo files. Dev time is worlds faster for python and it's portability is fantastic. Debugging is all just personal familiarity, because neither are that hard if you work with it. Portability can be matched by few compiled languages, but most include varying levels of additional steps/setup/tests. Fighting over languages is silly, because at the end of the day the reason you use one over the other is because: I'm paid to use [My Language] I like the control/safety of [My Language] I like the syntax/structure of [My Language] I only know [My Language] I'm conditioned to make fun of [Your Language] At the end of the day there are workarounds to alter the standard behavior, mitigate the shortcomings, and interact with most APIs with whatever language you choose. If it's Turing complete, then you just need to get gud, lol.
@samblanton967
@samblanton967 8 месяцев назад
So true, people love to bicker, but there is a million reasons to choose a certain language for a task. For my projects a few seconds has never been a deal breaker and the development time is most important
@anderdrache8504
@anderdrache8504 8 месяцев назад
6 seconds is not a task where startup time is of any influence, like what? Also I feel like the "we shouldn't fight over languages" is just used to excuse bad implementations. Yes, languages make a difference and we can and should talk about differences of programming languages to learn their use cases and to improve them.
@cyrilemeka6987
@cyrilemeka6987 8 месяцев назад
Well said
@stefsot2
@stefsot2 7 месяцев назад
None benchmarks startup time lol, what's up with thai copium
@Duconi
@Duconi 6 месяцев назад
I don't know about this benchmark but I have seen another benchmark that doesn't include start times in it. It just measures the task itself and there Python is extremely slow. I'm sure you can improve it further, but why not using an Language that is also simple to write but much faster in the first place?
@pretro6136
@pretro6136 8 месяцев назад
You also forgot about the compatibility, Python can easily be paired with fast languages like c or rust. I like to write most of the code in python, and write the important functions in rust, that way my code is fast and easity to read.
@petrlaskevic1948
@petrlaskevic1948 8 месяцев назад
But is it easier to interface your rist code with Python than writing the whole thing in Rust?
@pretro6136
@pretro6136 8 месяцев назад
@@petrlaskevic1948 yeah, otherwise i wouldn't do it. Most projects don't need to be fast for 90% of the project, and writing 10% of my code with rust makes my code look almost the same (i use maturin/pyo3, which allowes me to run rust functions as python functions), but the code is 100x faster when it needs to be
@SXsoft99
@SXsoft99 8 месяцев назад
You mean like most old school languages?
@pretro6136
@pretro6136 8 месяцев назад
@@SXsoft99 you mean dlls? Yeah
@petrlaskevic1948
@petrlaskevic1948 8 месяцев назад
@@SXsoft99 rust is younger than python
@colinmaharaj
@colinmaharaj 8 месяцев назад
I'm sticking with C++ Builder and I don't do ML or AI yet.
@sanjamkapoor9843
@sanjamkapoor9843 8 месяцев назад
same.
@TomDytorn
@TomDytorn 8 месяцев назад
22😅2😅😅❤😅❤❤❤😅❤😅😊🎉😂😅2​
@ManOFMedan-
@ManOFMedan- 8 месяцев назад
Same 🥶
@Waxkasta
@Waxkasta 8 месяцев назад
What projects have you worked with c++? I just started cpp and I am a bit nervous
@haijuzerg6556
@haijuzerg6556 8 месяцев назад
Turbo Pascal here
@senzmaki
@senzmaki 8 месяцев назад
technically the actual code is not executed line by line, that would be horribly inefficient, it first gets compiled into byte code which is what's executed "line by line" 🤓 ☝️
@sanjamkapoor9843
@sanjamkapoor9843 8 месяцев назад
nerds are great ❤😂
@osasomoregbee4878
@osasomoregbee4878 8 месяцев назад
😂 a TypeError just occured 😂😂😂😂😂
@kooskoos1234
@kooskoos1234 8 месяцев назад
Isnt python interpreted
@senzmaki
@senzmaki 8 месяцев назад
@@kooskoos1234 the compiled byte code is what gets interpreted not the actual python code
@kooskoos1234
@kooskoos1234 8 месяцев назад
@@senzmaki o did not know that, havent touched any interpreted languages in quite some time :>
@actuallyasriel
@actuallyasriel 6 месяцев назад
Python *is* compiled to machine code, just on the fly. You can also compile Python to intermediate code just like other languages and this improves the runtime a lot.
@russosalv
@russosalv 8 месяцев назад
mhhhh compre dev time and execution time is not so correct. honestly i found python grammar more annoying then js, typescript, java and c#
@AtomicCodeX
@AtomicCodeX 8 месяцев назад
Correct
@sowoul_
@sowoul_ Месяц назад
:skull: you really gonna compare python with javascript. Javascript is literally python made worse. At least python has types.
@fueledbycoffee583
@fueledbycoffee583 8 месяцев назад
For our codebase we are using Mypy to enforce types and new 3.11 and 3.12 typing features. is not perfect but allowing parameters to have custom types via "structs" and know the return type of a function (even know if it can return exceptions) is a bless for debuggin stuff
@k1f1t
@k1f1t 5 месяцев назад
1. Write phyton 2. Convert 3. Compile 4. Run😂
@rdwells
@rdwells 5 месяцев назад
One of Python's strengths is its use as a front end to libraries like NumPy, SciPy, and TensorFlow, which are written in high-level compiled languages like C and C++. I'm guessing that the particle simulation program Lewis described was written entirely in Python. If it had been written using NumPy, it may very well have been faster than the Java version.
@mlcode_dev
@mlcode_dev 5 дней назад
They should make a statically typed version of python like they did with Typescript
@m77mo65
@m77mo65 8 месяцев назад
We transfered the whole project from python to java due its performance. Im not saying we enjoyed write java code, we had to do it.
@mattmurphy7030
@mattmurphy7030 2 месяца назад
Should have just written the core functionality in C and called out to it from python
@traveller23e
@traveller23e 2 месяца назад
What caused you to decide on Java specifically?
@FloorMann
@FloorMann 2 месяца назад
i did the opposite, then did what you said because Java stopped working
@notorious313
@notorious313 2 месяца назад
@@FloorMann”java stopped working” doesn’t make any sense, the app YOU wrote in java stopped working probably.
@FloorMann
@FloorMann 2 месяца назад
@@notorious313 im serious, java commands stopped executing, even java --version
@blenderpanzi
@blenderpanzi 8 месяцев назад
Python's json module is fast because some of it is implemented in C. Also dynamic typing does NOT makes software development easier. Only in the context of a repl it's easier, e.g. for stuff like Jupyter. But when developing serious bigger software you want static typing, even just for refactoring and clearness of APIs etc. Python gives you the speed of a dynamically typed interpreted language with optional pretty lacking typing capabilities that aren't used by all libraries. yay
@jaspermooren5883
@jaspermooren5883 6 месяцев назад
Yeah for me the biggest downside of Python is it's dynamic typing. I hate it. As a Data Scientist I use it a lot anyway, because I kinda have to, since all the good libraries are in Python, but yeah, I type as much as possible manually anyway (which is possible in newer versions of Python), and having documentation that isn't typed is just annoying. Also IDE's work way better in typed languages, the predictive text is just on a whole different level. Tab is probably the key I press the most when programming in a static typed language, you type 2 letters, and the IDE knows what you mean already.
@xx_Ashura_xx
@xx_Ashura_xx 8 месяцев назад
things to note is languages like java and c# are also "interptred" or rather use a runtime. but they also have JIT compilers which convert it into the target machine code on the fly
@AndersJackson
@AndersJackson 7 месяцев назад
And they doesn't look up names, like class, variables, functions and other scopes during exevution like Python. They do that in compilation stage, not in execution. That is why they are faster and Python slow.
@traveller23e
@traveller23e 2 месяца назад
Although faster than Python, they're still decently sluggish as compared to C.
@traveller23e
@traveller23e 2 месяца назад
@@AndersJackson Not sure about Java, but C# has reflection which does allow you to call arbitrary code by name, which has become the backbone of several important frameworks like wpf. However personally I hate it because it makes the code way more fragile and you lose a lot of the benefits of the ide when making heavy use of reflection. iirc it's also fairly slow (though normally not enough to be a problem)
@KangoV
@KangoV 6 месяцев назад
Python is also single threading. Most libraries are C/C++ underneath.
@Kuba-xw1mw
@Kuba-xw1mw 6 месяцев назад
Still faster than scratch (You don't have to use turbowarp with multiple addons to do tolerable performance)
@predatortheme
@predatortheme 2 месяца назад
am a C++ programmer and i use python daily, i love using it for anything! except code that needs to be fast... prototyping is better in python, web dev, backends, building small tools, etc etc
@rustygear9370
@rustygear9370 6 месяцев назад
A good point about using python in AI: if it used C++ or assembly, it would be already running the world.
@bluesquare23
@bluesquare23 6 месяцев назад
Did you just preface your own point that you were going to make with "good point" 😅
@horryportier7539
@horryportier7539 6 месяцев назад
You know that most high compute stuff is implement in c under the hood
@username-oz6gz
@username-oz6gz 6 месяцев назад
the SkyNet is real
@michaelwatson7211
@michaelwatson7211 6 месяцев назад
The python ML libraries wrap C++ (or similar) code, which is why real world python isn't that slow. The idea is: python 'interprets' one line then passes off all the heavy lifting to precompiled binaries, so the interpreting time is tiny compared to the execution time. If your code is not doing that you are probably doing somthing wrong. If your code is doing that, in my experiance, it's probably faster than the naive C I would have written becuse the C python is calling is very well optimised.
@sninctbur3726
@sninctbur3726 4 месяца назад
Writing an AI in Assembly 💀
@52flyingbicycles
@52flyingbicycles Месяц назад
How to write fast in Python: write as little of your code as possible in Python. I.e. use preexisting functions and libraries whenever possible so that as much code as possible is run in C instead.
@metgaming9545
@metgaming9545 7 месяцев назад
I just wish there was a mode to have it so you can specify a variables type yourself so Python doesn’t have to do it for you. Would significantly speed up run time.
@AndersJackson
@AndersJackson 7 месяцев назад
Like Ocaml or Haskel does? It is to late for Python.
@krishnendumandal6547
@krishnendumandal6547 8 месяцев назад
In python, you can build complex data structures in minutes with significantly lesser code. Great language to validate your concepts fast.
@m_a_s6069
@m_a_s6069 7 месяцев назад
Python is the slow glue used to hold some C/C++ libraries
@nathaaaaaa
@nathaaaaaa 5 месяцев назад
Correct. Python is the weaker link in the chain
@litjellyfish
@litjellyfish 5 месяцев назад
It depends on use case. Remember that Python is de facto standard scripting language for creative software. Where it’s used to produce a lot of lore full functions.
@anshumanpal2959
@anshumanpal2959 6 месяцев назад
First of all you have to know why you are learning a language if you have to be a problem solver then you should go with c++ and c. If you want to make a platform friendly application you should go with Java and python✌️
@Mars86442
@Mars86442 8 месяцев назад
And it literally uses a library for everything
@techiza652
@techiza652 8 месяцев назад
And that's a bad thing?
@Mars86442
@Mars86442 8 месяцев назад
@irtizababar2203 nope but you have to learn each one and you really don't know how did they do the library so it's so annoying
@okthisisepic9218
@okthisisepic9218 8 месяцев назад
@@Mars86442or you could just use google and quickly research the library which takes a few moments the same amount of time it would take to learn a different solution
@crazyparrot2786
@crazyparrot2786 8 месяцев назад
It's annoying for you, advantage for people who want to get things done​@@Mars86442
@Duconi
@Duconi 6 месяцев назад
Well it has to, else everything would be painfully slow and no one would use it.
@heck-r
@heck-r 2 месяца назад
The annoying part is not that it's slow, but that it's not obvious when it's slow, and it gives a fake sense of being fast due to the libraries written in C/C++ which are usually considerably faster than the average/shitty code you'd write in a faster language, but then you try to do something fancy in Python, and it becomes weirdly slow
@HectarMaker
@HectarMaker 8 месяцев назад
Python is always the better second option. But never the first one. Being "easy to code" ends up with lack of knowledge about what are you doing. Magic happens under the hood and then weird and disturbing bugs appears out of nothing. Compilation and type safety is there to minimize human errors.
@AndersJackson
@AndersJackson 7 месяцев назад
Type help humans find errors. It ALSO help the compiler make fast compiled code. Python had nothing of that. Languages like Ocaml do have the speed and ready syntax like Python. And you dont need to write the type of all variables and methods unless some fee exceptions. But you can write types in the code if you want to.
@GalaxyTracker
@GalaxyTracker 7 месяцев назад
In the modern world, coding is not only for developing apps, but just the means to an end. Try downloading and manipulating satellite datasets with C++ or doing ML in any other language without PyTorch or TF and tell me again that it's the second best option.
@Bruh-sp2bj
@Bruh-sp2bj 6 месяцев назад
just say youre ass at writing code and need your compiler to do it for you 💀💀💀
@iankabaka6529
@iankabaka6529 4 месяца назад
Why am i coding in the first place, to build and do cool tasks, can i make building easier without having to undergo so much pain in the ass?
@nbvehbectw5640
@nbvehbectw5640 8 месяцев назад
Also because it's so simple that anyone can learn it, leading to the crappy code written by amateurs
@jaspermooren5883
@jaspermooren5883 6 месяцев назад
I mean everyone has to start somewhere... But I do think the field in general has a problem with a lack of trained professionals. There's a certain dicipline required in writing good maintainable code that most people that learned it by themselves just don't have. It's one of the few technical fields where this is commonplace. You don't see a civil engineer without a degree in civil engineering design buildings or roads, but in IT it happens all the time.
@bluesquare23
@bluesquare23 6 месяцев назад
Right yeah cause a language being easy to learn is a bad thing. Fucking 🤡s.
@zhornz
@zhornz 8 месяцев назад
i thied to make a ddos tool with python and it worked but i was pulling 20mbps with 1000 req/s i writed the same code with java and i was pulling 10gbps with 8m req/s
@m96fa40
@m96fa40 6 месяцев назад
I'd rather code in assembly than writing easy and slow code
@lowlevelcodingch
@lowlevelcodingch 6 месяцев назад
bru
@bluesquare23
@bluesquare23 6 месяцев назад
I think he's doing a sarcasm?
@m96fa40
@m96fa40 6 месяцев назад
@@bluesquare23 No that's not his opinion, those are facts
@CodingWithLewis
@CodingWithLewis 8 месяцев назад
I love Python tho
@rodneynsubuga6275
@rodneynsubuga6275 8 месяцев назад
No it's a hybrid language
@user-qw1rx1dq6n
@user-qw1rx1dq6n 8 месяцев назад
Honest question would it make sense to build a system to translate python to C++ or other languages like a google translate for languages to speed up prototyping while maximizing speed
@pretro6136
@pretro6136 8 месяцев назад
@@user-qw1rx1dq6n theres multiple versions of that. The main issue is preformance and language spesific features. Normally it's more popular to add a final executable script with optimization, but python doesn't have that since it's an interperted language (and the compilers kind of sucks)
@vaolin1703
@vaolin1703 8 месяцев назад
@@user-qw1rx1dq6nthats not possible. How would you translate x = 1 x = “hello” ?
@nepeta3286
@nepeta3286 7 месяцев назад
optimize the first assignation out because the second one renders the first one useless, if you do something with it prior though, just seperate them into 2 variables, or allocate for the biggest of the 2 types, and replace with the second one (with it being a void*) when you reassign it @@vaolin1703
@Kn17tybn
@Kn17tybn 6 месяцев назад
I started programming with python and loved it. Now I’m starting to dislike it more and more. Still gonna use it for LC cus the syntax is quite simple.
@OGTennyson
@OGTennyson 19 дней назад
Why'd you start hating it??
@Kn17tybn
@Kn17tybn 18 дней назад
@@OGTennyson hate is probably too strong of a word but I’ve worked at companies where they had entire backends written in python and it’s a disaster to debug a large dynamically typed codebase. Similar errors would be caught in compile time in a OOP language like Java, c#, go etc. obviously efficiency is a problem too as the short mentions. Still a great choice for a beginner, leetcode or making small projects/scripts.
@Dong_Harvey
@Dong_Harvey 4 месяца назад
Funny thing is, Java is both slower than C and less intelligible.
@fcolecumberri
@fcolecumberri 4 месяца назад
Funnier fact: Java was made when every computer had their own gimmick so by having 1 JVM you "solve everything". Now computers are more standardized with few relevant combinations while JVM have multiple vendors (OpenJDK, Oracle, ...), multiple versions and multiple word size (you can have a 32bit JVM on a 64bit OS) so Java main feature is now a bug.
@mattmurphy7030
@mattmurphy7030 2 месяца назад
Less intelligible than C? As a full time embedded C dev and a lifelong Java dev, all I can say is wtf??
@michaelsanchez1361
@michaelsanchez1361 6 месяцев назад
The problem with python was indentation sensitive. It's hard to fix indentation issues.
@miomip
@miomip 8 месяцев назад
I've said this before. Python is really good for concept builds before using something like Kotlin for the real build. (I decided to use Kotlin as an example because it's stable and compiled)
@ThatJay283
@ThatJay283 7 месяцев назад
python also has the advantage for beginners of actually being able to see how long their algorithms take to run visually
@jaspermooren5883
@jaspermooren5883 6 месяцев назад
As a Data Scientist, I don't need python for that (still use it a ton though, although most of it is actually just calling C++ libraries), just a large enough dataset. When you dataset is millions of rows, you'll want to turn that O(n^2) algorithm into O(nlog(n)) real fast.
@birahe1810
@birahe1810 8 месяцев назад
I strongly disagree, python isn't easy to write. Every f****** time I have to check my indentation 3 times.
@oSpam
@oSpam 8 месяцев назад
That’s bad code then. Bad coding habits doesn’t fall down to the language
@okthisisepic9218
@okthisisepic9218 8 месяцев назад
So you suck at writing code then. That’s your fault. Try using an interpreter to check syntax errors or just practice more and don’t blame the language. Cause every other language has indentation
@birahe1810
@birahe1810 8 месяцев назад
@@okthisisepic9218 nope, with brackets or alternatives it's not a problem at all. I write code every day and I don't have a problem with it. Python's indentation system makes you check your tab count every time and it sucks. And no, not every language has indentation by forcing, you can write one liner program with most of them.
@hungrymusicwolf
@hungrymusicwolf 7 месяцев назад
​@@okthisisepic9218 No, indentation is not every, or even a significant majority, of programming language uses it as anything other than a way to write code that's more readable. Only structured languages do. Here is a quote from the wikipedia article about it: In computer programming, indentation style is a convention, a.k.a. style, governing the indentation of blocks of source code that is intended to result in code that conveys structure. Indentation involves using the same width of whitespace before each line of a group of code so that they appear to be related. As whitespace consists of both space and tab characters, a programmer can choose which to use - often entering them via the keyboard space key or tab key. Indentation applies to every text-based programming language. This article primarily addresses free-form languages, with special attention to curly-bracket languages (that delimit blocks with curly brackets, a.k.a. curly braces, a.k.a. braces) and in particular C-family languages. As the name implies, free-form language code need not follow an indentation style. Indentation is a secondary notation that is often intended to lower cognitive load for a programmer to understand the structure of the code. Indentation can clarify the separation between the code executed based on control flow. Some free-from languages use keywords instead of braces - for example BEGIN and END. Structured languages, such as Python and occam, use indentation to determine the structure instead of using braces or keywords; this is termed the off-side rule. In such languages, indentation is meaningful to the language processor (such as compiler or interpreter); not just the programmer. A convention used for one language can be adapted for another language.
@adtc
@adtc 7 месяцев назад
@@okthisisepic9218 Most other languages have flexible indentation purely for making code easy to read for a human. It's totally unnecessary for the compiler/interpreter. You can write an entire JS module in a single line and it will totally work. It will be nearly impossible to read, but it will work fine. (That's what minification does anyway.) So no, forcing indentation as a syntax requirement doesn't give you the right to call people who hate it as bad programmers. It was a poor choice of the language designers that makes code maintenance a bigger chore than it could have been.
@thedrew6905
@thedrew6905 2 месяца назад
it just sucks people are just sticking to it because that is what they teach in school and online courses the most
@silversurfer1967
@silversurfer1967 8 месяцев назад
All advantages of python goes away when you start debugginh a very large code base.
@RedHair651
@RedHair651 8 месяцев назад
It has the most libraries, it's very easy to do anything you need to do
@user-pe7gf9rv4m
@user-pe7gf9rv4m 8 месяцев назад
Please stop using Python.
@silversurfer1967
@silversurfer1967 8 месяцев назад
@@user-pe7gf9rv4m Would you please "assert" that every time I write a line of code ?
@techiza652
@techiza652 8 месяцев назад
​@@user-pe7gf9rv4mPlease stop using social media.
@okthisisepic9218
@okthisisepic9218 8 месяцев назад
@@user-pe7gf9rv4mwhy? It’s the most common language if you are seriously interested in most CS fields python is necessary to learn. If you are so bad at python maybe you just don’t know how to code
@rustkitty
@rustkitty 6 месяцев назад
Okay, you can knock out simple apps and MVPs real fast with dynamic typing, but further development and maintenance suffers.
@Eugen1344
@Eugen1344 8 месяцев назад
Well, the "development time" should also consider "debugging time" and "maintenance time", which are the weaknesses of Python
@revimfadli4666
@revimfadli4666 8 месяцев назад
And "lost user time"
@anderdrache8504
@anderdrache8504 8 месяцев назад
@@revimfadli4666 yes, I hate all this slow and crashy software that is excused by "faster dev times" which often isn't even true.
@revimfadli4666
@revimfadli4666 8 месяцев назад
@@anderdrache8504 this! especially if those devs end up spending more time debugging their "mvp"
@DhruvRed
@DhruvRed 7 месяцев назад
You don’t know how to write the modern python code. It doesn’t force you to do it correctly but you should be experienced enough to do things pythonic way that is use types, pydantic, asynchronous await so on whereever it is needed which speeds up the code and also makes debugging much easier
@MartinBarker
@MartinBarker 7 месяцев назад
most positives you just gave python is a bigger positives in JavaScript with Node.JS it also does not have the extend of the draw back python does with it's interpreter, the only thing is the code syntax and i would actually argue that Pythons syntax is not as clean as a C Syntax language like JavaScript.
@nomadshiba
@nomadshiba 8 месяцев назад
well some don't hate phyton because it's slow, some hate it because of the syntax
@mahesh_bvn
@mahesh_bvn 7 месяцев назад
Oh. I love it because of its simple syntax
@ActionGamerAaron
@ActionGamerAaron 7 месяцев назад
Those people are wrong.
@Duconi
@Duconi 6 месяцев назад
I agree. I love to write code in a line and let the formatter do the job of making the code look nice. But as the formatting of python changes the behavior of it, that's just not possible with python.
@ItsCOMMANDer_
@ItsCOMMANDer_ 5 месяцев назад
This is me, fuck indentation, fuck no semi colons
@pedroivog.s.6870
@pedroivog.s.6870 5 месяцев назад
​@@Duconi someone made that donut shaped code in Python
@ewerybody
@ewerybody 2 месяца назад
As a diehard Pythonista I really don't value the dynamic typing so high! I like typing stuff pretty often and could actually do without it being dynamic. I like python because of it's availability and inclusiveness! If you want speed: Try the dedicated data structures, try the plugins (numpy, scipy, pandas, keras), embed it as a plugin, try the flavors pypy, mojo ...
@davidvernon3119
@davidvernon3119 6 месяцев назад
It’s important to remember that slow also means energy inefficient. As engineers we have an obligation to the planet. We have an obligation to build systems that are as efficient as they can be made to be. Languages like Java script and python are horrible when you consider their environmental impact.
@Awesomesauce0096
@Awesomesauce0096 6 месяцев назад
You typing that comment is bad for the environment
@davidvernon3119
@davidvernon3119 6 месяцев назад
@@Awesomesauce0096 I’m not arguing that we should abandon technology. I’m arguing that we shouldn’t solve software engineering problems with pollution, but rather with thought.
@kapytanhook
@kapytanhook 6 месяцев назад
You exhale co2, you know what to do about that. It's like people in 1800 worrying about manure build up or food running out. Technology overcame it. If anything these python people seem first to get to the AI scene that will set up a comfy future for you nervous Nellys
@davidvernon3119
@davidvernon3119 6 месяцев назад
@@kapytanhook “exhale co2” try harder, this argument is a straw man. But it is also true that in order for humanity to survive we will need to radically reduce the human population. Hopefully this can be done in an orderly manner. Also, I’m not arguing that inefficient tools aren’t useful - they are. But… it is immoral to deploy them at scale. For example the cost of Python is typically considered to be 30x. That is unconscionable.
@xBintu
@xBintu 6 месяцев назад
​@kapytanhook must be a hard life being that bitter, work on yourself...
@mariogalindoq
@mariogalindoq 7 месяцев назад
Yes, every language has its pros and cons, but Java is definitely the worst language ever invented.
@Explore4code
@Explore4code 8 месяцев назад
Mojo is our big brother 😎
@Dpk_YT
@Dpk_YT 8 месяцев назад
Still in development phase
@julzorinion
@julzorinion 6 месяцев назад
I'm planning to learn more in python but because of this short video.. it makes me not continue to learn that.. by the way I'm Javascript user specially node.js and sveltejs
@mikeyangyang8816
@mikeyangyang8816 7 месяцев назад
As a developer, Python is much much much harder to debug than C, C++, or Java are. I have worked on some large Python projects. They were absolute nightmares to deal with, nothing has a reason , but everything happens (i know it doesn't make, but it is what i felt debugging it)
@twoandhalfbengals
@twoandhalfbengals 6 месяцев назад
really? I just build web servers, but back end skeleton system tell you the error 99% of the time, line to go to, and how to fix it... Java looks so messy to me, I hate it. Here some random variables a,b,c,x, alien signs.
@mikeyangyang8816
@mikeyangyang8816 6 месяцев назад
@@twoandhalfbengals Em... You are not really interfacing with Python, you are using a Python binding to the backend, which is written in other languages. If you are talking about flask or django, they are high level server tools that have python bindings. You are not really writing programs. You are defining jobs to do for the framework using python. Java's error "looks so messy" because the language itself knows exactly which part of itself is wrong and why. It is printing out the call stack to help you understand why it's not working. In python... there are no types. So, you cannot deterministically say a function works or not before it runs. This is drastically difficult to work with if you are working on a larger Python project. Try to write a 50,000 lines Python project yourself. Because I tried to do that and had to switched to C++ half way, best choice ever. Using C++ saved me probably 2 months of development time.
@twoandhalfbengals
@twoandhalfbengals 6 месяцев назад
I don't even know what I said lmao. youtube deletes my comments.
@ekaylor4104
@ekaylor4104 8 месяцев назад
Python is mainly incredibly useful due its ecosystem for some specifc tasks. For example data science is almost completely dominated by python since the libraries available are incredibly efficient and easy to use with massive dat sets. I'm sure these libraries are written in faster languages but the user never sees this. For some tasks python is well suited. Other languages are good at other things. Simple as.
@smanzoli
@smanzoli 8 месяцев назад
It's not. Slow Python is a 10 year old dead concept.
@ДмитроПрищепа-д3я
@ДмитроПрищепа-д3я 7 месяцев назад
define dead concept. Python is used constantly even today, so it's hard to call it dead imo.
@smanzoli
@smanzoli 10 дней назад
@@ДмитроПрищепа-д3яthe concept Python is slow is a dead concept. Python runs C most of time... Also, Python can easily be jit compiled, where it's simply fast enough for 99.9% usecases
@EMdragonKnight
@EMdragonKnight 6 месяцев назад
Python is great for interviewing and it has a lot of support in machine learning. Other than that I don't think its got much going for it.
@jaspermooren5883
@jaspermooren5883 6 месяцев назад
Yeah only reason I use it as a Data Scientist, all the libraries it has. I'd have much prefered those libraries to exist in a language more conducive to Data Science (where efficiency of a program is real important, these programs take forever to run sometimes), but such is life, sometimes you have to adept to what already exists, and the historical argument becomes a big deal. Of course that is all Cython, but if you ever forget that and try to write something yourself, you're in for a lot of coffee breaks.
@taylorswe
@taylorswe 8 месяцев назад
Instructions misunderstood - now programming in elixir
@lordgiacomos2551
@lordgiacomos2551 8 месяцев назад
The normal Python JSON library isn't even the fastest one that exists for the language iirc
@Josh-kw7zk
@Josh-kw7zk 8 месяцев назад
I love pip, got basically anything
@Sycokay
@Sycokay 6 месяцев назад
I'm too old to find interpreters or jit compilers sexy - or to understand what makes Python easier to code and read than Pascal.
@LG-qz8om
@LG-qz8om 6 месяцев назад
Python is the new BASIC It is a general learning language that just happens to have a lot of cool libraries compiled in other language.
@tahmidnewaz3082
@tahmidnewaz3082 29 дней назад
Jokes on you I first code in python then translate it to other languages
@Darth_Insidious
@Darth_Insidious 4 месяца назад
There's not many languages which can beat the ease of pip. I've had c libraries render parts of my OS unusable after a botched uninstall
@woa1350
@woa1350 4 месяца назад
Csharp and it’s nuget package manager is pretty much on par with pip, or the dotnet cli package manager
@ThomasVWorm
@ThomasVWorm 2 месяца назад
Ruby does it with ease. Bundler is far better than pip.
@rokasbarasa1
@rokasbarasa1 7 месяцев назад
Development is not fast at all. I am a lot faster at writing production code in javascript or go. Python is hard to debug
@4t0mic57
@4t0mic57 8 месяцев назад
Dynamic types is clearly a con tho
@BlueSheep777
@BlueSheep777 7 месяцев назад
Easy to read syntax yeah right. Can you teach us how to do from __future__ import braces correctly?
@addmix
@addmix 8 месяцев назад
Even for what Python is, it's unnecessarily slow.
@AntranigVartanian
@AntranigVartanian 5 месяцев назад
Dear Lewis, “development time” is a myth that’s created by shitty developers :)
@ColinRichardson
@ColinRichardson 7 месяцев назад
The SYNTAX is the WORST part of Python.. the fact that you are calling it a Pro is just mind-boggling.
@maswinkels
@maswinkels 20 дней назад
I haven't ever heard a compelling argument for dynamic typing. It's tragic how such a useless 'feature' harms an otherwise great language.
@americanhuman1848
@americanhuman1848 19 дней назад
garrys mod lua addons:
@mqmi5251
@mqmi5251 8 месяцев назад
python is the goat
@2nito
@2nito 21 день назад
people will find a con for everything bruh
@JoseLucasd
@JoseLucasd 15 дней назад
Cuz everything has a con.
@Виталий-к9ь
@Виталий-к9ь 6 месяцев назад
У питухона НЕТ положительных сторон. Динамическая типизация, отсутствие нормальной рефлексии и подсветки синтаксиса усложняет разработку и ничего не даёт взамен. Те, кто говорит что писать на питухоне проще чем на других языках, обычно приводят в пример hello world, или аналогичные небольшие программки. Чтож, питухон - это действительно самый простой язык чтобы написать hello world, но в серьезных проектах он будет проигрывать нормальным языкам во всех аспектах.
@iblocstudios5563
@iblocstudios5563 7 месяцев назад
lua is better it is easier than python and has a builtin compiler and interpreter for debugging
@thepriestgodneverpaid
@thepriestgodneverpaid 5 месяцев назад
and as well python is mainly used for ai code which you one once in a while
@HkRines
@HkRines 5 дней назад
It is... You can code in Java in almost the same speed....
@BirCplusplusGeliştiricisi
@BirCplusplusGeliştiricisi 6 месяцев назад
I always use C++. Fast and determined.
@shivam_in
@shivam_in 7 месяцев назад
For me java code is easier to read and debug than python.
@bluesquare23
@bluesquare23 6 месяцев назад
You're probably better at Java than you are at Python.
@fewbronzegames
@fewbronzegames 6 месяцев назад
tbh, python is just a good language to learn for things that don't need to run insanely fast, like robotics, some web development, and many other things, in robotics in particular i would always use python because it has good support for it and unless you are making something really complicated it's much easier
@Wyklepheph
@Wyklepheph 6 месяцев назад
Dynamic types do NOT let you program faster, they just lower the barrier to entry and make it easy to do really stupid things for no good reason. Especially when you can still have type inference and static typing. Idk, dynamic typing held me back for a while and prevented me from learning important concepts bc it was always too easy to just use python. I learned Nim a while ago and write way better code as a result, regardless of what I'm using now. I can do way more, with far less debugging compared to dynamically typed languages.. It feels closer to test driven development, if anything. Nim's the first thing I reach for when thinking of what to use to build something with because I can compile tiny little binaries for any system and it actually frees my brain up to think more about orienting my design around data, not classes.
@Livelandr
@Livelandr 8 месяцев назад
Python is scripting language, change my mind
@adtc
@adtc 7 месяцев назад
What's the difference? Lol
@darioferretti3758
@darioferretti3758 6 месяцев назад
Python is just worse lua, but with more libraries
@SpaceSaver2000
@SpaceSaver2000 7 месяцев назад
I still prefer Node.JS
@maxwell6881
@maxwell6881 Месяц назад
"so, choose wisely" Thats the neat part, python is so easy you can just learn it anyways, even if you dont need it now.
@animuspexus
@animuspexus 6 месяцев назад
no gotos and jumps from break/continue... really good syntax?
@NiCo-gw2dh
@NiCo-gw2dh 5 месяцев назад
The json package is extremely slow for me for (de)serialisation. I use orjson (Rust implementation) which is way faster
@giosee_
@giosee_ 28 дней назад
We ignore the fact that python is slow only when debugging, once compiled it run way faster, also you can type hint to reduce runtime checks.
@arhombus8485
@arhombus8485 5 месяцев назад
Thats why you should use different languages for different usecases. Use python for simple things like APIs or small calculations or small algorythms, use Java or C for calculating graphs, physics and other stuff
@SkyyySi
@SkyyySi 8 месяцев назад
There are may dynamic scripting languages that are much faster than Python. They may be a reason, but are certainly not *the* reason.
@litjellyfish
@litjellyfish 5 месяцев назад
And Java can also be considered slow depending on what you compare it to. Also if parts of the Python code is really slow you can create that function in C / C++ and just call it.
@Shakor77
@Shakor77 7 месяцев назад
Dynamic typing SLOWS down development time. It is only for small scripts where dynamic typing feels faster. Static typing is much better for large programs.
@jaspermooren5883
@jaspermooren5883 6 месяцев назад
Yeah it's the worst part of Python. I don't like dynamic typing at all. It just makes everything way less clear. At least in Python you can type still, but it is just not nice and the fact that it's not enforcable, removes all the predictablility of enforced static variables. Dynamic typing causes so many bugs, it's unreal. I still use Python all the time, but that's because as a Data Scientist you kind of have to, since it's where all the good libraries are, but that doesn't mean I like it.
@PodcastClips910
@PodcastClips910 6 месяцев назад
Ppl always say python is slow and I've yet to meet a person who actually came up with an example where it bothered them. Nowadays computers are very powerful and for 99.9999% of programmers python's speed is enough. That comes from a c# programmer who learned python for ML
@SivaranjanGoswami
@SivaranjanGoswami 8 месяцев назад
Note that Python is a scripting language. It is not designed to write everything from scratch. Use the right package for your work, Python works way faster than a custom C or C++ code that is not properly optimized.
@sacredgeometry
@sacredgeometry 6 месяцев назад
Yeah, sorry no. Development time might be fast if you are just spaffing out bullshit scripts that only need to be run once and never changed then thrown away. if you are trying to write anything that needs to be worked on for years or maintained that "fast" development time ... its not that much faster if at all faster btw, fast turns to much much slower development time. At least its strongly typed, if it was weak and dynamic it would be even more of a clusterfuck.
@cerberusrap
@cerberusrap 7 месяцев назад
If you are not using ML libraries, python 3 is most dumbest language I've ever seen. Maybe it can used for learning algorithm logic, but that's it. Sorry newbies. That's truth.
@Sina_Qadri
@Sina_Qadri Месяц назад
That is why Rockstar games Used Py on GTA 5's source code. Yes I'm not joking I have the src myself and most of the codings are either CS or py Which is Interesting to me
@TheSingleWolf
@TheSingleWolf 6 месяцев назад
Easy to read syntax? That wasn’t my impression at all.
@hikari1690
@hikari1690 7 месяцев назад
Python developers doing web dev hate JavaScript cause of dynamic typing. And here's thos guy calling it a pro. He's such a con
Далее
Why Are Open Source Alternatives So Bad?
13:06
Просмотров 644 тыс.
When you Accidentally Compromise every CPU on Earth
15:59
Why Everyone Is OBSESSED With Arc Browser
10:26
Просмотров 295 тыс.
God-Tier Developer Roadmap
16:42
Просмотров 7 млн
How Fast Can I Fill My Inbox?
13:30
Просмотров 318 тыс.
The Most Legendary Programmers Of All Time
11:49
Просмотров 569 тыс.
10 Crazy Python Operators That I Rarely Use
11:37
Просмотров 19 тыс.
"Clean" Code, Horrible Performance
22:41
Просмотров 891 тыс.
How One Line of Code Almost Blew Up the Internet
13:47