toot.wales is one of the many independent Mastodon servers you can use to participate in the fediverse.
We are the Open Social network for Wales and the Welsh, at home and abroad! Y rhwydwaith cymdeithasol annibynnol i Gymru, wedi'i bweru gan Mastodon!

Administered by:

Server stats:

648
active users

#programmingtips

0 posts0 participants0 posts today

The benefits of trailing commas (by @treyhunner):
➡️ Trailing commas in #Python simplify code changes and reduce errors.
➡️ When swapping or adding elements in multi-line data structures, trailing commas prevent syntax errors and make diffs easier to read.
➡️They also help avoid implicit string concatenation, a common Python pitfall.

pythonmorsels.com/trailing-com

www.pythonmorsels.comThe benefits of trailing commasTrailing commas make for easier code changes, shorter diffs, and fewer bugs.

I would implore you all to use ISO 8601 for dates (year-month-day, biggest to smallest)! I sent a message out to my team at my job about this before discovered that XKCD actually made a comic regarding this haha. My favorite feature is that it allows for “natural” (lexicographical) sorting so that you can just sort your files on your computer by name! It also plays nicely with file paths on operating systems since it does not use `/` to delineate year-month-day.

The ambiguity between month/day in many date systems really hurts my brain. I admit that I sometimes use the US-standard of month/day/year for those individuals whose brains are likely not ISO 8601 compliant.

Original XKCD: xkcd.com/1179/

Wikipedia on ISO 8601: en.wikipedia.org/wiki/ISO_8601