
Clean Code: Functions (Part 1) - Beau teaches JavaScript
video description
Date: 2022-03-14
Comments and reviews: 4
Jason
Beau, what's your take on ternary operators with respect to -clean- code? I've seen the complaint that they aren't as readable as ifs, but I happen to like them (as long as there's no nesting or really weird stuff going on). For example at about 7:00 lines 104 to 108 could be,
const portfolio = employee.type === 'manager' ? employee.getMBAProjects() : employee.getGithubLink();
and you would retain the use of const. But, would this be considered -clean-? As a newer programmer, these nuances are tough to figure out, so thanks for these videos.
reply
Beau, what's your take on ternary operators with respect to -clean- code? I've seen the complaint that they aren't as readable as ifs, but I happen to like them (as long as there's no nesting or really weird stuff going on). For example at about 7:00 lines 104 to 108 could be,
const portfolio = employee.type === 'manager' ? employee.getMBAProjects() : employee.getGithubLink();
and you would retain the use of const. But, would this be considered -clean-? As a newer programmer, these nuances are tough to figure out, so thanks for these videos.
reply
Learn
-Thanks to Ryan McDermott (-ryconoclast) for writing the article that inspired this video.-... you mean, copied and pasted everything and made few mistakes doing that? You had one job.
reply
-Thanks to Ryan McDermott (-ryconoclast) for writing the article that inspired this video.-... you mean, copied and pasted everything and made few mistakes doing that? You had one job.
reply
Sagnik
U said of removing duplicate in code...then told not using flags and then made 2 functions with almost duplicate code? Which practice should I follow!
reply
U said of removing duplicate in code...then told not using flags and then made 2 functions with almost duplicate code? Which practice should I follow!
reply
Anurag
At 1:32 , emailClient is still filtering the records, maybe one could directly get an array of active clients and call email functions on it
reply
At 1:32 , emailClient is still filtering the records, maybe one could directly get an array of active clients and call email functions on it
reply
Add a review, comment
Other channel videos















