615 karma · joined October 11, 2021
do you not do code review?
if you pass a logger to a foo as a parameter in the request context, then missing a logger is a run-time error
those properties are important
and mindshare
and like there's plenty of people doing wasm on the server where performance is measured in microseconds
wasm is orders of magnitude faster -- actually comparable to native execution, at least on the server
if you're deploying wasm to the browser, then native means your JS engine
if you're deploying wasm to the server, then native means actual machine code
the competitive advantage versus java is (at a very high level) the language design -- java is much higher-level than wasm, which limits its potential
the main difference distills down to execution/implementation
java applets were slow, wasm is fast
that distinction makes a categorical difference
first()?.second()?.third()?
good: a = first()
if a failed, handle that error
b = second(a)
if b failed, handle that error
c = third(b)
if c failed, handle that error
yield ca context is created with each request, and destroyed at the end of it
and values stored in a context are accessible only through un-typed, runtime-fallible methods -- not something you want to lean on, if you can avoid it
the context stores request-scoped data, whether or not the logger is a request-scoped value is a grey area
and to reply to sibling comment, opentelemetry is basically a house of antipatterns, definitely do not look to it for guidance
but i'm sure i won't convince you of anything here, so good luck to you
if so, get the error and evaluate it -- like if json.Marshal fails in your http.Handler
if not, (shrug) -- like (maybe) if your fmt.Printf fails
panics are for core assertion violations, not an ersatz error reporting mechanism
; doesn't do this, afaict
when you're writing imperative code it's important that control flow (return) is explicitly visible
go error messages are clear to users without being cryptic
like, it's not as if the go type `float64` is also a go keyword
but i guess the java type `byte` is a java keyword? according to https://docs.oracle.com/javase/tutorial/java/nutsandbolts/_k...
how much faster are your development workflows now, versus before? like 100x?
how complex were your previous development workflows? what did that complexity manifest as? how has nix made it less complex?
i'm excited to learn more
(spoiler: no)
in generated code, sure -- that's why it exists, to support codegen
it's sometimes abused to manage for loop control flow
but the stdlib is definitely not some platonic ideal -- it's a decade+ old code base which has suffered all of the indignities of organic growth
it's full of bad code and terrible anti-patterns
(good stuff, too!)
in practice, go code bases that are subject to even minimal code review have basically no ignored errors