👉 To try everything Brilliant has to offer for free for a full 30 days, visit brilliant.org/TechWithTim . You'll also get a 20% discount on a premium subscription.
@misbahsaleem3332
8 сағат бұрын
Love from Pakistan ❤❤❤
@vcv6560
7 сағат бұрын
As in a conversation I had with a manager of some years ago said: Supervisor. "I'm not going to tell you how to do it..." Managed. "Yeah, but you'll be the first to let me know if I'm doing it wrong." We worked well together....
@dakoderii4221
2 сағат бұрын
"Do 1,000 things right and no one will remember. Do one thing wrong and no one will let you forget." - Drill Sergeant Phillips
@EyosiyasBelete-ge7fv
8 сағат бұрын
Who else loves coding
@TechWithTim
8 сағат бұрын
Moi!
@RaadClub
8 сағат бұрын
Love coding but hate the fact that can land even an internship in my god damn country.
@CoaLearn
7 сағат бұрын
I'm love from coding
@andreadelcortona6230
6 сағат бұрын
Great straightforward content I always learn something Thanks Tim!
@balloney2175
8 сағат бұрын
Thanks, Tim for the advice... as always... you are my hero!
@StuartLoria
2 сағат бұрын
Best practices is what I need, how the syntax works is what the docs are for, this video here is added value to go pro.
@RileyMeta
8 сағат бұрын
6:40 An alternative that you can leverage: match and case. It generates a look up table during run-time so it matches instead of checks.
@johnbennett1465
6 сағат бұрын
While the first example fix is fine for a general case, it has a different problem. It uses an if statement to just return true/false. In this simple case, just return the boolean expression.
@scragar
Сағат бұрын
I am also a fan of writing that sort of thing in reverse with early exits too. Writing if (! user.is_authenticated) return false; if (user.account_status != "active") return false; Just helps you keep less things in mind, eventually you wind up with a situation where multiple conditions combine and actually this page needs you to either allow anonymous submission or be logged in with permission or be an admin and if you do need to be logged in your account needs all the active stuff. Writing if (config.allow_anonymous_posting) return true; if (user.account_status != "active") return false; if (user.is_admin) return true; Etc just becomes a much nicer way to handle it than a single big boolean expression.
@johnbennett1465
5 сағат бұрын
Good solution for the second example. But if you don't care about performance, there can be short clear alternatives. In this case using "if number in range(2, 100, 2):" is much clearer. Just make sure you never do this in code that might be called a lot.
@dfields9511
27 минут бұрын
I have seen some really bad code in my professional career Even comments that say We now call our recursive private constructor Neeto “gag” It was creating a n-ary tree from a list
@nasccped
4 сағат бұрын
In the first mistake, you can also use all() Python function. It tests if all conditions (inside an iterable) are true. Else, return false
@JosphatKangethe-yp1mh
8 сағат бұрын
Hey Tim can you do a video discussing Devops roadmap
@johnbennett1465
4 сағат бұрын
For example five, passing a non-number should raise an error.
@niyondacrypticszealot1587
8 сағат бұрын
Thank you for this.
@StuartLoria
3 сағат бұрын
The first point is what my team does not understand, they like complexity hard to read code with lots of implementation details.
@HtunWinSoe-h1w
6 сағат бұрын
In 4-fixed file, should we write necessary functions for process in a separate file, and then import into the main file?Is it a conventional way to write code like this?I am beginner to this ?Really appreciate and love your work bro ❤
@kilianklaiber6367
8 сағат бұрын
You could have also defined a function, which returns true, if the numbers is valid and else whatever you want it to say.
@kilianklaiber6367
8 сағат бұрын
Nice job, I like that you readability over conciseness. Creating a dictionary is a great idea.
@kapibara2440
4 сағат бұрын
Thank you for your tips Tim! They are all so useful in daily life 💪
@GeekRedux
7 сағат бұрын
So what does continue actually continue? Because its use here is the opposite of my intuition. Like in this example, if it's true that it's not a number, the use of continue seems to me to mean that that was the desired result so the program should continue on to the next test. If it's out of range or is odd the program should continue on to appending the number. Does continue mean leave the function without appending, because that is the exact opposite of what I would expect that command to do.
@rootytuners
6 сағат бұрын
Continue means “continue with the looping process.” It ends the current iteration and proceeds to the next iteration of the loop.
@GeekRedux
5 сағат бұрын
@@rootytuners Got it, thanks. Still not the best name lol
@graynanuuq
4 сағат бұрын
Are functions within functions considered bad? In trying to avoid error 5, I frequently create a number of input validating/sanitizing steps which can border or fall into error 4, a large function that is difficult to quickly grok. Is creating subfunctions within a function to do the input sanity checking considered maintainable or should all the sanity checking be peer level functions? Some of the sanity checking functions are nearly universal and for those it makes sense to be peer level, but a good chunk end up relating only to one specific function.
@TechWithTim
4 сағат бұрын
Nested functions are “okay” but you want to avoid doing it too often as it’s just harder to read the more nesting you have going on
@graynanuuq
4 сағат бұрын
@@TechWithTim Thanks. I try to restrict it to one layer, so with code folding I can tell what the sanity checking steps are by the names before getting to the meat of the function itself.
@gregf9160
8 сағат бұрын
The 'continue' option is _really great_ in simplifying and making code even more readable 👍
@dfields9511
27 минут бұрын
I hate continue
@misbahsaleem3332
8 сағат бұрын
1st comment ❤❤❤
@misbahsaleem3332
8 сағат бұрын
And from Pakistan ❤❤❤😊
@WHAT.IF_UZ
8 сағат бұрын
is there anything for the first viewers and commenters and likers
@WHAT.IF_UZ
8 сағат бұрын
is there anything for the first viewers and commenters and likers
@TechWithTim
8 сағат бұрын
a heart
@WHAT.IF_UZ
8 сағат бұрын
@@TechWithTim what does that mean bruh
@TechWithTim
8 сағат бұрын
@@WHAT.IF_UZ what do u want lol
@WHAT.IF_UZ
8 сағат бұрын
@@TechWithTim a free course for frontend and backend development?
@whoami-ty1kp
7 сағат бұрын
@@WHAT.IF_UZyeah like you've survived world war by being the first viewer lmao.
Пікірлер: 46