You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jörg Schaible <jo...@gmx.de> on 2010/10/13 10:38:21 UTC

Re: Java is a swamp

Hi Kenneth,

now, after your mail, I realize that Java is also a swamp, too:

===== %< =====
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

public class HelloWorld {
  public void main(String[] args) {
    ScriptEngineManager manager = new ScriptEngineManager();
    ScriptEngine engine = manager.getEngineByName("JavaScript");
    engine.put("world", "world");
    String result;
    try {
      result = (String)engine.eval("'Hello ' + world + '!'");
    } catch (ScriptException e) {
      return;
    }
    System.out.println(result);
  }
}
===== %< =====

Take a look at the most obvious problems in the above:

===== %< =====
    ScriptEngineManager manager = new ScriptEngineManager();
    ScriptEngine engine = manager.getEngineByName("JavaScript");
    engine.put("world", "world");
    String result;
    try {
      result = (String)engine.eval("'Hello ' + world + '!'");
    } catch (ScriptException e) {
      return;
    }
===== %< =====

I am very new to Java, but it strikes me that what the above is saying is 
(in shell script):

echo "Hello world!"

I am just so sick of using crappy "solutions" (read: Java) layered over top
of what could be good solutions.

Sorry, I had to vent.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Java is a swamp

Posted by Sam Wun <sw...@gmail.com>.
Haha :D

On Wed, Oct 13, 2010 at 7:38 PM, Jörg Schaible <jo...@gmx.de> wrote:
> Hi Kenneth,
>
> now, after your mail, I realize that Java is also a swamp, too:
>
> ===== %< =====
> import javax.script.ScriptEngine;
> import javax.script.ScriptEngineManager;
> import javax.script.ScriptException;
>
> public class HelloWorld {
>  public void main(String[] args) {
>    ScriptEngineManager manager = new ScriptEngineManager();
>    ScriptEngine engine = manager.getEngineByName("JavaScript");
>    engine.put("world", "world");
>    String result;
>    try {
>      result = (String)engine.eval("'Hello ' + world + '!'");
>    } catch (ScriptException e) {
>      return;
>    }
>    System.out.println(result);
>  }
> }
> ===== %< =====
>
> Take a look at the most obvious problems in the above:
>
> ===== %< =====
>    ScriptEngineManager manager = new ScriptEngineManager();
>    ScriptEngine engine = manager.getEngineByName("JavaScript");
>    engine.put("world", "world");
>    String result;
>    try {
>      result = (String)engine.eval("'Hello ' + world + '!'");
>    } catch (ScriptException e) {
>      return;
>    }
> ===== %< =====
>
> I am very new to Java, but it strikes me that what the above is saying is
> (in shell script):
>
> echo "Hello world!"
>
> I am just so sick of using crappy "solutions" (read: Java) layered over top
> of what could be good solutions.
>
> Sorry, I had to vent.
>
> - Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org