Sunday, January 29, 2006

diffpatch124: Not much improvement over diffpatch114?

A couple of days ago I indicated that my diffpatch program (diffpatch114) did what it was intended to do, but it was neither user-friendly nor optimized for speed. Well, diffpatch124 is a slight improvement, but not much of one.

Here's how I described the the program and its deficiencies:

"diffpatch has two parts: "The diff [part] compares two versions of a document, generating a set of differences that reflect the changes that need to be applied to the old document to make it identical to the new document.... By running the patch [part], the document contents can be updated to the new version...."

"The major problem with diffpatch114 is two-fold: (1) it takes a l-o-n-g time for the program to process long files, and (2) the user is given no visual clue that the program is still at work. It is possible at this point that the user (at least in Windows) can "break" the program by clicking and reclicking the File menu to try to determine if the program is "alive." Rather than doing that, such a process itself may cause the program to "lock up" and "fail to respond" (again, at least in Windows)."

Well, diffpatch124 now uses a progress bar to show that the program is busy at work creating the differences file, but the process is still very l-o-n-g. The problem is not with the "patch part" of the program (that works almost instantaneously), but with the "diff" part of the program.

If anyone has any suggestions on how the program can be significantly speeded up (the diff part, not the patch part), I'll be glad to hear them. In the meantime, you'll have to take the program "as is." It does what it claims to be able to do, but it doesn't do it in the most efficient fashion.

I haven't yet found the RB program I wrote that is able to apply UNIX-format difference files, but I did find an RB program I wrote that will apparently convert a UNIX-format file into a Traver-format file as well as convert an Edit Pad Pro "compare files" differences fil into a Traver-format file. (I had forgotten that I had written such a program.)

Although our Abyssinaian, Ruby, doesn't like it when I use this metaphor, I'm too old a dog to change now: "There's more than one way to skin a cat." If the diff part of my diffpatch program cannot be greatly improved in speed, is there another (and faster) way that I can create a Traver-format differences file automatically?

Specifically, is it possible to write an RB program to automate a Windows Unix-style diff program (or a Mac UNIX-style diff-program) from RB so that the UNIX-style diff program will create the UNIX-style differences file (which it can do fairly quickly) _and then_ (this part is already done relatively efficiently in the new RB program I discovered) the RB program will covert that UNIX-style differences file to a Traver-format differences file?

Or (to mention a similar theoretical possibility) is it possible to write an RB program to automate my Edit Pad Pro (a Windows program) from RB so that Edit Pad Pro will produce the Edit Pad Pro "compare files" differences output (which it can do fairly quickly) _and then_ (this part is already done relatively efficiently in the new RB program I discovered) the RB program can convert that Edit Pad Pro "compare files" differences output to a Traver-format differences file?

I don't know the answers yet (I'm just thinking out loud, so to speak). The only point at this point is that in programming there is usually more than one way to accomplish a particular task and the "best" solution is not automatically the "most direct" or "obvious" approach (although that may be most often the case).

In programming, there is always room for innovation, ingenuity, creativity, and invention (especially necessary when the required technical expertise may not be there?).

Barry Traver

P.S. Stay tuned. In the next entry, I'll be discussing my RB CodeHelper Lite program as enhanced by Mark Nutter!



Home Page for This Blog: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home