4,485 karma · joined Jun 30, 2015 (11y ago) · 2,043 submissions
comment 8y ago · link · parent
comment 8y ago · link · parent
In Haskell you could always avoid that style and use the case syntax (or for this example guard syntax) instead. All varieties eventually desugar to a case analysis anyway. Haskell even added curly braces as an alternate to indentation!
comment 8y ago · link · parent
comment 8y ago · link · parent
comment 8y ago · link · parent
comment 8y ago · link · parent
comment 8y ago · link · parent
comment 8y ago · link · parent
Complex business logic really has no place in Go. I would advise people to use more expressive languages (ideally with a modern type system). Go was designed for low-level network systems programming and is not well suited to more high-level problems, despite what the hype train might claim. I see the future as a polyglot one. Folks should use the most appropriate language for whatever domain they are currently working in and not let their careers be defined by any one language or technology.
comment 9y ago · link · parent
comment 9y ago · link · parent
http://www.theguardian.com/news/2017/nov/06/apple-secretly-m...
comment 9y ago · link · parent
No they don't. They employ offshore tax havens, shell companies and exploit various loop holes in order to avoid doing so. It's lawful yes. But it's immoral and unfair to smaller businesses who do pay their share. Buying an iPhone in Europe means less money for infrastructure, schools, hospitals and universities. The iPhone itself piggybacks on decades of tax funded research and development, yet Apple do not contribute back.
Apple are of course one of many corporations that employ these practices, but they are the largest and often market themselves as being ethical.
comment 9y ago · link · parent
But does it? Can I even use e.g. a Scala collection from Java? (let alone Clojure, Kotlin, etc) Certainly it looks easy to import and use Java objects, but that looks to be the extent of it.
> it couldn't be statically known at compile time in the case where a library written in Scala is being called by code that was written at a later date
When you build some new code that uses an existing library, any parametric polymorphic type variables get instantiated at the use sites. Where I admit this isn't true, is the adhoc polymorphic dynamic dispatch via subtyping, but this wasn't given to me as an example. I don't see that ArrayLists and ADTs should present a problem.
> types still cannot be statically known in cases where you're being handed objects whose type is not determined until run time
Again, I think you are referring to dynamic dispatch here? I agree this could be a problem in open class hierarchies. But the ADT encoding in Scala is a closed statically-known hierarchy, so I can't see why it has to cause problems. Truly "generic" or parametric polymorphic code should not depend on type tags or even be allowed to introspect the runtime type, doing so violates parametricity, which ultimately reduces our ability to reason about the code.
comment 9y ago · link · parent
Perhaps Java interoperability is the reason for the choices Scala made, but it doesn't appear that e.g. Scala collections can be used from Java?