16 ms·
Why I'm Productive in Clojure (2013)
- juliangamble 9y ago> As the project matures bugs are inevitably found or new features are added, these correspond the occasional spikes in the activity. However, if the initial phase of the project can't be completed in a timely fashion then nothing else can happen. > In my experience, if you can't get something interesting working in a few days the likelihood of actually finishing the project starts rapidly approaching zero. > With Clojure you can get things done fast, fast enough that you get something working while the initial spark of excitement is still present. I would hazard to guess that this is the reason why Clojure has so many great libraries despite being a young language.
- grzm 9y ago(2013) Discussion from a couple of years ago (97 comments): https://news.ycombinator.com/item?id=8074186 https://news.ycombinator.com/item?id=8074186
- ronnier 9y agoI’ve already seen large scale clojure projects being rewritten to something average devs can maintain. Don’t expect much more growth out of this language in terms of new projects written in clojure.
- zengid 9y agoWhat domain were these projects in? What was the 'average' developer unable to grok?
- quickthrower2 9y agoThey can't grok how they will get a higher paid job after once they reset the "years' experience" clock on their chosen stack.
- Heliosmaster 9y agoThere's no worse student than the one that thinks he doesn't have anything to learn anymore...
- imhoguy 9y agoCould you elaborate more on that, please? I wonder what are challenges of Clojure in large scale or legacy projects. I already know finding devs with Clojure/FP as core skill is harder than e.g. Java devs. But I have also seen Java projects being rewritten to PHP for similar reason so... just curious the other arguments about rewrite.
- zubairq 9y agoI started again to rewrite my project from clojure as can be seen on my Github repository (https://github.com/zubairq/gosharedata/ https://github.com/zubairq/gosharedata/) but the problem was NEVER Clojure. By writing Clojure for 5 years it made me a better Javascript programmer I would say!
- sheepmullet 9y agoWhat exactly do average devs struggle with? Who is making these decisions to rewrite? It would be great if we can see a before and after comparison. Clojure is a pretty simple language. Ive taught it to junior devs with only Java experience and they learn it within a few weeks without any major problems.
- weego 9y agoIt's a business struggle. You're not going to hire Clojure devs. You're just not. So every hire will be a cost to cross train through language as well as get used to the codebase. And a lot of more seasoned devs are very binary about lisps. I personally wouldn't work at a place that wanted me to do Clojure over Scala/Java/Kotlin. I worked at a globally known media company that were primarily a Scala company and they had made a handful of applications from people with Scala experience a year at best. The churn of every skilled dev leaving being replaced by someone very green is a horrible opportunity cost even for a large business.
- TeMPOraL 9y agoBasically: companies are looking for cheapest programmers they can find. That involves using the stacks most popular on the market. (I remember my boss at one of my previous jobs literally saying to me "you know, we could let you write that in something more advanced, like Ruby or Python, but then when I'll be hiring, I'll have to pay 2x to a Ruby programmer than I have for a PHP programmer, so PHP it is".)
- pdimitar 9y ago...And you and I both know they are ignoring the much bigger long-term cost and prefer to go for short-term savings. And I think most programmers know how well does that end, historically. Shortsightedness is not a new invention. I have plenty of anecdata for when I invested in a better tech fit without asking anybody and it always ended up great. EVERY. SINGLE. TIME. I got a few slaps on the wrist because managers don't like not controlling how you breathe but even they were forced to admit that I saved them money in the mid- and long-term. I am getting old and cynical and quite frankly I never ask business people questions I know the answer to anymore. I also don't go fanboy mode about languages and tech anymore. If I find a better alternative for something that keeps bleeding my employer's money and human resource with no end in sight, I'll switch it over on both technical and long-term cost-saving merit. To hell with anyone who disagrees. My stance these days is -- "I know both programming and some business. You only know business. I am better equipped to make the decision than you."
- macroexchange 9y agoClojure is great for beating the averages, see: http://www.paulgraham.com/avg.html http://www.paulgraham.com/avg.html Clojure growth is just fine. If average devs have to add something there is Java. In our experience maintenance of Clojure code is orders of magnitude better than average languages (Python, Java, etc). Yes, object orientation in large organizations leads to the most unimaginable mess. People mostly get paid for unproductive behaviour. Clojure is great for startups where you can do things right.
- zubairq 9y agoI agree with this. It was this Paul Graham essay that made me use Clojure/Lisp in the first place :)
- cutler 9y agoYou might also be interested in the story of SISCOG (http://www.siscog.eu/upload/GESTAO-DE-LISTAS/News/PDF/eclm-2013-siscog-a-story-written-in-lisp-20130602.pdf http://www.siscog.eu/upload/GESTAO-DE-LISTAS/News/PDF/eclm-2...) - a massive transport infrastructure system designed in Common Lisp. I'm sure Clojure would have been chosen if it was developed today.
- flavio81 9y agoThanks for this post! >I'm sure Clojure would have been chosen if it was developed today. Clojure was already available in 2013. The paper shows they made use of the CLOS object-oriented system, which is a key feature of Common Lisp.
- cutler 9y ago2013 is just the publication date. The document cites an implementation of their London Underground system which has been in production since 2008 and a another within the Dutch rail system dating back to 1998.
- hellofunk 9y agoTen years ago (appoximately) I read an article about how PHP was dying, thanks in part to many new languages cropping up. But I see PHP mentioned all the time here on HN, and the PHP meetups in my area are frequent and popular, and major companies run on PHP. For decades, there have been rumors about the death of dynamic languages in general. And yet the decades pass and not only do those languages continue to flourish, but others come along and get popular too. Clojure just turned 10 years old and I see no signs of it slowing down. They did consolidate their 2 major conferences in the States into just one annual conference, so there's that (which may not mean anything). But I am in a large city and companies keep appearing and starting up with Clojure as their key language. With Clojure, it's an oddball because it is very simple and very powerful. Oftentimes, simple languages are not so powerful, and powerful languages are not so simple. But with Clojure, you can very easily get yourself into the situation of having extremely dense logic in just a few lines, where another language might easily take 10x (or more) lines to accomplish the same. This leads to code that can indeed be difficult to read later, especially if you are on a team and others must help maintain it. The Clojure community has come up with some excellent solutions to this problem, most recently the Clojure.spec library which is gaining wide adoption, which not only makes such "cleverness" easier to understand when reading it, but also makes a codebase automatically testable with property generators, which is a major feature. But your point about readability is always going to exist with a language like Clojure if it isn't written with a team in mind. That doesn't take away from its power though, in my opinion. However, there is one particularly indispensable tool that Clojure offers that I have not seen anything to meaningfully compete with for productivity, and that's ClojureScript. Writing a front end with Reagent or even the alternative libraries is such a major win over everything else I've tried. I've worked a bit with Elm, Typescript, Reason, Bucklescript -- I am so spoiled by the extremely fast turnaround and easy interaction with very powerful features like React in Clojurescript that I don't see anything on the horizon that will come close to replacing that workflow for now. Perhaps some day something will come along to shine an even brighter light on how front ends can be developed, but for now, ClojureScript remains one of the most significant contributions to the software industry in many, many years.
- sd34 9y ago> Clojure just turned 10 years old and I see no signs of it slowing down. It's a niche language which has barely any presence in the industry. It's mostly used with webprogramming which is the easiest domain out there. Edit: prove it otherwise. Edit2: it's not me who needs to prove lisp is useful. At least, be honest with yourselves. Edit4: if it's not obvious that you're the one who needs to provide evidence about lisp being useful then you're an idiot. Edit3: yes, webprogramming is the easiest - is there any easier domain? Then what is it? 3D programming? OS development? Desktop app development? Today's webprogrammers are surely cocky as hell...
- kibwen 9y agoEh, I don't use Clojure, but I don't think that a lack of a high growth rate is that big a deal. By my unscientific estimate, languages only need about 20,000 active OSS contributors to have a healthy OSS ecosystem, and that's easier to achieve than ever given the growth in the absolute number of programmers. As long as the growth of the language outpaces the attrition rate, it can thrive just the same.
- aaron-lebo 9y agoI've never heard this expressed, but it makes a lot of sense. Wonder what that actual number would be and the best way to measure it?
- kibwen 9y agoMy estimate is based on CPAN, which, in the early 2000s, was already lauded for offering an extensive, high-quality ecosystem despite having "just" 20,000 packages (contrast modern NPM, which claims >500k). Hence I consider this the lower bound of an ecosystem which can be reasonably expected to provide foundations, if not pre-made solutions, for anything you might expect to do in the course of general purpose programming. And it seems reasonable to assume that one maintainer per package is enough to sustain such a system.
- cutler 9y agoClojure hit 20,000 recently according to clojars.org . So that's it - we're where Perl was in 2001. Makes me feel all fuzzy inside as Perl was my first love.
- whalesalad 9y agoI can confirm this 100%. I've had to work with some really really bad Clojure software that is unbelievably hard to maintain. This is not a fault of the language, but just more proof that no language is a magic bullet.
- blain_the_train 9y agoI would imagine one reason for this is because the real complexity of a project has nothing todo with the programming. It has to do with evolving the business. Were on our 3rd re-write of our business, but the codebase still has legacy systems from the first two drafts. No language can save you from that.
- yogthos 9y agoI love it when people make a mess because they didn't really understand the problem initially, then rewrite it in something else and give all credit to the new technology they happened to be using. When you rewrite a project it's always going to be a lot better, because you have a much better understanding of the problem being solved having done that once already.
- hellofunk 9y agoIndeed, on anything serious I write it at least twice. Of course, using Clojure makes this easy since there is usually not a lot of code to rewrite. But after you get into something, you know details about what is needed that you simply cannot adequately predict beforehand in a lot of circumstances.
- imhoguy 9y agoTrue, but only with small projects. Once initial creators of rather complex project leave then the mess begins. No language will save you from changing requirements, egos or best practices. Will your rewrite of inherited 200KLOC "is always going to be a lot better"?
- vemv 9y agoMy thoughts exactly. There are many ways to use Clojure, the laziest one of course being the least maintainable. No language can subsitute engineering principles, years of experience, empathy etc. I wrote a few hints of what I consider maintainable here -> https://blog.vemv.net/maintainable-clojure-beyond-aesthetics-79e4fa56717d https://blog.vemv.net/maintainable-clojure-beyond-aesthetics...
- new_account5648 9y agoI'm trying to evaluate clojure for standard enterprise applications. But I haven't seen anything on how to model entities and relations without a database: Entities:Person, Insurance, Car Relationships: Insurance--hasHolder-->Person(m:1) Insurance--insures-->Car(1:m) Car--hasPrimaryDriver-->Person(1:1) Person--drives-->Car(m:n). Additional constraint: hasPrimaryDriver(C,P) => drives(P,C). The domain has cyclic relationships, hence I cannot model it as a tree. If everything is immutable, I have to update all entities that reference each other when replacing one?! What's the standard clojure way to implement it?
- jasim 9y agoThis was one of the questions (unarticulated at the time) that kept me away from value-based (immutable) programming for a long time. The answer is straight forward: you use unique identifiers instead of references. A lot of your code would become similar to how you write SQL queries. You always use `id` to cross-reference entities. You can use whatever enumerable functions are in the language - List.find, Map.find etc. Now if you want to mutate a leaf node inside a tree, well that question is itself invalid. You can't "mutate" a "value". Can you say mutate the number 12? Or the letter 'B'? Imagine every complex data-structure was atomic like this: the array [1,2,3] always remain [1,2,3]. You can't mutate it because it is one single value; you can get information from inside it, but that doesn't mean you can go and change it. If you do want to change it, then you "transform" it into a new value. So instead of using `array.push` in Javascript, you'd use `array.concat` which provides a new value. Or even better you always use the rest operator `{...oldHash, someKey: newValue}`. This also means your complex, large tree structure is a "value". You can't mutate it. You can however transform it into a new value. So if your leaf node has to change, then it means what you now have is an entirely new value. The old value still exist; any variables that pointed to the old value still point to that, because, duh, values don't change. Rich Hickey has articulated all this really well in his talk "The Value of Values" (https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/ValueOfValues.md https://github.com/matthiasn/talk-transcripts/blob/master/Hi...) You'd now be rightly vary of the space-time implications of copying over large sets of data everytime you want it changed a tiny bit. This is solved in functional languages by using structural sharing. When you get a new tree value with just one node changed, the runtime would actually share most of the tree structure, and newly create just the one we want changed. It'll update the reference pointer of the root node, and the entire path that goes from the root till the leaf that changed. This means if you do a shallow comparison between the new tree value and the old tree value, you'll immediately know they're different. You can also safely assume that the entire path till the changed leaf has a new reference and you can do quick shallow comparisons. This is however an optimization and implementation detail. We're able to do this because structural sharing still allows us to keep the semantic model of everything is value for all practical purposes yet have the benefits of immutability. OCaml lets you do both though - it supports the imperative place-oriented way of programming and value-oriented programming. It encourages value-oriented programming through its syntax and runtime library, but when you need it (for performance reasons), it is there for you.
- blain_the_train 9y ago> Don’t expect much more growth out of this language in terms of new projects written in clojure. Why would an average dev not be able to maintain a clojure code base? I'm going to guess what you really mean is a average dev that doesn't know clojure. In which case the argument your really making is that its hard to find "clojure devs". Which I think runs contrary to the numbers which suggest many more people wanting to work in clojure then can find jobs. This piece seems to echo that sentiment: https://juxt.pro/blog/posts/clojure-job-market.html https://juxt.pro/blog/posts/clojure-job-market.html I think by and large companies probably struggle to find clojure devs in there immediate area. Which is why i see all the clojure jobs either A) remote B) in big cities So its possible that companies could get great devs for less if they just allowed for remote. Nothing backed up here by hard evidence, but worth considering that the language might not really be the only factor here.
- yogthos 9y agoIf a dev can't work with Clojure, I'd be pretty suspect about their coding ability in general. I have yet to work with somebody who couldn't pick it up in a few weeks or so.
- sd34 9y agoIf a dev is dumb enough to advocate clojure, I'd be pretty suspect about their coding ability in general. I have yet to work with a decent programmer who liked it.
- dang 9y agoWe've banned this account for trolling. Please don't create accounts to do that with. Programming language flamewars (one of the hotter circles of hell) are off topic here, as are all flamewars.
- mmargerum 9y agoI’ve been doing c, c++, and objC for over 20 years and am just getting started with Clojure. Sure, it’s easy to understand the basics of clojure in a few weeks but it’s going to take me a while to stop thinking imperstively and objected oriented. Mutating everything is programmed in me at this point. I think it’s going to take me months to get decent at Clojure if not a year. I’m sold in the ideas but it’s not easy if you have been doing imperative style programming . I’d bet it’s almost easier for a novice to pick up Clojure
- yogthos 9y agoIt's different when you're learning on your own and when somebody is teaching you. If you're a company hiring new developers, then you already have people familiar with the language to ramp them up. When we hire new people, we do some pairing, and we do code review on pull requests for features. I also agree that it's sometimes easier for novices to pick up the language. I've seen students become productive faster than people with a lot of background in imperative style.
- cutler 9y agoExamples?
- maxpert 9y agoI have honestly tried many many times to read books/tutorials for getting started in LISP. I know there are many LISP inspired languages and Clojure is one of them. Where LISP throws me off is the excessive use of parenthesis, up-to the point my mind can't keep track of them anymore and IMHO language uses it's comprehension abilities. I am still struggling and pushing hard to learn it; hopefully I can get over it and experience the most powerful language. Any good starting projects/ideas I should try doing in LISP/Clojure etc. to help me out?
- hellofunk 9y agoThe parenthesis disappear from your thoughts after a few days, especially if you are using a proper editor with a feature like paredit. Clojure improves on this compared to other lisps because it uses brackets and squiggly braces instead of parenthesis for a lot of its syntax, making that aspect much easier to read. Just stick with it, you will see it is a non-issue after you get started in earnest.
- vbuwivbiu 9y agofunction.(x,y,z) (function x y z)
- civility 9y agoI happen to like Lisp (well, Scheme at least), but I think a better comparison would be: let a = 123, b = 456, c = 789; # more code vs: (let ((a 123) (b 456) (c 789)) ; more code ) In many cases outside of function calls, there are more parens.
- hellofunk 9y agoAnd in Clojure: (let [a 123 b 456 c 789] ...) Clojure syntax was designed with a clear and deliberate attempt to remove many of the parenthesis from lisp syntax. This is just a part of the greater design goal of offering very concise and elegant syntax in general, which is one of the reasons I keep coming back to it.
- lloeki 9y ago> Some languages are simple but they're also verbose. You've probably heard people say that verbosity really doesn't matter. These people will go to great length to point out that all languages are Turing complete and that in certain languages you simply have to write a bit more code. This argument I usually dismiss by suggesting moving to INTERCAL or Brainfuck. Even syntax matters a lot more than people care to admit. The best language is the one with which you can frictionlessly reason about and express a problem without impediment from syntax, paradigms, concepts and boilerplate. Computer languages just as much as natural ones are deeply tied to the way we think[0]. [0]: https://en.wikipedia.org/wiki/Linguistic_relativity#Programming_languages https://en.wikipedia.org/wiki/Linguistic_relativity#Programm...
- yogthos 9y agoI agree, and that's one of many reasons I like Clojure so much. I find its syntax maps very cleanly to the way I think. It's one of the most readable languages I've worked with. It primarily has to do with Clojure syntax being simple and consistent.
- nickbauman 9y agoWhen I have to write something computationally complex in the language my employer wants me to write it in, I first write it in Clojure because it's easier to think about the problem in that language. Then I translate that. I'm willing to bet that any dev who has learned Clojure does the same thing. If I'm right, that's a huge indictment of what we've been doing for the last 60 years in programming.
- aaron-lebo 9y agoYou'd lose that bet. I think it's easier to reason about problems in languages you are familiar with and that fit how you think, which can change through continued use. A lot of the other stuff is just post hoc rationalization about why we like these languages and why they are better.
- cutler 9y agoSurely the argument being made here is for the best prototyping language, not the most familiar. If familiarity was the only yardstick nothing beyond C would even exist.
- platz 9y agoThe argument being made is if it's necessarily efficient to prototype in a different language than the one that will be actually used, especially if one is more familiar with the target language.
- ritchiea 9y agoIn a world of options where an experienced programmer has had a chance to experiment with different languages the most familiar language is the best prototyping language. In a world where C is the only option programmers think about what other options they could imagine.
- nickbauman 9y agoThe opposite of my experience. I have many more years of experience and am far more familiar with in the target language than Clojure. But for the really difficult computational problems, say, for example, particular performance analysis of a sensor network for a given time series, I reach for Clojure.
- tomerbd 9y agoI would love to use closure, i just stay away from dynamically typed languages - after having a bad experience trying to maintain projects written in a dynamically typed languages which was an awful experience. You see a parameter named user and you have no idea which type it is, which fields it has, does this user has a phone number? how can i know? You see functions and you don't have any idea what is the type they return. just to put things in perspective I maintained X100 larger projects in a statically typed languages, with even worse code but maintaining it was easier than these other projects. Simply because I knew what functions were getting in and what their return type was.
- blain_the_train 9y agoI would encourage you take a look at the rational behind Clojure spec and Schema. Both allow you to specify the expected types of the arguments.
- ngrilly 9y agoHow is the spec checked, statically or dynamically?
- drcode 9y agoDynamically
- hellofunk 9y agoIt can actually be used in a variety of ways. It can be a runtime assertion. It can also be used to automatically generated unlimited tests (using property-based testing, similarly to Haskell and other languages) and that can be done at compile time. That is, you write a spec for a function and the tests are automatically created to ensure that all valid input the function can handle matches corresponding output it emits. Because these are not actual static types, you can get a lot of control and say things like "this function accepts three arguments, all integers between 5 and 50, but in increasing order, and the output must be a float between 0 and 1", and then have that checked on the function before the program ever runs. At run time, you can then verify that you are passing in valid arguments. Spec is relatively new, and there are experiments in the community to do things more like traditional static type checking also. The future is an interesting place.
- jgalt212 9y agoPython dev here who chooses his own tools. I want to move to Clojure, but Clojure and the JVM just aren't that strong in machine learning and ML is my current "growth" area. Even with JVM based solutions, such as Stanford CoreNLP Python has more support/interest than Clojure. I am not here to pump up Python and knock Clojure, just to illustrate there are areas that Clojure has a ton more wood to chop. And I do understand there have been significant efforts made in this arena lately. e.g. Neanderthal http://neanderthal.uncomplicate.org/ http://neanderthal.uncomplicate.org/
- falcolas 9y agoHaving worked with both Lisp and Python, I feel relatively comfortable saying the only thing missing from Python is macros; and when it comes to readable code, it's not a debilitating loss. Much of a macro's capability to create DSLs can be replicated using the introspection and metaprogramming. There are also some lisps that target the Python VM, so you could consider using one of those.
- cutler 9y agoYes, Hy (http://hylang.org http://hylang.org) is similar to Clojure and very nice to work with. Sadly, they had to abandon their implementation of let recently.
- devmunchies 9y ago> I am not here to pump up Python and knock Clojure, just to illustrate there are areas that Clojure has a ton more wood to chop If you are talking about ML, then basically every language has "wood to chop" when compared to python.
- jgalt212 9y agoprobably not R, though.
- blain_the_train 9y ago
- thediff 9y agoI liked this quote. "What matters to me in a language is whether I can use it without thinking about it."
- preordained 9y agoI've really taken a shine to Clojure. Parentheses and dynamic typing initially kept me away, but they're far from the thorns they've been made out to be. Parentheses? You don't even see them after a short while--as a beginner, you use something like parinfer, you are good to go. That, and like all lisps, you begin to appreciate programming directly in the abstract syntax tree: the language you type and the way it is interpreted aren't disjoint things. Dynamic typing? Being functional, immutable by default, and data orientated steal the vast majority of the sting from that in my opinion--and leave you with often downplayed advantages. On the last point, "data oriented", to put it succinctly, data itself is first class or the prominent currency among Clojurists, rather than a zoo of abstractions that never quite fit and and all have to be reconciled and made to play with one another (and often the reason you need types everywhere to keep it all straight). But where types--or validation--are more crucial near the boundaries of the API, there are outside the box solutions like Spec that don't rely on a baked in type system. The recent keynote by Rich Hickey covers a lot of these points (and far better than me): https://m.youtube.com/watch?v=2V1FtfBDsLU https://m.youtube.com/watch?v=2V1FtfBDsLU
- jasim 9y agoIf you have used a statically typed language in the ML family (OCaml, Haskell etc.), could you contrast the development experience between the two?
- preordained 9y agoI spent a good year or so with Haskell. I guess at first blush, one thing that jumped out was that Clojure was made from the jump with a focus on productivity and pragmatism, whereas you never feel too far from the academic origins of Haskell. Clojure is a very shrewdly designed--it's not proud, it takes leverage where it can find it, and makes some very deliberate and sensible trade offs. A large aspect of that is the JVM it sits atop of. You will know that it's Java underneath the hood, but this is not a bad thing at all. You get to have your cake and eat it too. It's done really well in the sense that while it would be awkward and not Clojure-like to promiscuously call native Java--especially code with side-effects--it it is perfectly alright, and practical, to pull in any of the multitude of proven Java libraries where it can obviously save you time and effort. There is no snobbery in the core language itself or in the community about "ew, icky Java". Or put another way, there is no from-scratch ecosystem like in so many languages where a new language means starting over (so the language needs a crypto library, and a web server, and...) Not to mention, many of the utility libraries out there are largely functional in nature anyhow (you can use a massive chunk of the wealth that is Apache Commons as just an arsenal of pure functions). In nitty gritty terms, programming in Clojure actually feels a lot like programming in Haskell to me, without the heavy type system. Lazy infinite lists, all your FP classics like map, reduce, filter, etc. work exactly like you would expect. But I don't miss having to create a stack of monad transformers in an area of code where I need to mix IO and state or something...and using type synonyms to mask the monstrous Turing-complete type signatures I had to make to describe it... In Clojure, you just put the "dirty" work in its own function, clearly separated from the pure functions (which are the de facto default), and you push them to the boundaries of the system while passing extracted data into pure functions (just like Haskell). If you did anything different, you'd get the stink eye from even the least principled Clojurists. It's just not done. A ball and chain type system is unnecessary. The lack of (explicit) types has been at the very most a minor nuisance. Occasionally I mistype something or miss a parameter, you're going to see the error pretty quickly in the REPL. If you run or test your code at all, the pedestrian type errors (oh, that was a string not an int) will be wrung out immediately. That benefit of type systems (preventing typos, essentially) has been much, much overstated IMO. Given you're going to be in the REPL a lot with Clojure, you'll be iteratatively developing and running your code constantly, so it's really not an issue. As far as refactoring, I think that's where there is more meaningful benefit. I use Intellij/Cursive IDE, and the refactoring capabilities are good--much like if it were a Java project (and there are hints and such for the typos I mentioned earlier, autocomplete, etc). So, while it is more of a challenge for IDEs, there are some excellent ones that do a pretty bang up job of inferring types for you. I haven't used Clojure on the job (Java dev by day), but I would have no problem using it for something "real", whereas I never felt anywhere near confident in using Haskell for something outside my own fiddling.
- devmunchies 9y agoIs this the same author as this book or is there plagiarism going on: https://www.amazon.com/Web-Development-Clojure-Build-Bulletproof/dp/1680500821 https://www.amazon.com/Web-Development-Clojure-Build-Bulletp... Go down to the "From the Publisher" section and you'll see: > "But the practical question is how well the language maps to the problem to be solved. Does the language let you think in terms of your problem domain, or do you have to keep translating domain concepts in the constructs of the language? The best case is when you can use the language without thinking about it."
- handojin 9y agoSame author.
- erichmond 9y agoI've been debating whether or not to give a talk / write a blog post on this, but I think this might just be the kind of thing that people make their assumptions about, and thats it. I do wish people would give clojure a real go, not just running a toy program, but taking the time to setup a REPL in clojure and clojurescript, learn about sending commands from the editor directly into the REPL, etc. The reasons for choosing clojure are un-obvious at first glance. Moving from Java -> Ruby for example is something that you feel immediately. People understand in < 5 mins why ruby might be a better fit for a number of solutions then Java. I don't dig clojure because it's a LISP, or it's homoiconic, or because of most of the academic ideas here in this thread. I picked clojure because with it, I get clojure and clojurescript. With clojure I get to target all java libraries, great concurrency primitives, the ability to live code a running system, the ability to experiment extremely quickly due to the REPL based workflow, now with spec/generative testing, I get better testing then I had before, with writing fewer tests. I get systems are often easier to reason about or debug. There's rarely a ton of libraries to do a single thing. Existing libraries don't change much. We launched our first service in clojure 1.6, we've never had to do anything but bump the version number. No breakage. With clojurescript we get just as many benefits. CLJS gives us access to all javascript libraries that have been written, Re-Frame/Om Next are incredible frameworks on top of react, figwheel allows us to never (rarely actually) have to refresh a page when doing layout / css things. Because we have access to a running REPL we can change the state of the app via function, allowing for way rigamarole when trying to test out inputs, etc. devcards lets you look at all the state of your widgets on the page + figwheel means you can see how CSS changes will affect all the states of your widget at once. Synchronicity between the two languages allows us to write .cljc files where share functions and schemas can exist, so your backend and front end are pointing to the same place for critical things that should be shared. It's really really different, but it's really really great. If you're a professional in the field, you owe it to yourself to just try it out and see if it helps you save time and be more productive.
- erichmond 9y agoAll that said, it's not perfect and there are annoying things about it, so I'm not painting it as a perfect language. And there are problems that it's probably not well suited to solve. I discovered clojure about 25 years into my programming career, and while it introduced new "annoying things", it resolved most of the annoying things I had dealt with over the past 25 years in most other languages.
- tombert 9y agoI love Haskell for its type system, but I gotta say that I feel I accomplish about 10x as much with Clojure than I do with it. Being able to quickly beam over my code from Vim to the REPL, and seeing my changes happen in real-time is so incredibly valuable, and I personally feel that Clojure's concurrency is a lot easier to grok than Haskell's. I also feel that Clojure's tooling is a lot nicer than most languages, and especially Haskell; Leiningen is very easy to use and Fireplace is a really simple and nice plugin for Vim.
- cutler 9y agoThe sad fact of life is that large corporations often dictate the platform. If you're a mobile app developer, for example, you're only native options are Swift, Java and Kotlin unless you're prepared to settle for a less efficient end product (Xamarin, Scala/Android, Clojure/Android).
- city41 9y agoJob trends play a role too. I really like Clojure and would like to keep using it. But it's less likely to help get me a job than say learning Python.
- vemv 9y agoI also feel this pain. The reward is high though (salary, remote, colleagues) so I remain motivated. One also can help creating job market by - starting up - introducing Clojure at work - evangelizing it at local meetups (e.g. hijack a JS meetup, explaining cljs goodness) I've been thinking about the latter, as a consultant creating a 'need' for your services would be quite an accomplishment.
- vemv 9y agoThere's some real niche to Clojurescript + React Native; one might even outperform a plain React Native app
- yogthos 9y agoI work in corporate environment, and it's absolutely possible to use Clojure there. It's going to be harder to get buy in than in a small company or a startup, but not impossible.
- muxator 9y agoI have no lisp experience, but I want to ask to who knows more: isn't the use of too many macros a potential hinder to maintainability? What happens to a project when it becomes a mini-language in itself, with its conventions, it's opinions, it's specific flavour? Does this help or discourage the onboarding of new developers? I know C is not a good example, bit at least in C projects, I was always wary of "smart" developers inventing their own "smart" conventions and syntaxes
- kazinator 9y agoMacro use scenarios have to be weighed against the alternative: writing by hand the logic that the machine would have generated from macro invocations.