Hacker Newsnew | past | comments | ask | show | jobs | submit | afavour's commentslogin

ReturnType is TypeScript, no? You’re using JSDoc to express but it’s a TypeScript type.

As I stated in the article, JSDoc is TypeScript :P

TypeScript utility types are available in JSDoc. You can pretty much copy-paste any typescript Type/Interface into JSDoc


Isn't that the whole point of the article? For all intents and purposes, JSDoc IS TypeScript

Eh. I agree with the principle. I’ve written personal projects with JSDoc because I truly love the idea of finally being done with build systems and just serving the files I write without a step in between.

But it’s more annoying than just writing TypeScript. There are ways to express just about everything TypeScript can but they’re all more difficult and convoluted (generics are a great example). For a project of any reasonable size I’m still going to advocate to use TypeScript.


Such an interesting bubble of time. JavaScript, CSS and the ability to modify the DOM… but no AJAX requests. I remember using iframes to load remote content. What a mess.

There wasn't much of a window where we had the ability to reliably dynamically update webpages without a way of getting data to do it. IE4 was the first browser that had a modern dynamic DOM with CSS support -- but it was all very rudimentary. IE5 came out a little more than a year later came with MSXML 2.0 which had the Microsoft.XMLHTTP ActiveX object that could be used within the browser; so it was really only like 14 months where we had DHTML without the ability to do XML HTTP requests.

And even then, you couldn't really make use of it unless you were in the enviable position of not having to maintain Netscape compatibility, because Netscape basically had no ability to alter a page after it was loaded outside of extremely specific exceptions like being able to replace one image with another image of exactly the same size. And through the weird and broken 'layers' concept they came up with to try to rush out a response to IE's iframes.

I remember discovering Microsoft.XMLHTTP in early 1999; probably within a month of IE5 coming out, and it really was like suddenly gaining a superpower. People (rightfully) gave Internet Explorer a whole lot of crap for getting to IE6 and then stagnating for years; but so much of what we consider to be the modern web today can trace its lineage directly to the ideas Microsoft brought to the browser in IE4 and IE5. They basically reinvented what the browser could be.


FWIW I do this with a TCL Roku TV and it’s fine. Not great, I still see the Roku interface for ~2secs on startup but otherwise it’s out of my way.

I disagree, I think the new layout and the app are bad for Reddit power users. But for someone brand new to Reddit today they work fine.

And that’s the point. They care about boosting their user base, not satisfying power users.


Let's take an example: if there are several images, you click on the "next" button (keys do not work!) several times, and if you are not careful, the last click gets you a full-screen image, because the button has disappeared and clicking in the same place now magnifies the image.

How is that "fine".

In the mobile app, even swiping from the left edge to go back doesn't work reliably.


Sigh, power user doesn't mean the individual is an alien with some quirky taste. Oh, the contrary. It means someone who has a wider spectrum and those who are not power users are still on the spectrum, but theirs is shorter, but overlap with the PU's. So if it is good for the power users it is almost always good for the rest of the world. Let that sink in.

Honestly your best bet is going to be buying a mini PC and hooking it up to any TV of your choice as the only input. Most bespoke hardware is too locked down to make anything like that possible.

I can't find the link now but I read an interesting article recently interviewing athletes. They get so much abuse in their Instagram direct messages ("you messed up my parlay! I'm coming for you!")... I don't mean to sound hysterical but there's going to be some horrible high profile crime one of these days.

Broadly speaking I'm a "whatever goes" kind of person. Don't regulate too much, let people do what they want. But this recent rise in gambling is making me feel like a censorious pastor or something. It's so obviously damaging. I don't even know that anyone was really asking for it. But there was money to be made, so of course it had to be legalized. And countless lives will be ruined.

One stat that gives me hope: young people aged 18-29, one of the prime targets for this gambling push, were asked if legalized betting is bad for society. In 2022 only 22% did, in 2025 41% do:

https://www.pewresearch.org/short-reads/2025/10/02/americans...

The damage is clear, everyone sees it. Only question is whether anyone will actually do anything about it now that the cat is out of the bag.


As a similar minded person in regards to “whatever goes”, the way I square it is drawing the line at persuasion, as well as the “wink, wink, nudge, nudge” games they are playing with enticing kids to gamble via sweepstakes loopholes, lax identity verification, etc.

I don’t care about most vice industries, even ones that have harm and addiction. What I care deeply about is advertising and persuasion. Gambling should be allowed, however bookmakers should never be allowed to initiate contact to entice the behavior. No push notifications, no ads, no TV network, no tv sponsorships. If people want to engage in your vice, they should have to find you.

Also, severe penalties. If a kid somehow gets access to an account, the bookmaker should have to unwind and refund all bets that they can’t definitively prove were made by an adult in addition to paying fines, or something similarly draconian. The burden of proof and responsibility needs to be on the people providing something that is proven dangerous to society. If that means that we can’t have betting apps, that’s fine.

The proven societal harms of the sports gambling boom more than justify this level of regulation.


Whether or not gambling is damaging to society shouldn't be a philosophical or moral debate. And IMO "popular opinion" surveys should carry zero weight.

There are many places where gambling has been fully legal for decades. We should be able to look at data to make conclusions about whether something is good or bad.

(I do, however, wish people would shine a spotlight on scratch off tickets... mainly because the odds are so terrible compared to how they're advertised -- if it weren't state-sponsored, I don't think private companies would be able to get away with running ads for lottery tickets that pay out so incredibly poorly)


Gambling has been legal in those place, often limited in space, and/or in advertisements. In my country, betting is fully legal, but gambling ads can't be showed on TV to people under 18 (or is it 16?) since at least 2000. The law didn't target internet advertisement until more recently though.

And to be honest, i think lootboxes and "gambling" with fake (but real. but fake) money like on Roblox is worse.

[edit[ But it is absolutely a _moral_ debate. That's basically the only debate that is relevant.


How is it anything but a moral debate? The definition of "good" and "bad" are completely subjective and based on personal perspective, experience, and preferences.

On top of that, we don't have the granulatity of data you seem to think we do that would allow anyone to definitively determine that legalized gambling is the cause of any specific characteristic of a nation, state, or locality.


It so clearly going to take down professional sports at some point - or make a complete mockery of them.

There's already a growing amount of smoke in almost every sport, it's not going to explode like it should because no one is actually interested in enforcement outside isolated players.

My theory is that it will turn pro sports, baseball especially, into something like boxing was decades ago, where "Johnny got paid to take a dive" was a common meme.

Wait until there's huge odds that a live police chase isn't going to happen tonight.

Are the police betting? Do they collaborate? How much does a cop earn on a normal night?

What regulation would you propose? I'm personally against most regulation as well but more transparency (e.g. showing house favored odds) and advertising restrictions don't seem that harmful.

I think regulating too hard here would result in black markets and gamblers becoming more vulnerable to bad actors.


It seems very self evident to me (given what we now see with legalized gambling) that the harms of broadly legalizing it and creating an industry around it far outweigh any harms associated with black markets by a wide margin. Also, black markets for gambling still exist, so this kind of just feels additively worse. Just from a measure of utility, even if we went back to only having gambling performed with organized criminals breaking legs when people can't pay, that would still result in significantly fewer ruined lives, significantly better quality of life for the communities that are having wealth sucked out of them and into gambling syndicates. It's entirely unproductive destruction of wealth, robbing from the poor and giving to the rich. If gambling made anything better in net for society, gambling syndicates would never attempt to legalize it.

Ban gambling advertising. Ban online gambling. If you want to place a bet, go to a betting shop. If you want to play slots, go to a casino.

Treat gambling like tobacco or alcohol, basically.


Black market gambling only has bad actors. There's no innocents to protect. There's no accidental gambling.

Not OP, but how about not being allowed to lose more than 1% of your net worth (or salary?) gambling in a year? (The gambling platforms would be required to monitor your losses)

I assume they are just advocating rolling back the recent roll of legalization over the past few years.

Limiting sports betting to in person at licensed casinos seemed to work well enough for decades. Only a little akward when teams play in Vegas.

Yes, there was a fair amount of unlicensed sports betting, and of course a pro sports scandal every so often.

Alternatively, if you cap the amount of bets the bookies can retain, that might solve my immediate problem of I'm so tired of seeing the sports players with betting ads on their jerseys, the commentators yapping about bets, and then half of the commercials are sports betting ads. If they can't keep much, they won't have money to advertise.

Personally, I enjoyed the ads a lot more when the poker industry was advertising their no money .net sites and hoping people would just happen to go to their .com sites instead. That was at least a little amusing.


It's the commercials that get me. Depicting people playing the games constantly, while clearing the house, going to the bathroom, hanging out with friends. It shows them with their minds elsewhere, as if they're in a fancy casino surrounded by rich beautiful people wearing suits and glamourous clothes. Meanwhile they are in their dull ordinary life, craving for a dopamine hit the app gives them.

The commercials are a celebration of addiction, and its disgusting to those of us who have struggled with addiction and know, like you say, the damage is clear. And they tacitly admit it too at the end of the commercial where they hurriedly say "struggling with gambling addiction? call this number." As if that absolves anything.

And it's not just the gambling either. A typical commercial break these days consists of: gambling ads where they try to get you addicted, crypto ads where they try to bilk you, political ads where they lie to you, and then there's the omnipresent pharmaceutical ads. Now we've got AI ads on top of it all. Every one of those ad categories should be made illegal, like tobacco advertising.


I'd support fairly broad restrictions on advertising for things like that: gambling, alcohol/intoxicants, prescription medicines. Basically, if it's not available to everyone, it should not be advertised to everyone.

Via The Economist:

> A survey conducted in 2023 by the National Collegiate Athletic Association (NCAA), the governing body of college sport, found that 60% of college students have gambled on sport.


> I don't even know that anyone was really asking for it

Its generally the case that people didn't ask for it, most of the legalization of gambling in 21st century America was done by state legislatures, not referendums, and there's plenty of evidence that lobbying had a big role in this. However its also true that the public failed to reject it, most of the times it was put to referendum. Most people probably never asked for it, but when they were themselves asked most people took a libertarian position and said let people do as they want, even if it harms their kids by ruining their family finances...


Somehow poker is still banned though, thanks to Chuck Schumer from 2006 (he’s still there).

“Except in Nebraska!” (Sorry I mean Pokerstars New Jersey.)


It adds such a negative vibe to sports too. It's all gambling advertising now.

At least if the sponsor is a truck company, they're selling me a truck for money. Maybe I don't need a truck, but I give them money and I get a truck that I might get utility out of.

Gambling is purely to separate chumps from their money, as much as possible, and then we as a society have to deal with that shit.

Some sports star selling me shoes, whatever. Gambling? It's more like "hey dumb asses..."


It's a less than zero-sum, non-productive activity that damages people's finances.

The institutions that enable gambling receive the majority of the upside, while society receives all the negative externalities of people not being able to pay their bills, digging themselves into holes, not able to participate in the real economy.

The institutions enabling this use dark patterns and addictiveness to fuel a cycle of dependence.

I am also of the libertarian ideology that we should mostly let people do whatever they want so long as it doesn't hurt others. But lately I've been starting to think there are some habits (gambling) and some drugs (fentanyl) that are impossible to use responsibility and that destroy individuals and degrade society.

I think gambling should be regulated and taxed. This should not be such a lucrative or desirable industry to target.

At least gambling in the stock market, housing market, etc. is actually tied to real securities and derivatives. Betting on sports is useless. It pads the wallets of the gambling marketplaces and decreases the fitness, mental health, and security of the losers.


All forms of entertainment are considered useless by some, and there are millions upon millions of people who responsibly participate in gambling. See fantasy sports, March Madness bracket pools, and the vast majority of casino customers as examples.

It is already heavily regulated (which I think makes sense), and the regulators are the ones enabling this recent expansion because they want the tax revenue.

And I say this as someone who very, very rarely gambles outside of fantasy sports.


Like social media, there’s a whole nasty well-funded world of businesses behind it doing everything they can to harm people if it means an extra buck.

A lot of things that are basically ok when one dude with ordinary human liability does it become horrible when corporations enter the mix. IMO it’s not contrary to liberalism to tamp down on the use of corporations for these purposes. They’re creations of the state, after all.


"Wait, you mean that someone will just...give me money for the privilege of gradually losing to my house edge?"

It's very easy to see why it's such a tempting business model.


Yes but they’re also shifting the problem from one they explicitly have to deal with themselves to one the framework handles for them.

Personally I don’t like it but I do understand the appeal.


Maybe, but you go from one of the most tested protocol with a lot of tooling to another with not even a specification.

I imagine they would block anonymous VOIP numbers.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: