Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

padding space in update code

 
Tim Fernandez
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Ive seen some codes in some posts about writing padded Strings to the db file and most of them use the System.arraycopy.. Now im worried that my code below is not efficient as compared to the others. Is my code ok?
 
Christian P�cher
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I understood the code within 30 secs and when you write documentation for the method, I would have been even faster. My assignment - as well as my experience - says you should prefer clarity over minor speed improvments. The code is readable, so it is ok. If you are really concerned about speed, I would take a profiler and fix hotspots first.

HTH, chris
 
Tim Fernandez
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
more readable than this?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic