Lemmy.one
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
stackPeek@lemmy.world to pissposting@lemmy.world · 2 年前

c posting

lemmy.world

message-square
20
fedilink
143

c posting

lemmy.world

stackPeek@lemmy.world to pissposting@lemmy.world · 2 年前
message-square
20
fedilink
alert-triangle
You must log in or # to comment.
  • green_square@yiffit.net
    link
    fedilink
    arrow-up
    27
    ·
    2 年前

    Can we all agree haskell style is a mental disorder?

    • street_pigeons@lemmy.world
      link
      fedilink
      arrow-up
      14
      ·
      2 年前

      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
        ·
        2 年前

        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
          ·
          2 年前

          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
            ·
            2 年前

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

    • frontporchtreat@lemmy.ca
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      2 年前

      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.

      • frontporchtreat@lemmy.ca
        link
        fedilink
        arrow-up
        2
        ·
        2 年前

        deleted by creator

      • Sweetpeaches69@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        2 年前

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

  • caseyweederman@lemmy.ca
    link
    fedilink
    arrow-up
    13
    ·
    2 年前

    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
    ·
    2 年前

    K&R 4evah

  • vampire@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    2 年前

    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
      ·
      2 年前

      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
      ·
      2 年前

      But it’s fun to argue over

  • alyth@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    2 年前

    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
      ·
      2 年前

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

  • perviouslyiner@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    2 年前

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

  • janAkali
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    2 年前

    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",
      ]
    
  • Cerise_W@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    2 年前

    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
      ·
      2 年前

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

  • TOR-anon1@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    2 年前

    I’m Ratliff and K&R style.

  • cheesorist@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    2 年前

    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.

  • 7 users / day
  • 6 users / week
  • 7 users / month
  • 7 users / 6 months
  • 10 local subscribers
  • 1.24K subscribers
  • 350 Posts
  • 1.64K Comments
  • Modlog
  • mods:
  • Redout@lemmy.world
  • BE: 0.19.7
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org