Clojure WTF
-
Is this code too contrived or non-trivial Clojure code usually looks like this ?
No, it's not too contrived. It's just bloody awful, as Bort shows with his reimplementation usingmapcat
.The main problem is that it's using
loop
, which is an expression of imperative programming bolted onto the top of a functional language. The result is, as you have realised, a horrible mishmash of imperative and functional styles, and it's unreadable.@Bort said:
@stillwater said:
Is there actually an enlightenment experience at the end of it all If i manage to torture myself through this ?
The claims of enlightenment are greatly exaggerated. But there are many great ideas in these "out-there" languages that you can employ in more conventional work.
I'm not sure about that. The enlightenment of functional languages is that they make you focus differently. Mutability and side effectful code begin to feel unnatural, and you do become a better programmer as a result of it.
-
What about Scala? How far down the rabbit-hole do you have to go to make it worthwhile?
If you know Java you can start using it immediately without effort, though probably more experience is needed to fully utilize the various features it has. For me it felt "like Java but with all those nice functional optional features".Safe choice if you need to build a working project, compatible with JVM libraries and existing Java code (project can be a mix of both). For building and library management I recommend gradle.
On the other hand, the functional style is by no means enforced, you can write a standard imperative program with it. Therefore the pure functional enlightenment is not guaranteed. But if you want to get things done, Scala will not stand in your way.
-
Cool. I'm just gonna be playing with it after work, seems like a good language to try.
-
Just for reference... I have no clue of what that's. Probably a hello world.
BTW, isn't this the same as with Haskell? Seems painfully close to what I remember of it.
-
The only thing I've ever heard of being produced by clojure is tragedy. There was that one guy with the child-ceo, another rant that I cant find anymore where a core language developer had decided that they were doing everything wrong and he was going to do something else with his life, never anything positive. The main reason I don't want to learn clojure is because I'm terribly worried that it might lead to a job writing clojure.
-
The part where you look at a piece of code and can understand it as you read it vs figuring out where an expression or function starts and where it ends.
The better editors will also format the code for you so that you can see the logical structure.
-
I didn't even want to think of it in terms of a mutable list. I've become very unaccustomed to that.
Went ahead and wrote the mutable list version for comparison. Not as bad as I thought, but still confusing with the extra increment to the list index.
public static void SymmetrizeBodyParts(List<BodyPart> parts) { for (int i = 0; i < parts.Count; i++) { var p = parts[i]; var mp = MatchingPart(p); if (p.Name != mp.Name) { parts.Insert(i + 1, mp); i++; } } }
-
@Bort said:
The claims of enlightenment are greatly exaggerated.
I'm not sure about that. The enlightenment of functional languages is that they make you focus differently. Mutability and side effectful code begin to feel unnatural, and you do become a better programmer as a result of it.
Perhaps my claim was also greatly exaggerated.
-
Or maybe mine was. Or both. Or neither.
Once you've been enlightened, it never seems like such a big deal.
-
Closest match: www.asstr.org/~ingrid/ossified-alice.html
Yarr, how about a warning on that link to a bunch of porn stories, eh?
-
Yarr, how about a warning on that link to a bunch of porn stories, eh?
Sure? IDK what you were expecting, given the context of the source quote...
I mean, come on, I don't even need Engine to tell me that!
@Lorne_Kates said:Chapter 37
Alice squirmed on the writing desk, her legs spread wide, her pinafore hiked up to her thighs-- already soaked."Take me, Mr. Raven," she breathed with a quiver, "Just like you would this writing desk."
She locked eyes with her lover. "Eat me."
-
With my extremely limited exposure to Clojure, I do think about how terrible it might be for some one to do clojure full time. I dont feel the same way about Python or F# or Julia which I know as little as I know Clojure. Hmmm I dont know..
-
How shitty is Haskell? Do you hate it completely? Haskell IMO felt like F# on Difficulty level 9000 after I went through a little F#.
-
Nobody @mentioned me?
I'm disappointed.Just ask @aliceif
What the doormouse said
Into her ear as he nibbled the lobe
Then worked his way down
-
@Tsaukpaetra attempted to content-match the source post and failed.
What kind of perverted sicko do you think I am, to read a smut site like that?
I made that up, in my brain, while thinking of a children's story.
I... hmm... fuck, I'm on some more watchlists now, aren't I?
-
@Lorne_Kates said:
What kind of perverted sicko do you think I am, to read a smut site like that?
I made that up, in my brain, while thinking of a children's story.
You apparently don't need to read smut to write it then!
Filed under: Didn't know that was what it was called. New link added!
-
You apparently don't need to read smut to write it then!
Well, there's one other source of inspiration for writing sex stories. It's called "having sex".
Filed under: clojure. surprisingly erotic
-
It's called "having sex".
TIL @maciejasjmj is quite a bit more kinky that previously thought...
-
quite a bit more kinky that previously thought...
Having sex is kinky now? Oh the humanity.
-
Having sex is kinky now?
No, somehow generating weird scenarios involving children, writing desks, and ravens from having sex is kinky.
-
With my extremely limited exposure to Clojure, I do think about how terrible it might be for some one to do clojure full time.
I heard that there are people who actually like coding in Clojure.
Filed under: the horror
-
@Tsaukpaetra said:
Closest match: www.asstr.org/~ingrid/ossified-alice.html
Yarr, how about a warning on that link to a bunch of porn stories, eh?
Warning: asstr.org is NSFW.
-
-
Do you not know why @Aliceif In Wonderland was written in the first place?
-
Do you not know why @Aliceif In Wonderland was written in the first place?
No, no, that was Lolita.
-
in the first place?
Based on your question, and the context of the ask.... Probably not?
-
Do you not know why @Aliceif In Wonderland was written in the first place?
For the same reason "Grown Ups 2" was made: so Lewis Caroll could score a free trip for him, C.S. Lewis, Lloyd Alexander and J.R.R Tolkein, paid for by the product placement bux.
-
-
If you want to learn a lisp, I'd start with Scheme. It's a language completely stripped down to the bare minimum. Get a copy of that book with the elephants in it that I have a copy of at home and work your way through that, once you have the basics solid, then take a look at these arcane newfangled lisps like Clojure or Common Lisp or what have you, but tbh Scheme has about 95% of what lisp is about, and the best part is there's so many different Schemes out there...