Live data from Hacker News

Android: The Land That Python Forgot

speakerdeck.com

81–90 of 127 posts

Re: Android: The Land That Python Forgot

#81
post #39

Earlier quoted context omitted.

One very prominent point in those slides is that Android is not based on the JVM, which complicates things for plenty of things that expect Java on JVM instead of Java on Dalvik (e.g. Jython).

Yup. If we had Jython, this talk wouldn't have needed to have been written. And I'd probably be working to improve Jython as we speak.

I wonder if this new ART system shipped with 4.4 changes anything - Google like Python and Go so maybe they'd have them available as languages that target the runtime?

PS. See you at LCAU2014!

Re: Android: The Land That Python Forgot

#82

Earlier quoted context omitted.

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.

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…

C# supports duck typing though:

http://en.wikipedia.org/wiki/Duck_typing#In_C.23

Re: Android: The Land That Python Forgot

#83

Earlier quoted context omitted.

I love C#, but when moving between it and python, I find I focus too much on the types and hierarchies.

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.

I agree, any tool must be used correctly.

Re: Android: The Land That Python Forgot

#84

Earlier quoted context omitted.

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.

Where's the best place to brush up on composition vs inheritance?

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

#85
post #64

Earlier quoted context omitted.

Could it be the reason Symbian was slow and eventually failed? Were they interpreting or compiling Python?

> Could it be the reason Symbian was slow and eventually failed? No, and no. I don't think Nokia ever shipped any significant amounts of Python code themselves. > Were they interpreting or compiling Python? It was the standard CPython interpreter.

A friend of mine was playing with python and opengl es on series 60 phones (symbian) - and it was completely fine.

[Even with pretty unoptimised python].

Re: Android: The Land That Python Forgot

#86
post #62

performance performance performance. And it is not just about direct user experience either. Even if a given app may be written in Python it will probably drain the battery faster, since for each bit of work that would have taken X cpu cycles with Java, you would spend 20X with Python, not to mention memory handling, etc... A language is just a tool, use the right one for the Job. a Pythonista

Not sure about that... actually most (well-written!) android code is already pretty wasteful with resources, because its abstractions upon abstractions.

To get a simple button on the screen, you need an Activity with a Fragment with a View with the button inside, with a few more layers inbetween. The gui is loaded from multiple XML files and resources, with lots of dynamic property binding going on. And even don't get me started on data storage and SQLite...

Writing an app in python wouldn't add much to this - it actually may allow you to avoid a couple of layers (the dreaded FactoryFactory syndrome of java). Python's weakness is number crunching, and I agree, you wouldn't want to do that in Python on Android. But just to show a gui, or to access a web api, python's performance should be more than enough.

Re: Android: The Land That Python Forgot

#87

Earlier quoted context omitted.

Are we really going to discuss this again? > code needs more debugging, it is harder to maintain and overall productivity is lower References?

Isn't it why Python guys are trying to use more annotations? To patch it with some sort of semi-decent static analysis? Check the Dropbox's pain presentation: https://www.dropbox.com/s/83ppa5iykqmr14z/Py2v3Hackers2013.p...

[deleted]

Re: Android: The Land That Python Forgot

#88

Earlier quoted context omitted.

Python has a type system.

Enforced type system is probably what he meant, i.e. annotations had a practical application at the moment.

I'm not just being purposefully obtuse here. When read in the context of his upstream comments, I don't think we can make any assumptions as to what he meant.

Re: Android: The Land That Python Forgot

#90
post #80
post #4

Ohai! I wrote the talk, and just want to let you know that you can watch it over at https://www.youtube.com/watch?v=p77BR6e1uoo --Chris

Great presentation, thanks for sharing it. Why isn't Kivy or one of the other existing solutions good enough for your needs?

Mainly, can't use native controls and is focused to their own toolkit.

(I talk about iOS, that I care most. I wish badly that I could use python instead of obj-c)

Post reply on HN