News for hackers. Stuff that matters.

0x6877

Re:When to use generics on Wednesday April 13, 2022 @03:57AM (#31012195)
Sometimes you need to instantiate a struct, usually in a test, that contains a bunch of pointers to built in types. Say a struct representing a json request body with optional fields. You can’t just take a pointer to a string literal `&”foo”` and making a variable for everyone of these fields is cumbersome so you have a function that returns a pointer to the value it’s given.

I’ve personally never needed it outside of tests.

Re:The Architecture of Mailinator (2007) on Monday June 25, 2018 @04:57AM (#17390915)
I'm working on something similar but it's still a work in progress. And it's not quite point a domain to it and your done type setup just yet. It takes advantage of mailgun and uses webhooks rather than hosting an email server yourself. https://github.com/haydenwoodhead/burner.kiwi
Re:Serverless Golang API with AWS Lambda on Saturday January 20, 2018 @09:41PM (#16196600)
I disagree that it’s half the hassle. With serverless I don't have to keep the os’s updated and hardened, manage load balancing or scaling (yes I’m aware of the cold start latency cost). It does that all for me. I also don’t have to worry about my service going down. Yes with good devops practices you could automate all of the above but serveless is still easier imo.

I won’t argue that its cheaper because it’s not. Once you get to a certain point you should probably migrate onto real instances which is why I think that the abstraction I talked about is important.

Re:Serverless Golang API with AWS Lambda on Saturday January 20, 2018 @08:09PM (#16196342)
I’d argue that if you’re doing serverless right you should be abstracting away the particulars of the serverless provider and implementing your functions in an provider agnostic way.

A good example would be using something like apex/gateway which simply proxies lambda requests to golang standard http handlers. Virtually elminating vendor lock-in.

I think serverless has a place (yes even for business logic) but like anything you have to pick the right took for the job.

Apex/gateway: https://github.com/apex/gateway

Re:The impossible dream of USB-C on Saturday October 14, 2017 @07:09PM (#15474831)
Exactly. Why should anyone? You should just be able to look at the cable and know what it does. Which as the article points out is not the current situation. The person I replied to stated that googling it is the answer but not everyone is that competent.
Re:The impossible dream of USB-C on Saturday October 14, 2017 @04:45PM (#15474186)
Most tech users... not every user is as tech savvy as your average HN reader and able to google these things, and that’s the issue.