News for hackers. Stuff that matters.
Re:Everyday hassles in Go by jondubois on Tuesday December 30, 2014 @10:13AM (#8814883)
Statically typed languages impose unnatural hardware-oriented constraints on your business logic - It forces you to spend extra time and effort to make sure that your logic is in a format which the compiler can understand.

Yes, this can sometimes help you to find silly errors in your code at compile time (and thus occasionally save you a bit of time) but, unfortunately, that occasional benefit doesn't make up for the productivity loss incurred from constantly trying to 'please the compiler'.

Dynamically typed languages offer fluidity in your logic where it is needed. For example, if you add an integer and a decimal (floating point) number together, there is nothing wrong about this mathematically, but a static compiler will complain! It's a limitation of the compiler not the programmer!

Statically typed languages force you to implement rigid class/type schemas within your logic (sometimes with complex hierarchies) - These schemas have to be significantly reworked whenever your business requirements change.

Re:Everyday hassles in Go by muraiki on Tuesday December 30, 2014 @10:21AM (#8814904)
I'm not trying to be insulting, but did you read the article? From what you've written, it sounds like you haven't actually used an expressive type system.

For instance, in Haskell I can type 2 + 3.75 and I get 5.75 right back -- no errors. That's because the type signature of + is "Num a => a -> a -> a," meaning I can add two of any type of Number (Integers and Floats are both Numbers, of course).

Re:Everyday hassles in Go by ufo on Tuesday December 30, 2014 @10:37AM (#8814965)
Actually, I see having to rework the type schema when the requirements change as a plus, not as a con. In a static language the compiler can point out all the bits of the program that need to be updated to conform to the new schema while in a dynamic language this kind of stuff is usually only detected at runtime.
Re:Everyday hassles in Go by theseoafs on Tuesday December 30, 2014 @01:36PM (#8815918)
Have you never used a statically-typed language? Most statically typed languages can handle adding an integer and a float together. The only one I can think of that isn't capable of that is OCaml, though this is probably a strength of OCaml rather than a weakness (int-to-float casting can be a common source of bugs if it happens unexpectedly).
Re:Everyday hassles in Go by jondubois on Tuesday December 30, 2014 @08:00PM (#8817767)
Try to add an int and a float32 using 'Try go' on http://glolang.org - I get this error:

prog.go:13: invalid operation: x + y (mismatched types int and float32) [process exited with non-zero status]

I'd have to cast one of the variables to get it to work. Casting is unnatural - Maybe it's not so bad in this case, but in many cases it isn't desirable.

Re:Everyday hassles in Go by ufo on Tuesday December 30, 2014 @03:08PM (#8816453)
In Ocaml's case its less about casting being a source of bugs and more about casting not playing well with Hindley-Milner type inference, which is Ocaml's "killer feature". (and Ocaml doesn't have type classes to solve this problem like Haskell does)
Re:Everyday hassles in Go by Peaker on Tuesday December 30, 2014 @03:10PM (#8816465)
I think you should spend some time familiarizing yourself with actual statically typed languages before expressing an extremely ill-informed opinion as fact.
Re:Everyday hassles in Go by codygman on Tuesday December 30, 2014 @03:02PM (#8816413)
Your comment certainly doesn't apply to languages with expressive type systems.