4 ms·
(find (most people) difficult (without (infix operations) (to expressions write)))
by lmm 8y ago
(find (most people) difficult (without (infix operations) (to expressions write)))
- maehwasu 8y agoThere’s definitely a learning curve, but it’s not a terribly steep one, and most minds with programming aptitude don’t seem to have much trouble with it after that. It’s similar to learning declensions in Russian/German/Latin: weird and seemingly pointless to English speakers, and then usually fully internalized after a few months, with better intuition for costs and benefits of syntax vs cases. I’d argue that the Clojure learning curve is significantly shorter than that also. The best criticisms of Clojure (and I’ve written a lot in it) have nothing to do with parentheses, but rather the difficulties of grokking other people’s dynamic, untyped code.
- ken 8y agoWorse than untyped code is undocumented code. Some programmers think types obviate the need for docs. Some programmers think concision obviates the need for docs. Except in the most trivial cases, they're both wrong.
- paultopia 8y agoMy gripe with other people's code in Clojure is less understandability in terms of types and more in terms of style. A lot of major clojure libraries seem to use a really indirect style that brings a bunch of OO-style concepts back in. Like, I'm thinking of libraries like Component and Mount whose authors seem to have been aiming for a dependency injection kind of experience and end up creating a bunch of free-floating state, where, for example, you use a template to scaffold a simple webapp up, and it's surprisingly hard to figure out where in the code it's talking to the database. This actually caused me to leave the clojure ecosystem eventually.
- lincpa 8y agoIf you use "The Pure Function Pipeline Data Flow",it only need Unix-style pipes and functions. you won't have to use concepts or patterns of OO&FP, and the parentheses are less than any programming language ;) [The Pure Function Pipeline Data Flow](https://github.com/linpengcheng/PurefunctionPipelineDataflow https://github.com/linpengcheng/PurefunctionPipelineDataflow)
- pepper_sauce 8y agoHi Lin Pengcheng, do you have an example of making side-effect calls with Pure Function Pipeline Data Flow method? e.g. database query.
- lincpa 8y agoA series of functions in a ->> block can only have one function with side effects and can only be at the end. Exception handling is included in the function of side effects, and the exception is handled as actively as possible. In management, if an exception is encountered, always throw it to the superior, who will be fired:-) you can do it like ring, treat client and server as db, query each other.
- TelmoMenezes 8y agoyes but (takes only (a (of bit practice)))
- ken 8y agoIn 99% of programming languages, infix operations are only used for arithmetic -- and more than 99% of the programming I do doesn't involve that. Even the numerics software I've written is >90% non-numeric parts. Arithmetic doesn't even look right in programming languages with infix operators. Go to the "Chalk is still one of the primary tools of mathematicians" article here, and try typing the inequality in Java. Mathematicians aren't writing "Math.floor()" and "% 2" on their blackboards. I think you're optimizing for the wrong thing. Arguing that we need infix operations for 1% of our programs, so that arithmetic looks like how we entered it on a TI-81 or Apple II, is a false economy. It was a good tradeoff 25 or 50 years ago, but the majority of programming has moved past writing programs in terms of arithmetic on registers. That said, there is a nifty macro [1] which adds infix support to Clojure, if you really want that. It even supports symbols like "√", unlike any other language I can think of! [1]: https://github.com/rm-hull/infix https://github.com/rm-hull/infix
- lmm 8y ago> In 99% of programming languages, infix operations are only used for arithmetic I've been spoiled by Scala, but certainly most languages allow a "subject.verb(object)" style for general-purpose code, and that reads a lot better (particularly for those looking from the business domain) than "(verb subject object)". > It even supports symbols like "√", unlike any other language I can think of! Heh, again I'm spoiled by Scala, where √ is just another method/operator (there's no distinction) name if you want it to be.
- ken 8y ago> most languages allow a "subject.verb(object)" style for general-purpose code, and that reads a lot better Why do you think this? Programming isn't natural language, and I don't even know what the "subject" or "object" is in most cases.
- lmm 8y ago> Programming isn't natural language It's not, but it should be close; readability is important, and particularly when you want to express domain logic it's important to be able to hew closely to the actual language of the domain. Arithmetic is the most obvious example of this but it's just as true for other domains.