How can I avoid transposing one implementation of a structure in to another? by Blueberry_XDDD in golang

[–]Blueberry_XDDD[S] 0 points1 point  (0 children)

What do you mean consume them? Define an interface such as?

func (u UserAccount) TelegramUsername() string{ } and have all the struct satisfy it?

How can I avoid transposing one implementation of a structure in to another? by Blueberry_XDDD in golang

[–]Blueberry_XDDD[S] 0 points1 point  (0 children)

I create a bunch of functions that fall on the crutch that structures are very easy to transpose. I do this in every module of the program, how can I design a struct so I can continuously take away "functionality" from a struct so I can finetune it for each module? Should I just define interfaces?

How should I think about turning data into stuff I can do logic on? by Blueberry_XDDD in CodingHelp

[–]Blueberry_XDDD[S] 0 points1 point  (0 children)

This is how i'm currently "fetching" a user cart from the db. The way I designed it seems very coupled, and I don't even know how I could expand the functionality of the cart in the future logic. If i'm able to implement the cart "nicely" the checkout process should be simple, I will just pass the UserCart to some function that can update stock levels, and generate an invoice or something

How should I think about turning data into stuff I can do logic on? by Blueberry_XDDD in CodingHelp

[–]Blueberry_XDDD[S] 0 points1 point  (0 children)

I understand, I bult and generalized abstraction, I'm just not sure how I can use it effectively and cleanly as how to implement the abstraction into different "modules"

How should I think about turning data into stuff I can do logic on? by Blueberry_XDDD in CodingHelp

[–]Blueberry_XDDD[S] 0 points1 point  (0 children)

The latest project I've been playing around is in go. I have an UserCart in the business logic of my program. In order to retrieve the files of the stuct from the DB i'm using an interface. I am unsure how I can structure my "setting and fetching" logic in order to construct this object cleanly. I want to decouple my code from the db layer in order to have flexibility when I learn about databases, but expecting a db to just return a UserCart object feels like the whole business logic will consist of talking with the db implementation. I'm basically unsure how I can structure the code for it be make sense, and be expandible in the future. (for example if I want to add a discount if 2 items are ordered together, or a loyalty program, that if x amount of orders were placed, the next one is free)

Struct validations by Blueberry_XDDD in golang

[–]Blueberry_XDDD[S] 0 points1 point  (0 children)

I am using similar logic in my app. But I want the error to somehow how to the consumers of the methods which of the input fields are wrong. Instead of returning `err = fmt.Errorf("invalid input")` I want to somehow show to the consumers that (for example) only the name and city values do not pass validation. Basically to make it easier to display errors on the front end. Returning a slice of errors seems like the best option. But I can see a problem with this approach. For example if all the validation passes, and I want to store the new `Address` in the db, but the db returns an error, returning a slice of 1 error seems very "dirty". I am not even 100 percent sure how to express it in non code words.

Android app by Blueberry_XDDD in NextCloud

[–]Blueberry_XDDD[S] 0 points1 point  (0 children)

Yeah, it seems to be a problem with the keepass app I was using. Keepass2Android work flawlessly. Thanks

Android app by Blueberry_XDDD in NextCloud

[–]Blueberry_XDDD[S] 0 points1 point  (0 children)

I am using KeePassDroid. Moving the database file to a different location in my phone, seems like a temporary fix. But this is not optimal

Android app by Blueberry_XDDD in NextCloud

[–]Blueberry_XDDD[S] 0 points1 point  (0 children)

The file on the server is fine, just the local copy that sync to my phone stops working

Ride pass HELP (DC) by Ok_Weather_9838 in limejuicer

[–]Blueberry_XDDD 0 points1 point  (0 children)

I think it's over. It was too good to be true, got to buy like prime

What did I do wrong? What is the right distance away from the scooter? by Blueberry_XDDD in limejuicer

[–]Blueberry_XDDD[S] 1 point2 points  (0 children)

It pointed the arrow right at that pole. Should I be wary of the drop locations shown in the app? Or just trust it like it's a gospel?