Closed
Description
Trailing commas have become a must have in "modern" programming languages, and I think Slint should implement them too.
Let's consider a simple Slint file:
import { Foo, Bar } from "lib.slint";
export component Baz inherits Foo {
Bar { }
}
Imagine I now want to import Bork
as well:
import { Foo, Bar, Bork } from "lib.slint";
But now the line is getting a bit big and I'd like to make it clearer what we're importing:
import {
Foo,
Bar,
Bork
} from "lib.slint";
All good. Now I need Asdf
too
import {
Foo,
Bar,
Bork // missing comma!
Asdf
} from "lib.slint";
Oops! Now I want to rearrange my imports to be in alphabetical order.
import {
Asdf // missing comma!
Bar,
Bork,
Foo,
} from "lib.slint";
:/
The point is, trailing commas help with rapid development, since it's one less weird rule you have to keep in mind.
After you've used a language with them, it's hard to go back. They're good because they are mostly an invisible QoL feature.