잡담

readability and efficiency

tomato13 2014. 4. 18. 09:34

Readability and efficiency.

 

If you are developing with so many persons, you should focus on readability more than efficiency.

 

Lets take an example. This was a real situation.

 

We used one character byte as mms Info which has an attachment files number and information of mms or not mms. The last one bit means whether the message is mms or not. For example if the value is 21, it means two attach files and mms message.

 

You dont have to understand in detail. My meaning is one variable has two or more meaning. Why did we use this way? Data was transferred by bluetooth and it consumes much battery. So we should spend little transferring as much as possible.

 

But it caused the low readability. If you develop something, so many persons are involved. You may think kind of comments could resolve this issue. But comments could be deleted at specific time because this causes no compilation error. So, in that case, separating variable may be right. I think so. For code readability is more important than small efficiency especially in case of cooperation development.