Live data from Hacker News

Why I Switched from Python to Clojure (2016)

bradcypert.com

161–170 of 200 posts

Re: Why I Switched from Python to Clojure (2016)

#161
post #159

Earlier quoted context omitted.

Just about every innovative idea from Lisp, and there were quite a few of them, has been incorporated into modern programming languages. Except for sexpr syntax. Draw your own conclusions.

sexpr syntax has incorporated into 'modern' programming languages like Clojure, LFE, Hy, ...

Indeed. Sexps are a syntax, so incorporating them in a language means you immediately start to look like a Lisp.

Re: Why I Switched from Python to Clojure (2016)

#162
I switched from Python to Clojure (because abstractions), and then to Go (static types; efficiency) and then to Elixir (because work) and then to Haskell (no more lame types and stupid nil errors).

I feel like with Haskell I have basically achieved perfection, and I'm more prepared to work on the other languages if the situation calls for it.

Re: Why I Switched from Python to Clojure (2016)

#163
post #94

It's interesting that the very things that attracted the author to Clojure was what kept me from moving to it from Python. I enjoyed the syntax. Loved the immutability. However, I wasn't able to understand the structure of program data at a glance even when reading my own code. The reliance on lists and maps everywhere meant that the structure of data was encoded in the code of the functions that created it and somet…

One way to read functional code is to focus on “what” rather than “why” of things similar to Unix commands.

Re: Why I Switched from Python to Clojure (2016)

#164
post #94

It's interesting that the very things that attracted the author to Clojure was what kept me from moving to it from Python. I enjoyed the syntax. Loved the immutability. However, I wasn't able to understand the structure of program data at a glance even when reading my own code. The reliance on lists and maps everywhere meant that the structure of data was encoded in the code of the functions that created it and somet…

I feel like people who come to Clojure forget the lessons that were known from the time of SICP that just because you can program using data, does not excuse not building up an abstraction tower.

If you have entities in your domain, presenting clean and encapsulated ways of interacting with them is a separate concern from navigating and modifying their underlying datastructure, which is an implementation detail.

IMO the "it's just data" benefits of Clojure are that a lot of the common patterns which might have felt like being macro-worthy in CL/Scheme are achievable using things like keywords, which leads to more uniform code (rather than ad-hoc project-specific macros).

Re: Why I Switched from Python to Clojure (2016)

#166

I don't have a horse in this race but I find it interesting that in my career I've seen a lot of bad code but the worst clusterfucks I've met where all in Clojure while the community seems to be chock full of purists and in general people that takes craftmanship seriously at least at face value. ¯\_(ツ)_/¯

I guess we would have to believe your empirical observations and ignore the facts: - Clojure has been noted as the most payed language in dev surveys of the past few years - Again, different surveys (e.g.: stackoverflow, state of javascript) shown that Clojurists overall are more experienced devs. This kinda makes sense - usually people try Clojure out of curiosity and not for dogmatic reasons and not for the points…

Pay for a language doesn't reflect skill, or even implied skill. Its simply a function of demand and supply

At $financial-news company, someone decided that they should re-write a few critical parts of the system in closure, partly due to boredom, partly due incompetence. They swanned off, along with 90% of the other people who knew how to maintain closure.

This left a bunch of junior java devs to maintain a ill thought out ego piece.

This logically meant that said company had to spend a large amount of money of contractors to maintain the system whilst they re-wrote everything in the same language.

Re: Why I Switched from Python to Clojure (2016)

#167
post #85

Earlier quoted context omitted.

Clojure lets you leverage the entire Java library ecosystem, which is flippin' huge -- bigger, even, than Python's.

Except for numerics, which is my whole world, where Java is horrific roadkill. FWIIW back 8 years ago I was ---><--- this close to trying to build out an important system with wrapped Fortran in Clojure. People (who even then looked like they didn't know what they were talking about) assured me the JVM would eventually surpass lapack, because MUH JVM, and that has failed to come to pass.

The SciPy stack got me into Python and it making it hard to leave despite becoming 100% fed up with Python's GIL. I need to port some signal processing code I prototyped in Python to Java for a customer, and a survey of libraries for Java is not making me look forward to this effort.

Re: Why I Switched from Python to Clojure (2016)

#168
post #98
post #40

Earlier quoted context omitted.

"The worst injuries I've ever seen were in big factories with large, powerful tools -- not in home garages where people just use hammers and hand-saws." Powerful abstractions are... powerful. They're more difficult to use correctly, and take longer to learn. The conclusion shouldn't (always) be to avoid them entirely.

I'd wager good money the exact opposite is true. Big factories should be better regulated and more professional leading to less accidents. It's the weekend dad with a beer in his hand trying to get something done quickly that saws through their tendon and fucks up their wrist. Also python is definitely not as simple as a hammer and hand-saw.

If you let an arrogant idiot loose on a 15kw CNC machine, they will without a doubt cause a massive injury to them, and given the power to others. If you let them loose on a pillar drill they might get a scratch and a broken bit.

Of course no company would ever let a newbie loose on a multi million pound CNC machine without a battery of training.

And this is where the engineering part of "software engineering" falls down. Companies rarely provide training, documentation or audit trail for junior devs.

All something required if you were doing real engineering.

Re: Why I Switched from Python to Clojure (2016)

#169
post #38

Earlier quoted context omitted.

Every person that I've talked to that seemed to have a strong negative opinion about parens never used it. They just think they won't like it but wouldn't take the minimal amount of time to give it a try with something like paredit. I was also in this camp for a long time until I figured I would give it a serious try instead of disparaging something I had not used. You might consider that creating and editing code wi…

I've been using Scheme as one of my languages for a decade. (Haskell, Python, Ruby, Bash are the main others.) I generally use a preprocessor for each language. The Haskell preprocessor treats indented as code, flush as comments, also supported by my syntax highlighting. Comment characters feel to me like a thousand Hitchcock birds shat on my car. They're so easy to avoid. It also introduces here docs; no language sh…

Would you mind sharing some example code on Gist, please ?

Re: Why I Switched from Python to Clojure (2016)

#170
post #43

I can, and do, appreciate opinions on languages themselves. But my decision to continue using Python over Clojure is much less about the language's syntax and more about the available libraries. How do Clojure web frameworks compare to Django/Flask? What would I use instead of Pandas for data analysis? Are there keras-like deep learning tools? Switching languages based on a comparison of idiosyncrasies between the tw…

Blog Post Author Here:

Personal Opinion: Django is a nightmare to work with. It's too opinionated and a pain in the ass. However, I love Flask. I wouldn't be where I am today had I not found Flask in 2012/2013.

If you're looking for web technologies in Clojure, you'll find quite a few good ones. However, I say web technologies instead of frameworks because generally, the Clojure community prefers to compose libraries to suit their needs and not leverage an opinionated framework. However, if you'd like someone to do that composing for you, the Luminus web template is fantastic.

http://www.luminusweb.net/

Post reply on HN