Mander
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
stackPeek@lemmy.world to pissposting@lemmy.world · 1 year ago

c posting

lemmy.world

message-square
20
link
fedilink
132

c posting

lemmy.world

stackPeek@lemmy.world to pissposting@lemmy.world · 1 year ago
message-square
20
link
fedilink
alert-triangle
You must log in or # to comment.
  • green_square@yiffit.net
    link
    fedilink
    arrow-up
    28
    ·
    1 year ago

    Can we all agree haskell style is a mental disorder?

    • street_pigeons@lemmy.world
      link
      fedilink
      arrow-up
      14
      ·
      1 year ago

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

      • littletranspunk@lemmus.org
        link
        fedilink
        English
        arrow-up
        8
        ·
        1 year ago

        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@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          1 year ago

          You might get a kick out of this

          https://en.m.wikipedia.org/wiki/International_Obfuscated_C_Code_Contest

          • littletranspunk@lemmus.org
            link
            fedilink
            English
            arrow-up
            3
            ·
            1 year ago

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

    • frontporchtreat@lemmy.ca
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      edit-2
      1 year ago

      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@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        8 months ago

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

      • frontporchtreat@lemmy.ca
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        1 year ago

        deleted by creator

  • caseyweederman@lemmy.ca
    link
    fedilink
    arrow-up
    13
    ·
    1 year ago

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

  • Subverb@lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    1 year ago

    K&R 4evah

  • perviouslyiner@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    1 year ago

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

  • alyth@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    1 year ago

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

    • stackPeek@lemmy.worldOP
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

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

  • vampire@lemmy.world
    link
    fedilink
    arrow-up
    8
    arrow-down
    2
    ·
    1 year ago

    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.

    • GissaMittJobb@lemmy.ml
      link
      fedilink
      arrow-up
      5
      ·
      1 year 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.

    • PM_ME_VINTAGE_30S [he/him]@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      But it’s fun to argue over

  • janAkali@lemmy.one
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    1 year 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",
      ]
    
  • TOR-anon1@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    I’m Ratliff and K&R style.

  • Cerise_W@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

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

    • Deuces@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

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

  • cheesorist@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    GNU > Allman

pissposting@lemmy.world

pissposting@lemmy.world

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !pissposting@lemmy.world

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

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 2 users / day
  • 10 users / week
  • 229 users / month
  • 864 users / 6 months
  • 7 local subscribers
  • 1.33K subscribers
  • 363 Posts
  • 1.35K Comments
  • Modlog
  • mods:
  • Redout@lemmy.world
  • BE: 0.19.12
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org