Live data from Hacker News

Why I'm Productive in Clojure

yogthos.net

71–80 of 99 posts

Re: Why I'm Productive in Clojure

#71
post #69

REPL-driven development is wonderful. I'm not a Clojure user (yet), but I write a lot of Scheme. My programs are living creatures that adapt and evolve as they are running. It's refreshing to see that Clojure is seeing real use in the industry. Gives me hope that I can get paid to work with a language I really enjoy some day.

I'm a bit curious about your comment. Do you mean during development you run your code on a REPL and change portions of it , or do you mean you run code in Production in a REPL and change portions of it as it's running? I'm interested to know your setup in either of those cases. The one inconvenience I have about REPL based development is that I need to copy over an expression from my editor into the REPL and if I ma…

REPL Driven development as it's called is really yes having your whole system running at your thingertips (even production for the adventurous). You can execute arbitrary code and get results or see what state has changed. You can also redefine anything (in Clojure at least) that is referred to, such as functions and variables (I use these terms loosely here).

Normally you have your IDE configured so that anything executed is executed in the context of the running REPL session. So there should be no need to copy/paste.

When done properly with tests running on every change you really can't, as a developer, get any quicker feedback. It's brilliant and empowering!

Your issue could be emacs but, for Clojure at least, there is the Cursive Intellij plugin which is now definitely usable. Also there are the brand new IDEs like LightTable.

LightTable.com started out with some very different ideas with regards to code organisation and there is still a lot of potential work there. But lighttable instead became open source and a core for plugins. The plugins now range from rainbow parentheses to 'pick your language' evaluation.

If you want to discuss any of these ideas or others please do or PM me. I'm always willing to discuss as my girlfriend is hopeless. But then for everything not programming she keeps me sane.

Re: Why I'm Productive in Clojure

#72
post #15

I recently migrated to clojure from the php world. I have to say that although I am still learning the language, its actually fun compared to php, which would sometimes feel like pulling teeth to get some basic functionality. Way less boilerplate, and as can be said of anything good, it just works. Also, the idea of thinking in the problem domain versus the subset of problems that arise in languages like php is an ac…

I made a career move from dentistry to programming. And I would say that anything I've used pre-clojure is a good approximation of pulling teeth. But even pulling teeth has the benefits of knowing when you're finished and the direct customer feedback is usually good.

Re: Why I'm Productive in Clojure

#73
post #64

Earlier quoted context omitted.

Storm ( https://storm.incubator.apache.org/ ) is a great example of Clojure used to solve concurrency problems in the wild.

Sorry pardon my ignorance but that seems like parallization not concurrency. I would like examples of things like pmap being used in the wild.

Well, p in pmap does stand for parallel. :) The two are obviously linked, Storm does both parallel and concurrent processing on the data. Another example is PigPen (http://techblog.netflix.com/2014/01/introducing-pigpen-map-r...) from Netflix. As far as pure concurrency goes, I'm not sure any companies have articles discussing that.

Re: Why I'm Productive in Clojure

#74
post #15

I recently migrated to clojure from the php world. I have to say that although I am still learning the language, its actually fun compared to php, which would sometimes feel like pulling teeth to get some basic functionality. Way less boilerplate, and as can be said of anything good, it just works. Also, the idea of thinking in the problem domain versus the subset of problems that arise in languages like php is an ac…

I'm in the process of making the move from PHP to Clojure as well. FYI, deploying to Amazon Elastic Beanstalk with the beanstalk leiningen plugin is a breeze.

Re: Why I'm Productive in Clojure

#75
post #69

REPL-driven development is wonderful. I'm not a Clojure user (yet), but I write a lot of Scheme. My programs are living creatures that adapt and evolve as they are running. It's refreshing to see that Clojure is seeing real use in the industry. Gives me hope that I can get paid to work with a language I really enjoy some day.

I'm a bit curious about your comment. Do you mean during development you run your code on a REPL and change portions of it , or do you mean you run code in Production in a REPL and change portions of it as it's running? I'm interested to know your setup in either of those cases. The one inconvenience I have about REPL based development is that I need to copy over an expression from my editor into the REPL and if I ma…

My setup involves GNU Guile Scheme, Emacs, and the geiser extension for Emacs. I boot up my Guile application and it spawns a REPL server. In Emacs, I run M-x connect-to-guile to connect to that server. From there, I edit my source code files as normal. However, once I've made an edit, I press C-x C-e next to the region of code that I want Emacs to send to the Guile REPL and view the results. The edit/apply process repeats until I'm done working and kill the application.

It's a really great way to work. I've spent a good amount of time making this workflow work well for applications that run an event loop, such as a game or web server, by writing a "cooperative" REPL server for Guile [0].

I hope this makes some sense!

[0] https://gnu.org/software/guile/manual/html_node/Cooperative-...

Re: Why I'm Productive in Clojure

#76
post #2

> What matters to me in a language is whether I can use it without thinking about it. I love this statement. It reminds me of the what it feels to be good at mathematics (not my words): "Your intuitive thinking about a problem is productive and usefully structured, wasting little time on being aimlessly puzzled." from http://www.quora.com/Mathematics/What-is-it-like-to-understa... The author also says more about math…

To be a language means to be a way of defining thoughts in order to have them delivered to another.

With no constraints you could just write random rubbish (a bit like this). With the constraints of Java or C# you write code which does it's job, however a lot of work is in fitting your thoughts within the extensive syntax of the languages' constraints.

Clojure, or any other Lisp, helps in that the initial constraints it imposes are simple ().

Once you get a feel for the simplicity you get the feel for the power it brings.

It's a bit like wingtsun kung fu. Your brain is no way fast enough to react to your opponent fast enough to decide for example is this a hard punch or a soft punch. By that point the punch would have been received, restricting your thinking further. However if your body knows the language of wingtsun there is no thinking involved. Period.

Your body knows the language of interacting with another body so leaving your mind the time to make decisions. Your body has embraced the language and can rely on it to keep you alive whilst giving your mind the freedom (time) to make decisions or ultimate kill moves or be creative.

Another word for decisions is creativity. The cost of creativity is time. So embrace your language and be creative with your thoughts given the time your language allows. If you feel your language is asking for help unrelated to your problem then either you don't understand your language or the language is not a language at all and maybe another is better for the current context.

To sum this range in rubbish clojure:

(if (total-time > time-spent-defining-problem) (ask-where-this-time-went total-time time-spent-defining problem) :you-are-at-one-with-your-language-and-in-flow-my-friend)

Or think about:

(def time (apply + allthetimesyouspentdefiningclasseswhenallyouwantedwasafunction))

End of drunken rant.

Re: Why I'm Productive in Clojure

#77
post #7

My biggest problem with Clojure (specifically ClojureScript) is that it's too workflow opinionated. Nearly all Clojure devs use 1 of 2 text editors. Nearly everyone uses Leiningen. Nearly everyone uses some sort of auto-builder. Nearly everyone uses hot-swapping. Clojure wasn't even optimized for this workflow, it's just the only one that works. So as much as I love the language I keep going away from it because I pr…

Well, people do use these tools, but honestly, do you really want a language with multiple build tools / package managers? The java world is a mess here. Leiningen is pretty great, no need to fragment the community. As far as editors go, I'm perplexed. You can use nearly any editor, why do you perceive the need to use one of these 2?

Checkout the awesome hoplon library for a different way: https://github.com/tailrecursion/hoplon

Re: Why I'm Productive in Clojure

#78
post #61
post #14

Earlier quoted context omitted.

Java has Maven, Scala has SBT, Clojure has Leiningen. That's not so bad. I use all three languages, and the appropriate tool for the language. I don't use hot-swapping for anything. For IDEs, in Clojure, you have the choice of Vim, Emacs, Cursive (for IntelliJ), Light Table, and Counterclockwise (for Eclipse), and more. All of them are good, pick your favorite.

Java and Scala are both pretty usable with Maven or SBT (my own Java projects use SBT now). Clojure is pretty much limited to Leiningen. (And, personally, I find working with Leiningen to be a huge drag.)

I have to disagree. Leiningen is the bollocks.

It makes working with maven easy for everyone.

Re: Why I'm Productive in Clojure

#79
post #19
post #16

Earlier quoted context omitted.

C brings in its own problems. Compiler (in)compatibilities, the need to install libraries on a machine to be able to compile and run programs. And besides, in C you still have a build system problem - Make is fine, but it is definitely opinionated about how things happen, and you potentially have to write a lot more boilerplate to get a complex project built with Make than you do for Leiningen, Maven, SBT, etc.

You don't have to use Make, there are a half a dozen other popular build systems.

I personally find that to be a horrible experience. Nothing worse than having to install a bunch of tools that you'll never use again, to compile someone else's project. For example, if you use CMake, tough, project A uses autotools. You use bjam? Project B uses QtCreator/QMake. You use Waf? Project C uses SCons.

No thanks, just give me a standard build tool like leiningen and be done with it.

(Ok, so its not "usually" that drastic, because there are only a handful of winners, but its happened a few times now that I've had to install Ruby - a language I don't use myself - just to run Rake to build some non-ruby software I've wanted...)

Re: Why I'm Productive in Clojure

#80
post #72
post #15

I recently migrated to clojure from the php world. I have to say that although I am still learning the language, its actually fun compared to php, which would sometimes feel like pulling teeth to get some basic functionality. Way less boilerplate, and as can be said of anything good, it just works. Also, the idea of thinking in the problem domain versus the subset of problems that arise in languages like php is an ac…

I made a career move from dentistry to programming. And I would say that anything I've used pre-clojure is a good approximation of pulling teeth. But even pulling teeth has the benefits of knowing when you're finished and the direct customer feedback is usually good.

Why did you decide to switch from dentistry?
Post reply on HN