2 ms·
(I accidentally upvoted you, but wish to explain why I wanted to downvote you): That’s just an attack that doesn’t really contribute. Java’s concept is more a
by kuschku 11y ago
(I accidentally upvoted you, but wish to explain why I wanted to downvote you):
That’s just an attack that doesn’t really contribute.
Java’s concept is more about backwards compatibility, and compatibility with generated code.
Which, btw, is why a lot of the tasks that should commonly be done by a compiler can be done by a compiler in the Java world as well.
Look at what JavaPoet and Lombok can be used for.
- mindslight 11y agoSorry, I carry the mental scars of a victim of the platform. Seeing that this is still being debated, a decade after Scala, is simultaneously mind boggling and unsurprising. If a single person takes my comment as a life preserver rather than an attack, the world will be a better place. The problem with "code generation", especially IDE-based, is when the programmer still has to worry about the resulting complexity. Reading code is harder than writing it, because understanding is what takes the mental work. So a language should seek to preserve intent and human-meaningful structure as its primary goal. I mean, take this idea of a "pattern" that is manually macro^Wexpanded - In the best case, a later developer reads many lines and immediately recognizes the single concept. But likely they recognize the general pattern and miss a slight difference, because the human brain works by glossing over details. Scala cut through much of the bullshit, and Clojure is a beautiful piece of work. But the primitive concepts of the underlying platform still remain as a crooked foundation. They seem fine when you're just reacting to them, as all programming requires accepting some layer of abstraction. But eventually you realize you're committed a long series of seemingly reasonable compromises (dependency on the massively complex JVM, community libraries that embrace unnecessary complexity, poor startup time, reliance on a single vendor, and the aforementioned "half-way" abstractions that represent neither your machine nor a simple high level model) and you snap, seeking out better abstractions that can be both relied upon and transparent when needed. But hey, just because I've been through this doesn't mean you need to take my comment as sarcastically as I've written it. The same sentiment will undoubtedly be earnestly expressed by actual Java programmers still stuck in that tar pit, talking about explicitness, IDE completion, general uniform verbosity, and simplistic conservatism. And I personally quite like the hope in the analogy to the seasoned master starting an apprentice off with a toothbrush to scrub floors, so that their struggle will encourage them to grow.
- kuschku 11y agoYou should really check out to projects I mentioned. In the Java world, we've abandoned IDE autocompletion years ago. Annotation processors are the magic of the day. You write an annotation into your class, say @ToString, and a tostring method is generated during build — it never shows in the code. In the same way you can use annotations to do compile time dependency injection resolution, or to do compile time expansion of ORM bindings. You write just plain Java, add annotations, and everything else is done by the — expandable — compiler.
- mindslight 11y agoI had briefly looked them over. There's always room for incremental progress, and a Lisp like Clojure even tackles the issue of syntactic transformation in a mic-dropping fashion. Yet it still can't address other problems I mentioned with the platform. In general, none of my objections are insurmountable - any specific issue will have an obvious solution, as one would expect in a Turing-complete language. But this is what makes the tar pit so insidious, as you pay the mental overhead of workarounds every time you need to cross the abstraction barrier.