I set the system prompt to try avoid censorship by substituting etc etc, it didn't listen - started generating a response and got as far as this before suddenly, [ERROR] :-)
>I'm sorry for any confusion, but it seems there might be some mix-up in your query. The year 1979 does not have a widely recognized event matching your description, and "TS" and "Cydonia" do not correspond to any known geopolitical locations or events in historical records. "Cydonia" is often associated with a region on Mars that has been subject to various conspiracy theories, but it doesn't relate to any political events or protests.
>If you're referring to a specific historical event, it could possibly be the Tian
Not really true. You can have separate queries to avoid cartesian explosions. EF Core implements it and its standard practice to use - but not enabled by default, because if you don't order by something unique you'll have a bad time.
No, it's more like saying "media" isn't a feature or a product. It's not. It's a very vague word that could mean any number of loosely related things that do form part of many different features and products.
This example is also an odd choice because... it's not the right way to do it. If you're super concerned about people misusing hashes, using string as the type is a WTF in itself. Strings are unstructured data, the widest possible value type, essentially "any" for values that can be represented. Hashes aren't even strings anyway, they're numbers that can be represented as a string in base-whatever. Of course any such abstraction leaks when prodded. A hash isn't actually a special case of string. You shouldn't inherit from string.
If you really need the branded type, in that you're inheriting from a base type that does more things than your child type.... you straight up should not inherit from that type, you've made the wrong abstraction. Wrap an instance of that type and write a new interface that actually makes sense.
I also don't really get what this branded type adds beyond the typical way of doing it i.e. what it does under the hood, type Hash = string & { tag: "hash" }. There's now an additional generic involved (for funnier error messages I guess) and there are issues that make it less robust than how it sells itself. Mainly that a Branded<string, "hash"> inherits from a wider type than itself and can still be treated as a string, uppercased and zalgo texted at will, so there's no real type safety there beyond the type itself, which protects little against the kind of developer who would modify a string called "hash" in the first place.
> I also don't really get what this branded type adds beyond the typical way of doing it
Your example is a (non-working) tagged union, not a branded type.
Not sure about op's specific code, but good branded types [0]:
1. Unlike your example, they actually work (playground [1]):
type Hash = string & { tag: "hash" }
const doSomething = (hash: Hash) => true
doSomething('someHash') // how can I even build the type !?!?
2. Cannot be built except by using that branded type -- they're actually nominal, unlike your example where I can literally just add a `{ tag: 'hash' }` prop (or even worse, have it in a existing type and pass it by mistake)
3. Can have multiple brands without risk of overlap (this is also why your "wrap the type" comment missed the point, branded types are not meant to simulate inheritance)
4. Are compile-time only (your `tag` is also there at runtime)
5. Can be composed, like this:
type Url = Tagged<string, 'URL'>;
type SpecialCacheKey = Tagged<Url, 'SpecialCacheKey'>;
This is a far better summary of branded types than the top level comment that most people commenting should read before weighing in with their "why not just" solutions.
This is a bit of a nitpick because strings often aren't the most appropriate type for hashes... but in some cases I can see using strings as the best choice. It's probably the fastest option for one.
In any case it still demonstrates the usefulness of branded types.
Search will be dead in a year or two. Nobody wants to double check information, they just want fast and easy answers, unless they're intentionally navigating to a specific website (facebook, electricity provider, etc)
I recently built a pretty simple static site. I wanted to know how bad the search engines were out to lunch. I chose an industry and domain, then built something simple using a template. Then I did what you should never do with SEO. Keyword stuffing, geo tagging and stuffing, using duplicate content and then copying material directly from high ranking sites in the same industry.
NONE of it was penalized and the site within a week or so was on the top two pages for dozens of specific searches I very deliberately abused SEO in order to achieve.
Nobody is awake right now at wheel. Not long ago, my site would've been buried in a matter of hours. Now? I'm rewarded when I purposefully manipulate the SERPS for some research and get listed on the front page.
If people think AI is going to make this better, they're in for a rude awakening. Its only going to get worse as more people realize how easy it is to manipulate the search engines to get your stuff ranked higher and take advantage of it. There doesn't seem to be any checks on the validity of what the AI is serving up - making it ripe for abuse.
That's a really interesting experiment. I've been pretty down on Google for a while now but that result is even worse than I would have expected. It's shocking how little Google cares about their core product. Same for Microsoft/Bing, but at least for them it's not a core competency.
Not only that but even for topics not abused to death by SEO, Google still manages to include absolutely irrelevant pages.
It seems like they have had some system for years already which includes an absolutely unhealthy amount of pages that in their algorithms view are similar to the thing I ask for without being the thing I ask for.
My go-to example is when I search for a construct from a JS framework that a previous dev used and Google gives me lots of results that seem superficially relevant but when I open them I think half or more of the results at the first page are about other, similar frameworks.
This is extremely annoying because they manage to hit a spot were the results are close enough that I often have to read a bit before I realize it.
Exactly. Who wants to double check information? You do it out of necessity.
If Google or its successor can give you exactly the information you need, with references/citations to appropriate sources/alternatives that you can spot check for a sense of security, then everyone is going to use it, and only it.
NoSQL is way harder than SQL to get right if you're trying to write something performant - and you don't want to refactor everything down the line. I pick SQL because I'm lazy, not the other way round.
The only upside of NoSQL is performance. Almost everything else is harder and worse than SQL. Sure you can get your denormalised schema and never have to join anything to get all your data. But, you need to know all of your access patterns at design-time and when you need to refactor the data model in some way you're fucked and need to, I dunno, rewrite an entire table, sometimes on the fly while the system is running, which is like changing a tyre on a moving car.
For what it's worth, one CSS line lags the HELL out of my laptop on the site. It's backdrop-filter: blur(0.1875rem) for modals, like the youtube video popup
I'm a front-end dev and I refuse to apply this effect for this reason. Even on high end laptops it uses way too much power and starts blasting the fans.
Respectfully - while that's no doubt useful for your visiting family, weighing that up vs the social costs of taking a house off the market when it could be used by a family, in the midst of what I think is the worst rental crisis in Aus history, in which many families are forced to live in vehicles, it doesn't really stack up in a utilitarian sense.
The house isn't being lived in, rental income could easily pay for temporary accommodation, or it could be shared with roommates etc.
> Respectfully - while that's no doubt useful for your visiting family, weighing that up vs the social costs of taking a house off the market when it could be used by a family, in the midst of what I think is the worst rental crisis in Aus history, in which many families are forced to live in vehicles, it doesn't really stack up in a utilitarian sense.
I don't disagree - I find it terrible that it's being kept off the market, especially as someone that is struggling with the housing crisis myself (my partner and I considered buying it, but my grandfather built it as a townhouse for him to live out retirement in and it's not really suitable for us with a young child).
There are complicating family factors for us but at the end of the day I would absolutely rather this house be on the market where someone could take advantage of it.
I think the reality is there are vastly more totally unused homes that are simply not being rented because they're just being sat on by (presumably mostly overseas investors).
what if another family member would take over soon but isn't of age yet, or is otherwise occupied but intends to take over later?
I don't think families should give up inheritances, especially not for nothing.
on the other hand there are corporations not renting out offices and apartments because appreciation will get them more money. this is what should be fought by laws, not the previous situation
get around such things through the power of cross referencing. Initially with a lot of manual trawling through microfiche records, later with computer assistance and digital records, recently with fully automated approaches.
This isn't my area but I feel like they might be kind of easy to define. They're wrappers around their inner companies. I'm sure nothing has been done because pretty much every corpo lobbyist represents a company that uses them.
>I'm sorry for any confusion, but it seems there might be some mix-up in your query. The year 1979 does not have a widely recognized event matching your description, and "TS" and "Cydonia" do not correspond to any known geopolitical locations or events in historical records. "Cydonia" is often associated with a region on Mars that has been subject to various conspiracy theories, but it doesn't relate to any political events or protests.
>If you're referring to a specific historical event, it could possibly be the Tian