"Buy Me A Coffee"

  • 0 Posts
  • 41 Comments
Joined 1 year ago
cake
Cake day: June 13th, 2023

help-circle






  • So the builder pattern is supposed to solve the problem of: if you have a large number of optional fields that may or may not need to be set to construct your object. Then once the dev has called all of the setters that they require, they call build to fully realize that object.

    Some rules that all builders should follow:

    • All setters SHOULD represent optional parameters. (Or ones that have a default value). If a parameter is required for all instances, include it in the constructor of the Builder itself.
    • All setters SHOULD return a copy of the Builder. This way you can chain calls off of each other.
    • Setters SHOULD do nothing more than store the provided value in a field local to the builder itself and then return itself (or a copy of itself).
    • You MUST expose a .build() method that will return the fully realized object. This method should essentially call the constructor for your target object using all of the parameters, regardless if a setter was called or not. Obviously any value where the setter wasn’t called will be null or some default value.







  • First I can’t speak for the Memmy devs but here’s my personal experience:

    In theory something like a mobile app doesn’t really have any reoccurring costs, at least not with Lemmy, etc… Not natively, anyway. Sure there’s the $100 cost for an iOS dev account but that’s nothing in the end. Should Lemmy start to introduce API access fees, again that could change, but that’s a long way off if ever.

    The question really comes down to, long term, how much time are the devs spending on development and if they want to make money with this or not.

    As some of us find this sort of development, well “fun”, and just do this as a hobby rather than as an income stream. And any small costs we’ll just eat because quite frankly we were going to build these apps anyway, if not just for ourselves why not share them with the rest of the community?

    Long story short, Memmy (and the other mobile apps) may not need to charge anything as it’s not costing the devs anything more than time. Now Lemmy itself, is a completely different story.




  • Btw I appreciate the fediverse and decentralization as much as the next guy, heck I’m even writing software for the fediverse. But I feel like there’s a handful of people out there that want to try and apply the fediverse concept to everything. Similar to what happened with Blockchain. Everyone and everything had to be implemented via Blockchain even if it didn’t make sense in the end.

    IMO though, GitHub is just one “instance” in an already decentralized system. Sure it may be the largest but it’s already incredibly simple for me to move and host my code anywhere else. GitHub’s instance just happens to provide the best set of tools and features available to me.

    But back to my original concerns. Let’s assume you have an ActivityPub based git hosting system. For the sake of argument let’s assume that there’s two instances in this federation today. Let’s just call them Hub and Lab…

    Say I create an account on Hub and upload my repository there. I then clone it and start working… It gets federated to Lab… But the admin on Lab just decides to push a commit to it directly because reasons… Hub can now do a few things:

    1. They could just de-federate but who knows what will happen to that repo now.
    2. Hub could reject the commit, but now we’re in a similar boat, effectively the repo has been forked and you can’t really reconcile the histories between the two. Anyone on Lab can’t use that repo anymore.
    3. Accept the change. But now I’m stuck with a repo with unauthorized edits.

    Similarly if Hub was to go down for whatever reason. Let’s assume we have a system in place that effectively prevents the above scenario from happening… If I didn’t create an account on Lab prior to Hub going down I now no longer have the authorization to make changes to that repository. I’m now forced to fork my own repository and continue my work from the fork. But all of my users may still be looking for updates to the original repository. Telling everyone about the new location becomes a headache.

    There’s also issues of how do you handle private repositories? This is something that the fediverse can’t solve. So all repos in the fediverse would HAVE to be public.

    And yes, if GitHub went down today, I’d have similar issues, but that’s why you have backups. And git already has a solution for that outside the fediverse. Long story short, the solutions that the fediverse provides aren’t problems that exist for git and it raises additional problems that now have to be solved. Trying to apply the fediverse to git is akin to “a solution in search of a problem”, IMHO.


  • I don’t get what benefit hosting your own git brings to be honest

    Just another level of backup. Personally I tend to have:

    1. A copy of my repo on my dev machine
    2. A copy on a self hosted git server. Currently I’m using gitbucket though.
    3. A copy on GitHub.

    This way I should always have 2 copies of my code that’s accessable at all times. So that there’s very slim chance that I’ll lose my code, even temporarily.


  • marsara9@lemmy.worldtoNo Stupid Questions@lemmy.worldWhy GitHub?
    link
    fedilink
    English
    arrow-up
    54
    arrow-down
    2
    ·
    1 year ago

    IMHO federation doesn’t bring any real benefits to git and introduces a lot of risks.

    The git protocol, if you will, already allows developers to backup and move their repositories as needed. And the primary concern with source control is having a stable and secure place to host it. GitHub already provides that, free of charge.

    Introducing federation, how do you control who can and cannot make changes to your codebase? How do you ensure you maintain access if a server goes down?

    So while it’s nice that you can self host and federate git with GitLab, what value does that provide over the status quo? And how do those benefits outweigh the risks outlined above?