If time is important, then language proficiency is more important than the dynamic/static choice. You don't want to learn the in-and-out of a language in the crunch time of delivering a product.
"Now if you are raging to some serious dubstep, its easy enough to miss that small typo, you go screw it and do it live, and deploy to production. Python will simply create the new variable and not a single thing will be said."
Erm... Did the author test this code before making this assertion?
>>> def get_first_problem(problems):
... for problem in problems:
... return problam
...
>>> get_first_problem([1,2,3])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 3, in get_first_problem
NameError: global name 'problam' is not defined
maybe he updated it? now it shows is an additional line:
def get_first_problem(problems):
for problem in problems:
problam = problem + 1
return problam
but there's nothing wrong with this, I assume he meant to return problem instead of problam which would produce an unexpected result without having added 1. Nothing a unit test wouldn't catch though :)
"Standard ML, Objective Caml and Haskell have purely static type systems, in which the compiler automatically infers a precise type for all values. These languages (along with most functional languages) are considered to have stronger type systems than Java, as they permit no implicit type conversions"
That chart is just plain bizarre. He appears to have placed languages randomly without even bothering to google the languages first to get even a vague idea of roughly where they might belong. I don't think he actually managed to get any of the language listed in approximately the correct area on the chart.
If you're asking this question this early, you're doing it wrong. Just code in whatever language you like and can pick up quick, build a product, talk to users, and iterate.
> Dynamic languages are languages that don’t necessarily need variables to be declared before they are used.
Not exactly true. You do need to declare variables in some dynamic languages (var in JavaScript, for example), but you don't need to declare their type.
Anyhow, the whole question is a little irrelevant. The language you pick for your startup is among the factors least important to its success. Just pick a reasonable language that you are productive with, that has library support for the stuff you need, and that works well on the operating systems you care about, and that will be fine.
You do need to declare variables in some dynamic languages (var in JavaScript, for example)
You can declare variables in JavaScript, but you don't need to. JavaScript is bad example here, as the var keyword is not really used for declaring but for scoping the variable.
You're doing it backwards. You didn't get to choose the language, you use whichever language has the best libraries/frameworks for your problem domain.
The definition given for dynamic and static languages is not very good. The main difference is that a statically typed language has type checks preformed at compile time and a dynamically typed language has them preformed at runtime. My intro CS professor had a really good explanation for this: in a statically typed language, the variables have types where in a dynamically typed language, the values have types.
Also, his graph of languages doesn't really make any sense at all. If he just kept it as a division into groups, it would make sense, but it really looks like he's trying to say that C++ has a "weaker" (whatever that means) type system than C or that Haskell has a "weaker" type system than Scala.
Also, static typing is not always for robustness; it can also increase performance. C is a perfect example of this--it is one of the easiest languages to write bugs in but is also really fast.
Overall, I was not terribly impressed with this article--it gave poor definitions and little new insight (as far as I could tell, it just reiterated the same old cliches about static vs dynamic types without any anecdotes, experience or advice).
Not impressed either. It also repeats the misconception that statically typed languages make it harder to do exploratory development. But with type inference, not only do I not have to define my variable types up front, the type checking makes it very easy to explore and refactor code,
especially when the exploration involves changing the types.
Add in the ability of haskell to let you write your own control structures and do higher-level programming, and I find myself exploring and refactoring my code much more than I do when using a dynamic language.
If you would have read the article; clearly states what you said in the first line of your comment. Also your professor maybe right, the distinct is less clear when stated in those terms.
It was never said that static typing is for robustness it does decrease the occurrence of runtime errors.
I think the overall point was just to give insight on what people don't consider when making a programming language choice.
This discussion is missing two key things: Go and Dart. They both combine the best of static and dynamic languages. There is no need to choose, you can have the best of both worlds, without the disadvantages.
I'm using Go right now, it is amazing, blowing both Python and C# out of the water, with speed of development, robustness and maintainability.
Nitpicking, perhaps, but I really would like the author to motivate why Haskel (sic!) is more weakly typed than say Ruby, Java or C#? Not sure how Ruby is less dynamic than Python either (besides the fact that his definition doesn't really admit a sliding scale), but that might be my relative inexperience with the languages showing.
No, you're exactly right. The author defines "weakness" versus "strongness" as whether you can do something like "int + array" and get a result other than a type error. ECMAScript is very "weak". Haskell is ridiculously "strong" by this definition, since you get a type error for computing "(1 :: Int16) + (1 :: Int32)". As far as stricter languages go, there is perhaps only Ada.
There are two kinds of language comparisons I've seen:
1. Language comparisons posted by dabblers, which you could scrape together by reading Wikipedia. You see a lot of poor logic and unsatisfying definitions, because if the logic were sound and the definitions useful, a dabbler would never have enough expertise to write the post.
2. Language comparisons by experts, which restrict the discussion to history, the underlying logic of type theory, or empirical observations about a small set of languages.
Your startup should go with "what works." The exact definition of what works varies for each person/company, but here's a list of things that aren't in it:
* Languages that entirely lack the needed libraries to perform a library-intensive task. (e.g. a CRUD web app in C++)
* Languages that you do not know
* Langauges that you only want to use because they're "hip" right now
funny, I've been writing haskell for years and don't remember "declaring" any variables even though its static and strict. author needs to check his definitions.
27 comments
[ 3.1 ms ] story [ 49.5 ms ] threadWhen you are cash strapped, speeding up time to market often becomes the number one priority.
Erm... Did the author test this code before making this assertion?
Edit: formatting
Or alternately how F# is less static than Haskell or weaker than Scala?
Or am I just reading too much into the chart?
The graph makes no sense to me.
http://en.wikipedia.org/wiki/Strong_typing
Not exactly true. You do need to declare variables in some dynamic languages (var in JavaScript, for example), but you don't need to declare their type.
Anyhow, the whole question is a little irrelevant. The language you pick for your startup is among the factors least important to its success. Just pick a reasonable language that you are productive with, that has library support for the stuff you need, and that works well on the operating systems you care about, and that will be fine.
You can declare variables in JavaScript, but you don't need to. JavaScript is bad example here, as the var keyword is not really used for declaring but for scoping the variable.
Also, his graph of languages doesn't really make any sense at all. If he just kept it as a division into groups, it would make sense, but it really looks like he's trying to say that C++ has a "weaker" (whatever that means) type system than C or that Haskell has a "weaker" type system than Scala.
Also, static typing is not always for robustness; it can also increase performance. C is a perfect example of this--it is one of the easiest languages to write bugs in but is also really fast.
Overall, I was not terribly impressed with this article--it gave poor definitions and little new insight (as far as I could tell, it just reiterated the same old cliches about static vs dynamic types without any anecdotes, experience or advice).
Add in the ability of haskell to let you write your own control structures and do higher-level programming, and I find myself exploring and refactoring my code much more than I do when using a dynamic language.
It was never said that static typing is for robustness it does decrease the occurrence of runtime errors.
I think the overall point was just to give insight on what people don't consider when making a programming language choice.
I'm using Go right now, it is amazing, blowing both Python and C# out of the water, with speed of development, robustness and maintainability.
There are two kinds of language comparisons I've seen:
1. Language comparisons posted by dabblers, which you could scrape together by reading Wikipedia. You see a lot of poor logic and unsatisfying definitions, because if the logic were sound and the definitions useful, a dabbler would never have enough expertise to write the post.
2. Language comparisons by experts, which restrict the discussion to history, the underlying logic of type theory, or empirical observations about a small set of languages.
* Languages that entirely lack the needed libraries to perform a library-intensive task. (e.g. a CRUD web app in C++) * Languages that you do not know * Langauges that you only want to use because they're "hip" right now
http://james-iry.blogspot.com/2010/05/types-la-chart.html