7 ms·
Outside of very special circumstances, I don't think it is a good idea to replace Python code with Clojure code. In fact, judging from my own contracting experi
by dizzystar 9y ago
Outside of very special circumstances, I don't think it is a good idea to replace Python code with Clojure code. In fact, judging from my own contracting experience and seeing the many mistakes made by first-time Clojure programmers, I more often than not suggest moving from Clojure to anything else.
The problem with using esoteric languages is multi-fold. First, you have to trust that the original programmers actually know the language enough to not create a massive disaster. Are they comfortable working without a framework, are they knowledgeable about all the issues that arise from building closer to the metal, so to speak? It seems to me that the answer is "no" more often than "yes."
Once this happens, you end up in a read-only code situation, and this is a problem because they leave the project with tons of bugs and downright stupid decisions. You are then left in the position to ask 15 people if they can make dollars or sense of anything written, and if you are fortunate, you will get one "yes." I joke that I know all 50 Clojure programmers in the US, and sadly, that's not much of an overstatement. If you want your code to exist, and you aren't a real somebody, then good luck. If you aren't located in SF, LA, or some other city that attracts talent, definitely do not use Clojure or any other esoteric language!
Of course, I didn't read the article, as it isn't loading at all.
- wellpast 9y agoI don't see how Clojure is "close to the metal". To me it seems pretty high up in the ladder of abstractions. In Java, we have Lambdas and Streams and some concurrency APIs and Clojure only seems to build _on top_ of these, making them much more ergonomic, simpler, AND encouraging immutability, to boot. Novice programmers love mutability, but in Clojure you kind of have to go out of your way to solve something with mutation. So to me (as long as users aren't getting carried away with writing macros) it seems you should land in a better spot with Clojure. If you're not seeing that's the case, then what is it? What are the common mistakes that you see these novices making that make for unmaintainable code---that somehow is not found in the same proportion in something more mainstream? Would seriously love to hear.
- jtmcmc 9y agoClojure is much 'closer to the metal' than django in the sense that you have to rebuild all of the pre-built, fairly hardened pieces that django has.
- wellpast 9y agoWell by that claim Python is also closer than Django but at this point we are comparing apples and oranges.
- yogthos 9y agoYou really don't though. Clojure ecosystem consists of lots of mature libraries. Luminus http://www.luminusweb.net/ http://www.luminusweb.net/ will wire them up for you in a standard way. All you have to do to make a new project is something like: lein new luminus myapp +postgres +auth And you're good to go. Everything is setup, and you just have to add the code relevant to your application. It's also worth noting that the nature of how web apps are built has changed over the years. Everything used to be done server-side, with the client just rendering HTML for the most part. A big framework makes sense in that context. However, SPA approach is the popular way to build apps today, and all the UI logic lives client-side. The server becomes just a set of service operations, that are ideally stateless for scaling. You really don't need anything too fancy on the backend with that approach.
- sb8244 9y agoSpecifically the parent is talking about coding without a framework that has solved many problems for you. "Metal" is the language in this case, not the CPU
- wellpast 9y agoAny framework that Java and/or Javascript has can be used in Clojure. I guess this is an apples to oranges comparison when you put it that way. Eg, React and Clojurescript are great together; and of course so are many JVM frameworks and Clojure.
- erokar 9y agoFrom what I remember from the article while it was up, the Clojure codebase ended up significantly smaller than the Python codebase.
- KingMob 9y agoThe headline is misleading. He actually built similar products in both Python/Django and Clojure at the same time. He didn't replace one with the other. It's mostly a language comparison blog post. "These were the good parts of Clojure, these were the bad parts, etc."
- rlander 9y agoNot really. It was more of a "platform choices" comparison blog post. We're mostly a Django shop, so the Python project began a few months before the Clojure one. We had the feeling that Clojure might be a good fit for a few use cases that we have, especially mobile-focused API backends, so the post is a summary of some of the lessons we learned when using a Clojure web stack instead of Django.
- blain_the_train 9y agoPeople usually say "closer to the metal" to mean more control over the hardware. Its hard to see what mainstream language clojure has more control over the metal then given that it targets the two of the largest languages it self.
- accordeiro 9y agoArticle is back up FYI :)
- rlander 9y agoSo you're saying we should all just settle for Javascript, Python, Java, and C because they're familiar and not esoteric (whatever that means)? Should we not consider ReasonML an option for frontend development, even though it solves many problems, because it is esoteric? The problems you list above are true enough regardless of language choice. I've seen disasters in Clojure as many times as I've seen disasters in Java or Python. Also, why are first-time Clojure programmers code worse than first-time C programmers?
- catshirt 9y ago"I joke that I know all 50 Clojure programmers in the US, and sadly, that's not much of an overstatement" yeah no i'm pretty sure that's a drastic overstatement
- yogthos 9y agoSeeing how the Clojurians slack alone has thousands of people in it, I think you're off your rocker here. :)
- pera 9y agoClojure is neither an "esoteric language" nor "close to the metal". Also, Clojure does have a pretty popular micro-framework called Luminus (which is basically ring+compojure), and there are other options too, so developers don't need to code a web server from scratch. > you have to trust that the original programmers actually know the language enough to not create a massive disaster The same can be said for any programming language, although I think you may find much more disasters in, for instance, PHP and Python projects than in Clojure and Elixir ones...
- IshmaelYavitz 9y agohttps://news.ycombinator.com/item?id=15473657 https://news.ycombinator.com/item?id=15473657 developers don't need to code a web server from scratch. I mean, that statement is true. But there is nothing in the Clojure ecosystem anywhere remotely close to the level of functionality contained in a framework like Django - Luminus included. Partially this is cultural: the Clojure party line is that libraries are good and frameworks are baaad.
- nwjsmith 9y ago> I more often than not suggest moving from Clojure to anything else. Rewrites are notoriously risky projects, I'm surprised you suggest this the majority of the time. > you have to trust that the original programmers actually know the language enough to not create a massive disaster This is my experience, but I've come across many coding disasters and none have been caused by misunderstanding the programming language. All have been due to poor software design or testing. > Once this happens, you end up in a read-only code situation, and this is a problem because they leave the project with tons of bugs and downright stupid decisions. Why have you pinned the blame on Clojure? What are the properties of Clojure that cause programs written in it to have so many bugs? Programming languages don't make decisions, let alone stupid ones. > I joke that I know all 50 Clojure programmers in the US, and sadly, that's not much of an overstatement This is a massive overstatement. Netflix, Apple, Soundcloud, and Walmart are all using Clojure. I work on a large team of Clojure developers, many of whom are located in the US. The Clojure community is large, healthy and growing. This is not an "esoteric" language. > If you aren't located in SF, LA, or some other city that attracts talent I work with Clojure developers all over the world, many in small towns in their respective country. My address hasn't been a factor for any tooling decision I've been a part of, it's a strange (overlooked?) criteria by which to judge technology.
- bshur 9y agoInteresting that job postings for clojure are declining: https://www.indeed.com/jobtrends/q-clojure.html https://www.indeed.com/jobtrends/q-clojure.html And clojure isn't even mentioned in zdnet's most popular programming languages: http://www.zdnet.com/article/which-programming-languages-are-most-popular-and-what-does-that-even-mean/ http://www.zdnet.com/article/which-programming-languages-are...
- erichmond 9y agoAnd yet Amazon, Facebook, Walmart, CapitalOne, Netflix, Oracle, Red Hat, Two Sigma and a bunch of banks use it. Makes you wonder how indicative those lists are of anything.
- 9y ago
- edem 9y agoSo you are basically saying that "Don't buy an Audi TT because it is harder to drive than a Mazda?" Not a good idea. I'd replace Python 100 times out of 100 with Clojure.
- whalesalad 9y agoAll of these articles are kinda click baitey sugary snacks for junior developers in my opinion. It’s conflating too many concepts and introducing too many variables. A vanilla comparison of GraphQL versus REST -or- Python (not Django) versus Clojure would have been more interesting. You can build anything with anything. It’s all data manipulation. Some languages have a more fruitful ecosystem of libraries or offer a more efficient syntax for your particular task. To be honest, the way that graphql is handled by the author in Clojure looks kinda inefficient. You have a language that allows you to create your own dsl with abstractions and macros but you write a massive edn map of your types? What’s the difference between that and using any other language at that point? Interesting insight but I hope folks don’t read this post and think: “wow we are wasting our lives with Django and REST”. The four technologies here all have value and merit in their own ways. P.S. I use Clojure and Python on a daily basis at FarmLogs
- rlander 9y agoI agree with you that that wasn't the best comparison. As I wrote somewhere downthread, in a perfect world, I'd be comparing Clojure/GraphQL with Python/Graphene. But it is what it is and, even though the project I could compare to wasn't ideal, I still think we were able to draw valuable lessons for our use cases. It isnt't feasible to choose a technology just because it would be a better comparison. > Interesting insight but I hope folks don’t read this post and think: “wow we are wasting our lives with Django and REST”. God no! As the author, I hope to god no one thinks that after reading the article. We're mostly a Python shop and we love it, but sometimes it isn't the best choice.
- yogthos 9y agoThis is pure and complete FUD. Clojure is not some esoteric language you can't hire people for. My team has been working with it for over 7 years, and we never had a problem hiring people. Today, there are plenty of companies using Clojure and consulting. There are literally thousands of Clojure programmers in the US, and many more around the world. Meanwhile, Clojure is used by companies such as Amazon, Apple, Boeing, and Walmart. This isn't some obscure language anymore. In terms of performance, Clojure is well known to be fast, and it runs circles around Python without any optimizations.
- lkrubner 9y agoDo you understand that he is talking about Lacinia, which is from WalMart? Do you feel that WalMart is esoteric? Do you wonder why WalMart has decided to commit to Clojure? A friend of mine offers the somewhat humorous summary of Clojure as "a library that makes concurrency easier in Java." And I suspect that is why so many large companies are moving towards it. These were companies that had a large number of Java programmers. Presumably the programmers often made mistakes regarding concurrency, and they were looking for a way to make it easier to manage concurrency. And so they switched to Clojure. Interop between Java and Clojure is seemless, so a lot of companies that are already using Java can add in Clojure painlessly. Actually, I should state that more strongly, Clojure removes some of the pain of dealing with concurrency. Lacinia is new. The first public release was just 6 months ago: https://github.com/walmartlabs/lacinia/commits/master?after=14c340a16b82de6ed3d0651b9de7d08c7651e447+419 https://github.com/walmartlabs/lacinia/commits/master?after=... The fact that big companies like WalMart are committing to Clojure, and then releasing their libraries to the community, suggests that Clojure is going mainstream.