this post was submitted on 23 Feb 2024
130 points (92.8% liked)

pissposting

1178 readers
1 users here now

Piss tier memes, lower than shitposts. Brain damaging stuff.

founded 1 year ago
MODERATORS
 
all 21 comments
sorted by: hot top controversial new old
[–] [email protected] 27 points 10 months ago (2 children)

Can we all agree haskell style is a mental disorder?

[–] street_pigeons 14 points 10 months ago (1 children)

I think it's trying to keep track of all the semicolons but my god does it look strange

[–] [email protected] 8 points 10 months ago (1 children)

I might just do that style just to make my professor cringe on my next c# assignment

"I mean, it's right, it runs, but it looks like shit"

[–] surewhynotlem 4 points 10 months ago (1 children)
[–] [email protected] 3 points 10 months ago

It's a competition? Damn, that's wild XD

[–] [email protected] 3 points 10 months ago* (last edited 10 months ago) (2 children)

One of the benefits of the haskell style is easy commenting of the additional functions. I do something similar in my python scripts when testing several differnent chunks of code.

But then again I chose a career in GIS so I probably have a mental disorder.

[–] Sweetpeaches69 1 points 1 month ago

As someone who works with, and sometimes on GIS, but not solely on GIS, I can confirm your last sentence. Godspeed.

[–] [email protected] 13 points 10 months ago

I went from not being able to tell the difference to being deeply disturbed by everything in the red

[–] Subverb 9 points 10 months ago
[–] perviouslyiner 6 points 10 months ago

Perl style: all on one line, with the 'while' statement at the end.

[–] alyth 6 points 10 months ago (1 children)

What is Lisp style, Lisp doesn't have this syntax? Or is it referring to something other than Lisp languages. Same with Haskell.

[–] stackPeek 3 points 10 months ago

Haven't coded with Lisp, but I've seen Lisp codes that are formatted like that. Haskell too.

[–] vampire 6 points 10 months ago (2 children)

Just run with the default style of the de-facto formatter for whatever language you are using. It's really not worth any mental effort.

[–] [email protected] 5 points 10 months ago

This is true, but it also moves the discussion to which is the superior code for matter for languages that don't have a clear default option, and of course to which languages have the best formatters.

I have a hard stance in this question - code formatters should be deterministic on any given syntax tree - there should be no leeway for choosing how any given piece of code formats. Seriously. If your anti-bikeshedding tool does not completely eliminate the bikeshedding, you have not done your job correctly.

[–] [email protected] 2 points 10 months ago

But it's fun to argue over

[–] [email protected] 5 points 10 months ago* (last edited 10 months ago)

Ew. I usually don't use curly braced languages. But whenever I need to define collections on multiple lines I always put opening bracket on the end of the line and closing bracket on the same indent level as the start of the statement:

let hello = [
  "Hello, there!",
]
var
  a = true
  arr = [
    "line 1",
    "line 2",
  ]
[–] Spider89 2 points 10 months ago

I'm Ratliff and K&R style.

[–] Cerise_W 2 points 10 months ago (1 children)

Can we talk about variable scope? Is x changing inside a called function without so much as a pointer being passed?

[–] Deuces 5 points 10 months ago

Avoiding global variables is just something dumb people do to protect themselves. Real programmers declare every variable before Main.

[–] cheesorist 2 points 9 months ago

GNU > Allman