Anyone have any personal opinions on this or have an explanation why the first option might be preferred?
@kyle I personally completely agree... but I see the second a lot more than the first. I've only seen the first with Python programmers, which may be a reflection of the generally indentation-based syntax of the language (as opposed to using explicit block scoping). I'm working on a Rust codebase right this moment, for example, and rustfmt takes the second option in many cases but never the first.
@syntacticsugarglider that's interesting, maybe I only feel this way because I stay in my corner of just python, JS and a bit of list
@kyle I generally use the second style, though I'd indent the list of arguments. Depending on complexity each function call in that kind of nesting could get a level of indentation.
@kyle I do parens on the next line, with function calls or even ifs and fors. It makes it easier to edit too. That said I've seen some hardcore lispers use a mysterious secret typing technique called paredit that allows them to ignore parens entirely. They work in terms of indentations/whitespace (kind of like python), parens are handled automatically when writing, and when reading you ignore them, cause they are none of your concern as long as you use paredit.
@namark I never realized that trick, I'll have to check that out
I've always seen the first example most prominently in the lisp the community, it's one of the reasons I haven't seriously used lisp
Revel in the marvels of the universe. We are a collective of forward-thinking individuals who strive to better ourselves and our surroundings through constant creation. We express ourselves through music, art, games, and writing. We also put great value in play. A warm welcome to any like-minded people who feel these ideals resonate with them. Check out our Patreon to see our donations.