4 ms·
The problem with Android isn't Java, but that it has one of most terrible, buggy, undocumented and confusing SDKs I have ever seen. It tries hard to touch every
by cel1ne 11y ago
The problem with Android isn't Java, but that it has one of most terrible, buggy, undocumented and confusing SDKs I have ever seen. It tries hard to touch every anti-pattern on the planet.
Android could be much more performant, but one would have to replace almost everything regarding UI and layout. Apps built with Dart cannot be much faster unless they do that.
I thought about rewriting/extending the base-class "View.java" to get more performance and less bugs (the default layouting algorithm seems to have exponential runtime! [0]), but the problem is
a) it would break compatibility with many other UI-components and
b) the behaviour and structure of the code is almost impossible to understand and imitate.
Just look at this beast: 8866 LOC without comments in one class [1].
[0] https://stackoverflow.com/questions/17493819/is-android-layout-really-exponentially-hard https://stackoverflow.com/questions/17493819/is-android-layo...
[1] http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.0.2_r1/android/view/View.java http://grepcode.com/file/repository.grepcode.com/java/ext/co...
- bane 11y agoThat's kind of scary that it passed internal code reviews and made it into production without comments. It speaks to Google's internal processes quite a bit.
- bicx 11y agoWhat do you mean? There are tons of comments in that class.
- gagege 11y agoThe obtuse answers on that thread are also the typical types of answers I see from the Android community as well. It's like the people heavily involved in Android are unaware that there is a whole other world of nicer and more efficient SDKs out there.
- bitmapbrother 11y agoWhat in the world are you blabbering about? First of all here is the link to the View class in the SDK: http://developer.android.com/reference/android/view/View.html http://developer.android.com/reference/android/view/View.htm... Looks fully documented to me in the SDK. But let's have a look at the actual code that you stated didn't have comments: http://grepcode.com/file_/repository.grepcode.com/java/ext/com.google.android/android/5.0.2_r1/android/view/View.java/?v=source http://grepcode.com/file_/repository.grepcode.com/java/ext/c... Sure looks like a lot of comments to me. As for the bugs, why don't you list them all? Your points would have a lot more validity...if they were actually valid. Unfortunately, the source of your comments comes from confusion and ignorance.
- esrauch 11y ago> But let's have a look at the actual code that you stated didn't have comments He meant it was 8800 lines excluding the comment lines, not that the file didn't have any comments.
- bitmapbrother 11y agoI still don't see why this is a bad thing. Sure it would be nice if they split the file into multiple source files for maintainability. But, should we also chastise the Linux kernel for having source files that have more than 5K+ LOC that aren't documented nearly to the extent the Android source is?
- cel1ne 11y agoGranted, the use of word "bugs" was a bit too much. I consider it a bug when ´Environment.getExternalStorageState´ tells me the SDCard is mounted, when the SD-slot is empty. That was because parts of Samsung's internals storage where referred to as external storage. I consider it very bad design when Android allows me to write Views that cause layout-passes multiple times during construction. (Because of setTypeFace). That Views are riddled with methods which cause re-layouts mixed with others that don't. There should be an annotation for this. I know, nowadays there's a logging-statement if that occurs, that wasn't there in Android 4.2 IIRC. On a complicated app you can either do proper separation of concern and compose everything in nested Views, but you have to throw everything back into a single View to get more performance. Or you write your own layout-manager which is what I did. It's impossible to define constraints on animations. I can't tell android, hey that view is going to change it's height, but not it's width and it won't affect anything else, so save yourself some time and stop calculating the height of this letter for the 546th time in the last 10 seconds. rant rant Hardware-Acceleration is a different matter. I ended up disabling it completely, because it would accelerate some animations, fades and make some other parts jittery. Most fine-grained layer-control specified in the Guide doesn't seem to affect anything. And so on, and so forth. Android development is painful compared to other SDKs and that's why app-quality is so low. You can claim that stems from confusion: no it doesn't, i've read large parts of the (UI) code by now and I've written software in many languages for many years. Or ignorance: Maybe in the sense that I refuse the reason for all this: That most of Android was baked hastily in the beginning to get something out and fixing mistakes which would require most APPs to be redone is close to impossible. Android is the new Windows. ;)
- aboodman 11y agoDid you watch the video? This project replaces everything about ui and layout within your app.
- TazeTSchnitzel 11y agoTrying to open [1] in Firefox froze the browser for several seconds. Wow, Google.