Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Google Dart
#6
Spaz Wrote:Not only does it prevent a large class of bugs, it makes it much easier for both humans and computers to reason about the code. Static typing means you can have an IDE with real autocompletion, which is a big productivity boost. Static typing makes code much more self-documenting.

Static typing helps with autocompletion, but programming is rarely just writing - most times understanding what code does, or trying to express some sort of idea in the programming language is far more critical. If you have to think in types from the beginning, it may (or may not, probably depending on who you are) hinder you from finding the solution fast. It does prevent some bugs from happening at runtime, there's no doubt about that. But saying it helps reason about code is kind of like saying that guard rails helps you drive better: If you've made a function which multiplies two matrices, you don't write in the documentation that it "Takes in two two-dimensional arrays of type int and returns a new two-dimensional array of type int which is the product of the two arrays if they were to represent two matrices.", you rather write that it "Takes in two matrices and returns the product of them.".

(And excuse me for totally derailing the thread.)
Reply


Messages In This Thread
Google Dart - by Spaz - 2011-10-21, 11:11 PM
Google Dart - by Nikkey - 2011-10-23, 05:33 PM
Google Dart - by Spaz - 2011-10-23, 07:10 PM
Google Dart - by Nikkey - 2011-10-23, 07:40 PM
Google Dart - by Spaz - 2011-10-23, 08:26 PM
Google Dart - by Nikkey - 2011-10-24, 01:44 PM
Google Dart - by Spaz - 2011-11-07, 11:42 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)