Programmers are pretty smart people.
Smart Programmer
Smart people sometimes like to show off their smarts by demonstrating their mental juggling abilities.
if you can reliably remember you can write similar code.
for (int j=0; j<34; j++) {
s += (t[j]*4)/5;
}
Professional Programmer
A professional programmer understands that clarity is king. Professionals use their powers for good and write code that others can understand.
int realDaysPerIdealDay = 4;
const int WORK_DAYS_PER_WEEK = 5;
int sum = 0;
for (int j=0; j < NUMBER_OF_TASKS; j++) {
int realTaskDays = taskEstimate[j] * realDaysPerIdealDay;
int realTaskWeeks = (realdays / WORK_DAYS_PER_WEEK);
sum += realTaskWeeks;
}
Write readable and understandable code.
i couldn't add indentation, if you know please write in comment.
Keep Learning!
Top comments (10)
You could have created a code block that preserves indentation.
Format:
[three backquotes][name of the language]
Your code
[Three backquotes]
it's very cool. thanks Manav, I will try
"A professional programmer understands that clarity is king. Professionals use their powers for good and write code that others can understand." YES YES and YES!
I read it in book "Clean Code" by C.Martin a.k.a "Uncle Bob"
I'll suggest to read this book. i can send you soft copy.
Just a reminder that any form of piracy via dev.to is going to be against terms of service.
thanks for notifying
Yes I know, I've already read it. Such a lovely book.
Lookup Markdown syntax to properly add indentation.
Nice point of view!
Thank you!
thank you for your support 😊
Some comments may only be visible to logged-in visitors. Sign in to view all comments.