10 ms·
Type checkers are an automated solution for the problem of not having good teammates. If you don't have that problem you won't benefit that much from type check
by sebastianconcpt 11y ago
Type checkers are an automated solution for the problem of not having good teammates.
If you don't have that problem you won't benefit that much from type checking and might have many other huge advantages.
- boothead 11y agoThat's nonsense frankly. I've worked with an excellent team of Haskellers before I don't think we'd have been anywhere near as good without the type system. I'd agree that having an awesome team gives you a lot of other advantages, and actually FP is a huge opportunity to build that team for start ups. FP tends to attract the kind of people who make up a great team. It's for this reason that I think the conclusions of the flub paradox article are wrong http://steved-imaginaryreal.blogspot.co.uk/2015/06/the-flub-paradox.html http://steved-imaginaryreal.blogspot.co.uk/2015/06/the-flub-...
- michaelochurch 11y agoI'd agree that having an awesome team gives you a lot of other advantages, and actually FP is a huge opportunity to build that team for start ups. FP tends to attract the kind of people who make up a great team. Yes, absolutely. It's amazing how overlooked this fact seems to be, by many. Languages aren't that hard to learn, so excluding the really awful ones (e.g. Java for anything other than code that has to be on the JVM and has to be fast) the "familiarity" aspect is minuscule. Programmers learn new languages quickly. What does matter is the community and the quality of programmer you'll attract based on the tools you use and the signals that your tools send about who makes decisions.
- jstuxx 11y agoWhy is Java one the of really awful ones? I know Java is not the best language, it's not my favorite language, but I wouldn't say its really awful.
- kyllo 11y agoTwo words: no functions.
- jstuxx 11y agoJava has functions one word "static".
- kyllo 11y agoYou can't pass a static method as an argument to another static method. You can't write a static method that returns a static method. You can't partially apply a static method. Static methods are not functions.
- sebastianconcpt 11y agoYeah, it do not have closures
- notduncansmith 11y agoI think Kyllo was referring more to first-class/higher-order functions. I believe Java 8 added support for lambda expressions, but it's nowhere near the same thing.
- sebastianconcpt 11y agoI think so too and agree about the power of being consistent with first class things (functions in this case)
- RazvanPanda 11y agoJava 8 does have functions as values/lambdas
- jstuxx 11y ago
- sebastianconcpt 11y agoThanks for the downvotes, I was referring to things beyond FP. The type system is a set of early restrictions (as opposing to late restrictions or runtime or late bound). But now you mention it, I'm curious about if you think the type checker allowed you and your team to reach the goals of the project faster or not.
- dllthomas 11y agoI had a system in C, with a goal of extremely low latency. This involved a small collection of threads, each serving a different role. Project goals would periodically change, and I would find myself needing to move some functionality from one thread to another. With some creativity, I was able to enlist the help of the type checker in assuring that a particular function ran only on a particular thread. This sped me up tremendously, as my tooling would point me to inconsistencies rather than having to reason them out myself.
- boothead 11y agoSometimes restrictions are useful... Aside from that in Haskell the type system isn't usually a restriction. Experts in Haskell tend to use the type system to guide them towards a correct solution. I'm not sure it possible to say that we couldn't have built something quicker in another language or stack. What I will say was that the underlying abstraction that we built our system on (streams of events) is very well suited to a Haskell implementation, and I can say with some certainty that building a solution that is as "correct" as the one we built would have been extremely challenging. The code also held together for longer than has been my experience in some other languages and communities.
- dmead 11y agothat is static typing FUD. if it takes you a few days or weeks to learn to use the type checker and it saves you from expensive runtime errors later, then whats the problem?
- chimprich 11y agoThe problem is the overhead in adding typing. The time taken to learn the type system is a one-off but static typing has running costs in slowing down development, discouraging exploratory programming, extra cognitive load in reasoning about the type system, and "false positives" in disallowing otherwise correct programs. It does nearly eliminate a class of bugs - this is wonderful, but the bugs it does eliminate tend to be ones that are fairly obvious to find.
- erdeszt 11y agoDo you have any evidence to prove this? I've read a few papers that disagree with your opinions...
- Skinney 11y agoProbably based on personal experience. For me, whenever I start a project from scratch I usually start with the most dynamic environment I can find, then hack away until I have something that resembles the functionality I need, before locking it down. In the beginning of a project I don't care if something is 100% correct, I just want to see what my idea looks like, and what I actually need. I don't want to deal with synchronizing my types with a database schema, or make sure the JSON I send to the server satisfy the type system. I really don't care about interfaces or abstract classes or whatnot, I just want to retrieve the value I know to be in the object I got. Then, when I have a working'ish prototype, I can start nailing it down with types, assertions, tests and contracts. Of course, people are different. Some people do all of this on paper before writing a single line of code. Others plan by making types and interfaces, then proceed to implement those. I just like making prototypes.
- 11y ago
- logicchains 11y agoEven the smartest teammates in the world won't protect a program from that idiot who wrote all the code in my personal projects. Good type systems minimise the damage that he can do.
- sebastianconcpt 11y agoI get your point so type systems are a protection for bad hires, a perceived as defense mechanism on code. But things should never reach not even close to that point.
- zak_mc_kracken 11y agoI don't think you understand the benefits of type checkers. Here are some: - Catching at compile time errors that would otherwise happen at runtime - Performance - Occasionally, it can enable making your code mathematically, provably correct - Maintainability and flexibility in the sense that the code is easier to read by future hires - And the most important advantage of all: automatic refactorings. Without that, the code base rots because developers are afraid to refactor since doing this without errors on a dynamically typed language requires a lot of tests, which nobody really has. Even renaming a function cannot be done safely in a dynamically typed language and it requires the oversight of a human
- sebastianconcpt 11y agoI know of at least 3 dynamically typed systems that can rename a method automatically in the whole system in one click. And move instVars to super and other tricky things like that before Eclipse was in the womb. I'm talking do those refactorings in year 1999.
- amttc 11y agoAs much as I love dynamic languages, I have to disagree friend. :( Static typing confers more benefits than just enforcing a self-documenting type check on your code. It adds a level of expressiveness about datatypes to match the expressiveness of the algorithm itself. This is especially true in languages like SML or Haskell where the type system lets you describe the data you're working with in a pretty precise way. Dynamic langs have lots of good qualities to them, but every tool has a drawback. Tests, documentation, good team dynamic, etc. hedge against some of the disadvantages of a dynamic language. They aren't a panacea.
- TheCoelacanth 11y agoType checkers are an automated solution for having a human brain.
- nmrm2 11y agoOf course, so are calculators :-)
- jcromartie 11y agoJust like hand-washing is for doctors who aren't cleanly people.