Earlier quoted context omitted.
What if I told you that Java code is perfectly compilable in Groovy and learning the required amount of Groovy isn't that much anyway? There's even a JavaDoc that you can reference at any time. And even now in Java 8, you have Lambdas... well guess what? Groovy uses Closures everywhere, and the syntax is similar too. So it really shouldn't be black magic.
What if I told you I am not a very experienced java programmer and learning something new wouldn't really help me become a better java programmer. That and my employer uses Java and randomly chooses PHP sometimes for no apparent reason.
An Opinionated Guide to Modern Java Development, Part 1
361–370 of 402 posts
Re: An Opinionated Guide to Modern Java Development, Part 1
#362Earlier quoted context omitted.
Exactly. I'd argue C++ has a lot going for it, and I think the claim that Java's performance is only slightly slower is simply not true for the vast majority of situations where good memory organization can provide significant speedups - which includes any computer graphics, vision or audio application. I personally find C++11 more high-level than Java and significantly more optimizable for performance. You can wax p…
Java is fast enough now to compete with C++ in some categories of software traditionally viewed as "high performance" e.g. web-servers or database systems. Applications running like "turtle on anything short of server-class hardware" is a result of bad-coding, not Java itself.
In many others, especially those requiring vector or matrix arithmetic (medical imaging, physical simulations, modeling, graphics, scientific computing, video games), there's simply no competition.
Re: An Opinionated Guide to Modern Java Development, Part 1
#363Earlier quoted context omitted.
From the usual JUG discussion themes I also get the impression, if it wasn't for Gradle, the Groovy interest would be much lower nowadays. There was a Grails wave here in Germany, but now I seldom see anything related to it.
Yesterday's Who is hiring? ( https://news.ycombinator.com/item?id=7679431 ) only had 1 mention of Groovy or Grails (and none of Gradle) out of over 400 comments. And many (most?) of the projects tagged Groovy on Github are triggered by a single Gradle build script for a project that uses some other language. These Gradle build scripts are often 30 lines long. So I'm not sure how Groovy will fare in the future. Nothin…
Back in 2009 there was a big Grails wave here in Germany. Many JUGs had Groovy and Grails talks.
There was also some people trying to use Groovy with JSF. Myself I attended a session promoted by Sun hitting at possible official support after the JSF 2.0 release.
To the point we added support to it in our in-house JSF framework SDK, still JSF 1.x based.
Since late 2010 I have been doing .NET land mostly and now back on Java land, I hardly see any Groovy besides Gradle.
Re: An Opinionated Guide to Modern Java Development, Part 1
#364Earlier quoted context omitted.
Java is fast enough now to compete with C++ in some categories of software traditionally viewed as "high performance" e.g. web-servers or database systems. Applications running like "turtle on anything short of server-class hardware" is a result of bad-coding, not Java itself.
In some categories, yes. In many others, especially those requiring vector or matrix arithmetic (medical imaging, physical simulations, modeling, graphics, scientific computing, video games), there's simply no competition.
Re: An Opinionated Guide to Modern Java Development, Part 1
#365Earlier quoted context omitted.
Java is fast enough now to compete with C++ in some categories of software traditionally viewed as "high performance" e.g. web-servers or database systems. Applications running like "turtle on anything short of server-class hardware" is a result of bad-coding, not Java itself.
In some categories, yes. In many others, especially those requiring vector or matrix arithmetic (medical imaging, physical simulations, modeling, graphics, scientific computing, video games), there's simply no competition.
Re: An Opinionated Guide to Modern Java Development, Part 1
#366Earlier quoted context omitted.
In some categories, yes. In many others, especially those requiring vector or matrix arithmetic (medical imaging, physical simulations, modeling, graphics, scientific computing, video games), there's simply no competition.
In anything where Java approximates the speed of C++ it uses two or three times as much RAM.
Re: An Opinionated Guide to Modern Java Development, Part 1
#367Earlier quoted context omitted.
Not to sound snarky, but you should read any introduction to dependency injection. The benefits are generally covered very thoroughly, and what you said is not usually considered a benefit.
Wikipedia article on dependency injection, section titled "Advantages", _first_ bullet: "The result is more independent clients that are easier to unit test in isolation using stubs or mock objects that simulate other objects not under test." Would you like to try again?
Where, in what you posted, does it reference being able to replace implementations outside of the source code itself?
Would you like to try again?
Re: An Opinionated Guide to Modern Java Development, Part 1
#368Earlier quoted context omitted.
> Indeed, Option in Scala has the same problem eh? scala> val safe = Option(null) safe: Option[Null] = None
I don't understand your objection: // The type of 'unsafe' is Option[String] var unsafe = Option("some string") unsafe = null unsafe map println gives Exception in thread "main" scala.MatchError: null effectively a NullPointerException. This would be impossible for a true Option (aka Maybe) type. The problem is introduced because Scala, for backwards compatibility reasons, still allows the assignment of null; this lo…
// The type of 'unsafe' is Option[String]
var unsafe = Option("some string")
unsafe = null
unsafe map println
Is complete contrived nonsense, var? Seriously, quit trolling, in Scala (immutable) val is king.Next:
def unsafeFunction(x: Option[String]): Option[String] = {
x orElse null
}
Oh yeah, that's brilliant, let's just try our hardest to come up with scenarios that never occur in the "real" world (unless we try really hard to create nullthing out of nonething).Re: An Opinionated Guide to Modern Java Development, Part 1
#369That pluggable type system looks amazing. One thing that's weird to me is how java included a new Optional type (seems similar to Haskell's Maybe), but the compiler (afaik) doesn't prevent you from setting an Optional field to null. Something about that doesn't feel right. (Side Note: Optional isn't serializeable. Also... what's the best practice for using Optional when I'm using JPA? Can it be used in my Entities?)…
Re: An Opinionated Guide to Modern Java Development, Part 1
#370Earlier quoted context omitted.
Well, for one, Lambdas are desugared into methods, not anonymous classes. Early on they used anonymous classes because it was convenient but that wasn't the final translation strategy. http://cr.openjdk.java.net/~briangoetz/lambda/lambda-transla...
Yes, and these methods create an anonymous class at runtime. What's so hard to understand about this?