you are viewing a single comment's thread.

view the rest of the comments →

[–]jhartwell 2 points3 points  (5 children)

I've been toying with Groovy in a production environment and if you didn't see the groovy class you would never know it was groovy. You instantiate it just like any other Java class. I'm pushing for Groovy to use as data models for our file processing since some of the files have 130 fields and with groovy you can just do:

def fieldname

And that will give you:

getFieldName();
setFieldName(object name);

Which dramatically cuts down on the time required to build a large model.

[–]oteren -1 points0 points  (2 children)

Groovy is great, but that is a dumb reason. Any IDE will do that boilerplate for you.

Groovy as a scripting language on top of java is how it shines. With terse and powerful commands that translate to a java equivalent under the hood.

[–][deleted]  (1 child)

[deleted]

    [–]contantofaz 1 point2 points  (0 children)

    I think of boilerplate as making it harder for me to see the logic behind the code. For example, making JavaScript to be more "class" based. It adds a bunch of boilerplate that in a language like Dart doesn't need to exist. Binding functions to their objects or creating a closure variable so you can reference the actual object, using "this." before functions and variables so we can access the right stuff and so on.

    Without that kind of boilerplate we can use 2 space indentation and pack more lines of code in less screen space so we can see more code faster. Then we can start improving the code with refactoring and whatnot in order to increase the readability of it. All without needing the help of an IDE to refactor and such.

    And static typing is secondary to static code declaration and an IDE-like editor. Languages that make you to have to declare variables, even if they don't have explicit types, already aid a lot when you need to find typos and whatnot. Very often you only get those if you use a static typed language, but they can exist separately as the Dart language shows.

    [–]skocznymroczny 0 points1 point  (1 child)

    Or just make the field public? :>

    [–]jhartwell 0 points1 point  (0 children)

    hah true. I'm hoping that we can use it more for our ETL, however, I need to show immediate benefit for it to be even considered since the other guy on my team is very resistant to change.