Skip to main content

Posts

Showing posts from 2018

Python 2.7 vs 3.6 in 2018

Python 3 now has 75% adoption and Python 2 has 25%, at least according to the Python developers survey 2017 referenced on Python.org,  however google trends doesn't seem to show this.



The following graph is from google trends, comparing 2.7 vs 3.4, 3.5, 3.6, and 3.7. I would expect to see a much greater difference if 2.7 has only 25% usage.


It does appear in the end of the 12 month graph that Python 3.6 is finally about to surpass 2.7, but has not yet done so. The 5 year trend shows that both 2.7 and 3.6 are both growing but 3.6 is catching up quickly. 


It's interesting that the data in the latest report does not seem to correlate to the 5 year graph. While "in 2016 60% were using Python 2 compared with 40% for python 3" is clearly shown in the graph,  the latest report of 75% using python 3 vs 25% using python 2 does not appear to be accurate. It appears to be more of a 50% - 50% or 40% - 60% split if you account for all the python 3 versions.

I use duck duck go, a…

Flutter vs React-Native - Why react-native will continue to dominate

I think that Flutter, Google's attempt at competing with react-native, will flop and react-native will continue to dominate, here's a few reasons why.



Please note that I have used react-native for almost a year now but not flutter. This is just a comparison and what I see as after looking at and using some of the apps and docs from each framework.

Let me discuss the pros and cons that I see of each.
React-nativePros:

1. Native widgets.
2. React community is huge
3. Any npm package works
4. Smaller apps
5. Feels fast

Cons:

1. Bridge can be slow (though I never had this problem in our app)
2. IDE integration is not as good
3. Javascript querks

FlutterPros:

1. Great IDE integration.
2. Non native widgets - Easier customization
3. Starts up and feels fast

Cons:

1. Does anyone use Dart outside of Google?
2. Non native widgets, very poor support for iOS looking "cupertino" components. Supported components lack a lot of features (so it seems)
3. Huge app sizes.

Discussion Let…

Enaml Native - New build system for cross compiling Python for iOS and Android coming

Besides speed, I think the biggest barrier preventing python from making it's way onto mobile is the lack of a good way of cross compiling python and all the extension modules that are commonly required for mobile devices.



This is not exactly straightforward, nor standardized (at all), but it's actually not too bad if you have a lot of time and don't mind waking up in the morning with CFLAGS and LDFLAGS flying through your head.  Still, it's extremely time intensive and is not an option for someone with deadlines nor for the person trying to learn python.

I think it's time for something different.



Existing options
While there have been many scattered projects here and there for cross compiling Python for Android or iOS, most don't support building 3rd party extensions.  The only projects that I know that do provide this are kivy's subprojects python-for-android and kivy-ios.

While these are great and very popular, they were written close to 7+ years ago be…

A look at Chaquopy the Python SDK for Android

I recently heard about chaquopy - A "Python SDK for Android" and was really excited. There's already a demo app on the Play store for python 2 and python 3. As the author of enaml-native, I had to take a look to see how others are trying to tackle the python on android challenge.  So here's a short review and discussion of my initial thoughts on chaquopy.

Demo I encourage you to try out the demo yourself to get a feel for it, but here's a short demo of what it does.



Initial thoughts. It starts reasonably fast (about 3-4 seconds on my phone).  There's a noticeable delay when starting the python activity on my phone (much smoother on the emulator), but other than that the widgets look great and interaction is smooth!

The apk is 11.54 MB and the app is only 18 MB installed (21MB if you include the cache), which is very good for bundling python!

Also, the build process was a piece of cake!  I cloned the repo, opened in android studio, pressed play, and it worked!…