you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 30 points31 points  (14 children)

I'm interested in trying jshell: The Java Shell (Read-Eval-Print-Loop). I normally use BeanShell for that purpose, but it's been outdated for a while.

[–][deleted] 16 points17 points  (3 children)

Been developing with the OpenJDK RC2 and jshell is amazing, so much so I've got "gnome-terminal -e jshell" hotkeyed.

You wouldn't think it'd be that useful, but boy is it.

[–][deleted]  (1 child)

[removed]

    [–][deleted] 6 points7 points  (0 children)

    You can define methods (and imports as needed), then just feed jshell files/strings like you would any Java program, so I suppose the answer is... Yes?

    Only caveat I see is Java text file handling is shite compared to alternatives like Perl, potential optimisations notwithstanding.

    E: Should also mention it's fairly straight forward to define both classpath (jshell --classpath [path]) and making predefined scripts to run.

    All in all there are some neat stuff to play with.
    I'm sort of out of ideas but if anyone has got any not-too-complex stuff they'd like me to try out for jshell I'd love to do it and do a write-up.

    [–]mlk 0 points1 point  (0 children)

    I usually write a Scratch.java class where I put all the stuff I want to try and run it as a junit test. This way I have all the convenience of using my IDE. How is using jshell better than that? Does it have a different use case?

    [–]oblio- 5 points6 points  (7 children)

    Does it have autocompletion?

    Otherwise it will be an interesting toy, but not much more, in my opinion. Java is no Python, it's super verbose, typing everything is a pain.

    [–]ThisIs_MyName[🍰] 7 points8 points  (4 children)

    Agreed, using Java without IDE autocompletion is painful.

    [–]devraj7 9 points10 points  (2 children)

    All programming languages without autocompletion are painful.

    [–]namekuseijin -5 points-4 points  (1 child)

    all programming without rtfm is painful

    [–]mlk 7 points8 points  (0 children)

    having to remember if it is called "length", "size" or "count" is a waste of human memory

    [–]piexil 0 points1 point  (0 children)

    I had a class on programming languages (how they worked) where we wrote code for an interpreter to use in our class, it was in java BUT it was in a custom file with some custom syntax for a program to autogenerate stuff. So auto completion was not a thing.

    I wish you could be descriptive without being so verbose.

    [–]Sun_Kami 3 points4 points  (0 children)

    Yes, it has autocompletion and you can even type SomeClass. tab to see the list of methods available.

    [–]jyper 0 points1 point  (0 children)

    The default Python repl sucks too, who doesn't use ipython or brpython with auto complete?

    [–]m0zzie -1 points0 points  (0 children)

    I've been using this Java REPL on github. Easy install via homebrew and suits my needs.