Recent Posts
Recent Comments
Tags
- UX
- 클린코드
- Google Analytics
- devbookclub
- data management
- Day.js
- cleancode
- 존 야블론스키
- react ga
- github clone
- NomadCoders
- uxui
- Day js
- 개발자북클럽
- 포그리트
- 노개북
- react scripts
- react ga4
- law of ux
- 구글애널리틱스
- React
- Data Driven UX
- 노마드코더
- 구글 애널리틱스
- 깃헙 클론 에러
- Clean Code
- Jon Yablonski
- FOUR GRIT
- github
- nomad coders
Link
TURI BLOG
[Nomad Coders Challenge] Clean Code - Assignment #06 본문

📍 It is part of a book club challenge on a programming learning website called Nomad Coders. The challenge is to demonstrate what I have learned after reading Clean Code by Robert C. Martin.
📝 It will consist of the following sections over three weeks: the range of reading, the top quotes from the book, my review, and remaining questions.
💻 I plan to read Clean Code in JavaScript and Python, referring to the GitHub repositories shared by Nomad Coders with the challengers.
Assignment #06
- ✔️ Mission #01
- 📚 Recap
- Top quotes from the book - Chapter 3. Functions
- Remaining questions
🎯 Mission #01
- Quiz 1.
- Use searchable names
From numbers without any explanation, not only is the code not searchable later, but you also won’t know what the values represent.// BAD ⛔ // What the heck is 86400000 for? setTimeout(blastOff, 86400000); // GOOD 😎 const MILLISECONDS_PER_DAY = 60 * 60 * 24 * 1000; //86400000; setTimeout(blastOff, MILLISECONDS_PER_DAY);
This is neither an understandable nor an efficient way to write code.
To address this, I defined a variable with a readable name and used it in the method.
- Use searchable names
- Quiz 02.
- Use meaningful and pronounceable variable names.
This variable name for the method is not meaningful or readable for users.// BAD ⛔ const yyyymmdstr = moment().format("YYYY/MM/DD"); // GOOD 😎 const currentDate = moment().format("YYYY/MM/DD");
It should have a meaningful name to convey what it represents clearly.
- Use meaningful and pronounceable variable names.
- Quiz 03.
- Don't add unneeded context
- If your class/object name tells you something, don't repeat that in your variable name.
..// BAD ⛔ const Car = { carMake: "Honda", carModel: "Accord", carColor: "Blue" }; function paintCar(car, color) { car.carColor = color; } // GOOD 😎 const Car = { make: "Honda", model: "Accord", color: "Blue" }; function paintCar(car, color) { car.color = color; }
- If your class/object name tells you something, don't repeat that in your variable name.
- Don't add unneeded context
📝 Recap - Chapter 3. Functions
🔍 Remaining questions
- Moment.js
🔗 Additional Resources
'Nomad Coders' 카테고리의 다른 글
[Nomad Coders Challenge] Clean Code - Assignment #08 (3) | 2024.12.08 |
---|---|
[Nomad Coders Challenge] Clean Code - Assignment #07 (0) | 2024.12.07 |
[Nomad Coders Challenge] Clean Code - Assignment #05 (0) | 2024.12.05 |
[Nomad Coders Challenge] Clean Code - Assignment #04 (1) | 2024.12.02 |
[Nomad Coders Challenge] Clean Code - Assignment #03 (1) | 2024.12.01 |
Comments