File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes padding space in update code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "padding space in update code" Watch "padding space in update code" New topic

padding space in update code

Tim Fernandez
Ranch Hand

Joined: Aug 31, 2005
Posts: 65
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

Joined: Sep 04, 2005
Posts: 8
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

Joined: Aug 31, 2005
Posts: 65
more readable than this?

I agree. Here's the link:
subject: padding space in update code
It's not a secret anymore!