I like to code, garden and tinker

  • 0 Posts
  • 14 Comments
Joined 5 months ago
cake
Cake day: February 9th, 2024

help-circle
  • Yea this is just syntax, every language does it a little different, most popular languages seem to derive off of C in some capacity. Some do it more different than others, and some are unholy conglomerations of unrelated languages that somehow works. Instead of saying why is this different, just ask how does this work. It’s made my life a lot simpler.

    var test int is just int test in another language.

    func (u User) hi () { ... } is just class User { void hi() { ... } } in another language (you can guess which language I’m referencing I bet).

    map := map[string]int {} is just Map<String, Integer> map = new HashMap<>() in another (yes it’s java).

    Also RTFM, this is all explained, just different!

    Edit: I also know this is a very reductive view of things and there are larger differences, I was mostly approaching this from a newer developers understanding of things and just “getting it to work”.


  • SQL is the industry standard for a reason, it’s well known and it does the job quite well. The important part of any technology is to use it when it’s advantageous, not to use it for everything. SQL works great for looking up relational data, but isn’t a replacement for a filesystem. I’ll try to address each concern separately, and this is only my opinion and not some consensus:

    Most programmers aren’t DB experts: Most programmers aren’t “experts”, period, so we need to work with this. IT is a wide and varied field that requires a vast depth of knowledge in specific domains to be an “expert” in just that domain. This is why teams break up responsibilities, the fact the community came in and fixed the issues doesn’t change the fact the program did work before. This is all normal in development, you get things working in an acceptable manner and when the requirements change (in the lemmy example, this would be scaling requirements) you fix those problems.

    translation step from binary (program): If you are using SQL to store binary data, this might cause performance issues. SQL isn’t an all in one data store, it’s a database for running queries against relational data. I would say this is an architecture problem, as there are better methods for storing and distributing binary blobs of data. If you are talking about parsing strings, string parsing is probably one of the least demanding parts of a SQL query. Prepared statements can also be used to separate the query logic from the data and alleviate the SQL injection attack vector.

    Yes, there are ORMs: And you’ll see a ton of developers despise ORMs. They is an additional layer of abstraction that can either help or hinder depending on the application. Sure, they make things real easy but they can also cause many of the problems you are mentioning, like performance bottlenecks. Query builders can also be used to create SQL queries in a manner similar to an ORM if writing plain string-based queries isn’t ideal.


  • For your own sanity, please use a formatter for your IDE. This will also help when others (and you) read the code, as indentation is a convenience for understanding program flow. From what I see:

    • Your enable and disable functions are never called for this portion of code
    • You use a possibly undeclared enabled variable, if so it never passes scopes between the handleClick and animation methods
    • You do not use any callback or await for invoke or updateCurrentBox, causing all the code after either to immediately run. As a result, enabled is never false, since it just instantly flips back to true. I’m not sure what library invoke is from, but there should be a callback or the function returns a Promise which can be awaited.


  • Looking over the github issues I couldn’t find a feature request for this, so it seems like it’s not being considered at the moment. You could make a suggestion over there, I do think this feature would be useful but it’s up to the devs to implement it.

    That being said, I wouldn’t count on this feature being implemented. This will only work on instances that obey the rules so some instances could remove this feature. When you look up your account on my instance (link here), it is up to my server to respect your option to hide your profile comments. This means the options have to be federated per-user, and adds a great deal of complexity to the system that can be easily thwarted by someone running an instance that chooses to not follow these rules.

    If your goal is to stop people looking up historical activities, it might be best to use multiple accounts and switch to new accounts every so often to break up your history. You could also delete your content but this is again up to each instance to respect the deletion request. It’s not an optimal solutions but depending on your goals it is the available solution.

    Edit: Also if your curious about the downvotes, it’s not the subject matter but your post violates Rule 3: Not regarding using or support for Lemmy.


  • As for the article, I think this is generally PR and corporate speak. Whatever their reasons were, they apparently didn’t shut down the initial XMPP servers until 2022 so it was a reliable technology. There “simplification” was bringing users into their ecosystem to more easily monetize their behaviour. This goes along with your last paragraph, at the end of the day the corporation is a for-profit organization. We can’t trust a for-profit organization to have the best of intentions, some manager is aiming to meet a metric that gets them their bonus. Is this what we really want dictating the services we use day to day?


  • Google tried to add support for it in their product

    Is like saying that google tried to add support for HTTP to their products. Google Talk was initially a XMPP chat server hosted at talk.google.com, source here.

    Anyone that used Google Talk (me included) used XMPP, if they knew it or not.

    Besides this, it’s only a story of how an eager corporation adopting a protocol and selling how they support that protocol, only to abandon it because corporate interests got in the way (as they always do). It doesn’t have to be malicious to be effective in fragmenting a community, because the immense power those corporations wield to steer users in a direction they want once they abandon the product exists.

    That being said, if Google Talk wasn’t popular why did they try to axe the product based on XMPP and replace it with something proprietary (aka Hangouts)? If chat wasn’t popular among their users, this wouldn’t of been needed. This could of been for internal reasons, it could of been to fragment the user base knowing they had the most users and would force convergence, we really can’t be sure. The only thing we can be sure of is we shouldn’t trust corporations to have the best interest of their users, they only have the best interest of their shareholders in the end.




  • It all depends on the size of your instance, but surprisingly little. The most expensive part of running an instance at the moment seems to be users interacting/posting. I’ve had my single user instance running for 22 days, here’s what I have found.

    Hardware: I was running it on an HP Chromebox G1 i7-4600U just fine, I did move it to a HP DL360 G7 but this is overkill.

    Network: I have 100Mbit/s down and 24Mbit/s up, I can’t even tell when lemmy is federating on my bandwidth charts. It seems to use very minimal network data. Hosting content or users will increase the data requirements, you’d have to get data from larger instances for a perspective there.

    Disk: I’m using 4.7G for the postgres and 6.2G for the pictrs after having the instance online for 22 days. This will all depend on how active the communities you subscribe to are. My pictrs is only thumbnails sent during federation, and I have read these purge after some time but haven’t verified these claims.

    TLDR; if you have some old hardware around stick a decent sized HDD or SSD in it and you’ll be able to host your own instance for personal use. If you have more users or host images on your instance, the requirements will go up so avoid this if network/disk space is scarce.