Earlier quoted context omitted.
"I instantly discard any language with a Lisp-like syntax. I just cannot work with it." I feel the opposite. I avoid any language without a Lisp-like syntax, since its absence is a serious handicap which unnecessarily complicates code and makes it less readable. I also much prefer the Lisp idiom of using meaningful function and variable names, vs the one-letter names and crypitic operators that are so common in Haske…
Bear in mind that often the reason Haskell code uses one-letter names (and this is possibly true for the other MLs) is that your types can be so generic that you can write useful functions without knowing what you're working on. In such situations, `x` is just as good as `thing`, as far as names are concerned. As for the operators: they are a visual language. We do not speak our punctuation aloud in English, and we u…
Why I Switched from Python to Clojure (2016)
91–100 of 200 posts
Re: Why I Switched from Python to Clojure (2016)
#92Sometimes I read these pieces and I wonder how much of the joy of the new language is just having become a better programmer in the meantime.
Re: Why I Switched from Python to Clojure (2016)
#93Earlier quoted context omitted.
> You will shoot yourself in the foot less often with Lisp parens than you might with Python whitespace. I'm not letting that stand ;-) In my experience Python's whitespace generally removes sources of scope/block errors compared to parenthesis and curly-based languages > unless you have a Python plugin that has block movement shortcuts Not sure what this means. The only support I need in an editor is the ability to…
> "It's visually obvious when code is correctly indented. " Not when the beginning of the code block isn't on screen. And more to the earlier point, configuring your editor to jump to the beginning from the end or the end from the beginning of a particular block of code going to be trickier than the equivalent in even vim for lisp, which is simply % (And vim isn't even a particularly good editor for lisp, but out of…
The length of your code blocks terrify me. :)
Re: Why I Switched from Python to Clojure (2016)
#94I 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 sometimes you had to go several functions deep just to understand the bit you wanted.
In Python if I'm returning a tuple that's more than 2 or 3 elements long, I know that it's time for, at the very least, a namedtuple because I've had to deal with code in the past that has mysterious 5-tuples etc that just becomes too tiring to deal with.
To be clear, big collections in Python aren't a problem as long as the type of the contained data remains uniform.
Re: Why I Switched from Python to Clojure (2016)
#95I 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…
I do agree the language is part of the battle. The other is tooling, and libraries. F#/dotnet was painful as a linux dev. The JVM works on almost any platform with great tooling.
For Libraries. I haven't found anything akin to django admin, but I don't really miss it. For me
SQLAlchemy -> Jooq
Flask -> Spark/Vertx
Re: Why I Switched from Python to Clojure (2016)
#96I have considered multiple times switching from Python to other alternatives. However, I instantly discard any language with a Lisp-like syntax. I just cannot work with it. Being a Haskell hobbyist, I would like Python to be statically type and have better support for pure functional programming, but Python has the libraries that I need.
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 gone through several period of straight Lisp parens, and several periods of using a preprocessor. I believe in committing to muscle memory before deciding; I've oscillated back and forth between Querty and Dvorak, for example. I'm more committed to psychological experiments than anyone who claims the parentheses haters are newbies who haven't tried.
Study counting in higher mammals: One finds that "one, two, three, many" is core to all of us, and higher systems are strapped on like the multiple layers of vision mechanisms. Humans can't deal with the tiger tails at the end of lisp expressions. But machines can? Yes, but machines can also handle inferred parentheses. The complainers about parentheses complainers want off-the-shelf support. Real programmers write their own support.
Lisp looks best with indentation to help infer parentheses. Use a pipe "|" to open a parenthesis that auto-closes at the next ")" or the end of the line. Use a dollar "$" (borrowed from Haskell) to open a parenthesis that auto-closes when the indentation returns. Lisp written this way is stunningly beautiful poetry, cleaner than any of the dozens of languages I've programmed in. The remaining parentheses actually matter, so one pays attention to them.
I've spent years each way, back and forth. Inferring parentheses is better, and one can write any tool to follow this syntax.
Re: Why I Switched from Python to Clojure (2016)
#97Earlier quoted context omitted.
> "It's visually obvious when code is correctly indented. " Not when the beginning of the code block isn't on screen. And more to the earlier point, configuring your editor to jump to the beginning from the end or the end from the beginning of a particular block of code going to be trickier than the equivalent in even vim for lisp, which is simply % (And vim isn't even a particularly good editor for lisp, but out of…
> Not when the beginning of the code block isn't on screen. The length of your code blocks terrify me. :)
If you want scary, check out GNU's implementation of `cat`. I think they hit ten nested indentation levels. Though, because that's C, you can at least jump between the beginning and end of each level by having your editor jump to the matching {}.
Re: Why I Switched from Python to Clojure (2016)
#98I 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. ¯\_(ツ)_/¯
"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.
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.
Re: Why I Switched from Python to Clojure (2016)
#99I have considered multiple times switching from Python to other alternatives. However, I instantly discard any language with a Lisp-like syntax. I just cannot work with it. Being a Haskell hobbyist, I would like Python to be statically type and have better support for pure functional programming, but Python has the libraries that I need.
Re: Why I Switched from Python to Clojure (2016)
#100Earlier quoted context omitted.
Not only is it not inherently hard to learn, it's arguably one of the easiest syntaxes to learn. ( fn-name param1 param2 ... ) is the syntax. Once the brain grasps this, a whole layer of complexity just vanishes. Furthermore, not having to use punctuation between items is just heavenly. There's so much less noise compared to Python, and Python isn't even a particularly noisy language.
Only if you don't consider a forest of parens to be noise. I do. I'm sure I could get used to it after a while, but at first glance, Python code is definitely cleaner than Lisp.