Translate

Saturday, May 12, 2012

Calling other programs

One of the things that motivated me to write the Class Viewer program in the first place was the ability to call other programs in Java, so calling a browser came in at the start, eight years ago. Oh, and it's amazing to me that it has been eight years, but I put the project up on SourceForge February 2004, so yeah, eight years.

The story is I'd been studying for my Java Certification exam--yeah I did pass--and writing test programs over the Java Reflections API to learn it. I wrote a text class viewer which is the ClassInfo.java which is still part of the project. And then I realized I could have a graphical piece and wrote ClassViewer.java itself. And eventually decided to share it, so put it up on SourceForge.

The ability of a program to call another program is in my opinion, so cool, and my recent update adding calling a text editor where I ran into some walls. Seems not all text editors take a line-number when you call them, but luckily gedit did when I checked, so I default to it.

And that makes things so modular.

For a while I had thought about throwing together some kind of text editor myself, which is such a waste of time with so many out there and Class Viewer can just call one! And then I almost thought I'd need to take an open source text editor and modify it to accept data from Class Viewer. Way too much effort.

So eight years ago I had my program calling a browser which works great and it allows you to go directly into javadocs without doing a lot of the searching which really had annoyed me for years as a software developer as it was SO tedious. Why do something though that a computer program can do for you?

Class Viewer does it for you.

Going forward, if I can justify the expense, I'd like Class Viewer able to call more things, and even came up with the idea of just having a command window where you can ask Class Viewer to call something for you, like a debugger.

Limits may be from what other programs accept as command-line input, and grace in handling the process, where I don't even worry with a browser. Class Viewer just calls the thing and forgets about it.

But for other things, the program would have to handle if the freaking thing crashed something or did something weird, so might have to manage it, but that's vaporware at this point.

But can you imagine? If you could modularly build a very functional app that called other apps as needed where all these programs are talking to each other and doing things for you?

Here's a simple example from this fantasy, as imagine asking your computer to open up your latest code and to please highlight all methods that ask for a String.

I can see Class Viewer able to do that with just a few things--if other programs can accept the instructions like a text editor which can obey a range of commands sent to it from another program.

It still might be necessary to modify an open source text editor out there but it could be done.

And consider how much easier on the coder, and how much more you could get done when your computer is your coding assistant.


James Harris

No comments: