A less unflattering interpretation might be that once they saw the level of skill required to contribute to a field, they switched to a field that they could more meaningfully contribute to.
I think the reality though is you don't need to be in the top 99.999% to contribute to a field, you just need a unique take/voice. Trying to be the best at anything is a bad strategy in a connected world
Yeah, but these are also about people who are not even starting off at a field. These are teenagers. It really stood out that they can think where they can make most impact in the world at such an young age.
What are you talking about? Our society harasses every teenager to think again and again and give definite answers to exactly that kind of question. It's completely normal and exactly like every other young person.
So, fun fact from calculus (though you can easily prove this with basic algebra as I do below):
- You want to compare two products: in this case 6x9 and 7x8.
- And in each product, if you add the two numbers together, you get the same result. In this case, 6+9 = 7+8.
Then the product will be larger for the pair of numbers that are closer together. So 7x8 > 6x9. That might help you remember which is 56 and which is 54.
You typically see this in a word problem where you are given a fixed amount of fence and you have to enclose the largest rectangular area. The answer is to use a square area (two sides being equal). If the problem has constraints that prevent the sides from being equal, then you pick the length and width to be as close to each other as possible.
In case you want to transfer the geometric intuition to an algebraic proof: If the sum of the two side lengths is 2m, then the two side lengths can be written as (m+n) and (m-n) for some positive n. If you multiply the two, you get (m+n)(m-n) = m²-n². To maximize the product, you need n to be as close to 0 as possible - i.e. for both sides to be as close to each other as possible.
I immediately see the logic in this API. When slicing, I look at indexes as being between elements or at the start (0) or end (length). This gives an in-bounds starting index between 0 and length, inclusive. So if the starting index is in bounds, you get a substring. If it's not, you get no result.
And your answer for Python is not quite correct: "" is falsy in Python, and both of the last two when translated to Python give "null".
What I find weird here is the asymmetry: Ruby apparently allows the end index to be out of range, but not the start index. Contrast with, e.g., Rust's slice syntax, where both endpoints have to be in range, or else it will cause a panic.
Fine, it's 'accepted' in the basic sense that it doesn't throw an immediate error. But it also doesn't return any useful string, as Python would. So you'd need an extra step to feed its output into anything expecting a non-null string.
The inconsistency here is that when you call "abc".slice(2, 10) and get "c", Ruby has implicitly truncated the range to return whatever characters are available, even though it can't go all the way to 10 because the string isn't long enough. But then when you call "abc".slice(4, 10), it doesn't just give you all available characters from index 4 (which would be an empty string), it gives you null instead.
I don't see the inconsistency. slice on Array works the same way. Where is the inconsistency?
> (which would be an empty string)
What other aspect of Ruby would suggest that it is an empty string?
If what you are struggling to say is that different languages are different, then okay. "Japanese is unlike the English I know and therefore is inconsistent" would be a rather bizarre take, though.
Between what happens when the start index is greater than the length of the input, and what happens when the end index is greater than the length of the input. If the end index is greater than the length of the input, it returns a string (as long as the start index is not greater than the length of the input). But if the start index is greater than the length of the input, it does not return a string: it returns null, which is not a string.
My suggestion is that the behavior would have made more sense if it either returned a string in both cases (i.e., if it returned a string even if the start index is greater than the length of the input), or returned null in both cases (i.e., if it returned null whenever the end index is greater than the length of the input).
> Between what happens when the start index is greater than the length of the input, and what happens when the end index is greater than the length of the input.
Again, what makes that an inconsistency and not just a different language?
> My suggestion is that the behavior would have made more sense
On the basis of the start and end indices being equivalent. But are they? What attributes of the language should see us consider them to be?
Maybe they are equivalent, but looking at what other languages do is irrelevant in determining that. If there is nothing else in Ruby to suggest that they are equivalent, then perhaps they are not?
I'm not sure where "care" enters into the picture. It's a computer language. For what reason would emotions be assigned to it?
Underneath the hood that's a C string, and the four points to the null terminator, so it's indexable. And that's why you get an empty string if you point exactly one past the end.
That's why if you put five or more in for the first index it fails to produce a result entirely. I think I might I preferred an exception or a failure code being returned, but I can't say the current design is truly awful.
> That's why if you put five or more in for the first index it fails to produce a result entirely.
Where does this come from? Are these discrepancies stemming from different Ruby implementations/versions behaving differently? "abc".slice(5, 10) returns the same value as "abc".slice(4, 10) [which, curiously, does not return the same value as the original comment] under MRI 2.6.1 that I had handy.
I believe I got it from the book Ruby under the microscope. Which looked at what is now a really old version of Ruby, and if they changed it to make a API more consistent that's probably good.
Apologies, you're correct. I didn't consider the ramifications of printing to the screen with an or. I was trying to get rid of the lack of distinction between `puts null` and `puts ""` in Ruby.
And yes, I also understand the logic of the API; but if you're used to using slice to protect against random NPEs and out-of-bounds exceptions - which is something I do and am used to being able to trust in as a general pattern.
How would you impose these limits on wealth? Where would the extra money go? To the government? If so, would you be okay with the government saying that _all_ future earnings if yours went straight to them because you have too much money already? Would you give anyone that power?
Yeah, I'd be OK with that. It's not like it would actually affect my life in any way whatsoever. We're not talking about the government taking the food out of anyone's mouth.
It's not actually a benefit to the world that we have individuals walking around with enough wealth to purchase, say, one of the major companies that acts as a backbone for communication and information-spreading worldwide. (Of course, it's also somewhat troubling that a single for-profit company can be such a backbone, but that's a separate conversation.) In fact, there's some pretty solid research indicating that it's destabilizing for entire societies to have that level of inequality.
TBH, I think Valve is doing pretty well with both. Steam has now long resulted in a renaissance for indie game marketing and access, and the Steam Deck is incredibly well designed for on-the-go usability.
He might have meant that there were lower-hanging fruits with which he could have written his theses much earlier and he got distracted by a more complex challenge.
I don't take it that way, and I'm deeply fortunate to be living the life suggested by GP. If I get to do what I'm passionate about even if it includes the closely-related grungy part to make it successful (not an altogether different job like marketing) and I am paid enough money to not have to worry about my daily needs and retirement savings, then I have a chance to spend a solid part of my productive day on it, engaging deeply, and building a deeper intuition, all the while not having the personal worries of stability at the back of my mind. My passion no longer needs to compete with my work for my mental energy. And I get to work with talented people who complement my skill, doing the part they enjoy and I don't, to make what we collectively build successful.
That being said, I'm a software engineer, and that's a really fortunate occupation to be passionate above due to the breadth of its applicability (e.g. allowing one to work more closely on my topic of interest) and salary potential.
reply