Browse DevX
Sign up for e-mail newsletters from DevX


Java Copier Frees You from Tedious Coding : Page 2

Transfer the repetitive copy/paste/edit part of your Java programming from your hands to your computer. With the somusar/tjpp Java copier, you can set yourself free of this tedious work.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Java Copier Case Study: Your HelloWorld Class Delivery Business
Your company delivers countless HelloWorld classes over the Internet. Believe it or not, the business is flourishing and you have to develop HelloWorld classes at an increasingly rapid pace to keep up with customers' requests.

The following is a typical delivery for your company:

class Hello { public static void main (String args[]) { System.out.println("Good morning, Francesco!"); } }

Or like this:

class Hello2 { public static void main (String args[]) { System.err.println("Hello, Fap!"); } }

Soon the requests grow so fast that your copy/paste/edit technique is overwhelmed. Hire a new programmer, maybe? Not in this economy, the boss says. So you have to come up with a new way to solve your productivity gap. You remember that you read something about a Java code generator and you rush to your browser to google for it. You find somusar/tjpp and download the free demo.

Twenty minutes later, you have written your new macro, "hello":

@ INTERFACE(GREETING,WHO,CHANNEL) class __JAVACLASS__ { public static void main (String args[]) { CHANNEL.println("GREETING, WHO!"); } }

This snippet instructs tjpp to replace GREETING, WHO, and CHANNEL with the parameters of the macro call. Additionally, the source files that you write thereafter need only contain a call to that macro with the appropriate arguments, like this:

$ hello(Good morning,Francesco,System.out)

Or like this:

$ hello(Hello,Fap,System.err)

Then you can convert them to regular, standard Java files with one simple command:

prompt> tjpp Hello.tj prompt> tjpp Hello2.tj

Tjpp generates well over 1,000 lines of code per second on a regular desktop PC. You could verify its performance by writing a more complex macro and using it several times in the same input file. You then could run tjpp on it and measure its performance on your own desktop.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date