24
Jan/080
Jan/080
Cleaner Way To Write Functions
Writing clean and understandable code is always important. When using functions you can easily mess things up as you will probably write all the parameters in one row.
Let’s take example of bad function usage :
do_this ( parameter_1, parameter_2, parameter_3, parameter_4, parameter_5, parameter_6 )
Better way to do it would be to separate each of the parameters to their own lines :
do_this ( parameter_1,
parameter_2,
// etc…. )
See? A lot cleaner way. I suggest doing this for functions that have more than 3 to 5 parameters.
Still figuring out solution for showing code..
Enjoy this article?
Comments (0)
Trackbacks (0) ( subscribe to comments on this post )
No comments yet.
Leave a comment
No trackbacks yet.