News for hackers. Stuff that matters.
Re:Why I'm Productive in Clojure by S4M on Wednesday July 23, 2014 @09:48AM (#8074314)
> Any language that lets you spend your brainpower on the essence of the problem is a tremendous advantage and joy. This unlocks creativity and productivity.

For some reason the only language that let me reach this level is Python. I tried Clojure and Common Lisp, but for some reason I could never be as efficient as I wanted with them, which I think is a shame because in some ways I think the Lisps are superior to Python (due to the "code is data and data is code" of Lisp).

Re:Why I'm Productive in Clojure by willismichael on Wednesday July 23, 2014 @10:23AM (#8074497)
I really like Python, and use it on a daily basis but I found that after enough experience in Clojure, I prefer it when I have the choice and there isn't a compelling reason to use Python instead.

This isn't a criticism by the way, I do understand that people have different preferences of language idioms, and I do occasionally find myself scratching my head about the idiomatic Clojure way to solve a problem that wouldn't have been so hard for me in Python.

Re:Why I'm Productive in Clojure by S4M on Wednesday July 23, 2014 @10:32AM (#8074545)
While I don't think Python is a bad language at all, it has some limitation that I am becoming more and more being aware of them - lack of static typing, limitation of lambdas, speed is an issue sometimes, but on the other hand it's very easy for me to be productive in it.

I am pretty sure that its lack of features is making Python easier to "master" (I don't claim to master it, just that I am more productive with it), but this lack can be limiting sometimes, so I am trying to find a solution to have both power and proficiency.

Re:Why I'm Productive in Clojure by jcromartie on Wednesday July 23, 2014 @11:08AM (#8074732)
I use Clojure a lot, and did more Python in the past. Whenever I come back to Python, I am frustrated by being unable to remember what's a plain old function and what's a method, and the differences defining functions vs classes and methods etc..

In Clojure I know it's always (except for interop) just functions on values. Some functions dispatch to an implementation based on the type of the value, as is the case with multimethods and protocols, but it's still always just function calls from my point of view while writing the code.

Re:Why I'm Productive in Clojure by scardine on Wednesday July 23, 2014 @12:57PM (#8075428)
Objects in Python little more than glorified namespaces. I always think of methods as a function that gets the namespace where it was declared as the first argument. Yes, there is the inheritance thing, but in Python it is just a mechanism to organize code.
Re:Why I'm Productive in Clojure by mimighost on Wednesday July 23, 2014 @01:03PM (#8075469)
In general, Python method is just combination of function object and pointer to "self" namespace.
Re:Why I'm Productive in Clojure by agumonkey on Wednesday July 23, 2014 @03:34PM (#8076470)
I'd like to know if it's done differently in other languages. In my view, methods are curried function over self with a '.' syntactic shortcut.
Re:Why I'm Productive in Clojure by kazagistar on Saturday July 26, 2014 @03:07AM (#8089131)
Lua does not do the currying bit, but it does a lot less OOP and a lot more "dictionaries with stuff that can do something like prototype OOP if you squint hard enough". Java and whatnot just don't let you really use methods as first class citizens, so it doesn't matter.
Re:Why I'm Productive in Clojure by agumonkey on Monday July 28, 2014 @03:43AM (#8095607)
IIRC under the hood Java will 'evaluate' the methods body as a sophisticated function with 'this' in its environment.
Re:Why I'm Productive in Clojure by collyw on Thursday July 24, 2014 @07:56AM (#8079099)
That's pretty much how I view them as well.
Re:Why I'm Productive in Clojure by agumonkey on Friday July 25, 2014 @08:14AM (#8084769)
Great then.
Re:Why I'm Productive in Clojure by djtriptych on Wednesday July 23, 2014 @11:41AM (#8074952)
"code is data and data is code" has a name: homoiconicity.
Re:Why I'm Productive in Clojure by S4M on Wednesday July 23, 2014 @12:23PM (#8075190)
True, somehow I forgot the name of that concept.
Re:Why I'm Productive in Clojure by pjmlp on Wednesday July 23, 2014 @01:34PM (#8075649)
I was big on Python side back in the early 2000's, on the Perl vs Python for system administration tasks.

Maybe because of the experience in using scripting languages on the server side for a late 90's .COM startup in terms of performance, I never could convince myself to use Python other than for shell scripting on steroids.

I always looked for other languages in terms of tooling support, IDE support and support for native compilation on their toolchains (JIT or AOT).

Re:Why I'm Productive in Clojure by agumonkey on Wednesday July 23, 2014 @10:54AM (#8074658)
Could you tell us more about what you ended up missing from Python ? is it syntax ? concepts ? libraries ?
Re:Why I'm Productive in Clojure by S4M on Wednesday July 23, 2014 @11:02AM (#8074703)
It's nothing I miss, it's just that I couldn't keep in my head all the standard way to do things in Clojure/CL. I kept wondering "oh, how do I check if an element is a member of a list in Clojure, again?", or "ok, so I need to put this Sexpr out of this parenthesis, so with paredit I need to do C-right or C-left?", etc.

I plan to give Clojure and CL another shot in the future, but for now I am just lack of proficiency with them (I think I wrote about 1k loc in those language, including 4Clojure and project Euler, and some mock projects I tried to do but gave up).

Re:Why I'm Productive in Clojure by agumonkey on Wednesday July 23, 2014 @11:17AM (#8074799)
Ok so only a matter of habits then.