4 ms·
There's a difference between typed and statically typed. Python is a strongly typed language, but it is dynamic. > bad developing experience, code needs more d
by jsmeaton 13y ago
There's a difference between typed and statically typed. Python is a strongly typed language, but it is dynamic.
> bad developing experience, code needs more debugging, it is harder to maintain and overall productivity is lower
All of these observations are highly subjective.
> Developing experience:
I much prefer developing in python than java. If IDEs factor in, there are a number available for python, none of which I use, because I find a simple editor is usually enough.
> code needs more debugging
That's a function of the problem and the developer. The run, check, edit cycle in python is a lot quicker than using your IDE to run, check, edit, compile. There are debuggers available for nearly every language that allow you to step and inspect.
> harder to maintain
Disagree. When you have code 1/5th (number pulled from my ass) the size codebase, maintainability can be much better. Unit testing helps, regardless of the language.
> productivity
A developer proficient in language [X] should be just as productive as a different developer proficient in language [Y]. Creating a massive type hierarchy of classes and interfaces is a tonne of overhead when you are trying to express a simple idea. In a language like python, you might write a simple class (or two), and use dynamic typing appropriately. A java developer may use code generation and IDE shortcuts to lessen the amount of total code they have to write though.
The advantages and disadvantages of dynamic and statically typed languages are fairly well known. Neither is perfect all the time and for each person. Just because you don't like dynamic languages, it does not mean they don't have their virtues.
- msie 13y agoWorking in C# right now and agonizing over the class hierarchy...
- jsmeaton 13y agoI love C#, but when moving between it and python, I find I focus too much on the types and hierarchies.
- droidist2 13y agoI used to be like this before I realized I used class inheritance way too much and shifted to using composition in the majority of cases.
- voltagex_ 13y agoWhere's the best place to brush up on composition vs inheritance?
- profquail 13y agoIf you're familiar with C#, Real World Functional Programming: With Examples in F# and C# [1] is an excellent resource for learning how and when to use composition over inheritance. [1]: http://www.amazon.com/Real-World-Functional-Programming-With-Examples/dp/1933988924 http://www.amazon.com/Real-World-Functional-Programming-With...
- voltagex_ 13y agoI thought composition vs inheritance was strictly an OO, not a functional thing?
- profquail 13y agoFunctional programming usually leans towards composition, and OO programming towards inheritance. "Hybrid" functional languages, like F# and Scala, allow you to use both styles, mixing them in whatever way is most useful for the particular problem you're solving; "pure" functional languages, like Haskell don't offer OO-style inheritance, since composition is a better fit for combining side-effect free ("pure") functions. tl;dr -- Composition is to functional programming as inheritance is to OO programming.
- voltagex_ 13y agoYeesh, $40 for the ePub directly from Manning, or $33 from Amazon for the print edition with a free ePub.
- _random_ 13y agoWhat does it even mean? You can dump everything into one class hacky Python way if you want. You can use dynamic keyword if you don't care about type safety.
- jsmeaton 13y agoWe're not talking about monolithic, do-everything, hacky classes. You could do the same thing in C#. Static languages (usually) force you to use interfaces and sub-typing just so common code can be reused. Duck typing is a much nicer way of working - without having to jump through seemingly unnecessary hoops. The situation is even worse when you code for testability. Things that really shouldn't have an interface now require one, so you can mock out the object appropriately. This is all avoided in a language with duck typing. This is actually where Go has a great impact. You get your static type checking without being forced to use explicit interfaces. It essentially uses duck typing for interface implementation. You're free to enjoy static typing over dynamic typing all you like - but you shouldn't make the mistake of thinking dynamic typing is inferior in any way. It is different - just like imperative vs functional is different. You make a series of tradeoffs, that is all.
- _random_ 13y agoC# supports duck typing though: http://en.wikipedia.org/wiki/Duck_typing#In_C.23 http://en.wikipedia.org/wiki/Duck_typing#In_C.23
- jsmeaton 13y agoYes, but it's not idiomatic C#. The point I've been trying to make is that both kinds of languages (dynamic and static) have their different virtues. You can drop down to dynamic in C#, but unless you have a very good reason, your co-workers will lynch you.
- _random_ 13y agoMakes sense.
- StavrosK 13y ago> I much prefer developing in python than java. If IDEs factor in, there are a number available for python, none of which I use, because I find a simple editor is usually enough. Protip: Try pudb. It will blow your mind.