is there any performance benefits in coding java style in groovy/grails?

114 views Asked by At

You can specify types and also use interfaces in groovy. So in other words you can code in java style in groovy. Coming from java background some people find it comfortable to treat groovy as java and start development in java style. I am wondering whether specifying types and coding java style has any benefits in groovy in terms of speed and performance or can we get rid of specifying the types and code pure groovy style if there is no performance difference?

here is a service method with java style

Reservation makeReservation(Sale sale, Buyable buyable, BigDecimal serviceFeePayment = BigDecimal.ZERO,
            Integer quantity = 1, BigDecimal price = null, Date expiration = null, Boolean includedInRegistration = false, String initials = ''){

here is without specifying types

def makeReservation(sale, buyable, serviceFeePayment = BigDecimal.ZERO,
            quantity = 1, price = null, expiration = null, includedInRegistration = false, initials = ''){

I appreciate any insights. Thanks!

0

There are 0 answers