HNHacker News
TopNewBestAskShowJobs

benas

0 karma · joined March 11, 2016

submissionscomments
benas··on A Little Clojure
No, you are deviating from the main point: natural expressiveness. So let me back up: If you think "if (= x 1)" is natural to humans, then try to ask someone in the street "is equals this that?" and let me know about their reaction. My point is that the natural way of asking such questions is:

  * "Is this equals to that?" and not "is equals this that?"
  * "Is this bigger than that?" and not "is bigger this that?"
And this is regardless of the language (be it English or whatever, see https://news.ycombinator.com/item?id=22811168). I'm not going to debate this to death, so feel free to disagree. Again, I have nothing against Clojure, I'm just trying to argue in a constructive way.
benas··on A Little Clojure
Thank you. This is really the impression I have right now after reading all these replies (and those on twitter as well).. Even though I'm trying to argue in a constructive way from the beginning.
benas··on A Little Clojure
Writing code is different from writing mathematical equations. Developers (humans) prefer meaningful variable names, method names, expressions, etc. Comparing this to maths where conciseness is key is not the best analogy IMO. And it is not about experience (btw, I have no problem being one of these newbies who "need to learn those before they can understand what is being said "naturally""), it is really about expressiveness to reduce the mental effort to match things (what I have in mind and what I see in code). That's why there are many attempts [1] to create programming languages that are as close as possible to people's natural languages.

[1]: https://en.wikipedia.org/wiki/Non-English-based_programming_...

benas··on A Little Clojure
Yes of course, that's incorrect and provocative in purpose. The point is not about the syntax, but about expressiveness: A programming language should make it easy for a human to express (write) his intentions in code and for other humans to interpret (read) those intensions in a natural way. In other words, the gap between the developer's natural language and his/her programming language should be minimal (and this is regardless of the developer's natural language, be it English or whatever).
benas··on A Little Clojure
Did I mention English? That still applies to any language. If the developer's natural language is Russian, the mental effort to translate what the developer wants to express in Russian in his programming language should be minimal.
benas··on A Little Clojure
I have nothing against Clojure, but I agree with Donald Knuth who said: "Programs are meant to be read by humans and only incidentally for computers to execute." [1].

I could be wrong, but I don't find Clojure to be "simple" for humans to read (or write). Here is an example from the blog post:

  So let’s write a simple one. Let’s write the factorial function.
  (defn fac [x] (if (= x 1) 1 (* x (fac (dec x)))))
Note the "simple one" here. I don't know for others, but this is not simple for me as a human to read, understand and reason about. For instance:

  if (= x 1)
As a human, I read this like "if equals x one", which does not translate to my natural language where I would say "if x equals one". So I need an additional mental effort to do the translation. This is not the case in other languages where "if x equals one" would be written like "if x = 1" or "if (x == 1)". If the gap between the natural language and programming language is big, it is difficult for a human to use that programming language. And for Clojure, this gap is big IMO.

(I (wanted) (to learn ((some)) Clojure in the past) but [quickly] ([(realized it was (not) for me)])) [2].

[1]: https://news.ycombinator.com/item?id=16430751

[2]: https://twitter.com/b_e_n_a_s/status/1244417191556063234?s=2...

benas··on Show HN: Seashells – Pipe output from CLI apps to the web in real time
Nice job! We all like free services without registration :-)

This is similar to https://github.com/benas/gossed (uni-directional) and http://websocketd.com/ (bi-directional) tools.

Both written in golang and open source.

benas··on Show HN: A Multiplayer Geography Game Using WebSockets
I'm addicted already!! Thank you for making this
benas··on What is the best part about being a Software Engineer?
I couldn't agree more. Choose a job you love, and you'll never work a day in your life!