Didn't forget it, just didn't include it since to me, it's more like a totally different (and not pretty) language that tries to look like python. I should however include Nuitka [1] since it is fairly usable, it's just the generated version isn't much faster than its interpreted python version.
Why is Cython a totally different language? It's definitely a superset, what with all the custom syntax for type annotations, struct definitions etc. But you can ignore all that, and just stick to the pure Python subset.
Guess you can say Crystal is a totally different language as well. It's just to me, Crystal still has the same feel as ruby and Cython doesn't. Again, it's just my opinion, I won't argue if you feel otherwise.
This is exactly what mypy allows, actually! (Except for speedups -- types currently have no effect on runtime behavior, and it turns out they wouldn't make a big difference anyway.) The hybrid type system concept is called "gradual typing", and it's actually powered by some somewhat-recent developments in programming language theory. See this seminal paper by Jeremy Siek in 2006 if you're interested in the details: http://scheme2006.cs.uchicago.edu/13-siek.pdf
That sounds sweet! It's been a while since I did anything in Python (at work, for various reasons, I mostly use Perl when I can, C# when I have to). But the next time I do something with Python, I'll make sure to check it out!
Good question! There are separate capitalized types for List, Dict, etc provided as part of the `typing` module in order to let you specify element types. Types are all normal Python expressions, so if you wrote `list[int]` you'd get a runtime error, because `type` objects (i.e. the `list` class) aren't subscriptable.
Yeah, you need to write `from typing import List` to get the generic List class that you can parameterize with an item type. As you pointed out, you can use the builtin lowercase-l list without importing anything, but that doesn't allow you to specify the item type.
This is intended behavior, actually! By default, mypy doesn't type check the interior of functions that don't have any type annotations. This lets you slowly introduce types to a large codebase without having to convert everything at once (or even file by file). Adding a type annotation to "bar" will cause mypy to check it:
def foo(n: int):
pass
def bar() -> None:
foo("123")
>> main: note: In function "bar":
>> main:4: error: Argument 1 to "foo" has incompatible type "str"; expected "int"
Leeching shouldn't be too much of a problem: the user will upload while they remain on the page (which should be much longer than it took them to download the assets).
While I agree that being skeptical about self-help books is a good thing, I think you made a big mistake in your specific example. I have not looked at "The Feeling Good Handbook" that you linked to, but I am quite familiar its predecessor (by the same author), "Feeling Good", which is excellent. It has helped a couple of my friends, and at least one other HN reader.[1] Further, its efficacy is supported by at least one clinical study.[2]
You're right about the image, but the book is worthwhile.
I think "the root of all evil" is, in general, not a good choice of phrase. I understand the vehemence with with you speak, but I think it's a bit overly hyperbolic and creates quibbling over the word "all". Saying that religion is the cause of much evil (which far outweighs the good) would be sufficient.
I thought my post would be downvoted anyway, so I didn't care about being a bit hyperbole.
I really didn't want such a huge discussion here, I'd rather have people talk about Vile Rat, the State Dept Rep who got killed for nothing. He deserves all the attention, not the quibbles of people disagreeing here.
> Anyone who can complete Tour de France at all or moderately but steadily grow an investment portfolio over the years should be extremely satisfied with just that already.
(I'm not certain what "should" means in that sentence - a moral judgement? - but I'll interpret it as advice.) I think that this is excellent advice for some people, but poor advice for others. I don't think there is anything wrong, per se, with wanting to be the very best at something. There's just a trade-off: you can be happily excellent, or you can take a chance and be perhaps the best but most likely just unhappy. But this decision is, in my opinion, a personal one: happiness does not have to be the ultimate goal of life.
> I don't think there is anything wrong, per se, with wanting to be the very best at something.
Its probably obvious, but everyone wants to be the very best at something (or even everything?), even though of course its unrealistic, so most people disregard that desire almost immediately after thinking of it.
However, there are a minority that feel they can be, and when they realize they mightn't be, they cheat to do so, at the cost of others. And that's what i think is the real crux of the problem.
Imagine you're now the best programmer in the world who knows as much as any other programmer knows, and more. How depressing would that be. You'll always find room to improve any library you download from the internet. When you have no idea to do something, you have no one to ask. You'll have nothing to learn from reading programmer's blogs. Nothing to learn reading programming related entries in HN. No role models to learn from. No new information to read from programming books. No enlightenment reading Knuth's (Or Rob Pike or Paul Graham or Jeff Atwood or any other programmers') writing.
No, I have no desire to be the very best at all. It'd be great if I can always have someone in front of me to learn from, all the time.
I'm happy for you, really. But those who strive for greatness and who invent or discover new concepts also get amazing feelings, and learn amazing things too.
Not to mention that nobody can know everything. If you know everything about programming, you are deluding yourself. And even if you could know everything, there is much to be said of applying concepts from other disciplines to your own. That's how we got Design Patterns.
What you described is not the best programmer. It's some kind of superhuman programmer that you get when you combine the best attributes of every single programmer on the planet and spends five thousand hours a day doing computer science research so that they always think of every idea first.
I'll go point by point in a situation where you're just 'the best' and not some kind of demigod that steals ideas before they are conceived.
1. Every library has room for improvement. Even the libraries you make can be improved by average programmers that focus on specific aspects of it.
2. Do you honestly only ask people that are better than you for help? Everyone that can understand a problem can potentially provide insight.
3. Blogs will still have new information, new insights that you haven't gotten to.
4. Same as 3.
5. If the only standard for role model is who is the best programmer ever, then this can be a valid point.
6. Same as 3.
So sure, being a demigod might be boring, but I would be perfectly content being the best at something.
Your interpretation is correct: I wrote it as an advice, not a judgement. Whenever in doubt, prefix the original sentence with "In my opinion, " and internet comments start making a whole lot of sense.
[1] http://cython.org/