4,485 karma · joined Jun 30, 2015 (11y ago) · 2,043 submissions
comment 4y ago · link · parent
That's a big shame. But don't knock it until you've tried it.
> And all of those modern functional languages are as fringe (or even more fringe) than Lisp is.
I'm not convinced Lisp is more popular anymore. I've spent the last 10 years being a full time Haskell and OCaml programmer. The killer application is compilers and associated tooling. Almost no one is choosing Lisp for this today. And why would they?
> but let's be honest: programming languages that appeal to mainstream developers
Where do you think the newer mainstream languages are getting e.g. algebraic datatypes and pattern matching from?
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
This is nonsense. Types help us name, categorise, discuss and share abstractions. These abstractions are useful in any language, typed or otherwise. Lisp lives on in its descendents ML and Haskell. If someone doesn't want to learn anything new, then they are themselves "lost to history".
comment 4y ago · link · parent
An object is a term-level construction and therefore is not really comparable to a type. Types can be given to both state and behaviour. For example, a function type describes pure behaviour.
Note that statically-typed OOP languages have a name for the nominal types of objects: "classes". One could say that a class is a type representing both state and behaviour.
comment 4y ago · link · parent
A type (of a term) represents the set of all possible values for a particular term. An "object" in OOP, does not have any formal definition, but is typically a first-class module with mutable state. As such, they can be represented by a term and therefore can have a type.
comment 4y ago · link · parent
Yes but they should also be compositional, one should build larger types from smaller types. This is how we scale to solving difficult problems.
> but currencies are a moving target and needs constant update to handle the quirks of the real world.
This is a separate issue orthogonal to types. The problem of modelling the real world and what models might be more generally useful. No model is perfect, all have trade-offs.
> In my book the string is a great way to store a country of origin
As an implementation using a string sounds pragmatic, but that should not be its type! You should still create a currency type and parse into it. Then you won't accidentally pass an arbitrary string to a parameter that is supposed to be a currency.
comment 4y ago · link · parent
comment 4y ago · link · parent
Nit pick: Python is typically at least an order of magnitude slower than JS, it's a whole different class of slow.
> Developer time also has energy cost in AC, transport, etc for a human.
Yes and fixing bugs in production is especially expensive. Presumably that's why Python is now trying to retrofit static types. There are statically typed languages that are just as terse as Python.
comment 4y ago · link · parent
That's why we have different programming languages. The danger of making a language a jack-of-all-trades is that it will be master of none. Restrictions are more often than not a good thing, they give the power to reason, for both humans and machines (giving, for example, memory safety).
comment 4y ago · link · parent
"Functional Programming" is not a well-defined term. But I would argue that if you are not using pure functions then you have more of a hybrid imperative/functional language, which is fine, especially if you are careful with how you structure your effects. Modern FP languages use monads (Haskell) and/or algebraic effects (Eff) to enable pure functions to describe effects. The pure function is what enables mathematical reasoning and safe function composition.
comment 4y ago · link · parent
That's not really the fault of the Optional. That's Java adding null as value to every type. Java also allows lists of nulls, mappings to null etc. An optional is just a container that stores one item at most. I do agree that it makes optionals less useful in Java. In Haskell and OCaml they are used essentially instead of null.
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
https://www.wsj.com/articles/what-is-the-log4j-vulnerability...
comment 4y ago · link · parent
Log4J has been a major embarrassment for the Java community. I suggest you Google it, if you don't know why.
> It's hard to criticize Spring Core
Spring Core is at best a dynamic (reflection based) band-aid to work around Java's lack of expressiveness. It comes at a significant complexity cost and loss of static guarantees. You cannot both love Spring and Java. So which is it? :)