DEV Community

Shoaib Akbar
Shoaib Akbar

Posted on

One Difference Between Smart and Professional Programmer

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)

Collapse
 
sigmapie8 profile image
Manav • Edited

You could have created a code block that preserves indentation.

Format:
[three backquotes][name of the language]
Your code
[Three backquotes]

Like this
Collapse
 
shoiabakbar profile image
Shoaib Akbar

it's very cool. thanks Manav, I will try

Collapse
 
mx profile image
Maxime Moreau

"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!

Collapse
 
shoiabakbar profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Shoaib Akbar • Edited

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.

Collapse
 
integerman profile image
Matt Eland

Just a reminder that any form of piracy via dev.to is going to be against terms of service.

Thread Thread
 
shoiabakbar profile image
Shoaib Akbar

thanks for notifying

Collapse
 
mx profile image
Maxime Moreau

Yes I know, I've already read it. Such a lovely book.

Collapse
 
zubairmohsin33 profile image
Zubair Mohsin

Lookup Markdown syntax to properly add indentation.

Collapse
 
ruthiel profile image
Ruthiel Trevisan

Nice point of view!
Thank you!

Collapse
 
shoiabakbar profile image
Shoaib Akbar

thank you for your support 😊

Some comments may only be visible to logged-in visitors. Sign in to view all comments.