• 2 Posts
  • 77 Comments
Joined 1 year ago
cake
Cake day: June 19th, 2023

help-circle

  • Tons of people making Python comparisons regarding indentation here. I disagree. If you make an indentation error in Python, you will usually notice it right away. On the one hand because the logic is off or you’re referencing stuff that’s not in scope, on the other because if you are a sane person, you use a formatter and a linter when writing code.

    The places you can make these error are also very limited. At most at the very beginning and very end of a block. I can remember a single indentation error I only caught during debugging and that’s it. 99% of the time your linter will catch them.

    YAML is much worse in that regard, because you are not programming, you are structuring data. There is a high chance nothing will immediately go wrong. Items have default values, high-level languages might hide mistakes, badly trained programmers might be quick to cast stuff and don’t question it, and most of the time tools can’t help you either, because they cannot know you meant to create a different structure.

    That said, while I much prefer TOML for being significantly simpler, I can’t say YAML doesn’t get the job done. It’s also very readable as long as you don’t go crazy with nesting. What’s annoying about it is the amount of very subtle mistakes it allows you to make. I get super anxious when writing YAML.




  • If you gonna rant, please make it at least comprehensible. You went from “JS is flawed” to “everyone is wrong these days” within three paragraphs like wth.

    I also highly disagree with your premise that people think ‘simple is bad’. Things that are complicated are usually complicated for a reason. C++ for example is complicated, because it grew over decades. Rust is complicated, because it tries to be secure, capture mistakes at compile time, while allowing for concurrency and memory management, and at the same time be very efficient and give the programmer much control. It’s hard if not impossible to achieve all these goals in a language without making it complicated.

    Go on the other hand is not complicated, because Google engineers saw C++ and wanted to make something less complicated - and thus they created a simpler language. This is an example that goes directly against your argument, together with many other modern languages and frameworks that were created for reasons like this. But notably and more importantly, the most popular languages are simple. Python, JS/TS, Java - These languages are all relatively easy to use.

    I won’t pretend that I get you bit about WASM since I have little experience with it, but as far as I understand it is primarily a vehicle allowing to use programming languages for the web that weren’t designed for it. And as far as I’m aware you can do quite sophisticated things with it, so where exactly is the problem? Putting guardrails in place is rarely a bad thing, because they are easy to remove but hard to establish retroactively.














  • It allows for more fine grained access control and to implement afterthoughts.

    Think having some private function that can break things if called improperly, but also allow you to avoid significant overhead when calling it the correct way. For example you could be avoiding input validation in a public wrapper for that function. If your friendly class already does it, or cannot produce invalid inputs, there is no need for that.

    You could also implement logging after the fact, because your friendly logger object to read private members.

    Arguably it’s a questionable design decision tho, as you could do all of this in other ways and it basically breaks any guarantees private would usually give you.