3 Python MISTAKES You Should Avoid!! #python #programming #coding

3 Python MISTAKES You Should Avoid!! #python #programming #coding

b001

1 год назад

522,920 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@TekKskakwmkwm111
@TekKskakwmkwm111 - 25.12.2024 10:42

If a module has a strictly defined _all_ object, wildcard imports are OK. Sorry, that one seems arguable.

Ответить
@dodouniquelife9725
@dodouniquelife9725 - 17.12.2024 21:36

How to Know How many Built in Python Functions are There???

Ответить
@Luda_is_taken.Try_Ludoed228
@Luda_is_taken.Try_Ludoed228 - 16.12.2024 15:01

Loading just one function from a module does not improve perfomance overhead, since the rest of the module is still left loaded in the memory. You pay for the whole math lib, use the whole math lib

Ответить
@justliberty4072
@justliberty4072 - 07.12.2024 05:54

Yeah, a single-letter-variable for a loop index or counter of some kind seems at worst harmless and at best very readable with intentions immediately obvious.

Ответить
@ExcitedBoy678
@ExcitedBoy678 - 04.12.2024 13:44

Great video ❤
But can I know which program you're using? (The one in the video)

Ответить
@PolySorinYT
@PolySorinYT - 03.12.2024 16:52

the variable i: "why would u do this! i was helping everyone and this is how u repay me😭"

Ответить
@copterphontan9928
@copterphontan9928 - 30.11.2024 04:41

RIP
for i in range()
And
For i,v in enumerate()

Ответить
@iaminfinityiq7182
@iaminfinityiq7182 - 21.11.2024 18:00

Not in my own programming language 💀💀💀

Ответить
@CarlosGonzalez-mp9re
@CarlosGonzalez-mp9re - 18.11.2024 12:22

For the last point I see a some of useful exceptions:
- i, j, k as abbreviations of index: they are ubiquitous and everyone understands it (although you should avoid nesting loops to need that many index names).
- import module as <letter>: since the module object itself is not useful, you will be using its methods and attributes, and their names will give additional context to the abbreviation.
- lambdas: since they are simple and mostly single use, the context should be enough to understand it.
- short lived variables: if you need some placeholder for up to... idk, 8 lines of code, a single letter variable or even an underscore is okay. Although avoid using more than one at the same time (unless the example is trivially simple, like an add two numbers function).

Ответить
@hikari1690
@hikari1690 - 18.11.2024 10:30

Atleast he's self aware about the last tip

Ответить
@jeremieportejoie2254
@jeremieportejoie2254 - 16.11.2024 18:58

That flashback was unnecessary as your code is simple and readable

Ответить
@aaaaaaaa2008-h8z
@aaaaaaaa2008-h8z - 11.11.2024 16:18

Thanks

Ответить
@pqsk
@pqsk - 07.11.2024 06:36

Mistake #4: using python

Ответить
@vilenius187
@vilenius187 - 03.11.2024 05:58

My code: i = [y, x for p, a in enumerate(l) if o == e]

Ответить
@abebuckingham8198
@abebuckingham8198 - 02.11.2024 23:22

Previously I used single letter variable names but now I just call them xa, xb, xc, ...

Ответить
@rproctor83
@rproctor83 - 02.11.2024 03:51

Everything in context. You might want to overwrite a function. You must might want to import all, and you might want single character variables. Different tools, different context.

Ответить
@LOGoltem4682
@LOGoltem4682 - 31.10.2024 13:04

1. Use Python, unless you do data science.

Ответить
@dillanvogt2442
@dillanvogt2442 - 31.10.2024 12:08

I love you he admits he also makes the common mistakes

Ответить
@danielalvesldiniz
@danielalvesldiniz - 30.10.2024 09:49

"from moduleX import foo" still loads the entire moduleX. there is no performance gain.

Ответить
@anonymousssim
@anonymousssim - 28.10.2024 21:03

i just need your vs code theme ❤

Ответить
@raviexthegod
@raviexthegod - 26.10.2024 11:06

The only time I do single letters is when Im doing something like algebraic expressions and equations using established equations ij my code, like using an equation to allow an accurate graph of a realworld equation to be referenced by the program during runtime. For example, lets say im working with statistics and exponential functions, I would use the variables given in the equation I'm referencing and use comments to provide the context of the referenced equation.

Ответить
@jzthegreat
@jzthegreat - 26.10.2024 04:45

You had us the in the first half ...

Ответить
@The-CoIIector
@The-CoIIector - 25.10.2024 15:27

int1 int2 int3 int4 int5 int6 ect...
Anyone?

Ответить
@fusion.studioX
@fusion.studioX - 17.10.2024 20:26

you can use single letters for meaningless variables like the examples

Ответить
@im_a_chair.
@im_a_chair. - 17.10.2024 18:09

just use c++

Ответить
@lebleathan
@lebleathan - 15.10.2024 17:54

How is this related to python?

Ответить
@spinnenente
@spinnenente - 14.10.2024 12:51

for the second one please just use an ide. don't do imports manually. life's too short to do imports manually.
First one is a great tip especially with with a good example.
Last one is ok for writing but replace them by refactoring the var names when you managed to get it running. Exceptions are x y i and maybe n

Ответить
@gsshyxh
@gsshyxh - 05.10.2024 14:12

你好

Ответить
@jumpjump-oz2pr
@jumpjump-oz2pr - 03.10.2024 13:40

As someone who also do C usibg a ' hurt my eyes

Ответить
@andreujuanc
@andreujuanc - 23.09.2024 12:26

The actual mistake is to use python to begin with

Ответить
@thomascorreia1365
@thomascorreia1365 - 23.09.2024 04:05

Which IDL do you use to program?

Ответить
@spyroninja
@spyroninja - 21.09.2024 16:57

1. Using python

Ответить
@PanduPoluan
@PanduPoluan - 19.09.2024 17:16

It's actually okay to use singular variable name of "i" because it has become a convention that "i" is the iterating variable, specifically of type integer.

Of course it's better to use a more descriptive name when possible, but sometimes it's not really necessary and instead reduces readability.

Ответить
@spikes1210
@spikes1210 - 19.09.2024 06:59

Excellent video

Ответить
@CodingWithAnshu
@CodingWithAnshu - 18.09.2024 18:49

Themes?

Ответить
@ErrorINAOfficial
@ErrorINAOfficial - 16.09.2024 19:06

This isn’t just python, you shouldn’t do this stuff in any language

Ответить
@Dontlikeyellow
@Dontlikeyellow - 13.09.2024 19:45

Remember the golden rule: the size of the variable should be proportional to the project size.
This is to not waste time making variable names whilst still allowing you and others to look trough the code within a reasonable time frame.

Ответить
@faizalam7776
@faizalam7776 - 11.09.2024 08:58

Theme name ?

Ответить
@gojosatoru1252
@gojosatoru1252 - 11.09.2024 01:26

Pylint and mypy gonna help with that

Ответить
@ThomasLyhneHansen
@ThomasLyhneHansen - 10.09.2024 18:49

Why do you say Wild card import cause “unnecessary performance overhead”? I don’t think this true. When importing another module, Python loads everything from that module whether you use wild card import or not. The only difference is the name space pollution.

Ответить
@thomasschodt7691
@thomasschodt7691 - 10.09.2024 16:00

Python mistakes:
Fundamental syntax variations from version to version...
Who wants to learn python if your knowledge could become obsolete from version to version...

Ответить
@someone_else_4U
@someone_else_4U - 09.09.2024 16:11

Flashback of "single letter variable name" got me rolling😂

Ответить
@goodoleeli7921
@goodoleeli7921 - 05.09.2024 18:55

I’m new to python, what program is he using to code

Ответить
@divyanshukumarchaudhary716
@divyanshukumarchaudhary716 - 04.09.2024 08:16

😂

Ответить
@drbadzer
@drbadzer - 02.09.2024 14:18

Single letter variable names are okay if your code is 10 lines or less and is very easy to trace

Ответить
@stalker32041
@stalker32041 - 01.09.2024 01:13

str more than function... It's class

Ответить
@IfYouEscapedYTKidsIWillGetYou
@IfYouEscapedYTKidsIWillGetYou - 27.08.2024 01:10

Mistake 2 is not a problem, its just if you do only this then do only this

Ответить
@muntahmahfuzsrestho.
@muntahmahfuzsrestho. - 24.08.2024 22:59

So helpful. 😊

Ответить
@le9038
@le9038 - 23.08.2024 05:55

"Try not to use single letter variable names"
TI-BASIC Developers: *Uncontrollable Sobbing*

Ответить
@hzon1405
@hzon1405 - 16.08.2024 22:53

The code in the video is small, so using a single letter as a variable name doesnt affect the code's visual that much

Ответить