4,017 karma · joined Mar 10, 2017 (9y ago) · 930 submissions
comment 1y ago · link · parent
(Probably not the nicest code and no doubt I've broken a lot of Go idioms, but it was a good learning exercise)
IPInfo is a good service and their developer relations were surprisingly relaxed about me (mis)using their API this way
404.
Show HN: Daylight – track sunrise / sunset times in your terminal(github.com ↗)
79 points · by zero_shift · 1y ago · 19 comments
comment 1y ago · link · parent
In large orgs with customer-facing APIs, it's imperative that you can validate and enforce OAS specifications against all routes. Customers need to know exactly what auth mechanisms they can use and shouldn't be enabled to call undocumented capabilities. It's also important from a practical perspective that developers can scaffold up new routes that are always-already bound to a specification. Depending on the context you either need to do "contract first" specification or "code first" generation based on type system introspection.
Go can let you knock something together yourself but as your team gets larger, the overhead of reviewing and marshaling your team's practices gets more and more difficult.
It's like the problem you have with NodeJS. It's very possible to assemble something that has easy to scaffold routes with strong type-to-spec validation, authn/z, no exposure of undocumented APIs. But without something like NestJS or Adonis each project becomes a special snowflake with no support for interop across repositories.
comment 1y ago · link · parent
> Why not use the actual language or framework your engineers like instead?
Go does not provide "enough" by itself to completely furnish my needs. And having a framework that uses common terminology and patterns allows you to get s__t done and not waste time bikeshedding.
"Microservices are cattle, not pets."
comment 1y ago · link · parent
I don't think anyone today could recite Beowulf from heart. But 1500 years ago that's exactly how it was enjoyed.
comment 1y ago · link · parent
One of the heuristics is that if someone says something very left-field, does not qualify why it falls out of consensus, and it appears the same as arguments made by politically motivated actors, we trust it a lot less.
Especially when that person has no expertise in the area and is mostly famous for a completely different thing.
comment 1y ago · link · parent
It's that I find programming a fundamentally visual medium, even as text. It's an urge whenever I write a function, not simply to be "neat" and visually consistent but for the program text to embody a rhythm that provides a subtext.
Functions with lots of short branches have a bubbly fine grained texture. I see them performing lots of detailed operations and I know it's IO bound code. It's one reason Golang programs feel good to me when applied to this domain.
I see rigidity aligned segments and I sense this is programming as configuration. I know I'm supposed to... elide over the operational details as a reader and it's maybe even functional. I like authoring those sorts of functions in Haskell, I can line up my let / wheres and case matches to visually communicate "I am doing rules based programming here".
I wonder if other programmers interact with programs visually. It's one reason I kind of... dislike other contributions to my programs because they don't usually follow my visual subtext. I tolerate it, obviously but it makes me wonder how much of code readability really is common sense and what aspects are highly unique
comment 1y ago · link · parent
Some questions I had successfully answered recently:
> "I would like to animate changing a snippet of code. I'll probably be using Remotion. Is there a JavaScript library that can animate changing one block of text into another?"
> "In Golang, how can I unit test a http mux? How can I test the routes I've registered without making real http calls?"
> "Hello ChatGPT. I have an application using OpenTelemetry. I want to test locally whether it can collect logs and metrics. The application is running in Tilt. How can my local integration test read the logs and metrics from the OTel collector?"