AstonJ

AstonJ

EG:

  defp deps do
    [
      {:phoenix, "~> 1.4.1"},
      {:phoenix_pubsub, "~> 1.1"},
      {:phoenix_ecto, "~> 4.0"},
    ]
  end

Or do you prefer not to?

  defp deps do
    [
      {:phoenix, "~> 1.4.1"},
      {:phoenix_pubsub, "~> 1.1"},
      {:phoenix_ecto, "~> 4.0"}
    ]
  end

Showing Posts 1 to 10

sribe

sribe

Looks ugly, but I do it so that code diffs better reflect the actual change after an addition…

hauleth

hauleth

I would add them, but formatter removes them after that. So while I would prefer to have trailing commas (but only in multiline expressions) I stopped using them as that is what code formatter expects.

So there unfortunately is no option for me in this survey :frowning:

16
Post #2
AstonJ

AstonJ OP

Oh I didn’t know that :lol:

I actually prefer them without (think I might have slight OCD, lol) but I’m sure I read in one of my Ruby books once that it was best to add them.

hauleth

hauleth

The main problem in Elixir is that trailing comma isn’t always possible, ex.:

def foo(a, b), do: {a, b}

# Legal
foo(10,
    20
)

# Legal
foo(10,
    a: 20
)

# Legal
foo(10
    a: 20,
)

# Illegal
# foo(10,
#     20,
# )
dimitarvp

dimitarvp

Exactly in the camp where @hauleth is: I always add them for consistency and smaller diffs but the formatter always removes them.

blatyo

blatyo

Conduit Core Team

I don’t add them unless the formatter adds them for me. That’s the case for the Javascript stuff I work on and not for the Elixir stuff. When I had to manually added them, I actually felt like I ended up doing more work. Now that formatters add/remove them for me, I don’t care that much. The smaller diff is only slightly compelling to me.

OvermindDL1

OvermindDL1

Another +1 to adding trailing commas on multi-line lists/maps/etc… I always prefer them, diff’s, moving, etc… are always cleaner, but the formatter for some reason thinks more noisy diffs are more useful for reasons that I don’t understand… ^.^;

14
Post #7
jeremyjh

jeremyjh

I much prefer them but yeah, formatter. Our eslint config requires them for javascript.

paulsullivanjr

paulsullivanjr

I can’t do trailing commas. I think it’s an OCD thing for me or something.

peerreynders

peerreynders

I imagine Elm’s leading commas would drive you to distraction …

Where Next? Top

Trending in Discussions Top

cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
achempion
I’ve been using Emacs as my main code editor for more than a two years. It’s a custom build version although I’ve tried doom emacs and sp...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
georgeguimaraes
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews