Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> (ever noticed how the space bar is much easier to hit than a comma, you enlightened dynamic language devotee? Size does matter).

This author makes so many good points about key ergonomics with languages. I’d love to see more research into this, and the results being incorporated into languages.



Hehe: http://www.cs.stir.ac.uk/~kjt/techreps/pdf/TR141.pdf

A paper that tries to compute Halstead language level for Haskell. It was so high they had to change constants in the computation of Halstead volume (page 6 in the paper above). Basically, many spaces in Haskell program are "apply" operator and one have to count these spaces to even attempt to be compatible with the theory.

I also have to say that I like Tcl very much but for different reason: values in Tcl are immutable and passing a dictionary or list to a procedure will not change that dictionary in unpredictable way (will not "pull the rug").

I once ranked languages by their support for drunken programming (diminished higher thinking ability - how much thinking programming language really takes from you) and Haskell and Tcl came out first and second - both have immutable values and Haskell also helps with the type system. Other contenders like C, C++, C#, Python and some other languages were much worse to use when one is drunk. Mainly due to the need to remember effects on the arguments passed to a function and/or method, but also for infamous "null".

C# had third place - some type safety and garbage collection help a lot (and compiler accepts more code than Java). Everything else just brings you more headache when you try to decipher and make work what you wrote being drunk.


When I was in college I once wrote Java code while drunk late into the night. I reviewed it the next morning (afternoon, really). The good news was that the code worked exactly as expected and produced correct results. The bad news was that it was completely incomprehensible. As in my sober self could not construct a mental model of how the code worked.

Then again, I also sometimes write code in my sleep if I left a problem unsolved during the workday and then I implement that solution when I wake up. Does anyone else also do this?


One time at university I was up late working on a math assignment, but couldn't figure out one of the problems. I fell asleep and had a dream in which I came up with the solution. I woke up briefly, wrote down the answer, then fell asleep again.

When I got the assignment back from the TA I had gotten everything correct, except for that problem, which he had marked up with red question marks and exclamation points. I looked at what I had written and found it to be incomprehensible nonsense...


This is my experience coding drunk as well. I also really hated the experience. As someone who enjoys getting lost and getting drunk and programming I thought I would love doing both together, it turns out for me drinking just maximizes the magical transient errors when coding caused by false assumptions which are always the hardest to debug.


These magical transient errors are exactly why one should choose language with immutable values. You have old value and you compute new one (with sharing if possible). You can continue to use old value or throw it away.

The mutation operation can be seen as resource management optimization, premature (and thusly evil) more often than not.


Did it make sense next time you got drunk? :P

I had to update some code that a more talented coder than I, wrote while stoned. It was an adventure.


Hah. I didn’t try, but that’s a good question.


Did you also consider Clojure? I suspect it would have made position 1 or 2 on your list depending on the problem to be solved.


Tcl IS the Clojure, but for C and it also has Tk, which is purely awesome (canvas elements have tags and event bindings).

I did these experiments when Clojure was not all that hip, circa 2008-2010.


We are vastly different programmers if you are being hindered by your ability to input.

If I could write code that was perfect and easy to read - but had to use nothing but my toes, I’d be investing in some fancy slippers and in a second.


I'm not sure if i understand you correctly, but if you think you aren't affected by where the relevant keys are, I would like to challenge you to get a German keyboard layout and write some program in C, Java or another curly braces language.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: