HTTP status codes are *not* sufficient.
Clients need more detail to provide a good UX for users.
There are a million things that can cause a 400 Bad Request, for example.
HTTP status codes are *not* sufficient.
Clients need more detail to provide a good UX for users.
There are a million things that can cause a 400 Bad Request, for example.
It's unintuitive at first, but in the context of an API server, it makes sense once you think through it. Here's what was happening:
It's unintuitive at first, but in the context of an API server, it makes sense once you think through it. Here's what was happening:
Do not rely on docker / codespaces / env variables / setup scripts to make your dev environment function.
Doing a git pull should *never* break the dev experience.
Make fixes for the dev environment in-code, so that updating the code is all you need to do to continue working.
Do not rely on docker / codespaces / env variables / setup scripts to make your dev environment function.
Doing a git pull should *never* break the dev experience.
Make fixes for the dev environment in-code, so that updating the code is all you need to do to continue working.
Spent like an hour yesterday debugging weird behavior.
Turns out, I was hitting the wrong route accidentally, because our routes overlapped in non-obvious ways.
Spent like an hour yesterday debugging weird behavior.
Turns out, I was hitting the wrong route accidentally, because our routes overlapped in non-obvious ways.
The biggest problem is that it greatly hinders discoverability.
I type foo.NewBar( and my IDE shows the signature includes ...foo.BarOptions. What are the options? Dunno. I have to look through all functions in the package. #golang
The biggest problem is that it greatly hinders discoverability.
I type foo.NewBar( and my IDE shows the signature includes ...foo.BarOptions. What are the options? Dunno. I have to look through all functions in the package. #golang
That's it. That's dependency injection in go.
That's it. That's dependency injection in go.
But it is definitely like a pretty smart linter that you don't need to configure ahead of time.
sure, it does more things than static analysis, but it still isn't going to result in someone else grokking the code at 2am.
But it is definitely like a pretty smart linter that you don't need to configure ahead of time.
Wrong!
Good job, Capital One. You've forced me to find a new bank.
Wrong!
Good job, Capital One. You've forced me to find a new bank.
If a number (like an ID or a length) should always be positive .... you should use a (signed) int.
Why? Because it prevents bugs. If you calculate a length to be -2 bytes, that's clearly a bug. If you are converting that to a uint32, it becomes 4294967294.
If a number (like an ID or a length) should always be positive .... you should use a (signed) int.
Why? Because it prevents bugs. If you calculate a length to be -2 bytes, that's clearly a bug. If you are converting that to a uint32, it becomes 4294967294.
I know we’re (almost) all on the same page here, but a Bluesky without cute cats, science facts, and dumb jokes would be bad for everyone.
I know we’re (almost) all on the same page here, but a Bluesky without cute cats, science facts, and dumb jokes would be bad for everyone.
Not specific to #golang but also that is the language I am using :)
Not specific to #golang but also that is the language I am using :)
✅ 2,000 code completions per month
💬 50 chat messages per month
💫 Models like Claude 3.5 Sonnet or GPT-4o
♥️ More fun for you
Check it out today!
Oh yeah, and we passed 150M developers on GitHub 💅 github.blog/news-insight...
Coworker: but sometimes we ship bugs that burn through millions of IDs!
Me: <mathing> if you burned a billion IDs per second, you wouldn't exceed MAX_INT64 for 292 years
9,223,372,036,854,775,807 is *really* big
Coworker: but sometimes we ship bugs that burn through millions of IDs!
Me: <mathing> if you burned a billion IDs per second, you wouldn't exceed MAX_INT64 for 292 years
9,223,372,036,854,775,807 is *really* big
youtu.be/a-9pk8_LLC0
Very exciting to see it out in the wild.
github.blog/news-insight...
Very exciting to see it out in the wild.
github.blog/news-insight...
github.blog/news-insight...