1317
Brace Style (sh.itjust.works)
you are viewing a single comment's thread
view the rest of the comments
[-] mox@lemmy.sdf.org 60 points 2 years ago* (last edited 2 years ago)

Growing up with C made me assume semicolons and braces were needed to avoid subtle bugs, but experience with more recent languages showed me that it's possible to reliably parse the same semantic cues that humans use: indentation, parentheses, and other such context. (Perhaps this was less viable when C was invented, due to more constrained hardware.)

I was skeptical at first, but in practice, I have never encountered a bug caused by this approach in Python, Nim, or any other language implementing it consistently, over the course of a decade or two using them. Meanwhile, I have seen more than a few bugs caused by brace and semicolon mistakes.

So nowadays (outside of niche & domain-specific languages) I see braces and semicolons as little more than annoying noise and fuel for religious arguments.

[-] humbletightband@lemmy.dbzer0.com 7 points 2 years ago

It's kinda organic in python, but God forbid how often I made mistakes in yaml learning k8s

[-] mox@lemmy.sdf.org 3 points 2 years ago* (last edited 2 years ago)

Haha... Yes, I've found yaml to be problematic in this area, too. Probably because it lacks the context cues and modularity of a programming language.

[-] humbletightband@lemmy.dbzer0.com 3 points 2 years ago

Context cues could be provided by jsonschema, but still it's unbearable in comparison even with json.

load more comments (14 replies)
this post was submitted on 28 Jul 2024
1317 points (99.0% liked)

Programmer Humor

30963 readers
1625 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS