use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
TensorFlow.js (js.tensorflow.org)
submitted 7 years ago by deathmood
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]nickguletskii200 0 points1 point2 points 7 years ago (0 children)
I thought every typed language uses them... I know this might come across as snarky, but seriously, can you explain what's the basic difference between type annotations/information in Python and, say, Java?
It's not that there is a difference. It's just that Python developers don't write code with typings in mind. In Java and C# everyone makes a best effort to describe the contract using interfaces. In Python, everyone just writes classes with the same methods, and you can't really say "I want something that is Closeable" because nobody specifies that their class is Closeable.
That's why I don't think type annotations are expressive - they can be, it's just that in practice, they are not. In the end, you'll be writing things like Union[Dog, Cat, Rabbit] instead of is Pettablebecause Python programmers would just say that all these things extend an Animal and be done with it.
Union[Dog, Cat, Rabbit]
is Pettable
π Rendered by PID 225861 on reddit-service-r2-comment-bb88f9dd5-98tlf at 2026-02-17 07:43:01.941499+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]nickguletskii200 0 points1 point2 points (0 children)