• 0 Posts
  • 15 Comments
Joined 3 years ago
cake
Cake day: June 17th, 2023

help-circle

  • nous@programming.devtoLinux@lemmy.ml•systemd really, really sucks
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    2
    ·
    20 days ago

    Application developers are not being forced to integrating with systemd at all. They are choosing to do that because it helps them. The only developers negatively affected by this are the ones developing other init systems that don’t want to provide the same features the application developers want to use.



  • Three branches and a fifteen-line ceiling sounds generous until you write against it.

    I disagree with this. There is a lot of situations where breaking these rules results in more readable code and trying to follow them strictly results in code that is far harder to read overall. Sometimes colocated code is the more readable solution. There is no hard and fast rule that can make code more readable. Only general guidelines that don’t always work.

    This has Uncle Bob vibes which just takes this to the extreme - thinking you can only have 1 branch and 5 lines in a function. It does not solve the complexity problem. It just spreads it around and thus makes the whole program and logic flow harder to read as you need to make far more jumps through the code to understand it.



  • They need a basic remote API and SKD first. Now we have that anyone can implement these local daemons/translation layers if they want to. This is still early days.

    They could at least have implemented a shell

    They do have an interactive shells:

    You can also run interactive shell. Just type ./proton-drive and then the commands directly.

    Though the commands are not the same as Linux equivalents that is IMO not a big concern. Similar things like AWS S3, or even ftp also don’t have the exact same commands. It is really a trivial thing to learn how it works.

    And again, anyone is free to build on this now if they want to.

    I would not be surprised to see a fuse fs popup at somepoint around this.


  • Where’s sftp? s3? smb?

    I would highly suspect this is because they don’t want to handle encryption and decryption on their servers where ever they can. Yes they need encryption for emails they receive but for every thing else they want to have as end to end protected as they can. Which means client side encryption and decryption for almost every thing. That is the big feature that a lot of people are buying into from them.

    All these protocols don’t feal with encryption on the client at all. Which means if they supported them they would need to handle encryption and decryption on the server side. Which I doubt they want to do and likely work hard to avoid at all.




  • Or just thing.age() which is fine and is fairly obvious it will return the age of the thing. And that is what is done in most languages that dont have computed properties. get_ on a method really adds no value nor clarity to things. The only reason foo() is ambiguous is because it is a bad name - really just a place holder. Missing out the brackets here adds no value either, just makes it hard to tell that you are calling a function instead of just accessing a property.


  • Make its usage cleaner? I don’t see how a property does that at all. We are talking about x.foo vs x.foo() really. And IMO the latter tells you this is a function that needs to do some work even if that work is very cheap. x.foo implies that you might be able to set the value as well. But with computed properties maybe not. Which IMO makes the program a bit harder to read and understand as you cannot simply assume it is a simple assignment or field access. It could be a full function call that does different things depending on other values or even if you are setting vs getting the value. I prefer things being more explicit.


  • Functions do something, while properties are something.

    This is my argument against them. Computed properties do something, they compute a value. This may or may not be cheap and adds surprising behavior to the property. IMO properties should just be cheap accessors to values. If it needs to be computed then seeing a function call can hint the caller may want to cache the value in a variable if they need to use it multiple times. With properties you need to look it up to know it is actually doing work instead of just giving you a value. That is surprising behavior which IMO I dislike in programs.



  • You can create some really ugly code in spite of the forced indentation in python. Indentation does not really help here at all. In all languages you can correctly or incorrectly format things. A code formatter strictly applying a coding standard helps far more here than indents vs bracers. Take a look at black it takes the pep8 standards and adds more strict things on top making code look a lot more consistent and thus makes it easier to read.

    And all formatters will indent code consistently, so having it as part of the language parser does not really help improve readability at all. And even without a formatter everyone I know will still correctly indent their code no matter the language used. But sometimes forcing new lines to have a meaning does make things worst - just look at pythons lambdas which have to be a single line.


  • In unit testing, a “unit” does not have to be the smallest possible section of code. It can be a while class or module or even set of related classes/modules. Testing individual functions in isolation leads to brittle tests that easily break during refactoring. Testing overall system behaviour results in more robust tests that require fewer changes during refactoring which gives you more confidence then you have not introduced a regression.