3 ms·
I'm not sure many languages support the introduction of types such as: * An integer that is sum of two primes. * A string that is created between the hours of
by ReflectedImage 4y ago
I'm not sure many languages support the introduction of types such as:
* An integer that is sum of two primes.
* A string that is created between the hours of 2 pm - 4 pm on a Tuesday.
* A dictionary who's fields comprise a valid tax return.
What do you mean by future proving? If the new version of the code doesn't ship by 2 pm today, the company goes bankrupt and there is no future for the code.
- naasking 4y ago> I'm not sure many languages support the introduction of types such as: Any language with types can enforce any proposition you can reliably check, which you run as part of the type's constructor. There are multiple ways to do this, for instance in pseudo-ML: > * An integer that is sum of two primes. type SumOfPrimes fn sumOfPrimes : Prime -> Prime -> SumOfPrimes type Prime fn primeOfInt : Int -> Maybe Prime > * A string that is created between the hours of 2 pm - 4 pm on a Tuesday. type Tuesday2To4String fn whichString : Clock -> String -> Either String Tuesday2To4String > * A dictionary who's fields comprise a valid tax return. type ValidTaxReturn fn checkTaxReturn : Dictionary String String -> Maybe ValidTaxReturn > What do you mean by future proving? If the new version of the code doesn't ship by 2 pm today, the company goes bankrupt and there is no future for the code. Shipping broken code will not save the company from bankruptcy. It's also a myth that dynamically typed languages will get your code out faster.
- ReflectedImage 4y agoI'm not sure how you intend to check the creation date of a string in memory since there is no information available to do that or that a tax return is valid given the thousands of rules involved. Nevertheless let's move on. It's not a myth, if you are using dynamic typing you will get three times the number of features out the door as someone who uses static typing. It's just a fact. 1 dynamic typed programmer = 3 static typed programmers in productivity and output. That is why people use dynamic typing. From a commerical perspective, static typing does not make sense in most cases. You need something more than a typical business CRUD app to justify it. Usually you only need static typing for performance reasons. Like for a video game or image processing. In practice, the shipped code doesn't have noticably more bugs. That just something which people who have never used dynamic typing properly like to believe. If you ever read an article by Eve online where they say Python is their secret weapon or watched what Discord did by implementing everything in Python first. You will understand.
- naasking 4y ago> I'm not sure how you intend to check the creation date of a string in memory since there is no information available to do that See the signature of the constructor function I provided. > or that a tax return is valid given the thousands of rules involved. Tax software does it every year. Clearly the government has an effective procedure to decide the validity of a tax return, even if that procedure is executed by a human. > It's not a myth, if you are using dynamic typing you will get three times the number of features out the door as someone who uses static typing. It's just a fact. That's just laughably false. There is zero empirical evidence supporting this claim. > In practice, the shipped code doesn't have noticably more bugs. That just something which people who have never used dynamic typing properly like to believe. No True Scotsman fallacy.
- ReflectedImage 4y agoA signature of a function is very different from it's implementation. "That's just laughably false. There is zero empirical evidence supporting this claim." There is a reason all the startups are using Python. Just ask Eve Online or Discord. Dynamic typing is great for getting products to market fast. Neither of them have problems with too many bugs. What you are saying doesn't even make sense, since you would just increase your QA budget if it increased the rate of bugs. So how in earth could the end user see more bugs? Dynamic typing has an issue but that issue is code performance. Eve Online gets slow downs during massive battles and Discord rewrote parts of their interface in Rust to save on server costs.
- naasking 4y ago> There is a reason all the startups are using Python. Show the evidence that "all the startups" are using Python.
- ReflectedImage 4y agoWhy don't you go argue with an empirical study on the topic instead of me? https://games.greggman.com/game/dynamic-typing-static-typing/ https://games.greggman.com/game/dynamic-typing-static-typing... Because all the studies say that dynamic typing reduces development time without increasing the number of bugs.