Earlier quoted context omitted.
Yeah, I do wonder how Unity deals with the GC. Maybe there's an algorithm like this one, maybe the engine's core systems (physics and graphics) are written in native code. C# as a language does tend to be nicer than Java, but its VM doesn't have as rich a family of languages.
My limited understanding is that high end Unity devs code their stuff not to make garbage. Unity has a very nice system for profiling that sort of thing. Also, CLR has F#, which I like much better than Scala (and, no type erasure in CLR), Clojure which is ... just like Clojure on JVM, and C#, which as a Java dev since 1.1 I have come to prefer as a language even as I remain JVM ecosystem preferring on the server side…
Java 12
431–440 of 478 posts
Re: Java 12
#432Earlier quoted context omitted.
I‘m seasoned dev with 20 years of Java programming experience, I see no problems using Spring and I don’t see why anyone with similar experience would have any. It’s sometimes not obvious, how some things work, but it’s open source and the code is quite good to analyze, extend or replace.
"the code is quite good to analyze, extend or replace" But how do you even know what code to read when so much of the program's logic is in annotations and other kinds of action at a distance?
It's not that Spring is badly coded or something, I just don't need these surprises and the magical thinking surrounding newbie Spring Boot projects.
Re: Java 12
#433Earlier quoted context omitted.
> it feels like the designers resented OOP and reusable code Can you give some examples, that wouldn't be equally applicable to Java?
Polymorphism and inheritance by default?
As Hejlsberg explained, the problem with virtual-by-default is that every time one of your public methods calls another public method on the same object, it makes it that much more complicated to reason about your invariants. If the called method is non-virtual, then you're in full control, and you know exactly what happens. But if it can be overridden, then you need to define a contract for overriders to follow, and you can't assume that it does anything other than what's expressed in that contract (in particular, you can no longer call that method without ensuring that all class invariants hold, even if it's expensive). Furthermore, the overriders often also need to know which other methods on the class do or do not call this method.
In practice, this is so much hassle that not even the Java standard library does that. For example, given ArrayList, if you override add(), does that affect addAll()? The docs don't say. So in practice, the only things that are safe to override is what the docs say are safe to override... which is to say, exactly like "virtual", except it's not enforced by compiler. Overriding random methods often works, but is a hack not dissimilar to using Reflection to access non-public members - even if it works, you're relying on implementation details of the class.
Re: Java 12
#434Re: Java 12
#435Earlier quoted context omitted.
I‘m seasoned dev with 20 years of Java programming experience, I see no problems using Spring and I don’t see why anyone with similar experience would have any. It’s sometimes not obvious, how some things work, but it’s open source and the code is quite good to analyze, extend or replace.
"the code is quite good to analyze, extend or replace" But how do you even know what code to read when so much of the program's logic is in annotations and other kinds of action at a distance?
Re: Java 12
#436Earlier quoted context omitted.
"the code is quite good to analyze, extend or replace" But how do you even know what code to read when so much of the program's logic is in annotations and other kinds of action at a distance?
Exactly. For example, if you're (still) using Spring MVC, what gets called in your backend on a given action attribute in your JSP or Thymeleaf or whatever template, is expressed through your method signature and lots of annotations where the order of arguments matter eg. some magic attributes must come right after others. All you see in your debugger, though, is that your request hangs in some nested and chained han…
Re: Java 12
#437Earlier quoted context omitted.
"the code is quite good to analyze, extend or replace" But how do you even know what code to read when so much of the program's logic is in annotations and other kinds of action at a distance?
The source code of Spring itself. I know Spring internals - there’s no dark magic there and reference guide describes it well. DI is straightforward, MVC - not perfect, but generally easy, Security - well, it has design problems, but they are not related to annotations.
I had a problem with security that I could only solve by adding an "Order" annotation to my class. Reading the code and stepping through it in the debugger did me absolutely no good.
Re: Java 12
#438Earlier quoted context omitted.
Exactly. For example, if you're (still) using Spring MVC, what gets called in your backend on a given action attribute in your JSP or Thymeleaf or whatever template, is expressed through your method signature and lots of annotations where the order of arguments matter eg. some magic attributes must come right after others. All you see in your debugger, though, is that your request hangs in some nested and chained han…
Newbie can write bad code on any platform, but it‘s a short period of life of software developer - the problem of beginners is solved not by the tools they use, but through a reasonable composition of the team with sufficient number of experienced developers who can define the architecture and best practices.
Re: Java 12
#439Earlier quoted context omitted.
> The JVM is a highly-optimized, cross-platform, garbage-collected environment on which people have built much more progressive languages that lack the syntactic baggage of Java: Scala, Groovy, Clojure, Kotlin. Apache Groovy has inherited all of the syntax of Java. When Jeremy Rayner built the Antlr 2 based syntax for Groovy back in 2005, he began with the syntax for Java, then added the Groovy-specific grammar to it…
The new parser is available in the Groovy 3 alphas.
Re: Java 12
#440Earlier quoted context omitted.
Yes. But it's done in a different way than C#. C# supports fields and field references so you can pass them directly to a function. The Java code "looks" like they do the same because they generate code to simulate method references instead. It's pretty clever and Javas code generation support for Annotation Processors is excellent and makes it possible to do this in a cross-ide cross-build-system way LINQ and JOOQ/Q…
That's really interesting. All of these years I've been beating up on Java for lack of something akin to LINQ. I guess I'll have to find something else to complain about.....