this post was submitted on 10 Feb 2024
220 points (100.0% liked)

196

17958 readers
830 users here now

Be sure to follow the rule before you head out.


Rule: You must post before you leave.



Other rules

Behavior rules:

Posting rules:

NSFW: NSFW content is permitted but it must be tagged and have content warnings. Anything that doesn't adhere to this will be removed. Content warnings should be added like: [penis], [explicit description of sex]. Non-sexualized breasts of any gender are not considered inappropriate and therefore do not need to be blurred/tagged.

If you have any questions, feel free to contact us on our matrix channel or email.

Other 196's:

founded 2 years ago
MODERATORS
 
top 23 comments
sorted by: hot top controversial new old
[–] Bishma@discuss.tchncs.de 43 points 1 year ago (3 children)

Nope, Haskell was just a bad dream I had. It was just a dream, not real, that's not real. I'm OK.

[–] mokus@lemmy.blahaj.zone 21 points 1 year ago

There there, the monads can’t hurt you here

[–] zewu@lemmy.world 15 points 1 year ago

Haskell is nice. This code style... not so much

[–] match@pawb.social 6 points 1 year ago

A distant voice:

Learn you a Haskell for great good

[–] saigot@lemmy.ca 32 points 1 year ago (2 children)

If all your code isn't on one line you aren't a real programmer.

[–] damnfinecoffee@lemmy.world 3 points 1 year ago

I prefer to newline after every symbol for better readability

I wonder if you could have it all on one column.

[–] ambrosiaforest@lemmy.blahaj.zone 28 points 1 year ago (2 children)
[–] MashedTech@lemmy.world 4 points 1 year ago

Let me explain...

[–] yetAnotherUser@lemmy.ca 2 points 1 year ago

Imagine having to use {}; instead of

[–] 9point6@lemmy.world 26 points 1 year ago* (last edited 1 year ago)

OP is clearly a python user incapable of understanding punctuation

Embrace the brace, you won't be alone with a semi-colon(...e)

[–] Wilzax@lemmy.world 22 points 1 year ago (1 children)

Kernighan & Ritchie. This is the hill I choose to die on.

[–] zoly@lemmy.world 6 points 1 year ago

The only correct answer

[–] wreckedcarzz@lemmy.world 17 points 1 year ago (3 children)

Allman or gnu, rest are fucking bonkers

[–] Metype@lemmy.world 16 points 1 year ago (2 children)

Putting the opening curly brace of a code block on the same line that defines the conditions the code block will run under is bonkers?

[–] jwelch55@lemmy.world 6 points 1 year ago

There's an asymmetry to it that always left me uncomfortable.

[–] doctorcrimson@lemmy.today 4 points 1 year ago

If we're judging purely on readability then I think Allman probably has the edge, here. You can see at a glance where the encasement starts or ends in a vertical column on the far left. Of course, that's a moot point if the programmer's color coding is set up to where it is obvious.

[–] drbluefall@toast.ooo 15 points 1 year ago (1 children)
[–] perishthethought@lemm.ee 3 points 1 year ago
[–] state_electrician@discuss.tchncs.de 9 points 1 year ago* (last edited 1 year ago)

Lol, you deranged lunatic.

[–] kryptonianCodeMonkey@lemmy.world 15 points 1 year ago* (last edited 1 year ago) (1 children)

Reject the code block. Embrace the modularity. If you were going to write a code block, write a function instead.

[–] zea_64@lemmy.blahaj.zone 13 points 1 year ago (1 children)

If you must avoid code blocks, that means you can only use one line. I don't think you can be Turing complete if each function can only call one function. I don't even think you can get a context-free grammar, Chomsky normal form at least allows a variable to expand into two variables.

[–] JDubbleu@programming.dev 6 points 1 year ago

Please never bring up CNF again. I'm a year out of college, two years out of finite automata, and I still shudder when it's brought up.