HackerTrans
TopNewTrendsCommentsPastAskShowJobs

JD557

no profile record

comments

JD557
·8 mesi fa·discuss
I have a similar opinion but I think Java's model with maven and friends hits the sweet spot:

- Packages are always namespaced, so typosquating is harder - Registries like Sonatype require you to validate your domain - Versions are usually locked by default

My professional life has been tied to JVM languages, though, so I might be a bit biased.

I get that there are some issues with the model, especially when it comes to eviction, but it has been "good enough" for me.

Curious on what other people think about it.
JD557
·5 anni fa·discuss
> So, let's make an odd_int_less_than_20587 type and a billion of other types?

I see your point, but I think that (while not always), it can still be pretty helpful to add your custom types to make invalid states unrepresentable.

This can sound ridiculous on something like C, but if your language has refined types, it's not that bad.

For example, this doesn't look awful to me:

``` type WeirdId = Int Refined (Odd And Less[20587])

val myId: WeirdId = 5 // OK val myInt: Int = myId // Can be used as an Int val myRuntimeId: Either[String, WeirdId] = refineV[Odd And Less[20587]](myId + 2) // Runtime Check val myInvalidId: WeirdId = 6 // Compilation Error ```

https://scastie.scala-lang.org/qoSHgL4PQCW6lC2MUHc5YA
JD557
·7 anni fa·discuss
> My personal expierience with one of the news sites (cant remember which it was) after GDPR was somehow refreshing. If you didnt agree, they disabled all javascript and throw you into same website but with only text and images relevant to the article. I loved it.

That was probably NPR.

Text version: https://text.npr.org/