A PROGRAMMER'S GUIDE TO
WRITE CODE LIKE A PRO
There is no doubt that a complex so�ware applica�on development
process ain't easy. If there are more professionals involved in a certain
project, code conven�ons and format could save �me and makes
maintenance easier.
Here are some �ps we would like to share in order to make reader-
focused code a piece of cake:
1. Document your code
It's true that deadlines could make it
harder for programmers to maintain
the documenta�on up-to-date, but this
should be considered a con�nuous
process.
Before you start wri�ng new func�ons,
write down and explain the steps that
should lead to expected results.
2. Use descriptive names
Giving descrip�ve and pronounceable
names will impart meaning to func�ons,
variables and classes. If you'll choose
suitable names, later in your future
edi�ng sessions, everybody will know
what all those variables are reffering to.
Moreover, by doing so, there's no need
for useless self-explanatory comments.
3. Add white spaces
We all were taught in schools to break
our stories into paragraphs in order not
to discourage the reader before he/she
starts to read. This rule can also be
applied in this case.
Adding white space could greatly
improve the readability of your code.
x
4. Code line length
Reading on a computer screen is harder
than reading text on paper. In most
cases, the light on a computer display is
�ring the eyes.
Studies have shown that our eyes are
more comfortable with short lines of
code instead of long lines. If code lines
are too wide, it takes longer to return to
the start of the line of code.
5. Delete unnecessary code
6. Refactor your code
Did you happen to gather blocks of code
that are old and no longer necessary?
Well, maybe you should take a few
minutes to clean them up in order to
avoid confusion and poten�al
misunderstanding.
Clean code will always be a pleasure for
anyone new working on a project
Despite ge�ng rid of the useless code
lines, it's necessary to restructure the
exis�ng ones. While refactoring, you
could improve the code readability and
reduce its complexity.
Remember: Always make your code
be�er than you found it!
c o d e y o u r b u s i n e s s
AXONSOFT
Bd. 21 Decembrie 1998, nr. 126
400604 Cluj-Napoca
Tel +40 264 487 026
Email office@axonso�.ro

A programmer's guide to write code like a pro [Infographic]

  • 1.
    A PROGRAMMER'S GUIDETO WRITE CODE LIKE A PRO There is no doubt that a complex so�ware applica�on development process ain't easy. If there are more professionals involved in a certain project, code conven�ons and format could save �me and makes maintenance easier. Here are some �ps we would like to share in order to make reader- focused code a piece of cake: 1. Document your code It's true that deadlines could make it harder for programmers to maintain the documenta�on up-to-date, but this should be considered a con�nuous process. Before you start wri�ng new func�ons, write down and explain the steps that should lead to expected results. 2. Use descriptive names Giving descrip�ve and pronounceable names will impart meaning to func�ons, variables and classes. If you'll choose suitable names, later in your future edi�ng sessions, everybody will know what all those variables are reffering to. Moreover, by doing so, there's no need for useless self-explanatory comments. 3. Add white spaces We all were taught in schools to break our stories into paragraphs in order not to discourage the reader before he/she starts to read. This rule can also be applied in this case. Adding white space could greatly improve the readability of your code. x 4. Code line length Reading on a computer screen is harder than reading text on paper. In most cases, the light on a computer display is �ring the eyes. Studies have shown that our eyes are more comfortable with short lines of code instead of long lines. If code lines are too wide, it takes longer to return to the start of the line of code. 5. Delete unnecessary code 6. Refactor your code Did you happen to gather blocks of code that are old and no longer necessary? Well, maybe you should take a few minutes to clean them up in order to avoid confusion and poten�al misunderstanding. Clean code will always be a pleasure for anyone new working on a project Despite ge�ng rid of the useless code lines, it's necessary to restructure the exis�ng ones. While refactoring, you could improve the code readability and reduce its complexity. Remember: Always make your code be�er than you found it! c o d e y o u r b u s i n e s s AXONSOFT Bd. 21 Decembrie 1998, nr. 126 400604 Cluj-Napoca Tel +40 264 487 026 Email office@axonso�.ro