HNHacker News
TopNewBestAskShowJobs

jflwyasdf

2 karma · joined April 25, 2024

submissionscomments
jflwyasdf··on What if null was an Object in Java?
Right that depends if you subscribe to the belief that null means the absence of a value `Option<T>` or does it mean the zero value `T`.
jflwyasdf··on What if null was an Object in Java?
This is how I would do it.

  Go: *string

  Java: Option<String> or @Nullable String

  Rust: Option<String>

  TypeScript: string | undefined (or string | null)
jflwyasdf··on What if null was an Object in Java?
null would just mean the zero value instead of the absence of a value

  String foo = null;

  String bar = "";

  foo.equals(bar) --> true
This works well provided the data type has a sensible zero value like collection types

EDIT: I'm blocked from posting so I won't be responding further, thank you for discussion.

jflwyasdf··on What if null was an Object in Java?
Fortunately, Uber made tooling for languages with broken type systems

* https://github.com/uber/NullAway

* https://github.com/uber-go/nilaway

jflwyasdf··on N+1 in Ruby on Rails
Former ActiveRecord & Django ORM enjoyer here.

I've been using sqlc, sqlx, pgtyped, & kysely and I found they have ORM-like productivity with full type-safety but they don't bring the baggage of leaky abstractions.

Unfortunately I don't know if there are Ruby or Python equivalents yet.

jflwyasdf··on We have 4 days to contest KYC being required by internet services
Their username says it all: https://landscape.cncf.io/