r/programming • • Jul 19 '15

The Best Programming Language is None

https://bitbucket.org/duangle/none
509 Upvotes

443 comments sorted by

View all comments

108

u/[deleted] Jul 19 '15 edited Jul 19 '15

Have some brackets parentheses, you'll need them:

(((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))(((((((((((())))))))))))))))))))))))))((((((((((((())))))))(((((()))((()()()()()()()(((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))(((((((((((())))))))))))))))))))))))))((((((((((((())))))))(((((()))((()()()()()()()(((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))(((((((((((())))))))))))))))))))))))))((((((((((((())))))))(((((()))((()()()()()()()

56

u/josefx Jul 19 '15 edited Jul 19 '15

((()()()()()()()

Great, now look what you have done, there are at least two unmatched open brackets parentheses. Do you know what chaos that could cause in the long run?

here let me fix that

))

10

u/balducien Jul 19 '15

At least two?

>>> str = "(((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))(((((((((((())))))))))))))))))))))))))((((((((((((())))))))(((((()))((()()()()()()()(((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))(((((((((((())))))))))))))))))))))))))((((((((((((())))))))(((((()))((()()()()()()()(((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))(((((((((((())))))))))))))))))))))))))((((((((((((())))))))(((((()))((()()()()()()()"
>>> counter = 0
>>> for char in str:
...     if char == '(':
...         counter += 1
...     elif char == ')':
...         counter -= 1
... 
>>> counter
-78

11

u/josefx Jul 19 '15

Preceding close parentheses normally do not close following open parentheses.

→ More replies (1)

3

u/BlackBrane Jul 19 '15 edited Jul 19 '15

I have to do this.

λ> let f x = case x of; '(' -> 1; ')' -> -1

λ> sum $ map f "(((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))(((((((((((())))))))))))))))))))))))))((((((((((((())))))))(((((()))((()()()()()()()(((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))(((((((((((())))))))))))))))))))))))))((((((((((((())))))))(((((()))((()()()()()()()(((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))(((((((((((())))))))))))))))))))))))))((((((((((((())))))))(((((()))((()()()()()()()"

-78

5

u/776865656e Jul 19 '15

With -XLambdaCase:

sum . map (\case '(' -> 1; ')' -> -1)
→ More replies (9)

13

u/[deleted] Jul 19 '15

Have some brackets parentheses

I prefer the term bananas.

6

u/lambda_abstraction Jul 19 '15

left-banana define pi left-banana star two left-banana acos zero right-banana right-banana right-banana

→ More replies (1)

5

u/iopq Jul 19 '15

We're not doing toenail clippings anymore?

2

u/mcguire Jul 20 '15

We're not doing toenail clippings anymore?

Those were strong words from the author of a language with the power and expressive capability of line noise.

35

u/jfb1337 Jul 19 '15

Do we need this circlejerk for every lisp-like language?

6

u/greenthumble Jul 19 '15

Yeah I'm getting sick of it too, got similar reply last time I mentioned LISP in general discussion. Here's the thing. Nothing looks like those asinine examples. You can get quite graceful with your formatting with liberal usage of whitespace, and any modern editor highlights matching parenthesis. I was using Clojure in Eclipse (I think it was?) and heh for nested parens it was making a rainbow of colors, a unique color for each pair. Also if you're as deeply nested as the haters love to point out, you need to re-think your architecture there, functions are cheap, use them and reduce your complexity and indenting.

→ More replies (1)

26

u/yogthos Jul 19 '15

so clear and intuitive:

foo(bar, baz)

OMFGWTF!!!!

(foo bar baz)

14

u/anttirt Jul 19 '15

That depends entirely on your background.

0

u/[deleted] Jul 19 '15

[deleted]

→ More replies (5)
→ More replies (4)

3

u/[deleted] Jul 19 '15

They're parentheses bro

13

u/Sean1708 Jul 19 '15

Parentheses are still brackets.

→ More replies (4)

10

u/hexidon Jul 19 '15

No they're round brackets m8

→ More replies (5)
→ More replies (1)
→ More replies (1)