Re Iridium satellites: unfortunately, they are being replaced by a new generation of satellites which do not produce flares and thus likely won't be seen by the naked eye anymore. Source: https://heavens-above.com/IridiumDemise.aspx
It's an error only when the 'when'-expression is used as a value, like assigned to a property, passed as an argument or returned from a function. Otherwise it's not an error. There's also a warning for matching enum values over an incomplete set of enum entries, but otherwise non-exhaustive 'when'-expression is green code.
You can basically consider 'when'-expressions to be syntax sugar over Java's if-else or ternary operator (?:) chains.
No, as I mentioned, only those 'when'-expressions, the result of which is used as a value, must be exhaustive. Those which are not, we call them 'when'-statements, correspond to an if-else chain in C-like languages and thus are not required to be exhaustive.
I think you are falling into the mistake of associating what you call design with features. How features are implemented and how consistent they are with some pure notion of their role is secondary to how they serve the high-level design goals. Once you understand Kotlin's design goals you see that the features and their implementation make a lot of sense. If you think the features aim to serve another goal, then the features might seem inconsistent. Outside of academic languages, language features exist to serve particular purpose, and so their "academic" form may be compromised to serve that purpose better. There is no point in isolating features from their purpose and then arguing over them without first understanding their goal in that particular language, as the same feature can serve different (or subtly different) purposes in different languages, or a feature must be twisted in order to allow the goal to be better achieved. There is no way to say whether a feature is good or "broken" without first analyzing the language's goals, and a feature that may be bad in one language may be great in another.
As Scala (or Ceylon) has such radically different goals from Kotlin, it doesn't make much sense to discuss which features were imported and how without first understanding the why. Kotlin's designers didn't say, "I like this Scala feature but not that one"; they said, "we have this goal and this Scala feature serves it but that one doesn't". A language is not measured by what features it has, but by how those features serve its goals, and whether those goals are appropriate to begin with (i.e. provide a good cost/benefit ratio).
Have I done something to offend you? Because you are being extremely rude. You are entitled to think whatever you want about my ramblings, confused or otherwise, and you are even entitled to not try to understand them or even read them at all. But your outbursts are inappropriate. Continue expressing yourself in this way and you will be banned from HN.
What's broken about extension methods? I have zero experience Scala and about a week's worth of experience with Kotlin, but so far I'm finding extension methods to be pretty straightforward and useful. What am I missing?
Extremely poor cost/benefit ratio for what purpose? If your main goal is to adopt existing classes and libraries as your own (i.e. without any loss of functionality compared to language-native libraries), then extension methods obviously have an extremely high cost/benefit ratio. You can't analyze a feature in isolation of the language's goals. Features exist to serve a purpose, and are measured by how well they serve it.
To give an analogy, a shoulder-fired missile might have a terrible cost/benefit ratio if you're trying to hunt an antelope, but if you're trying to disable a tank, then I'd say it's cost/benefit ratio is pretty good.
Could you please explain how the internal representation of null in the language's type system has any effect on the semantics of code written in that language?
Sure. So I'll give you one very over-simplistic example. Let's assume that T is an unknown type (a type parameter).
You can form types like Object&T, and if T is an optional type of form S|Null, then that is reduced automatically to the type S by the typechecker. But if T is not an optional type, then it just remains T.
Very useful to be able to do this kind of trick in generic code.
And note that nothing here was using any special reasoning about Null: this is all just the totally generic reasoning for union types in general.
Null in Ceylon is just another type, and nullable-X is just another union type, so you can use them sensibly with generics. With Kotlin if you want to write a generic method like "add two values" and have it handle nullness polymorphically then you have to think about it.
Running, especially when heavy or overweight puts a lot of stress on your joints, most notably the knees. The effect is worse when you're untrained and don't have a proper technique. Swimming does not, since your body weight is suspended by the water.
"There are caveats, though, especially for people who have suffered significant knee injury or are overweight."
Sure, in moderation it's a small net gain, but few are the correct weight, without injury, and run in moderation.
Note: Simply being tall can have the same effect as being overweight and shorter. The knee supports 3d volume on a 2d surface so it has scaling issues. There is a significant peak load difference between a 5'2" runner and a 6'2" runner.
Edit: "We know from many long-term studies that running doesn't appear to cause much damage to the knees," vs. "In one study, Swedish researchers found that exercise, including jogging, may even be beneficial." So, at best "if you have a relatively normal knee and you're jogging five to six times a week at a moderate pace, then there's every reason to believe that your joints will remain healthy." Which is hardly the same things as saying running is not harmful.
"Is there a causal relationship between running and osteoarthritis? The current data are based on small studies, and their results are often unclear."
I've previously come across the cited studies by Lane, "at 9-year follow-up, the results were the same; there was no difference in the incidence and progression of knee and hip osteoarthritis in runners and nonrunners", but had not seen Sohn's comparison of college varsity runners and swimmers, "There is no association between moderate longdistance running and the future development of osteoarthritis. Furthermore, the evidence suggests that neither heavy mileage nor the number of years running are contributory to the future development of osteoarthritis."
On the other hand, Schmitt et al found that "Osteoarthritis of the knee joint is rare in former elite marathon runners. The risk of osteoarthritis of the hip joint seems to be higher than in control subjects who do not engage in much sport."
"The current evidence in persons who participate in elite sports activity, particularly in sporting groups susceptible to joint injury, suggests that these groups are at increased risk for OA as a result of their participation, but it is unclear whether participation in the absence of injury is harmful. "
Weight and other health issues are a massive and hard to control for Confounding variable in most of these studies. Osteoarthritis causes (weight, injury, bone misalignments etc.) are also likely to inhibit running. At the same time running increases the risk of injury.
Note: Most of these studies are also talking about jogging not running as running is shown to cause damage.
However, from your link "Researchers22 found a significantly higher incidence of osteoarthritis in men (aged 20–49 years) who were involved in high levels of physical activity (ie, walking or running more than 20 miles per week). "
It messes with your knees and heel. When you take a step during a run, your leg lands with your entire body slamming into it.
There are ways to run that are less damaging (better equipment, like socks and shoes, or using the technique where you largely only make contact using the balls of your feet), but it doesn't change the fact of a shock happening.
That said, it's unlikely to be so damaging to you as to outweigh its benefits. Swimming is better mostly because water has less resistance than the ground, and pushing off isn't really a shock to anything.
I looked into this quite a bit some years ago and found no research to suggest more cushioned shoes, less cushioned shoes, pronation-control shoes, barefoot running, etc. have any effect on injury rates. Are there recent studies or info that I missed on this topic?
> it's unlikely to be so damaging to you as to outweigh its benefits
It's even possible that all the shock and load bearing of running /is/ a benefit.
Running is associated with acute injuries of all sorts, but as others have commented does not correlate with osteoarthritis or other long term injuries.
In fact Kotlin doesn't have reified generics. This idea was planned in the beginning and was reflected in the old docs but abandoned later. I believe there's no reference to reified generics on the new web site anymore.
Not sure why they conclude that "bergamot essence may induce muscle cramps" etc based on a single case. What if the man had an allergic response of some kind and 99.99% of the population would be fine drinking so much earl grey tea?
Because the proposed mechanism has nothing to do with histamine or immune response. Such a K+ channel blocker should hypothetically have the same effect in the vast majority of the general population.
Hypothetically if a person did experience myalgia as a direct result of drinking Earl Grey tea and their proposed mechanism is accurate, the treatment would probably involve K+ channel opener with a lower K_d (higher affinity) than the culprit bergapten, perhaps Diazoxide.
I don't think they are drawing those conclusions from this case. They appear to be pointing out that these are known reactions, based on the references.
Really, they are just reporting the surprising fact that it is possible to overdose on bergamot by drinking a large, but not unreasonably so (at least by UK standards), quantity of tea.
This of course is only one case report, so one should not assume that one needs to drink 4L of Earl Grey to induce these symptoms. I typically drink about 2L of tea per day, yet 2-3 cups of Earl Grey makes me feel nauseated. I've never had cramps or vision problems, but that's probably because I stop when I start feeling ill. This is good to know for future reference.