Any dynamic language - by definition, they check types at runtime.
Or, unfortunately, a lot of static languages. Any static language that allows type casting, for instance - that's the only way they can check whether a cast from a type to one of its descendants is valid (eg, in Java, casting an Object to a, say, URL).
You say that like it's a bad thing, but that's what a static language is - types are checked at compile time and, hopefully, forgotten about at runtime.
But java.util.Date is mutable where a long isn't, and that's a problem. People can mutate a Date from under your feet if they manage to get a reference to it. This has a lot of far reaching implications, but essentially, unless you protectively copy all values of type Date you get or give, you can't trust your own internal state. You can't write a legal equals or hashCode implementation that uses a date field. The list goes on.
I would say that rather depends on what OP means by "properly".
If OP already knows Scala and would like to get better at it and one assumes that "Scala as Haskell in the JVM" is more desirable than "Scala as a better Java", then yes, that's a great suggestion.
If OP wants to learn Scala from the ground up, I disagree pretty strongly with starting there. It's a great book, well written, with a wealth of challenging and mind-opening exercises, but I wouldn't recommend that as anyone's first exposure to the language. The second or third, sure, but it purposefully restricts itself to what its authors consider a sane subset of the language.
I happen to agree with their definition, but, in my experience, knowing a programming language is about reading it as well as writing it, and by restricting your learning to a subset of the language, you'll find yourself unable to understand perfectly valid, normal code - code that is part of the standard library, for instance.
I would rather suggest reading Odersky's book while allowing oneself to skip large chunks that go rather in too much details about fairly useless things like the XML API. Or going through scala-exercises (https://www.scala-exercises.org). Or the coursera class - its first incarnation was pretty good, I assume the new one is at least of the same caliber. They might not make you an expert overnight, but they'll get you to know most of the Scala features you're likely to encounter in the wild, and to be able to read and learn from most Scala OSS projects.
I actually learned Scala from this book, and the only languages I had used in production before were Python and Fortran. I don't think learning the functional subset first made it harder for me to learn the object-oriented and imperative parts later on. Plus, understanding the functional subset gives you a better understanding of many of the internals, such as what `for` comprehensions are actually doing.
Of course, if you just read one book and stop there, I'd agree. But most people will continue learning from tutorials, videos, stackoverflow, etc.
I've also seen several other people learn Scala this way, usually without knowing any functional programming before, and really haven't seen any signs of issues wrt not understanding code written in other styles.
What do you mean, you should not be testing internal implementations anyway? Does that also mean you don't do unit test, only integration or end-to-end ones, because unit tests are tests of the internal implementation of your software?
Not quite – most projects have internal interfaces which are relatively stable, and tests should be against those, rather than the internal implementation of those modules.
Unit tests are great, but they should still be testing at the boundary of code modules – if changing the internal implementation of that module breaks a test, it probably isn't testing at the correct level.
He means you test pure functions and mutations. You dont stub data sources that your implementations use to see if they were called. tests need to be about enforcement of correct interface exposure. not exact implementations. its one of the most facepalm types of useless testing that ive seen littered around Amazon's Seattle teams due to these Indian managers wanting to make sure the data sources called in every method actually got called and that there is 100% coverage. serves no purpose except to basically make two copies of the code..the test as a doppleganger of the actual code but using stubs.
Or, you know, write property-based tests instead, so you only need to worry about the logic and not the test values.
I've always found that if you let the author of a piece of code decide on what value that code should be tested with, he'll test for the edge cases that he's thought of (and dealt with), not the ones that actually crash production.
I think both are important. Use property-based tests to fuzz for mistakes you might have made. Use hardcoded value tests to ensure that common future breakages of edge cases are caught, and to validate that your property-based tests are even doing anything.
Usually, property-based tests are more complex, which means that the chance of an logic error in the test increases, and having something easy to verify hardcoded brings peace of mind.
On the other hand, if you ask the author to think of the edge cases first, they're more likely to list them and then write code that handles them. Still no guarantee, but better than writing tests for code you just "finished".
But still, you end up with tests for what the author feels his code should handle, not necessarily what the real world is actually like.
Don't get me wrong, that's still valuable - if only for the non-regression aspect - but I feel property-based testing is a superior approach.
Write your code ("this is a function that sorts lists of ints"), write a property ("when given a list of ints, after sorting it, elements should be sorted and the list should have the same size"), let the framework generate test cases for you. Whenever something breaks ("lists of one element come back empty"), extract the test case and put it in a unit test to make sure the same issue doesn't crop up again in the future.
I thought the concept entertaining, up until I read the bit about "rape causing little to no long lasting harm to the victim". Shame, this could have been a fun, if weird and selfish, thing.
Consider that the author writes "they point to" which implies it's a universal among MGTOWs. Is it really a tenet of MGTOW belief? Is it likely that a large number of people feel that way? I doubt it. It sounds like an extreme minority opinion.
It's the opinion of one poster named "Supremo," yet the author presents it as the opinion of the MGTOW movement.
And if you read the responses, you'll find many people disagree with it.
So don't let this single, secondary source make up your mind for you. Do your own due diligence.
Any movement, tendency or idea that seeks to "change things" is always immediately attacked with suspicion. Think of when the iPod or Dropbox came out! It's just people testing the authenticity and sincerity of the beliefs.
I clicked on the link given in the article and read the opinion piece and the following comments. From my reading, this article totally misrepresented the views of the community on this issue.
Yes, the person who wrote the opinion piece linked to made that exact argument, but many of the commenters disagreed and said the crimes were as bad as each other.
So saying this is one of the views of the group as a whole seems disingenious at best. At worst, a blatant lie.
As a disclaimer - I have never heard of this group before so have no skin in the game.
To quote that in its entirety: “[Rape] ends in just a few minutes with little-to-no harm caused to the victim. Meanwhile, false accusations of rape have a long-term and much more devastating impact on the victim.” - That's really sick.
Yeah, and burglary ends in a few minutes with the victim not even being there. Meanwhile, I have friends who now are having trouble sleeping just because of the mere idea of violation to their personal space.
I don't know what the author was thinking writing the above, but wow.
The author showed his or her bias with this. There are lots of sexists and idiots on the internet talking about anything. It's fine if the author wanted to discuss systemic issues of sexism in MGTOW, but quoting a single douchebag like he somehow speaks for all men learning MGTOW is stupid.
I agree with part of your sentence only. Managers, especially professional ones (as opposed to ones that were promoted from the kind of position they end up managing) do tend to push for client-facing features with little thought to the accumulating technical debt.
It's been my experience, however, that when left to their own devices, developers tend to either learn new things or refactor code that's getting too hard to maintain. And both are important, critical even, but certainly no help in getting up to date documentation, fixing "painful" bugs, or writing good tests. In fact, they can even be counter-productive in that respect: heavily refactored code will invalidate at least part of its documentation and tests.
Or, unfortunately, a lot of static languages. Any static language that allows type casting, for instance - that's the only way they can check whether a cast from a type to one of its descendants is valid (eg, in Java, casting an Object to a, say, URL).