Live data from Hacker News

Clojure will affect the way you think about programming

eli.thegreenplace.net

211–220 of 226 posts

Re: Clojure will affect the way you think about programming

#211

Our experiences with clojure are clearly different. There have been plenty of people who have built successful businesses with perl too. /shrug I'm still going to recommend people not use either language, because I've personally encountered the downsides of 'when things go wrong'; and it's been significantly worse than in other languages. > Are we doing opinion threads now? Okay. I can do one too! That's a bit of a f…

> I'm still going to recommend people not use either language, because I've personally encountered the downsides of 'when things go wrong'; and it's been significantly worse than in other languages.

I... Didn't ask. I appreciate your post as a jumping off point for mine, but I honestly I think what you're going to do is not relevant to me. Thanks for the heads up though.

> That's a bit of a flip off isn't it?

I'm not sure what "flip off" means in your dialect. In mine... No? You have an opinion and I'm clearly stating the following is mine.

I'm sorry if you found this combative. I took pains to face the content away from your points to focus on what I like rather than what you hate.

I could contest your post if that's what you'd like me to do, but it seems like you're fairly defensive on this subject. So maybe that's inappropriate.

> You want to call it an opinion thread? Well, you know what they say. Opinions are like assholes, everyone has one...

Oh yeah, I know this one. Opinions are like assholes, everyone has one, but a person named shadowmint on Hacker News seems very keen to suggest theirs is ground truth with vaguely sourced points.

I had never really understood how that classic anecdote had relevance in the modern world, but here we are. Wow.

Re: Clojure will affect the way you think about programming

#212
post #66

Earlier quoted context omitted.

I work in Scala and it has live code update, interactive worksheets and a repl. As for type systems increasing complexity I think that depends on the application. As a beginner to Clojure I would pass unstructured data around all over the place and then have the mental overhead of trying to remember the structure or fix it all at runtime.

The biggest difference is the editor integration. Scala, like most languages has a REPL that's basically a toy you use on the side. Clojure REPL is tightly integrated into your workflow. I did a talk last year where I illustrate it starting around 15 minute mark https://www.youtube.com/watch?v=nItR5rwP4mY I'm not aware of any non-Lisp languages that provide anything close to that. The REPL driven workflow directly ad…

Nice talk. I agree with you that the repl in Clojure and Common Lisp etc is much more of a first class citizen in the development environment. What people often don't realize is how powerful the repl and worksheet can be in scala development.

Re: Clojure will affect the way you think about programming

#213

Earlier quoted context omitted.

Any book on clojure and website too will go over them. They are fundamental to using clojure. I don't know enough about haskell to say what it does or doesn't have in relation to clojure. However, it's not simply the data structures, but how the language is built to interact with them from a programmers perspective. From a user interface to the language point of view, I find the ways of interacting with maps to be ve…

> To pull a value out, you can evaluate (:c map1) which will return "taco". Not (map1 :c)? A bit odd.

Both work I believe, but the idiomatic way is keyword first.

Re: Clojure will affect the way you think about programming

#214
post #46
post #32

Earlier quoted context omitted.

One huge difference is the workflow you have in Clojure. REPL driven development is an experience unique to Lisps. When you're working with Clojure, any code can be run in the context of the live app straight from the editor as you write it. This is an amazing experience and very mind expanding in what a development process can look like. Also, anybody who wants to try FP style programming, but isn't interested in st…

I don't think that's entirely unique to Lisps, you can get a REPL into an existing Erlang instance very easily. More easily than getting nREPL running in Clojure, actually. I believe Smalltalk as well, although I'm less confident on that one as I haven't used it much.

As someone who's professionally developed mostly in Erlang and Clojure in the last 6 years, it's not even close. I love Erlang, but the REPL is severely underpowered and used mostly for debugging and inspection.

Re: Clojure will affect the way you think about programming

#215

Our experiences with clojure are clearly different. There have been plenty of people who have built successful businesses with perl too. /shrug I'm still going to recommend people not use either language, because I've personally encountered the downsides of 'when things go wrong'; and it's been significantly worse than in other languages. > Are we doing opinion threads now? Okay. I can do one too! That's a bit of a f…

> I'm still going to recommend people not use either language, because I've personally encountered the downsides of 'when things go wrong'; and it's been significantly worse than in other languages. I... Didn't ask. I appreciate your post as a jumping off point for mine, but I honestly I think what you're going to do is not relevant to me. Thanks for the heads up though. > That's a bit of a flip off isn't it? I'm not…

> I... Didn't ask.

If you have an opinion that is unrelated to mine, don't reply to my thread then.

You have an opinion? Great job. Good work.

Calling my comments an 'opinion piece' is actively combative. If you dont want to do that, then how about you just post your opinion in its own thread?

Its easy and saves us having this conversation, if you're not interested in a discussion.

> but a person named shadowmint on Hacker News seems very keen to suggest theirs is ground truth with vaguely sourced points.

Fuck off. Really.

If you don't want to talk about it, then don't reply. I've in no way suggested your experience with clojure is anything less than you've said it has been, and all I've posted is my experience with it. You're being a jerk.

Re: Clojure will affect the way you think about programming

#216

Earlier quoted context omitted.

> I'm still going to recommend people not use either language, because I've personally encountered the downsides of 'when things go wrong'; and it's been significantly worse than in other languages. I... Didn't ask. I appreciate your post as a jumping off point for mine, but I honestly I think what you're going to do is not relevant to me. Thanks for the heads up though. > That's a bit of a flip off isn't it? I'm not…

> I... Didn't ask. If you have an opinion that is unrelated to mine, don't reply to my thread then. You have an opinion? Great job. Good work. Calling my comments an 'opinion piece' is actively combative. If you dont want to do that, then how about you just post your opinion in its own thread? Its easy and saves us having this conversation, if you're not interested in a discussion. > but a person named shadowmint on…

> Calling my comments an 'opinion piece' is actively combative

You yourself admit they're opinions. I'm not sure why you find this to be a problem.

> If you dont want to do that, then how about you just post your opinion in its own thread?

I'm terribly sorry to inform you but conversations develop in threads here. That's normal. There are cases where that doesn't happen, but I'm pretty sure "these are our experiences about Clojure" is on topic enough.

Besides, you went into other people's threads to say they were wrong about Clojure. It does feel like you're giving yourself a double standard here...

> Fuck off. Really.

I really don't understand why we can't keep a conversation about programming languages civil and light-hearted.

Tool choices have impact and weight, but there is room for a lot of people in the world. Why is my presence so specifically intolerable?

I'm not even the only person who has a different experience. Heck, I can point to 3 other nastily worded posts you didn't reply to. Please tell me what makes my post special? The charisma? The power? The... You know... Animal magnetism?

Thinking on it though, if you really are made that uncomfortable by this conversation, please accept my apologies. Just because I'm confused doesn't obligate you to explain.

Re: Clojure will affect the way you think about programming

#217

Earlier quoted context omitted.

I've worked with Java for over a decade in the enterprise before I started using Clojure.

And which Java libraries where so complex that you could not understand them?

I didn't say I couldn't understand them. I was talking about the amount of time it takes to understand a typical library in a language like Java. My experience is that you would have to spend a lot of time jumping through different classes, and often have to step through things in a debugger to understand them.

By contrast, I find that code in Clojure libraries to be much easier to read and understand. You literally needs orders of magnitude less code to solve same kinds of tasks, and it tends to be organized much better. I can open a namespace and read it top to bottom to see what it's doing. That's pretty much never the case with a non-trivial Java class.

As a concrete example consider the Java Flyway migrations library to the Clojure migratus library that I've taken over maintaining

https://github.com/flyway/flyway/tree/master/flyway-core/src...

https://github.com/yogthos/migratus/tree/master/src/migratus

They both provide same core functionality, and I was able to understand the Clojure version in a few hours. It would take me much longer to understand Flyway or to be meaningfully contribute to it.

Re: Clojure will affect the way you think about programming

#218
post #66

Earlier quoted context omitted.

The biggest difference is the editor integration. Scala, like most languages has a REPL that's basically a toy you use on the side. Clojure REPL is tightly integrated into your workflow. I did a talk last year where I illustrate it starting around 15 minute mark https://www.youtube.com/watch?v=nItR5rwP4mY I'm not aware of any non-Lisp languages that provide anything close to that. The REPL driven workflow directly ad…

Nice talk. I agree with you that the repl in Clojure and Common Lisp etc is much more of a first class citizen in the development environment. What people often don't realize is how powerful the repl and worksheet can be in scala development.

Thanks, having editor integration with the application runtime completely changed my workflow. I simply couldn't go back now, having instant feedback on the code you write is extremely satisfying.

What surprises me is that none of mainstream languages provide this kind of environment. Lisp and Smalltalk have been around for many decades, and somehow this workflow ended up being completely neglected in the mainstream.

Re: Clojure will affect the way you think about programming

#219
post #132
post #36

Earlier quoted context omitted.

I personally don't view Scala as a FP language, it's a FP/OO hybrid. It's not opinionated in that regard, and a lot of code in it is written in traditional OO style or a mix of the two. Erlang is another widely used functional language, but it's not very widely used outside the telecom niche. Clojure has the advantage of running on the JVM, and makes it easy to target a much wider range of domains.

Clojure is also a hybrid. The other part is called Java or Javascript. This is claimed as an advantage, since there is already a lot of functionality in another language to be reused by a direct interface. Some stuff is simply deferred to the host language and since the other part is based on OOP, applications will then be a mix of more FP-oriented code calling OOP-oriented code.

This is an implementation detail, and doesn't affect the API presented to the user. For example, consider the clj-http library that's backed by the Apache http Java library internally https://github.com/dakrone/clj-http . As a user of clj-http, I don't know or care about the fact that it's a wrapper around OOP code.

Furthermore, if you wanted to, you could reimplement the internals in Clojure and the users of the library wouldn't be affected.

Being able to leverage existing mature libraries is a huge advantage, and the fact that they can be used via idiomatic functional APIs provides the best of both worlds experience.

Re: Clojure will affect the way you think about programming

#220
post #173

Earlier quoted context omitted.

> In Clojure parlance, "simplicity" refers to interconnectedness Clojure tends to redefine words describing concepts with a new or restricted meaning. Typically a general concept like 'simplicity' would have more than one dimension. > take as as argument an object that has the "id" field from the "Student" class, and the "email" field from the "User" class. Or would you have to explicitly pre-define mixins like HasSt…

> Clojure tends to redefine words describing concepts with a new or restricted meaning. Typically a general concept like 'simplicity' would have more than one dimension. Sure, but that happens all the time in programming. When we talk about "objects" we don't mean "a material thing that can be seen and touched". > I would not do this at all. Having slots or not are low-level artefacts and writing methods which are fi…

"this is a function that takes data that includes a student's email and enrolment date"

You can do this using a row type, e.g. OCaml:

    # let foo student =
      Printf.printf "Email: %s\nEnrolment: %d" student#email student#enrolment
    val foo :  -> unit = 
The second line is the output from the OCaml REPL. Note how it automatically infers that the input is an object which includes an email and an enrolment field, with the correct types.
Post reply on HN