tgm

u/tgm@lemmy.world
0 posts · 126 comments

Recent posts

No posts.

Recent comments

on Remember, Kids: · c/lemmyshitpost · 20 pts · 18d

My greatest regrets are all actions that ended up hurting someone. Even the inactions I regret most are related to not preventing pain which I had the power to do something about.

I think this post is talking about a different kind of regret or comes from someone with very different life experience than me.

Well transphobes are always going to find some dumb reason to hate. I find this one particularly stupid though, what stops one from just becoming socialized by the desired group? Abd honestly, since when was that a requirement of womanhood? Are tomboys no longer considered women now?

Nonsensical I say

on IYKYK · c/progressivepolitics · 5 pts · 99d

Would someone take pity on an ignoramus, such as I, and explain the abbreviation and context?

on Anon has a bad dream · c/greentext · 8 pts · 134d

I once had a dream where an ex followed mene around explaining in detail how she cheated on me. In hele real world she didn't, so I woke up with a feeling of "wow, thanks brain, that was unnecessary."

on The lost art of XML · c/lobsters · 2 pts · 200d

I agree with some of the points made in the article, but I think a reason JSON won it is that it is directly representable in many languages. As the author mentions, JSON makes dictionaries, which has native types in most, if not all, languages I have used and languages like JS/TS and Python have native support for JSON.

So interpreting a JSON string is easier and doesn't necessitate a custom type, while allowing for it. Both TS and Python (3) do have static analysis and type checking for JSON, with some limitations.

The final point I feel the other missed is that JSON and by extension YAML is more concise and therefore more readable, even in a terminal or console where syntax highlighting might not be available. In my experience the speed at which humans kan parse DTOs increase troubleshooting and development.

That said they do mention several use cases where I agree that XML is a better tool, but I still believe that JSON is the better general purpose tool. If your model for DTOs is tight and well defined XML may well be the better option and JSON does have some significant drawbacks, but not enough that I would start my project out using XML unless I know I will need to compose XML files or enforce strict type checking.

In my, albeit limited, experience using XML the time saved on type checking DTOs is spent on writing and maintaining serializers and deserializers. Thus the benefit of one tool over the other depends on the use case.