5 ms·
> What on earth does this have to do with clojure? Programmers will do this in any language, there's nothing special about clojure here. I haven't programmed i
by magpi3 9y ago
> What on earth does this have to do with clojure? Programmers will do this in any language, there's nothing special about clojure here.
I haven't programmed in Java in over ten years, but one if its "advantages" (at least back in the day) was what I called its object-oriented handcuffs, which prevented programmers from being too fancy with their code. Every file had to be a class. Every class was an object. Namespaces were clearly and rigidly defined. Setters and getters were standard for defining properties of an object. Etc.
The net result was frustration for programmers who detested such rigidity, but relief for any new programmer coming into a project because Java made it very difficult to write the kind of "specialized beautiful code' that shadowmint laments.
Lisps in particular allow the kind of freedom that programmers love and project managers hate. And I say that as someone who loves writing code in lisp (racket in particular).
- DigitalJack 9y agoI've never seen anyone put more than one namespace in a single file in clojure. I don't think the compiler would even understand that... While you can define classes in clojure, it's not the common way to do things, and so namespaces take the role of classes insofar as compartmentalizing code. It's not normal to operate on data in another namespace directly... you can do it, but it doesn't feel natural in the language. You do it through an interface (called a protocol in clojure), or through functions in that namespace. So in that sense, you are still using getters and setters for everything. But yeah, there is a lot of freedom in clojure. And that favors the writer, not the reader. Hence it can be difficult to grok somebody's code if they are more comfortable using the more advanced features of the language.
- hellofunk 9y ago> namespaces take the role of classes insofar as compartmentalizing code Indeed! In fact, this is one of the sanest ways to do something resembling OO in Clojure.
- cnlwsu 9y agoJava still has same issue too with bored engineers. Over engineering happens. AbstractSingletonProxyFactoryBean anyone? But really strongly typed languages like java is easier than most dynamic typing language to jump into _if the project is sane_.
- davedx 9y agoYeah, typing usually helps. Hiring and training programmers to follow good practices (like not doing what grandparent claims only happens in Clojure) helps even more :)
- specialist 9y agoThe J2EE culture (for lack of a better perjorative) negatively impacted Java's mindshare. I still love me some Java for personal projects. But work Java usually means Spring, Hibernate, Maven, and other monstrosities. I'd hate Java too if that's all I knew.
- davedx 9y agoYeah, sorry, but having had to try and work with 10,000 line Java classes, I still disagree. (And don't even get me started on some of the abomination .jsp files I've encountered!) Maybe there's more whitespace and boilerplate in Java, but it's just as possible for lazy programmers to not split their code into modules, or write horrible spaghetti code. Object oriented languages also introduce an entire different class of potential problems too. Pointless interfaces and abstract classes, terrible sprawling inheritance hierarchies... Oh, and I've also seen horrible walls of text written in PHP too! And JavaScript... and C#...