News for hackers. Stuff that matters.
Re:Android: The Land That Python Forgot by jsmeaton on Sunday November 10, 2013 @04:05AM (#6705809)
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.

Re:Android: The Land That Python Forgot by StavrosK on Sunday November 10, 2013 @06:57AM (#6706135)
> 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.

Re:Android: The Land That Python Forgot by msie on Sunday November 10, 2013 @05:09AM (#6705934)
Working in C# right now and agonizing over the class hierarchy...
Re:Android: The Land That Python Forgot by _random_ on Sunday November 10, 2013 @06:43AM (#6706103)
What 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.
Re:Android: The Land That Python Forgot by jsmeaton on Sunday November 10, 2013 @07:14AM (#6706175)
We'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.

Re:Android: The Land That Python Forgot by _random_ on Sunday November 10, 2013 @09:09AM (#6706452)
Re:Android: The Land That Python Forgot by jsmeaton on Sunday November 10, 2013 @04:29PM (#6708524)
Yes, 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.
Re:Android: The Land That Python Forgot by _random_ on Sunday November 10, 2013 @05:01PM (#6708635)
Makes sense.
Re:Android: The Land That Python Forgot by jsmeaton on Sunday November 10, 2013 @05:40AM (#6705980)
I love C#, but when moving between it and python, I find I focus too much on the types and hierarchies.
Re:Android: The Land That Python Forgot by droidist2 on Sunday November 10, 2013 @07:09AM (#6706159)
I 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.
Re:Android: The Land That Python Forgot by eonil on Sunday November 10, 2013 @12:45PM (#6707511)
And .NET framework tend to overuse subclassing/overriding pattern where delegation is more appropriate. That frequently leads users also overuse subclassing/overriding.
Re:Android: The Land That Python Forgot by novaleaf on Sunday November 10, 2013 @10:24PM (#6709763)
++ this, I moved from C# to Typescript and see that pattern change as being the biggest difference as to the code style i write.

I started Typescript by subclassing but as I work more and more with it, I subclass less and less, and delegate more and more.

Re:Android: The Land That Python Forgot by voltagex_ on Sunday November 10, 2013 @08:51AM (#6706404)
Where's the best place to brush up on composition vs inheritance?
Re:Android: The Land That Python Forgot by profquail on Sunday November 10, 2013 @09:12AM (#6706460)
If 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...

Re:Android: The Land That Python Forgot by voltagex_ on Sunday November 10, 2013 @06:18PM (#6708940)
I thought composition vs inheritance was strictly an OO, not a functional thing?
Re:Android: The Land That Python Forgot by profquail on Sunday November 10, 2013 @07:41PM (#6709247)
Functional 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.

Re:Android: The Land That Python Forgot by voltagex_ on Sunday November 10, 2013 @08:51PM (#6709485)
Yeesh, $40 for the ePub directly from Manning, or $33 from Amazon for the print edition with a free ePub.
Re:Android: The Land That Python Forgot by profquail on Monday November 11, 2013 @08:34AM (#6711471)
There are a few chapters of the book online for free at MSDN, and if you're going to buy the book, they also have a coupon code: http://msdn.microsoft.com/en-us/library/vstudio/hh314518%28v...
Re:Android: The Land That Python Forgot by _random_ on Sunday November 10, 2013 @09:10AM (#6706457)
I agree, any tool must be used correctly.