6 ms·
Git, JSON and Markdown walk into bar
- OCTAGRAM 1y agoEach forum had flavor of BBCode. phpBB, IPB, vBulletin. That imposter markdown came out of nowhere
- wingmanjd 1y agoComing from PHP, the lack of trailing commas in JSON always bites me. It's annoying when I rearrange the items and now the missing comma line was buried somewhere upwards.
- petepete 1y agoTrailing commas is the source of 95% of my SQL syntax errors. I know I _could_ put them at the start of the line, but it's unintuitive.
- zarzavat 1y agoI recommend writing a function to remove trailing commas from SQL. Big time save.
- hk1337 1y agoI like the comma in front for SQL better than at the end but you still have the problem of one of the fields missing a comma, the first field instead of the last but I guess maybe you're more likely to move fields and forget to add/remove a comma at the end.
- neocron 1y agoWho writes trailing commas in sql?In every company I worked with the standard was prefix commas: <pre><code> var , var2 , var3 , var4 </code></pre>
- deleted 1y ago[deleted]
- DarkNova6 1y agoNeat little blog post. But it kept me waiting for a punchline which never appeared.
- stevage 1y ago>Why not bold and _italics_. That would make a lot more sense to me. Surely _underline_ would make more sense than _italics_. Somewhere I have seen /italics/ in use, but that does look kind of regexpy. >I dislike that trailing commas are not allowed...There is no need for this and it makes writing out valid JSON more complex. Trailing commas as a trend emerged after JSON was standardised. And thank god JSON is as well and truly standard as it is.
- philipwhiuk 1y agoThe trailing comma trend is almost entirely down to line-based diff tools as far as I can tell.
- perching_aix 1y agoGit is generally insufferable when it comes to these. Diffing YAMLs is even worse, and it gets downright hideous when the specific document you're working with betrays YAML's rules about orderedness (the document is order invariant, while YAML is ordered). In that case, even most semantic diffing tools become unusable. This is a thing with JSON too, arrays are ordered. I've been recently using dyff [0] to diff YAMLs in an order invariant way, and it's been absolutely liberating. Couldn't help with version control, but it's still night and day. [0] https://github.com/homeport/dyff https://github.com/homeport/dyff
- arccy 1y agoit's also annoying to edit, copy a line, add it to the end of a block. now you need to add a comma to the previous line, and strip off the comma on the new one you added (if you copied it from not the previous line).
- ithkuil 1y agoI wonder how much json aware diff representation and merge conflict resolution would remove the need of having the trailing comma
- usrusr 1y ago
- p2detar 1y agoTo those who may not know, Grumpy Gamer is a blog by Ron Gilbert, the creator of iconic game titles such as Maniac Mansion and Monkey Island. A true legend.
- itomato 1y agoWho works in a GUI editing unflattened JSON like so much Markdown.
- theshrike79 1y agoAlso his blog RSS feed is unabridged (full post in the feed with no "click here to read) and contains every single post ever. Now I have 308 posts to read :)
- b2ccb2 1y agoFor the mentioned problem of removing sensitive data, BFG Repo-Cleaner does the trick: https://rtyley.github.io/bfg-repo-cleaner/ https://rtyley.github.io/bfg-repo-cleaner/
- kingkero 1y ago[dead]
- reddalo 1y agoI was surprised by the comment about John Gruber; I love reading his Daring Fireball. I'll try to look at the articles from Gilbert's perspective now.
- dspillett 1y ago> Why is italics italics* and bold is *bold*? Why not bold and _italics_. That would make a lot more sense to me.* I think that comes from separating content and style, indicating meaning rather than explicit style: it isn't really one asterisk for italic and two for bold, it is one for emphasis and two for strong emphasis and the renderer choses how to display those levels. Like using HTML's “em” and “strong” tags instead of explicit “i” and “b” tags.
- oniony 1y agoBack on Fidonet/Aminet/Spot on the Amiga in the 1990s, pre-internet, the convention was /italic/, *bold* and _underline_. This was much more intuitive for me than what we have today.
- zygentoma 1y agoThat's also how I did it in IRC times, when nothing would actually formatted by this It still looks good even without any formatting! (And btw. I thought that was the intention of markdown …)
- dspillett 1y agoThe problem is that markdown has no real standard. Well, it does, but not everything follows it because many things existed before the formal standard and many created since are made to be compatible with something that pre-dates the standard. Some optimise for matching stylistic intent (bold, italic, underscore) and others prefer to be more abstract (emphasis, sting emphasis), and yet more try to support both but that requires compromise and they don't all compromise the same way. Many interpreters will accept underscores for italic, though they still generally (but not always) require two asterisks for bold. I just accept it as a general idea, not a standard, and lookup the local conventions for whatever tool I'm using at the time. Or if I'm writing a translator, I prioritise converting things written how I personally prefer to write plain text documentation.
- oniony 1y ago
- deleted 1y ago[deleted]
- dabeeeenster 1y agoThe drive by shooting of Gruber in this article is sort of weird?!
- tobr 1y agoThe ad hominem is unnecessary when there are more substantial criticisms of his writing and interviews.
- fluoridation 1y agoIt's not an ad hominem, it's just a insult.
- phoronixrly 1y ago> I also have issue with it’s creator, John Gruber. He is a highly annoying smug Apple Fanboy. His writing was fine in the early days when Apple was #3, but got intolerable as Apple became the 800lb gorilla. It’s changed recently as Apple has snubbed him but I still can’t read anything he writes. Thank you! I thought it was just me...
- jackhalford 1y agoHasn’t is always been an open secret that daring fireball it a shadow marketing website for apple?
- darkwater 1y agoCame here to paste the exact same quote with a very similar comment. I expand it by adding that Gruber is probably the archetypal "Apple fanboy" made flesh. They don't look like fanatics - as in sports fan or politics discussions in a bar over a beer - they just made their point with a subtle superiority and an "obviously Apple made the best choice here, as usual" spin to all of his posts. I should also add that I stopped reading him time ago though, things might have changed (also it feels like his posts are not so present on the HN frontpage like they used to be)
- deleted 1y ago[deleted]
- brap 1y agoAs for JSON, I am also constantly annoyed by lack of trailing commas and mandatory quotations for keys. However I think these were the right design decisions and the slight annoyance is a small price to pay (especially when automation exists). No trailing commas is great for enforcing consistency. I’ma huge fan of consistency in code. Same with required quotation marks, which also simplify writing (imagine having to wonder if something needs it, or be surprised when it does and things break).
- RedNifre 1y agoIf you already have quotation marks, what's the point of the commas?
- merelysounds 1y agoThis is a popular question, the most common answer I’ve seen is: > Commas exist mostly to help JSON be human-readable. They have no real syntactic purpose as one could make their own notation without the commas and it'd work just fine. https://stackoverflow.com/a/36104693 https://stackoverflow.com/a/36104693 Elsewhere such commas can be optional, e.g. in clojure: https://guide.clojure.style/#opt-commas-in-map-literals https://guide.clojure.style/#opt-commas-in-map-literals
- bayindirh 1y agoTry parsing this: { foo :"bar" baz :"bak" quux :[ a,b,c,d ] lol :9.7E+42 } Ref: https://www.json.org/json-en.html https://www.json.org/json-en.html, but without commas. It's line noise. Commas allow a nice visual anchor.
- practal 1y agoOh, actually that is the syntax I will use for writing abstractions: my-abstr x y z foo: "bar" baz: "bak" "quak" quux: [a, b, c, d] lol: 9.7E+42 I don't think my-abstr x y z, foo: "bar", baz: "bak" "quak", quux: [a, b, c, d], lol: 9.7E+42 would be better. Indentation and/or coloring my-abstr and the labels (foo:, baz:, quux:, lol:) are the right measures here.
- TYMorningCoffee 1y agoDid the grumpy gamer mean perforce instead of perform and it got auto 'corrected'?
- yanis_t 1y agoSince I became taking notes basically for everything[0], markdown was a savior. Just text is fine, but when you're able to sprinkle a little bit of formatting here and there (and provide links) without sacrificing the readability, this just great. [0] https://www.mindthis.io/ https://www.mindthis.io/
- theshrike79 1y agoThis is why I have standardised on Obsidian as my data storage along with Datasette[0] (by simonw) for larger data amounts. Watch a movie? Add a page to Obsidian with the movie title as the note title, run a python script and boom it has all of the metadata filled up along with everything relevant from TMDB and it's a pretty card with a cover image on my Movies Base. If Obsidian turns Evil Corporate, my workflow will still be the same, the editor just changes. I'll miss Bases, but all of my own automation is a bunch of external scripts that modify markdown. [0] https://datasette.io https://datasette.io
- raincole 1y agoJSON is one of the most iconic tragedies that happened in software development. It's not that JSON itself is bad, but it's obviously for machines to author, not for humans. - No comment - No trailing comma - No multi-line string It's a terrible format to type manually. However, we just shrugged and said "at least it's not XML" and started writing it manually anyway. And later we finally realized comments are not optional, so we got JSON5, JSONC, etc...
- eviks 1y ago> And later we finally realized comments are not optional, so we got JSON5, JSONC, etc... But we haven't, otherwise we'd use all those better formats instead
- s1mplicissimus 1y ago> And later we finally realized comments are not optional except they very much are. the place to explain your payload is in the API documentation, not alongside the payload. It's not code.
- nwellinghoff 1y agoWhat about json schema files? Hmmm
- rkomorn 1y agoThat kind of stops working when (for example) your "payload" is configuration in a file where comments may make sense, though. I'm more partial to YAML for readability, but I don't think JSON configs are an awful anti pattern.
- raincole 1y agoThe exact issue is that JSON's usage spread far beyond "payload." > It's not code. package.json has a field literally called 'scripts' where the values are shell one-liners.
- tedggh 1y agoThis is true, but it is also true that if someone who didn’t read the documentation or the latest version of it, changes a config parameter that brings down a critical system you are responsible for, your bosses or customers won’t care if it was in the documentation or not.
- unit149 1y ago[dead]
- eviks 1y ago> Why not bold and _italics_. Because that's _underline_, and /italics/ are slanted > I also have issue with it’s creator Just pick a different specification of markdown, it's not like there is only one :)
- pavel_lishin 1y agoThe lack of comments is a bummer; allowing /* */ style comments seems like it wouldn't complicate parsing significantly, and instead I've sometimes ended up having to do things like this: { "channel-comment": "This is the Slack channel that will receive notifications.", "channel": "#abc" }
- PretzelFisch 1y agoComments are not hard to parse. It was a strong opinion by Douglas Crockford, that they would be abused and therefore he omitted them.
- yencabulator 1y agoUnfortunately we're too late for a CommonJSON to yank the definition out of his hands. CommonMark is so much better than Markdown..
- deleted 1y ago[deleted]