Avoid Inlining Magic Values

  Рет қаралды 38

Senior Code Review Buddy

Senior Code Review Buddy

5 ай бұрын

There are often times that we need certain values in our code, like some string value to properly retrieve a value from a data set, a limit for some threshold or the URL of a server to query.
When the value is put directly into the code, it can be hard to understand what that particular value was chosen, it tends to be lacking context around it’s meaning. And thus it becomes a magic value.
Today I’ll talk about this, and how we can improve readability by moving these magic values into constants.
While all my examples today are in Python, this idea applies to most programming languages.

Пікірлер
Avoid Overly Complex Statements
9:42
Senior Code Review Buddy
Рет қаралды 719
How to run C++ program in command prompt
1:00
Coding is Love
Рет қаралды 180 М.
Каха ограбил банк
01:00
К-Media
Рет қаралды 11 МЛН
OMG😳 #tiktok #shorts #potapova_blog
00:58
Potapova_blog
Рет қаралды 4,3 МЛН
My little bro is funny😁  @artur-boy
00:18
Andrey Grechka
Рет қаралды 13 МЛН
Physicists Claim They Can Send Particles Into the Past
7:21
Sabine Hossenfelder
Рет қаралды 262 М.
When to Write Unit Tests vs  Integration Tests
8:57
Senior Code Review Buddy
Рет қаралды 734
IT’S GETTING BAD! James Webb's Finding Ends Debate in Physics
15:15
Cosmos Chronicles
Рет қаралды 2,3 М.
Germany | Can you solve this ? | Math Olympiad
7:02
Master T Maths Class
Рет қаралды 1,9 М.
C vs Python Speed Test #cpp #python #programming #code
0:25
Nicolai Nielsen
Рет қаралды 120 М.
Что не так с яблоком Apple? #apple #macbook
0:38
Не шарю!
Рет қаралды 475 М.
iPhone 16 с инновационным аккумулятором
0:45
ÉЖИ АКСЁНОВ
Рет қаралды 3,5 МЛН
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,5 МЛН