News for hackers. Stuff that matters.

kevinmcconnell

Re:SPAs Were a Mistake on Wednesday March 02, 2022 @12:30PM (#30530004)
> The server rendered app will ALWAYS have to wait at least 1xRTT for every new render. The SPA does not.

Not necessarily. I think you're conflating caching/fetching and rendering here. You can cache rendered views in the same way you'd cache the data for those views.

Turbo does this, for example. When you navigate to a cached page it will display the page from the cache first, then make a request to update the cache in the background. So it's similar to what you describe, but with server-rendered content.

Re:Solid.js feels like what I always wanted React to be on Tuesday March 01, 2022 @04:17AM (#30511657)
> so it breaks the pure function assumption right there

There's no pure function assumption being broken here. React is a framework for rendering UI from state and coordinating updates to that state. That's why we have things like `useEffect`, contexts, and so on. The only part of React that is expected to be free of side effects is rendering.

Put another way, given your example, React just says that you shouldn't issue your Ajax call in your rendering code. Instead, you should do it in response to an appropriate action, such as a change event on your form controls.

Re:PostgreSQL's Missing DateDiff Function on Tuesday December 21, 2021 @06:38PM (#29643493)
Ah right, my mistake. I’m used to DATEDIFF on other platforms meaning the interval between two dates, and misread.
Re:PostgreSQL's Missing DateDiff Function on Tuesday December 21, 2021 @06:18PM (#29643321)
You can find the difference between dates by subtracting one from the other, the same way you’d find the difference between two numbers. That’s why there’s no need for a function to do it.
Re:Unbundling Work from Employment (2020) on Tuesday December 07, 2021 @07:56AM (#29471906)
> It feels like a lot of these freelancing micro-entrepreneurship perspectives sort of ignore this aspect. It's hard to imagine people still doing it when they're 50.

Why do you say that? I’m asking this genuinely, as someone who is a) dipping my toe into freelancing and micro-entrepreneurship, and b) turning 50 next month :)

Personally I’m just looking for a way to find more enjoyment and meaning in my work, and to be able to balance my priorities in life a bit differently. Which is something I didn’t think much about when I was younger, but has come to be important to me as I get older. So to me, this sort of age actually seems like a natural time to want this approach.

Re:How I Wrote My Book on Tuesday December 07, 2021 @03:52AM (#29470340)
Oh cool, that looks really interesting! I hadn't seen it before, but will definitely try it out. Thanks for sharing.
Re:How I Wrote My Book on Tuesday December 07, 2021 @03:50AM (#29470334)
> By the way, the link to the Spell Right extension actually links to the AsciiDoc extension.

D'oh! :) Thanks! I've fixed it.

Re:Show HN: I wrote a book about using Lambda with Go on Monday December 06, 2021 @09:22AM (#29460021)
Ah yes, you're right! Thanks, I'll fix that.
Re:Show HN: I wrote a book about using Lambda with Go on Saturday December 04, 2021 @04:46PM (#29444585)
I used Asciidoctor. It's mostly the default theme, but I tweaked a few things about it.

If you're interested in the details, I wrote a blog post that goes into it a bit more: https://www.kevinwmcconnell.com/writing/how-i-wrote-my-book

That post also has a link to a repo with all the settings/theme/etc, so anyone can take it and use it as a starting point for their own book.

Re:Show HN: I wrote a book about using Lambda with Go on Saturday December 04, 2021 @01:11PM (#29442832)
I found usually they'd be on the order of a few hundred milliseconds. They tend to be quicker if you have more memory allocated to your function (because the additional CPU power helps).

I've mostly found that my cold starts were slow enough to look bad in the metrics, but fast enough (and rare enough) that the impact on user experience wasn't actually that noticeable. Given the other benefits I was getting from Lambda (like the easy scaling and low maintenance), it was worth the occasional small blip in latency.

And for functions that aren't directly user facing -- like processing items from a queue -- I've not found it to be an issue at all.

Of course every use case is different though, and some apps can tolerate this more than others.

Re:Show HN: I wrote a book about using Lambda with Go on Saturday December 04, 2021 @12:58PM (#29442706)
What I've started doing (and how I cover it in the book) is using the CDK to build and deploy the Lambda code. The `GoFunction`[0] construct handles building and deploying the code, so you don't have to set anything up manually.

Underneath it still happens by way of S3 & CloudFormation, but the CDK abstracts away a lot of the details, which makes it quite convenient to use.

[0] https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-g...

Re:Show HN: I wrote a book about using Lambda with Go on Saturday December 04, 2021 @12:48PM (#29442631)
Thanks! And that's a good point about EFS, it's something I've found very useful too. I'm planning to add some updates to the book, so I'll put it on my list of things to include.

Thanks for the feedback!

Re:Show HN: I wrote a book about using Lambda with Go on Saturday December 04, 2021 @10:13AM (#29441306)
I forgot URLs don't become links in the submission text, so here's a clickable one :)

https://kevinmcconnell.gumroad.com/l/lambda-go-book/hn

Show HN: I wrote a book about using Lambda with Go

Hi HN!During the last few years, I worked on a few applications built with Go, running on AWS Lambda.As I got to know the platform better, I started to find Go & Lambda to be a really productive combination. The applications were fast, and they ended up being much cheaper to run than what my team & I had built before. It’s probably not the best platform for _every_ application, but I...

( Read More... | 17 comments | 103 points | on HN )
Re:Ask HN: Black Friday/Cybermonday deals for hackers? on Thursday November 25, 2021 @02:29PM (#29344206)
I'm seeing that now too.

Refreshing the page seems to make it load properly (for me, at least) so, while not ideal, at least there is a way to work around the problem.

Re:Ask HN: Black Friday/Cybermonday deals for hackers? on Thursday November 25, 2021 @06:36AM (#29340449)
Also, full disclosure (and shameless self-promotion;)), I have a deal listed in that collection. My book "Make the most of AWS Lambda with Go" is 50% off with this link: http://kevinmcconnell.gumroad.com/l/lambda-go-book/sale
Re:Ask HN: Black Friday/Cybermonday deals for hackers? on Thursday November 25, 2021 @06:32AM (#29340431)
There's a collection of deals from indie makers, collected by Marie Ng, at https://indiemakerblackfri.glide.page/dl/d0a5f4/s/d0a5f4

And the Twitter thread where it started: https://twitter.com/threehourcoffee/status/14609177735848960...