• 3 Posts
  • 191 Comments
Joined 2 years ago
cake
Cake day: August 9th, 2023

help-circle

  • Makes perfect sense. If you’re checking if a collection is empty you don’t need to know its exact size. Getting the size can be very inefficient in collections like linked lists or trees, if you have to follow all nodes. To check if it’s empty, all you need fo know if at least one item exists. If one does, there’s no point counting the rest.

    People who don’t understand the difference will probably not understand the difference between passing a list and passing an literator/generator to any() .





  • Docstrings are important and their role is different than comments. They give an overview how the function works, explain parameters and sometimes give examples how to use them. You can generate documentation using sphinx from Docstrings, and as others said IDEs use docstrings to show you information about function you’re using.

    Comments are just text that gets ignored by interpreter. You can add explanation to code if it’s not self explanatory, but they’re not useful outside of the immediate area being commented on.

    Other languages also have documentation options that is separate from comments, e.g. JavaDoc. The syntax is usually similar to coment, but slightly different to differentiate it from comments (extra * in multiline comment).






  • The thing about email is that the software is proprietary. Each of these providers has their own implementation of the interface, features, and integration with their tools (Google drive, photos, etc).

    As long as lemmy servers run lemmy software, this won’t happen, or at least won’t be an issue as you can move to another server and not have to change your usage habits.

    However if some server owners decide to fork Lemmy and develop their proprietary server, overhaul the UI, add features and attract users, it will start to become a problem.