Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
benhoyt
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
26 ms
·
301.
▲
The Vaccine Moment, part one
(paulkingsnorth.substack.com)
23 points
by
benhoyt
5y ago
|
36 comments
302.
▲
by
benhoyt
5y ago
Fair enough on that part. But it's the "their inputs" part that's just as problematic: whatever massaging you do to your "inputs", they'll always be unsafe in some contexts. You need to encode/escape
303.
▲
by
benhoyt
5y ago
Yeah, I believe so -- the OP would need to do this, though (and it's probably outside of the edit window now).
304.
▲
by
benhoyt
5y ago
That's odd: personally, I was drawn in. And the first two paragraphs convey its subject and aims pretty explicitly, don't they?
305.
▲
by
benhoyt
5y ago
I agree that it'd be easier to read with wrapping, though "abomination" is rather too strong. You can just click "reader mode" in your browser, or size the window down to something readable.
306.
▲
by
benhoyt
5y ago
I kind of understand why HN strips the "How" prefix off titles, but I think this one needs it: "How I think about writing" is very different from "I think about writing".
307.
▲
by
benhoyt
5y ago
> sanitize their inputs. For anyone confused about why "sanitizing your inputs" isn't the right approach, please read (shameless self-promotion, but I think the concept is important): https://benhoyt.com/wr
308.
▲
by
benhoyt
5y ago
Indeed. In fact, even with the release of generics in Go 1.18, which is coming out in early 2022 exactly a decade after Go 1.0, there will be no new keywords. So it won't even have happened once in a decade. :-)
309.
▲
by
benhoyt
5y ago
Yes, and specifically in this case no keywords have been added to the Go language at all since its 1.0 release (I just checked the 1.0.1 spec and there are still 25 keywords). Even the addition of generics coming soon in 1.18 will add no ne
310.
▲
by
benhoyt
5y ago
You can set the attribute loading="lazy" on an <img> tag and the browser will do it for you. Looks like Edge and Chrome and Firefox support it, but not Safari yet ( https://caniuse.com/?search=loading ).
311.
▲
by
benhoyt
5y ago
Are you sure? This would only affect C code calling Go functions, right? Apart from that being very rare (the other way around is more common using CGo), from the register proposal it looks like they've discussed and had ways to addres
312.
▲
by
benhoyt
5y ago
The other replies give the answers: the ABI has always been an implementation detail, and Go binaries are static built from source, so this change won't matter. But just to add to that: I've been using Go for 4-5 years, and have n
313.
▲
by
benhoyt
5y ago
I agree with the basic idea in your blog post -- that interfaces should be defined by the consumer, and be small -- but I think it's a bit dogmatic: "it’s wrong". :-) For one thing, it's easy to work around the issue of
314.
▲
Go 1.17: Faster software through register-based calling
(menno.io)
2 points
by
benhoyt
5y ago
|
0 comments
315.
▲
by
benhoyt
5y ago
I think this is good advice (I've been in both managerial and individual contributor roles over the years). On the other hand, as an individual contributor, especially if I'm new on the job, I often have imposter syndrome, and kee
316.
▲
by
benhoyt
5y ago
You should check out https://pkg.go.dev/modernc.org/sqlite -- it's an (automated) conversion of SQLite's C source to Go so you can use SQLite without CGo. Apparently it passes all the SQLite tests. I've
317.
▲
by
benhoyt
5y ago
I haven't used pgx -- can you give some specifics of the issues with dates/times or other rough edges?
318.
▲
by
benhoyt
5y ago
Heh, that would be significantly harder. Probably doable, but it'd run quite slowly. Send me the link when you've written it! :-)
319.
▲
Back to basics: Writing an application using Go and PostgreSQL
(henvic.dev)
129 points
by
benhoyt
5y ago
|
78 comments
320.
▲
Pattern matching in Factor (2009, PDF)
(micsymposium.org)
2 points
by
benhoyt
5y ago
|
0 comments
321.
▲
by
benhoyt
5y ago
Nice! My star-struck story is I had lunch with Peter Weingberger (the W) at Google a couple of years back. Neat guy, smart and opinionated. He was working on VSCode's Go integration, if I remember correctly. Asked him what he would cha
322.
▲
Jessica Livingston (2015)
(paulgraham.com)
1 points
by
benhoyt
5y ago
|
0 comments
323.
▲
AWKGo, an AWK-to-Go compiler
(benhoyt.com)
9 points
by
benhoyt
5y ago
|
0 comments
324.
▲
Improving the code from the official Go RESTful API tutorial
(benhoyt.com)
3 points
by
benhoyt
5y ago
|
0 comments
325.
▲
by
benhoyt
5y ago
I suspect it's because Go's general philosophy is that it's better to be verbose and explicit (than terse and magical). Probably falls under "clear is better than clever" from Rob Pike's Go Proverbs: http:
326.
▲
Improving the code from the official Go RESTful API tutorial
(benhoyt.com)
16 points
by
benhoyt
5y ago
|
4 comments
327.
▲
by
benhoyt
5y ago
The Go grammar/language changes very slowly -- most of the improvements are in the tooling and libraries, so there isn't much. But the best way is the release notes. For the last two years (four versions): https://golan
328.
▲
by
benhoyt
5y ago
I don't think it's anything like the Python jump from 2 to 3. That changed the behavior of a lot of code (unicode vs bytes, various syntax changes, import changes, etc), and there was no way to automatically upgrade a codebase (2t
329.
▲
by
benhoyt
5y ago
Isn't the "noise problem" with Go error handling the control flow rather than the lack of generics? You want to return early (and potentially add context to the error) if there was an error, otherwise continue on. How are you
330.
▲
by
benhoyt
5y ago
I used web.py heavily in the early days on many small websites and one large website at work (well after it was relatively unmaintained). It was an early "microframework" that was really nice to use, and simple to hack on as neede
More ›