idk837384,

All of these are bearable except for Haskell style. Wtf is that😭

LarmyOfLone,

I want a language that takes this and has a specification for the editor to prettify it


<span style="color:#323232;">while x==y
</span><span style="color:#323232;">     func1
</span><span style="color:#323232;">     func2
</span>
Bienenvolk,

On a serious note tho, I never understood the benefits of GNU’s spaces after functions. I don’t really mind most of the rest but I just don’t get the benefits of ‘funcname (arg)’ vs. ‘funcname(arg)’. Is there a specific reason for this? Personally, I find this to reduce readability because I have to think for a split second whether I’m looking at a variable or a function call.

Of cause this is also due to my habits, but I’m curious as to what the reasoning is.

reverendsteveii,

Honestly I think it’s just “spaces before open parens” and at least it’s consistent. K&R, which I use, wants spaces before the parens in conditionals and loops but not in method sigs or method calls and the linter at work gets me almost every time I type the word “if”.

Bienenvolk,

Fair enough if the GNU dudes valued consistent spacing more than taking function calls as one “logical block”. Not my cup of tea but that’s what configurable auto formatting is for.

Bonsoir,

That’s why Python has a superior syntax. There is usually one obvious way to do it, and that’s the right way.

7heo,

Ok, 2 spaces or 4?

Bonsoir,

4, just like the PEP8 gods intended

sverit,

This is the way

Chrumbs,

Allman is objective the correct choice

reverendsteveii,

Allman is a benign neurosis

Phegan,

Allman is the only other one that has some sanity.

ThatFembyWho,

Some of those made me physically ill.

Like. You do WHAT with your whitespace?!

wer2,

To be fair, some of these look very different in non-C-like languages (e.g. Lisp/Haskell).

Psythik,

If you have ADHD, your coding style is a combination of all of these, and sometimes none of the above.

wer2,

For real, this is why I enable format on save.

JackLSauce,

That’s not Lisp…


<span style="color:#323232;">(while (== x y)
</span><span style="color:#323232;">  (func1)
</span><span style="color:#323232;">  (func2)
</span><span style="color:#323232;">)
</span>
flamingos,
@flamingos@ukfli.uk avatar

What kind of monster writes lisp with the closing bracket on its own line.

kryptonianCodeMonkey,

(((((Not(enough)))((parentheses)))))

superb,
@superb@lemmy.blahaj.zone avatar

No syntax, only parentheses

7heo, (edited )

Hear me out: brainfuck, but with parentheses only.


<span style="color:#323232;">>    )))
</span><span style="color:#323232;"><    (((
</span><span style="color:#323232;">+    ())
</span><span style="color:#323232;">-    (()
</span><span style="color:#323232;">.    ()(
</span><span style="color:#323232;">,    )()
</span><span style="color:#323232;">[    )((
</span><span style="color:#323232;">]    ))(
</span>

Hello world example:


<span style="color:#323232;">()))(((()(())))(())(())))))()))))(()
</span><span style="color:#323232;">(()(()(()(()(((((())(((((()(()((((()
</span><span style="color:#323232;">(()(()))()))(()()()))))))))())()()))
</span><span style="color:#323232;">)))()(()(())())()))((()()))))(((((((
</span><span style="color:#323232;">((((((()(())())())()((()(()(()(()(()
</span><span style="color:#323232;">(()()((((((((()()())))))))))))())()(
</span>

Ancient aliens meme with the caption “LIPS!!”

Python transpiler:


<span style="font-style:italic;color:#969896;">#!/usr/bin/env python
</span><span style="font-style:italic;color:#969896;">"""Lipsfuck to brainfuck transpiler"""
</span><span style="color:#323232;">
</span><span style="font-weight:bold;color:#a71d5d;">from </span><span style="color:#323232;">sys </span><span style="font-weight:bold;color:#a71d5d;">import </span><span style="color:#323232;">stdin
</span><span style="color:#323232;">
</span><span style="color:#0086b3;">OPS </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">{</span><span style="color:#183691;">")))"</span><span style="color:#323232;">: </span><span style="color:#183691;">'>'</span><span style="color:#323232;">, </span><span style="color:#183691;">"((("</span><span style="color:#323232;">: </span><span style="color:#183691;">'<'</span><span style="color:#323232;">,
</span><span style="color:#323232;">       </span><span style="color:#183691;">"())"</span><span style="color:#323232;">: </span><span style="color:#183691;">'+'</span><span style="color:#323232;">, </span><span style="color:#183691;">"(()"</span><span style="color:#323232;">: </span><span style="color:#183691;">'-'</span><span style="color:#323232;">,
</span><span style="color:#323232;">       </span><span style="color:#183691;">"()("</span><span style="color:#323232;">: </span><span style="color:#183691;">'.'</span><span style="color:#323232;">, </span><span style="color:#183691;">")()"</span><span style="color:#323232;">: </span><span style="color:#183691;">','</span><span style="color:#323232;">,
</span><span style="color:#323232;">       </span><span style="color:#183691;">")(("</span><span style="color:#323232;">: </span><span style="color:#183691;">'['</span><span style="color:#323232;">, </span><span style="color:#183691;">"))("</span><span style="color:#323232;">: </span><span style="color:#183691;">']'</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="font-weight:bold;color:#a71d5d;">def </span><span style="font-weight:bold;color:#323232;">main</span><span style="color:#323232;">():
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">"""Obvious main procedure"""
</span><span style="color:#323232;">    _d </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#183691;">''</span><span style="color:#323232;">.join(stdin.readlines()).rstrip(</span><span style="color:#183691;">'</span><span style="color:#0086b3;">n</span><span style="color:#183691;">'</span><span style="color:#323232;">)
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">for </span><span style="color:#323232;">_op </span><span style="font-weight:bold;color:#a71d5d;">in </span><span style="color:#323232;">[_d[x:x</span><span style="font-weight:bold;color:#a71d5d;">+</span><span style="color:#0086b3;">3</span><span style="color:#323232;">] </span><span style="font-weight:bold;color:#a71d5d;">for </span><span style="color:#323232;">x </span><span style="font-weight:bold;color:#a71d5d;">in
</span><span style="color:#323232;">                </span><span style="color:#62a35c;">range</span><span style="color:#323232;">(</span><span style="color:#0086b3;">0</span><span style="color:#323232;">, </span><span style="color:#0086b3;">int</span><span style="color:#323232;">(</span><span style="color:#62a35c;">len</span><span style="color:#323232;">(_d)), </span><span style="color:#0086b3;">3</span><span style="color:#323232;">)]:
</span><span style="color:#323232;">        </span><span style="color:#62a35c;">print</span><span style="color:#323232;">(</span><span style="color:#0086b3;">OPS</span><span style="color:#323232;">[_op], end</span><span style="font-weight:bold;color:#a71d5d;">=</span><span style="color:#183691;">''</span><span style="color:#323232;">)
</span><span style="color:#323232;">    </span><span style="color:#62a35c;">print</span><span style="color:#323232;">()
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">__name__ </span><span style="font-weight:bold;color:#a71d5d;">== </span><span style="color:#183691;">"__main__"</span><span style="color:#323232;">:
</span><span style="color:#323232;">    main()
</span>
thesporkeffect,

The eternal holy wars rage on

BirdyBoogleBop,

Allmans what I learnt then went to K&R on my own because it made more sense to me. I think GNU is fine I guess, not the others though. Not that what I say matters I’ve forgotten how to code and can barely do Hello World these days.

ThatFembyWho,

And who can forget this abomination

while (x == y) { func1(); func2(); }

thesporkeffect,

Aka the bash one-liner

Gork,

All of those are heretical. The one True Language is Brainfuck, where the coding syntax for Hello World is

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>—.+++++++…+++.>>.<-.<.+++.------.--------.>>+.>++.

nilloc,

The Morse code of programming languages.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • 196@lemmy.blahaj.zone
  • fightinggames
  • All magazines