Hacker News new | comments | show | ask | jobs | submit login

"Python and Ruby (in particular these two) more than anything else allowed you to write really terse, expressive code."

If you like being able to write terse, expressive code, you'll love APL,[1] where Conway's Game of Life[2] can be written in one line as:

  life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
[1] - https://en.wikipedia.org/wiki/APL_(programming_language)

[2] - https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life




We also want our code to be readable.


I can't read APL but perhaps that is readable. I'm unsure that other common dynamic languages like Ruby or Python are readable purely in comparison purely for using http://en.wikipedia.org/wiki/COBOL#Verbose_syntax.


I think a really simple rule-of-thumb for code is: "can you dictate it through the phone?"


Code has nested structures which are commonly shown with indentation, which it's difficult to communicate vocally with say, intonation. E.g. think about how differently you'd dictate this variation on your reply...

I think a really simple rule of thumb-for-code is "can you dictate it?" through the phone.


shudder

My first introduction to functional programming was with J (APL but using ASCII) during my sophomore year of college and I definitely didn't have the chops to understand it at that point. I was scared of functional languages for another year until a different professor introduced me to Haskell.


APL is far more readable than J in my opinion, perhaps because APL keeps the brackets and curlies balanced, while J doesn't. All operators in APL are one token long, while J uses multi-token operators. The extended character set of APL has many benefits.


This is terse but not expressive.


It is highly expressive.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: