olitech

Joined 4 years ago

Karma
65
Submissions
14
Member since
Oct 4
sunsetkookaburra.net
View on Hacker News

Recent submissions

Comment · 3 years ago
I'm thinking it might be related to Bard.
Comment · 3 years ago
Someone had shared the quirk with me and said they were able to find the text in news articles (though dating from 13 August 2003), which may explain the dependence on country.
Comment · 4 years ago
I'd disagree that its a poor decision, some help is better than no help when reading code - and if it's inline then it's intrinsically meaningful.

By no means is it perfect, the language doesn't enforce the type rules, but that the developer has the option is far better than not. As far as I can tell the proposal would pretty similar to Python; one can misleadingly or accidentally misuse type hints like the following:

  def myfn(a: int) -> str:
    return int(a)
  
  print(myfn("42"))
But when done right, it gives you a leg up when you come back to read your own code or scan over someone else's. When you're reading over other's code in group programming assignments, comments make a world of difference (a niche example).

It is a choice, but its use in code might just inspire someone to investigate further - my own introduction to types in programming came when I wondered what these oddly placed colons and arrows were in some Python I came across. If they do add these annotations to JavaScript, some future programmer browsing the source of a web page may well just stumble upon types and have a whole new world of theory opened up to them - I'm all for it.

Comment · 4 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton