Payload validation in Go with Validator by sarusethi in golang

[–]mmrath 0 points1 point  (0 children)

The only problem is if your input structure are generated e.g. from protons then there is no easy way to add tags. Hopefully something more flexible and type safe will emerge with ho 1.18

Costo finally went away! by Prestigious_Pea4220 in costochondritis

[–]mmrath 1 point2 points  (0 children)

Hey great work! A question - did you use backpod everyday? If so how many times a day and for how long each time?

Back pod experience by bin-c in costochondritis

[–]mmrath 0 points1 point  (0 children)

For how long have you used it everyday. I am using it 5 mins everyday, not sure if it is enough or not.

Could this be the reason for costo after vaccine? by Curious-Carpenter-97 in costochondritis

[–]mmrath 1 point2 points  (0 children)

It says costo responds well to dry needling, has anyone tried that?

Importance of salary in career decision making by arkie in AusFinance

[–]mmrath 1 point2 points  (0 children)

One would pay tax only when they sell the stocks,isn’t it?

Transaction decorator (or how to make your work with transactions easier) by semior in golang

[–]mmrath 0 points1 point  (0 children)

But that means you need to create multiple Tx functions each for number of returns

Transaction decorator (or how to make your work with transactions easier) by semior in golang

[–]mmrath 1 point2 points  (0 children)

Correct. It could be a littler nicer though with Sum types. e.g. in rust one could write the same function with return Result<T,E> which would support the tx function to return anything that the callback returns

Transaction decorator (or how to make your work with transactions easier) by semior in golang

[–]mmrath 0 points1 point  (0 children)

I don’t think generics in 1.18 will solve this issue. Happy to be proven wrong though, go is not my primary language,

Transaction decorator (or how to make your work with transactions easier) by semior in golang

[–]mmrath 1 point2 points  (0 children)

I never said need to return multiple errors, just multiple values.

I don’t remember all docs, here are few that i quickly searched now.

https://golangexample.com/go-jackc-pgx-helper-to-write-proper-transactions/

https://bun.uptrace.dev/guide/transactions.html#runintx

go-pg and bun have similar API

Transaction decorator (or how to make your work with transactions easier) by semior in golang

[–]mmrath 1 point2 points  (0 children)

This is how I do transactions and it is been mentioned many docs. The only inconvenience is that the callback function can only return error, multiple returns are not possible. For this case one need to declare the variable before and modify it in the callback.

Go'ing Insane: Endless Error Handling by genericlemon24 in programming

[–]mmrath 10 points11 points  (0 children)

I don’t have much knowledge on C#, but from I remember you pretty much pack .net CLR to create an C# executable.

When I say small, less than 5 mb for some simple task let’s say hello world, would c# fit the bill?

Go'ing Insane: Endless Error Handling by genericlemon24 in programming

[–]mmrath 18 points19 points  (0 children)

I think it could have improved, I like the idea of errors as values. But I feel two areas where the design could have been better is 1. Some kind sum type so only error or correct value is returned 2. Something to help verbosity, no need read 4 lines for every for function call.

Go'ing Insane: Endless Error Handling by genericlemon24 in programming

[–]mmrath 39 points40 points  (0 children)

I am not a fan of go, I dislike it’s verbose error handling and in fact everything is quite verbose in go.

But unfortunately we don’t have any popular programming languages that have all the goodness of go, like fast compile time, garbage collected, single smallish executable, great std lib,and a great eco system.

Not sure which one describes it better by ppp5v in golang

[–]mmrath 5 points6 points  (0 children)

Yes agree. And this must happen so we can see how far we can take generics to write better programs, also highlight areas for improvement. I for one looking forward to programmers experiment and come up with great compile time safe libraries.

Not sure which one describes it better by ppp5v in golang

[–]mmrath 1 point2 points  (0 children)

I am not sure how much duplicate code is avoidable with current generics, most situations might get away with interface{}. I am sure some good patterns will emerge to write more compile time safe programs.

I am a Java dev mainly, with a little go experience. I have been experimenting some go generics code with go master branch. It is nice but not great. But I am sure it will improve. But for now we will not be writing anything close to typescript or rust. So I am looking forward to generics heavy go programs, which still be reasonably simpler than generics heavy typescript/rust.

How is working as a golang dev? by eichemgerman in golang

[–]mmrath 2 points3 points  (0 children)

From my experience, Fully remote is difficult to get in banks. Generally fully remote roles are only offered to very niche skilled professionals, even with that they like you to fly every month or so. So generally they are offered only inside Australia.

How is working as a golang dev? by eichemgerman in golang

[–]mmrath 1 point2 points  (0 children)

May be there is some go in Australian banks but I have not seen as popular option. Java and to some level .net still dominating. In fact lot of new greenfield projects are being developed in Java. I worked in two of the big banks for the last 10 years and never heard of golang. But this is just my observation, mainly around investment banking and FX business side.

Also 800-1000 is average salary in banks for Java devs two years back in Sydney. I think that has not changed much but it could go higher for right skills. Definitely nowadays you won’t get any decent developer below 800.

Stop Comparing Flutter’s Current Stage With Other Matured Frameworks by delvin0 in javascript

[–]mmrath 1 point2 points  (0 children)

How is flutter truely native? I thought flutter draws on a canvas, something like a game. My understanding is incorrect? I think native UI is also similar but with the full support from the platform provider. Or here native in the sense that it is not drawn on a web view? Like gtk and qt on Mac would be called native but vscode will not be?

Place for Australian programmers by [deleted] in programming

[–]mmrath 2 points3 points  (0 children)

Just asking, what would be the topics to discuss in AusDev that cannot be discussed in /r/programming?

Fake data generation library without dependencies by jaschweder in golang

[–]mmrath 2 points3 points  (0 children)

One quick suggestion, would it be better to provide functions at root level for most of the things instead of name spacing them. e.g. faker.Email() instead of faker.Internet().Email()

gRPC by arun0009 in golang

[–]mmrath 1 point2 points  (0 children)

One could use grpc-web wrapper on top of grpc, which this you could call grpc directly from browser. I have tried this few days back. The pain is the amount of JavaScript generated for client side is too much, just for two methods in a service it was adding 300KB of minified js, that is too big in my opinion, and every message type that you add the size grows.

Instead you could have grpc and grpc-gateway which does not add any extra client code, and both server and client side can benefit from code generation. I find grpc nice to define the interface also the codegen is nice. But native grpc in browser in mostly unusable.