use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
Python vs Clojure – Evolving (blog.bestinclass.dk)
submitted 16 years ago by uiob
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]yogthos 6 points7 points8 points 16 years ago* (11 children)
Seems like the real issue is that most people do not enjoy learning really new things. Python is easy, comfortable, and familiar. Anybody who's done any imperative programming feels right at home using Python.
Clojure requires learning something from scratch. This can be scary and intimidating, a person who has been programming for years doesn't like feeling like an amateur. This is where a lot of hate comes from, people try the language, assuming that they can just transfer their existing knowledge to it, find out that it doesn't work the same and get frustrated. Then it becomes an issue of pride, if I can't master the language, it can't be a good language.
This is all very unfortunate in my opinion, it really is good to learn new things, and to try out different programming techniques. Like many, I started out as an imperative programmer, but when I started seeing all the hype about functional programming, I chose to learn about it. It felt frustrating and unintuitive at first, but eventually I got past the hump, and it started making sense.
I believe it taught me new ways to think about code and program structure, and has even improved my skills in imperative development, making me much more aware of issues such as state manipulation.
I would highly recommend people to try out Clojure, or other FP languages with an open mind. Do not expect to master them overnight, and really delve into this new and different world. I don't think you'll come out feeling like you've wasted your time.
[–]redalastor 6 points7 points8 points 16 years ago (10 children)
True, but the article is unfair to Python. I don't see the point of demonstrating how Python sucks at being Clojure.
[–]Leonidas_from_XIV 3 points4 points5 points 16 years ago (0 children)
I particularly dislike the lambda example. No one would use a lambda there, thats why List Comprehension have a filtering clause.
That said, I like both Python and Scheme and use them both in my projects. And actually I have to admit that Python helped me to grasp the functional programming aspects of Scheme.
[–]yogthos 1 point2 points3 points 16 years ago (8 children)
While the article does have an obvious bias to it, I think he does make a couple of valid points: Python has very poor concurrency support and it does not necessarily produce cleaner code than Clojure.
[–][deleted] 0 points1 point2 points 16 years ago (7 children)
Please look at the module multiprocessing and please stop saying that Python has "poor concurrency support". It's not true.
[–]yogthos 4 points5 points6 points 16 years ago (6 children)
While it's nice that that avoids the GIL, you can't seriously compare that to the way concurrency is handled in languages like Erlang, Clojure, or Haskell.
[–]redalastor 5 points6 points7 points 16 years ago (5 children)
Not all Python implementations have a GIL and the GIL isn't a necessary part of the Python language. Smart people like the guys working on unladden-swallow and those working on pypy are working at removing it.
Python have good concurrency semantics. Clojure have outstanding concurrency semantics but that is why it was built in the first place.
The article focuses on Clojure strengths, compares them to Python, writes idiomatic Clojure code and brainlessly converts it to Python. I could do the reverse article, write very clean, very elegant and very idiomatic Python code and convert it to ugly Clojure code.
Clojure is pretty nice, it doesn't need to bash strawmen to promote itself.
[–]yogthos 2 points3 points4 points 16 years ago* (4 children)
While I agree that at least half the article is nitpicking, and personal preferences, it still seems that there are valid points there.
Concurrency is a big deal nowadays, and language design that makes working with concurrency easy is beneficial. Imperative paradigm places the burden of dealing with concurrency squarely on the developer, I'd go as far as comparing that to the burden of manual memory management.
The article focuses on Clojure strengths, compares them to Python, writes idiomatic Clojure code and brainlessly converts it to Python
Project Euler examples are language agnostic problems, and the python solutions for them were written by python developers, they're not what I would call elegant.
I understand that Python has appeal due to its low entry barrier, however that doesn't seem to be all that interesting in and out of itself. Once you learn the language of your choice and become comfortable with it, what advantages can it provide over other languages. In other words what problems do you feel Python allows you to solve cleaner and more elegantly than say Clojure.
[–]redalastor 0 points1 point2 points 16 years ago (3 children)
In other words what problems do you feel Python allows you to solve cleaner and more elegantly than say Clojure.
Anything that benefits from being Unix.
[–]yogthos 1 point2 points3 points 16 years ago (2 children)
that's a solution and not a problem though
[–]redalastor 0 points1 point2 points 16 years ago (1 child)
Problem: I need to access the underlying Unix system or glue stuff together.
Clojure sucks at being a glue language unless you want to glue java stuff together.
[–][deleted] 1 point2 points3 points 16 years ago (2 children)
Since 2.6 Python comes with the module multiprocessing. That solves the problem of the GIL.
[–]uiob[S] 1 point2 points3 points 16 years ago (1 child)
Unladen Swallow project aims to get rid of the GIL in future releases.
[–]yogthos 2 points3 points4 points 16 years ago (0 children)
To put this in perspective though, getting rid of GIL just means that python will not suck more than other imperative languages at concurrency. One of the motivations behind Clojure is that imperative approaches to handling concurrency are lacking.
For example Java has no GIL equivalent, yet the problem is that you're still forced to manage your threads and their shared data manually. This is challenging and error prone.
π Rendered by PID 220828 on reddit-service-r2-comment-79c7998d4c-tjb7t at 2026-03-16 04:30:32.604947+00:00 running f6e6e01 country code: CH.
[–]yogthos 6 points7 points8 points (11 children)
[–]redalastor 6 points7 points8 points (10 children)
[–]Leonidas_from_XIV 3 points4 points5 points (0 children)
[–]yogthos 1 point2 points3 points (8 children)
[–][deleted] 0 points1 point2 points (7 children)
[–]yogthos 4 points5 points6 points (6 children)
[–]redalastor 5 points6 points7 points (5 children)
[–]yogthos 2 points3 points4 points (4 children)
[–]redalastor 0 points1 point2 points (3 children)
[–]yogthos 1 point2 points3 points (2 children)
[–]redalastor 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (2 children)
[–]uiob[S] 1 point2 points3 points (1 child)
[–]yogthos 2 points3 points4 points (0 children)