7 ms·
Clojure is fantastic for its simplicity, and I worked on a Clojure code base full time for 5 years, coming up with ways of translating Java patterns into Clojur
by _diyu 9y ago
Clojure is fantastic for its simplicity, and I worked on a Clojure code base full time for 5 years, coming up with ways of translating Java patterns into Clojure. But I've noticed it has not been gaining traction in the job market, and now I feel like that 5 years has been a waste of valuable career building time, which I wish I had spent gaining more experience in (sigh) C# and .NET, so that I could get the more local jobs which all seem to use the Windows ecosystem, so we don't have to uproot our family and move to the city. Not that I don't know C# and .NET, but I definitely don't have 3+ years experience in it and I definitely don't have any experience MS SQL. So being able to do really cool things in Clojure, and especially having excellent rapid development skills with REPL-driven development, has done me no good. The one remote job that I found that uses Clojure turned me down because they used zippers in the code test, and that's literally the one Clojure construct I just can't wrap my head around, which is ironic because idiomatic Clojure really doesn't use recursion in the first place, favoring streams and transducers instead. My career future doesn't really seem to have a lot of Clojure in it unfortunately. Plus most of modern JavaScript has most of the same benefits as Clojure anyway, especially in terms of FP.
- tejinderss 9y agoLearning lisp is never in vain. You can almost apply your functional programming paradims learnt in clojure to most of the dynamic languages out there. Plus you will be thinking in the immutable way of doing things.
- 8ytecoder 9y agoYes, as someone whose primary languages are Ruby and JS, I agree. It has made a tremendous change in the way I organise code.
- justbaker 9y agoLisp is fundamental programming knowledge IMO.
- erik_seaberg 9y agoIt's worth noting that most Lisp dialects don't really encourage immutable data, and Clojure seems to be a step forward there.
- edwinnathaniel 9y agoBut "immutable" way of doing things have been encouraged, suggested, marked-in-stone as best-practices in most languages since 2005... am I missing something? People have been saying that: - Global Object is bad - Stateless is better than Stateful - Singleton becomes an anti-pattern - Methods/Functions without side-effect (avoid mutation) Nobody really mentioned to do things the Functional programming way per-se but the characteristics are there.
- jb1991 9y agoImmutable programming with proper immutable data structures (i.e. persistent) is very different than immutable programming in a language with lots of constructs for mutation. You can throw "const" on things but that isn't really the same kind of immutable programming that exists in Clojure. Because immutable programming is not just about data not changing, it's about the transformations you can do on that data without concern for the costs that would arise if you did those same transformations in a language without immutable data structures.
- Scarbutt 9y agoPlus most of modern JavaScript has most of the same benefits as Clojure anyway, especially in terms of FP. "Modern Javascript ES2020" + lodash + immutablejs But lodash and immutablejs don't mix ;) and still, with either two, it won't be as consistent. But nodejs and its ecosystem is just to hard to ignore for web apps, it really has too much good stuff (and bad too).
- deleted 9y ago[deleted]
- Royalaid 9y agoI feel your pain but from a different angle, I am trying to find a job right now that is clojure and either its on site in SFO (No thanks) or in London. Breaking in seems hard enough and then hearing stories like this don't instill confidence. I really hate it because going back to dealing with OO is actually painful, it just seems like it's building up a whole big skeleton for little benefit.
- kudokatz 9y agoI feel the same with not having Clojure around at work anymore after I quit my last job. That said, at the new place that uses Rails we instilled a culture of avoiding stateful updates, preferring hash structures to mountains of object definitions, and use of functional transforms as much as possible. Then we needed to ramp up to the next level and chose the JVM for writing concurrent code. But we started with Scala as something that has functional concepts baked in since it's "easier to hire for". Not the same, but there are other paths to dealing with lack of Clojure. Oh, and the Scala only makes up for part of losing Clojure because we actually use it in a similar way to Clojure plus a bajillion type declarations. With the occasional workaround for a compiler bug (I've encountered three in the past 6 months).
- imhoguy 9y agoHow you deal with two separate tech stacks in single product? I try to shift from Ruby (on Rails) to to Clojure. But I feel hard to rewrite mountains of RoR convieniece and habits into Clojure (1.day.ago, named routes, ActiveMailer, encrypted cookie etc). As I am also partially Java guy, I came to conclusion that migration of project into JRuby and then embedding Clojure parts gradually might ease the transition.
- mycelium 9y agoI try to shift from Ruby (on Rails) to to Clojure. But I feel hard to rewrite mountains of RoR convieniece and habits into Clojure (1.day.ago, named routes, ActiveMailer, encrypted cookie etc). This seems like a bad idea from a business value perspective. What value is delivered by translating mountains of code? Probably none, being honest. As I am also partially Java guy, I came to conclusion that migration of project into JRuby and then embedding Clojure parts gradually might ease the transition. Don't transition everything, giant waste of time. Run ruby/rails on jruby, then package the core Clojure logic up as a library, and call into it from rails where needed. Clojure is your core logic, ruby/rails is the web front end to that core.
- modernerd 9y agoAs Evan Czaplicki (creator of Elm) said: “If functional programming is so great, why is it still niche? We have a product that can practically eliminate runtime errors, make refactoring much easier, lighten the testing burden, all while being quite delightful to use. What’s the hold up?” - http://www.elmbark.com/2016/03/16/mainstream-elm-user-focused-design http://www.elmbark.com/2016/03/16/mainstream-elm-user-focuse... I'm just getting into Clojure and enjoy working with it so much that I don't care if there are job opportunities at the end of it to justify the time investment and mind-reboot. It's the first language that I didn't feel like I was fighting, and Parinfer has made all those “weird parentheses“ a joy: https://shaunlebron.github.io/parinfer/ https://shaunlebron.github.io/parinfer/ That said, there do seem to be more opportunities than last time I looked at Clojure/Scala/Haskell (Functional Works, mentions in HN Who's Hiring) – it feels like people are waking up to FP ideas after React stormed the front-end scene.
- StreamBright 9y agoI am not sure it is niche anymore. Java 8 added many functional features to Java. :)
- allover 9y agoFunctional 'concepts' are not niche, but functional languages still are. If you asked your average Java 8 programmer or JS programmer to write an app in Haskell or Elm, they'd struggle.
- jwdunne 9y agoI'd consider myself an average JS programmer and would love to try writing web apps in Haskell. I've spent some time on Haskell books, fell in love with the type system, got a basic understanding of monads but found it difficult to "move forward". I think the issue for me is I predominantly build web apps. Can you recommend any resources for building modern web apps in Haskell or at least fitting it into my day to day at work?
- 9y ago
- zengid 9y agoClojureCLR still exists, although it's not as popular as the JVM implementation. Perhaps that could give you a leg up on transitioning.
- vnglst 9y agoDoesn’t the Clojure way of thinking/programming help you with writing better JavaScript though? I’m a JS Dev and I’ve been looking into Clojurescript to broaden my horizon but I’m also hoping to learn some FP techniques that I can use in my Node/React projects.
- BalinKing 9y agoI'm a JavaScript developer, and (much to my delight) my team recently switched to a much more FP-heavy style (for example, switching from Flux to Redux for our React app... we even used PureScript for a bit). The differences were night and day; even just prioritizing immutability has transformed our codebase. The project is about ~100,000 LOC, so the benefits we get in maintainability and readability are huge; also, after we switched to Redux, our application's performance jumped tremendously (for several reasons). So, to answer your question more directly, I can emphatically say: Yes!
- acemarke 9y agoHi, I'm a Redux maintainer. I'd love to see a writeup on how your team has been using Redux, what maintainability benefits you've seen, and how the app's performance has improved. If you do write something, please ping me @acemarke and let me know!
- agumonkey 9y agoI wonder how many people feel the same out of real life experience. Imperative and mutable objects are still seen as the only way for serious products .. there needs to be a large body of evidence to at least make people consider other options (and I'm not trying to sell my church here, just avoid blindness)
- s4vi0r 9y agoWhat do you mean by serious products? There are plenty of massive projects written in purely functional languages (e.g. Facebook's Sigma) and while adoption isn't as fast as it could be, things seem to be shifting towards functional/immutable, which makes sense since reasoning about highly parallel code without RT and immutability is pretty much impossible.
- agumonkey 9y agoIt's a bit sad how network effects rule. If businesses weren't sold so much .net maybe there would be more jobs for other, arguably better solutions. Now, as a side note, there were recent news about clojure CLR. Maybe some will accept having clojure code on top of C# ? (clojure is often used as a better lifestyle on top of Java legacy)
- jaccarmac 9y agoI read a blog post a few days ago about a Clojure compiler from the CLR which is being actively maintained to produce bytecode for Unity. It was posted here a few days ago but didn't seem to gain much traction, perhaps there's more interest in this thread: http://nas.sr/magic/ http://nas.sr/magic/
- _sdegutis 9y agoClojureCLR is definitely cool, and a few years ago I wrote a simplistic window manager [1] using ClojureCLR for scripting. But local jobs that want a C# person aren't probably the same kind of people who will be open minded about CLR languages, they probably just want someone who can maintain their plain-jane .NET apps that were written by someone fresh out of community college (which is ironically where I learned C++ and VB.NET).
- agumonkey 9y agoyour [1] was too lazy, please force
- lewisl9029 9y ago> Plus most of modern JavaScript has most of the same benefits as Clojure anyway, especially in terms of FP. This is technically an accurate statement, the JavaScript ecosystem is massive and has excellent equivalents to just about every piece of useful Clojure FP construct out there. But from a practical standpoint, when you start stitching these FP pieces together, you'll notice that the FP model in JS suffers immensely from the mutable-by-default design in its core data structures. This means FP libraries have to accept and output these mutable-by-default data structures to gain any non-trivial adoption, which in turn often means they can't afford to use persistent data structures internally either, because recursively translating to and from the default mutable data structures, even just on the edges of the system, will often prove to be prohibitively expensive for most libraries. The entire JS ecosystem thus overwhelmingly assumes the use of mutable data structures, and in a program that tries to do FP in JS, any performance wins resulting from the use of structural sharing in persistent data structures (instead of naively cloning the default mutable data structures) get mostly nullified, if not outright negated by the need for recursive translation every time it needs to interact with third-party libraries or core browser APIs. Even in systems that uses Redux (which as an architecture is about as functional as you can get, and outright forbids direct state mutation) overwhelmingly end up using built-in mutable data structures to represent state. Its Recipe page on "Using Immutable.JS with Redux" (https://redux.js.org/docs/recipes/UsingImmutableJS.html https://redux.js.org/docs/recipes/UsingImmutableJS.html) is littered with a long list of caveats precisely because there exists far too many not-immediately-obvious performance footguns available for one to shoot themselves with when taking up the task of carefully micro-optimizing all the expensive toJS and fromJS calls they'd have to make to build anything non-trivial. This is of course not to throw ImmutableJS under the bus, because it provides an excellent set of persistent data structures by any measure. It does have an uphill battle to fight to justify its adoption though, because it exists in an ecosystem that compels users to reject it for no fault of its own. I haven't even gotten started on the developer ergonomics of using non-native data-structures, which since ES6 has taken a (relative) nosedive, because of all the syntactic sugar that was introduced for the built-in data structures. Contrast this with the ClojureScript ecosystem, in which the use of efficient persistent data structures is rarely ever a question, because that's the default, and every third party library and application written in CLJS can just take the associated performance benefits for granted. P.S. Apologies for the rant. I've been switching back and forth between CLJS projects and JS projects for the past year, and this has always been my biggest pet peeve with the state of functional JS. I'm actually quite happy with just about every other aspect of functional JS, to be honest, but I fear JS may never reach its full potential as a functional language because of this core defect.
- spraak 9y agoThere are remote Clojure jobs. Some guidance here https://purelyfunctional.tv/ https://purelyfunctional.tv/
- _sdegutis 9y agoThanks but I'm highly skeptical of the wording, it sounds suspiciously like a pyramid scheme. If they really were in contact with remote Clojure jobs, I don't know why they would hide them behind a free email course. That doesn't seem to benefit the employers or employee candidates, only the people behind this website.
- modernerd 9y agoThe site's run by a well-respected Clojure developer and educator called Eric Normand. This is not a pyramid scheme, and Eric makes no guarantees of finding Clojure-related work – only that the content will be useful if working in Clojure and FP is of interest to you. I've found the free drip-fed email course helpful. The free video content is also well presented, as are Eric's talks at Clojure conferences on YouTube. I plan to subscribe, but the video content is also downloadable individually if you want to skip the free tips and offers in the intro emails: https://purelyfunctional.tv/courses/ https://purelyfunctional.tv/courses/
- Scarbutt 9y agowell-respected Clojure developer With no offence, but what quality code/library/framework has he shared or produced?
- modernerd 9y agoI respect him as a developer for his enthusiasm and ability to convey complex concepts simply: Building composable abstractions https://www.youtube.com/watch?v=jJIUoaIvD20 https://www.youtube.com/watch?v=jJIUoaIvD20 Category Theory From the Universe Up https://purelyfunctional.tv/courses/category-theory/ https://purelyfunctional.tv/courses/category-theory/ Data modelling in Clojure https://purelyfunctional.tv/courses/modeling-solitaire-in-clojure/ https://purelyfunctional.tv/courses/modeling-solitaire-in-cl... To me instruction like this is worth more than a library with a few thousand stars on GitHub. The FP industry could benefit from more programmer-educators that don't actively obfuscate concepts in mathspeak. (That sometimes has its place too, though, and there are other resources that do a good job of deciphering monads etc. without heavy metaphor, like Haskell Programming From First Principles: http://haskellbook.com/. http://haskellbook.com/.)
- didibus 9y agoGo work for a Java shop, and slowly start sprinkling some Clojure into it. I mean, maybe you can even do so in a C# shop, ClojureCLR is a real thing.
- threeseed 9y agoIf you did that you would likely be fired. And for good reason. Clojure is a language that needs a lot of careful thought before being dropped into a Java shop. It's the complete opposite of Java in many respects and at some point that code will need to be maintained.
- jb1991 9y agoI've known more than one developer who successfully did this in their Java job. They were not fired. Some of them ended up speaking at Clojure conferences about it.
- blunte 9y agoThis kind of sneaky sneaky subversion is how Linux gained a foothold in corporate IT. And we know how that turned out. This is definitely a method smart underlings can employ to change things for the better. It is not without some career risks, but it can also open new doors.
- genetics_guy 9y agoMy gripe with Clojure is readability. Its like the PERL of FP to me. Why is there so much syntactic sugar to achieve the same thing? Like this line from the article: "Eve: Or if you want - no-hash solution." This shit makes me cringe. Just pick one way to to do something, and make that the default in the language. This is why Python is one of the more popular languages today, you can go from 0 to relatively proficient in no time. No FP lang can claim the same thing. And people wonder why after 50 years FP hasn't completely taken off (unless you count javascript). I can read 10 programs solving the same problem in clojure and they can look almost completely different. That is bug, not a feature, I'm sorry. Having "freedom" to do things in different ways just adds cognitive load. We already deal with enough option fatigue in our daily lives, why make it a core part of a language?
- zimablue 9y agoReadability might be a fair criticism but syntactic sugar is a weird one, there's not a lot of syntax at all. Multiple ways to do something is a feature, and there's definitely multiple ways to do things in python: metaclass vs class decorators lambdas vs explicit functions (basically the same thing as your no hash example) map/reduce/filter vs list/generator comprehensions
- manishsharan 9y agoThe sad news for Elm/Clojure/Haskell developers is that most of the dev managers are old java/c# folks -- not the sharpest or the most curious folks and they are unlikely to try out functional languages or any new languages for that matter.
- rohshall 9y agoI am surprised that there are more jobs in Windows and .NET at your place. Java platform is more popular than .NET, and your knowledge of JVM is very valuable. I think you are much better off trying for Java/Scala/Clojure jobs.
- a-saleh 9y ago> which I wish I had spent gaining more experience in (sigh) C# and .NET I am sort of afraid that I might end up in similar situation if I would need to change jobs. At my current company I worked 1/2y in Java, 1y in Clojure, 1y in Python, 1/2y in C#, 2y in mix of javascript, groovy, ansible and chef-scripts. There seems to be GO on a horizon. This means that all the well earning "Senior Developer - requires 5 years experience with swing" will probably be out of reach. But as they say, you shouldn't call yourself $LANGUAGE-programmer anyway, so I hope I will be able to sell myself as the "7 years of devops/process-automation", rather than "2-year Node.js experience" guy :-)
- hellofunk 9y ago> Plus most of modern JavaScript has most of the same benefits as Clojure anyway Except for the very elegant syntax. Your Clojure code will be at least half the size of equivalent JS code, probably much less than that. And without pulling in explicit dependencies on ImmutableJS, React and others. Projects with less code have less bugs and are more fun to think about, in general. That's something extra Clojure brings to the table.
- zimablue 9y agoAlso no macros, no parallelism
- gonewest 9y agoIt can’t be literally true learning Clojure did you no good... You do need to be conscious in your interviewing, and make sure you have some talking points ready to explain how clojure sharpens your thinking and applies to other languages besides. At that point if the recruiter doesn’t see the fit, you probably want to avoid that employer anyway.