HackerTrans
TopNewTrendsCommentsPastAskShowJobs

culturedsystems

no profile record

Submissions

An Introduction to Recursion Schemes

blog.sumtypeofway.com
1 points·by culturedsystems·2 anni fa·1 comments

Design document on nullability and value types

mail.openjdk.org
2 points·by culturedsystems·2 anni fa·0 comments

Avoiding the soft delete anti-pattern

cultured.systems
61 points·by culturedsystems·2 anni fa·55 comments

Predicate Functor Logic

en.wikipedia.org
3 points·by culturedsystems·2 anni fa·0 comments

If there's a concern, it's your concern

cultured.systems
1 points·by culturedsystems·3 anni fa·0 comments

comments

culturedsystems
·anno scorso·discuss
"It is very annoying when you need to add a dependency and suddenly you have to touch 50+ injection points because that thing is widely used"

You don't have to update the injection points, because the injection points don't know the concrete details of what's being injected. That's literally the whole point of dependency injection.

Edited to add: Say you have a class A, and this is a dependency of classes B, C, etc. Using dependency injection, classes B and C are passed instances of A, they don't construct it themselves. So if you add a dependency to A, you have to change the place that constructs A, of course, but you don't have to change B and C, because they have nothing to do with the construction of A.
culturedsystems
·2 anni fa·discuss
"because it does preloading directly in javascript, it can't possibly follow the HTTP semantic of not actually applying cookies until later when the cached route is used"

I may be wrong, but I don't think using JavaScript vs using the standard HTML <link> element to prefetch makes a difference here. I don't see anything in the HTML specs about preload or prefetch delaying cookie setting to sometime after the resource is actually loaded (although admittedly I find this bit of the spec somewhat hard to read, as it's dense with references to other parts of the spec). I tried it out, and, both Firefox and Chrome set the cookies for preloaded and prefetched links when the resource is loaded, even if the resource is never actually used.
culturedsystems
·2 anni fa·discuss
I initially interpreted "unaccounted-for null values may cause compile-time warnings, but not compile-time errors" as meaning "in some cases, an unaccounted-for null value might not cause a compile-time error", but in the context of the rest of the spec, I think it actually means "unaccounted-for null values are not permitted to cause compile-time errors, only warnings", which seems like a bad idea to me. I can see why allowing implicit conversion from unannotated "Object" to "Object!" is a reasonable compromise to work with existing code, but I don't see why conversion from "Object?" to "Object!" would not cause a compile-time error.

Worse, permitting this conversion at compile time means developers will ignore the warning, so we'll have actual codebases which include these conversions. Any later change to enforce nullability checking at compile time will then have a significant backwards compatibility cost.
culturedsystems
·2 anni fa·discuss
"Soft deletion isn’t a blanket rule"

That's right, I think it's really "soft deletion as a blanket rule" which is the anti-pattern; soft-deletion is one option which (IMO) is used too often without thinking about specifically what you need to achieve. If soft-deletion is used as a blanket rule, you're more likely to want to try and abstract it away via an ORM or similar, which tends to be fragile (I agree views aren't fragile, but they do add another layer of complexity in defining the relationship between the application logic and the schema). If soft deletion is chosen judiciously and represented explicitly in the business logic, it's less likely to cause problems (the "archived state" in the post is kind of an explicitly represented soft delete).
culturedsystems
·2 anni fa·discuss
I don't think there's an explicit reference in the JavaScript spec to numbers being treated this way, because this is how all variables are treated in JavaScript - the relevant part of the specification is probably the definition of the "PutValue" abstract operation[1], which doesn't include any special cases for numbers (or other primitive types) vs. objects.

[1] https://tc39.es/ecma262/multipage/ecmascript-data-types-and-...
culturedsystems
·3 anni fa·discuss
Temporal tables, aka system versioned tables, are something like this: https://mariadb.com/kb/en/system-versioned-tables/
culturedsystems
·3 anni fa·discuss
The language in the UK version of the law is "strictly necessary for the provision of an information society service requested by the subscriber or user", which the ICO interprets as meaning "it must be essential to fulfil their request". I don't think tracking page views counts, because it's technically possible to serve a page without using a cookie to track that it was viewed.
culturedsystems
·3 anni fa·discuss
The paper linked to in the Criticism section of the article [1] is well with reading, IMO. It points out that AOP only works when there is "obliviousness of application", i.e the code to which the aspect is applied doesn't need to know about the aspect, and argues that this kind of obliviousness is pretty rare.

1: http://onward-conferences.org/2009/files/steimannessay.pdf
culturedsystems
·3 anni fa·discuss
It's an API for a specific hypermedia client, i.e, a web browser. It's not obvious that it's the best hypermedia API for a different client, for example, a JavaScript application that happens to be running in a web browser.
culturedsystems
·4 anni fa·discuss
"quicky discover I couldn't post on the timeline of the music or videogames one"

That's technically true, but who cares? The instance timeline isn't a "community", it's just a particular filter applied to the global timeline. The communities of videogame and music enthusiasts are larger than any one instance, and can follow one another across instances, and see each others' tagged posts in searches across instances.
culturedsystems
·4 anni fa·discuss
Taylor Swift did do something a bit like this this for a previous tour - you could get early access to the ticket sales by doing various kinds of fan activities, including buying physical copies of her records, watching videos, and posting on social media [1]. People were kind of mad about it, although I think in part that was because the "fan activities" that gave you the best chance to get tickets were the ones that also involved buying things.

[1]: https://www.theguardian.com/music/2017/aug/31/bad-blood-is-t...